From dbc3ba6d15b1c8aee4802007e40eed90e097d881 Mon Sep 17 00:00:00 2001 From: HoangVD2 Date: Tue, 23 Apr 2024 10:47:25 +0700 Subject: [PATCH 001/176] feat: implement ADR-036 --- yarn.lock | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index a9947291..237baeff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8722,7 +8722,7 @@ crypto-browserify@3.12.0, crypto-browserify@^3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -crypto-js@4.2.0, crypto-js@^4.0.0: +crypto-js@4.2.0, crypto-js@^4.0.0, crypto-js@^4.1.1, crypto-js@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz" integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== @@ -10659,9 +10659,17 @@ form-data@^4.0.0: resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" + bignumber.js "^7.2.1" + blakejs "^1.1.0" + bn.js "^4.11.8" + buffer "^5.2.1" + crypto-js "4.2.0" + elliptic "^6.4.1" + hmac-drbg "^1.0.1" + lodash "^4.17.21" + node-forge "^1.3.1" + rlp "^2.1.0" + tweetnacl "^1.0.3" freeport-async@2.0.0: version "2.0.0" From c6b4b9756213fae93186b8538a8570aeb93286d1 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 Date: Thu, 25 Apr 2024 17:39:22 +0700 Subject: [PATCH 002/176] fix: solana lib mobile errors --- yarn.lock | 179 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 128 insertions(+), 51 deletions(-) diff --git a/yarn.lock b/yarn.lock index 237baeff..93e46210 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1434,6 +1434,13 @@ dependencies: regenerator-runtime "^0.14.0" +"@babel/runtime@^7.25.0": + version "7.25.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" + integrity sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.0.0", "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.23.9", "@babel/template@^7.3.3": version "7.23.9" resolved "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz" @@ -4646,7 +4653,7 @@ "@metaplex-foundation/beet-solana@^0.4.0": version "0.4.1" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.4.1.tgz#255747aa7feee1c20202146a752c057feca1948f" + resolved "https://registry.npmjs.org/@metaplex-foundation/beet-solana/-/beet-solana-0.4.1.tgz" integrity sha512-/6o32FNUtwK8tjhotrvU/vorP7umBuRFvBZrC6XCk51aKidBHe5LPVPA5AjGPbV3oftMfRuXPNd9yAGeEqeCDQ== dependencies: "@metaplex-foundation/beet" ">=0.1.0" @@ -4656,7 +4663,7 @@ "@metaplex-foundation/beet@>=0.1.0", "@metaplex-foundation/beet@^0.7.1": version "0.7.2" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.7.2.tgz#fa4726e4cfd4fb6fed6cddc9b5213c1c2a2d0b77" + resolved "https://registry.npmjs.org/@metaplex-foundation/beet/-/beet-0.7.2.tgz" integrity sha512-K+g3WhyFxKPc0xIvcIjNyV1eaTVJTiuaHZpig7Xx0MuYRMoJLLvhLTnUXhFdR5Tu2l2QSyKwfyXDgZlzhULqFg== dependencies: ansicolors "^0.3.2" @@ -4666,12 +4673,12 @@ "@metaplex-foundation/cusper@^0.0.2": version "0.0.2" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/cusper/-/cusper-0.0.2.tgz#dc2032a452d6c269e25f016aa4dd63600e2af975" + resolved "https://registry.npmjs.org/@metaplex-foundation/cusper/-/cusper-0.0.2.tgz" integrity sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA== "@metaplex-foundation/mpl-token-metadata@2.13.0": version "2.13.0" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-token-metadata/-/mpl-token-metadata-2.13.0.tgz#ea498190ad4ed1d4c0b8218a72d03bd17a883d11" + resolved "https://registry.npmjs.org/@metaplex-foundation/mpl-token-metadata/-/mpl-token-metadata-2.13.0.tgz" integrity sha512-Fl/8I0L9rv4bKTV/RAl5YIbJe9SnQPInKvLz+xR1fEc4/VQkuCn3RPgypfUMEKWmCznzaw4sApDxy6CFS4qmJw== dependencies: "@metaplex-foundation/beet" "^0.7.1" @@ -4865,12 +4872,12 @@ dependencies: "@noble/hashes" "1.3.3" -"@noble/curves@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" - integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== +"@noble/curves@^1.4.2": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b" + integrity sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ== dependencies: - "@noble/hashes" "1.4.0" + "@noble/hashes" "1.5.0" "@noble/hashes@1.3.2": version "1.3.2" @@ -4882,10 +4889,10 @@ resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== -"@noble/hashes@1.4.0", "@noble/hashes@^1.3.3": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" - integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== +"@noble/hashes@1.5.0", "@noble/hashes@^1.4.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" + integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -5170,9 +5177,9 @@ serve-static "^1.13.1" "@react-native-community/cli-doctor@^10.2.2": - version "10.2.7" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-doctor/-/cli-doctor-10.2.7.tgz#1a3ecd18a7b1e685864c9dc95e014a5f8f225f84" - integrity sha512-MejE7m+63DxfKwFSvyZGfq+72jX0RSP9SdSmDbW0Bjz2NIEE3BsE8rNay+ByFbdSLsapRPvaZv2Jof+dK2Y/yg== + version "10.2.5" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-doctor/-/cli-doctor-10.2.5.tgz#e5e28c66c2373f05a94b296a8ec637f8df736707" + integrity sha512-1YbzXvsldBmSw1MmBsXB74bKiHXKNCjlb2ByLgkfTiarpSvETYam3g5vex0N+qc0Cdkzkq+8NznE744LFhnUpw== dependencies: "@react-native-community/cli-config" "^10.1.1" "@react-native-community/cli-platform-ios" "^10.2.5" @@ -5182,6 +5189,7 @@ envinfo "^7.7.2" execa "^1.0.0" hermes-profile-transformer "^0.0.6" + ip "^1.1.5" node-stream-zip "^1.9.1" ora "^5.4.1" prompts "^2.4.0" @@ -5511,11 +5519,15 @@ "@solana/codecs-numbers" "2.0.0-preview.2" "@solana/spl-token-metadata@^0.1.2": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.4.tgz#5cdc3b857a8c4a6877df24e24a8648c4132d22ba" - integrity sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ== - dependencies: - "@solana/codecs" "2.0.0-preview.2" + version "0.1.2" + resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.2.tgz#876e13432bd2960bd3cac16b9b0af63e69e37719" + integrity sha512-hJYnAJNkDrtkE2Q41YZhCpeOGU/0JgRFXbtrtOuGGeKc3pkEUHB9DDoxZAxx+XRno13GozUleyBi0qypz4c3bw== + dependencies: + "@solana/codecs-core" "2.0.0-experimental.8618508" + "@solana/codecs-data-structures" "2.0.0-experimental.8618508" + "@solana/codecs-numbers" "2.0.0-experimental.8618508" + "@solana/codecs-strings" "2.0.0-experimental.8618508" + "@solana/options" "2.0.0-experimental.8618508" "@solana/spl-type-length-value" "0.1.0" "@solana/spl-token@0.3.8": @@ -5529,7 +5541,7 @@ "@solana/spl-token@^0.3.6": version "0.3.11" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.11.tgz#cdc10f9472b29b39c8983c92592cadd06627fb9a" + resolved "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.3.11.tgz" integrity sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ== dependencies: "@solana/buffer-layout" "^4.0.0" @@ -5539,7 +5551,7 @@ "@solana/spl-type-length-value@0.1.0": version "0.1.0" - resolved "https://registry.yarnpkg.com/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz#b5930cf6c6d8f50c7ff2a70463728a4637a2f26b" + resolved "https://registry.npmjs.org/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz" integrity sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA== dependencies: buffer "^6.0.3" @@ -5567,7 +5579,7 @@ "@solana/web3.js@^1.32.0": version "1.89.1" - resolved "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.89.1.tgz" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.89.1.tgz#52df6820f2d088c4558aa359af40580a03d10ec9" integrity sha512-t9TTLtPQxtQB3SAf/5E8xPXfVDsC6WGOsgKY02l2cbe0HLymT7ynE8Hu48Lk5qynHCquj6nhISfEHcjMkYpu/A== dependencies: "@babel/runtime" "^7.23.4" @@ -5587,13 +5599,13 @@ superstruct "^0.14.2" "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.66.2": - version "1.91.7" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.91.7.tgz#1d639f8f3cc772fd6d88b982e8fdb17dc192b9e1" - integrity sha512-HqljZKDwk6Z4TajKRGhGLlRsbGK4S8EY27DA7v1z6yakewiUY3J7ZKDZRxcqz2MYV/ZXRrJ6wnnpiHFkPdv0WA== + version "1.95.3" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.95.3.tgz#70b5f4d76823f56b5af6403da51125fffeb65ff3" + integrity sha512-O6rPUN0w2fkNqx/Z3QJMB9L225Ex10PRDH8bTaIUPZXMPV0QP8ZpPvjQnXK+upUczlRgzHzd6SjKIha1p+I6og== dependencies: - "@babel/runtime" "^7.23.4" - "@noble/curves" "^1.4.0" - "@noble/hashes" "^1.3.3" + "@babel/runtime" "^7.25.0" + "@noble/curves" "^1.4.2" + "@noble/hashes" "^1.4.0" "@solana/buffer-layout" "^4.0.1" agentkeepalive "^4.5.0" bigint-buffer "^1.1.5" @@ -5602,10 +5614,10 @@ bs58 "^4.0.1" buffer "6.0.3" fast-stable-stringify "^1.0.0" - jayson "^4.1.0" + jayson "^4.1.1" node-fetch "^2.7.0" - rpc-websockets "^7.5.1" - superstruct "^0.14.2" + rpc-websockets "^9.0.2" + superstruct "^2.0.2" "@swc/helpers@0.4.11": version "0.4.11" @@ -5614,6 +5626,13 @@ dependencies: tslib "^2.4.0" +"@swc/helpers@^0.5.11": + version "0.5.13" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.13.tgz#33e63ff3cd0cade557672bd7888a39ce7d115a8c" + integrity sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w== + dependencies: + tslib "^2.4.0" + "@terra-money/feather.js@2.1.0-beta.3": version "2.1.0-beta.3" resolved "https://registry.npmjs.org/@terra-money/feather.js/-/feather.js-2.1.0-beta.3.tgz" @@ -6221,6 +6240,11 @@ resolved "https://registry.npmjs.org/@types/uuid/-/uuid-7.0.8.tgz" integrity sha512-95N4tyM4B5u1sj2m8Tht09qWHju2ht413GBFz8CHtxp8aIiJUF6t51MsR7jC9OF4rRVf93AxE++WJe7+Puc1UA== +"@types/uuid@^8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" + integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== + "@types/w3c-web-usb@^1.0.6": version "1.0.10" resolved "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz" @@ -6245,6 +6269,13 @@ dependencies: "@types/node" "*" +"@types/ws@^8.2.2": + version "8.5.12" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e" + integrity sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ== + dependencies: + "@types/node" "*" + "@types/yargs-parser@*": version "21.0.3" resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz" @@ -6860,7 +6891,7 @@ ansi-styles@^6.1.0: ansicolors@^0.3.2: version "0.3.2" - resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" + resolved "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz" integrity sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg== any-promise@^1.0.0: @@ -7508,6 +7539,11 @@ bignumber.js@9.1.2, bignumber.js@^9.0.0, bignumber.js@^9.0.1, bignumber.js@^9.1. resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz" integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== +bignumber.js@^7.2.1: + version "7.2.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" + integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" @@ -7631,7 +7667,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.8, bn.js@^4.11.9: bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== body-parser@^1.20.1: @@ -7876,7 +7912,7 @@ buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -buffer@^5.5.0: +buffer@^5.2.1, buffer@^5.5.0: version "5.7.1" resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -8722,7 +8758,7 @@ crypto-browserify@3.12.0, crypto-browserify@^3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -crypto-js@4.2.0, crypto-js@^4.0.0, crypto-js@^4.1.1, crypto-js@^4.2.0: +crypto-js@4.2.0, crypto-js@^4.0.0: version "4.2.0" resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz" integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== @@ -10155,6 +10191,11 @@ eventemitter3@^4.0.7: resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + events@^3.0.0, events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" @@ -10647,7 +10688,7 @@ foreground-child@^3.1.0: form-data@^3.0.0, form-data@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== dependencies: asynckit "^0.4.0" @@ -10659,17 +10700,9 @@ form-data@^4.0.0: resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: - bignumber.js "^7.2.1" - blakejs "^1.1.0" - bn.js "^4.11.8" - buffer "^5.2.1" - crypto-js "4.2.0" - elliptic "^6.4.1" - hmac-drbg "^1.0.1" - lodash "^4.17.21" - node-forge "^1.3.1" - rlp "^2.1.0" - tweetnacl "^1.0.3" + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" freeport-async@2.0.0: version "2.0.0" @@ -12061,6 +12094,24 @@ jayson@^4.1.0: uuid "^8.3.2" ws "^7.4.5" +jayson@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.2.tgz#443c26a8658703e0b2e881117b09395d88b6982e" + integrity sha512-5nzMWDHy6f+koZOuYsArh2AXs73NfWYVlFyJJuCedr93GpY+Ku8qq10ropSXVfHK+H0T6paA88ww+/dV+1fBNA== + dependencies: + "@types/connect" "^3.4.33" + "@types/node" "^12.12.54" + "@types/ws" "^7.4.4" + JSONStream "^1.3.5" + commander "^2.20.3" + delay "^5.0.0" + es6-promisify "^5.0.0" + eyes "^0.1.8" + isomorphic-ws "^4.0.1" + json-stringify-safe "^5.0.1" + uuid "^8.3.2" + ws "^7.5.10" + jest-changed-files@^27.5.1: version "27.5.1" resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.5.1.tgz" @@ -15756,9 +15807,9 @@ ripple-lib@^1.10.1: ripple-lib-transactionparser "0.8.2" ws "^7.2.0" -rlp@^2.2.4: +rlp@^2.1.0, rlp@^2.2.4: version "2.2.7" - resolved "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== dependencies: bn.js "^5.2.0" @@ -15806,6 +15857,22 @@ rpc-websockets@^7.5.1: bufferutil "^4.0.1" utf-8-validate "^5.0.2" +rpc-websockets@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.0.2.tgz#4c1568d00b8100f997379a363478f41f8f4b242c" + integrity sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw== + dependencies: + "@swc/helpers" "^0.5.11" + "@types/uuid" "^8.3.4" + "@types/ws" "^8.2.2" + buffer "^6.0.3" + eventemitter3 "^5.0.1" + uuid "^8.3.2" + ws "^8.5.0" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + run-async@^2.4.0: version "2.4.1" resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz" @@ -16737,6 +16804,11 @@ superstruct@^0.14.2: resolved "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz" integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== +superstruct@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-2.0.2.tgz#3f6d32fbdc11c357deff127d591a39b996300c54" + integrity sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" @@ -18281,6 +18353,11 @@ ws@^6.2.2: dependencies: async-limiter "~1.0.0" +ws@^7.5.10: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + ws@^8.12.0, ws@^8.12.1, ws@^8.5.0: version "8.16.0" resolved "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz" From 623740a0ef763b0e63abd3c4f9219f8ece506bc1 Mon Sep 17 00:00:00 2001 From: HoangVD2 Date: Wed, 17 Apr 2024 09:57:39 +0700 Subject: [PATCH 003/176] base: remove @xchain packages --- yarn.lock | 113 ++++++++++++++++++------------------------------------ 1 file changed, 37 insertions(+), 76 deletions(-) diff --git a/yarn.lock b/yarn.lock index 93e46210..9f74cbec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5458,65 +5458,41 @@ dependencies: buffer "~6.0.3" -"@solana/codecs-core@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-preview.2.tgz#689784d032fbc1fedbde40bb25d76cdcecf6553b" - integrity sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg== - dependencies: - "@solana/errors" "2.0.0-preview.2" - -"@solana/codecs-data-structures@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz#e82cb1b6d154fa636cd5c8953ff3f32959cc0370" - integrity sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg== - dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" - "@solana/errors" "2.0.0-preview.2" - -"@solana/codecs-numbers@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz#56995c27396cd8ee3bae8bd055363891b630bbd0" - integrity sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw== - dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/errors" "2.0.0-preview.2" - -"@solana/codecs-strings@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz#8bd01a4e48614d5289d72d743c3e81305d445c46" - integrity sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g== - dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" - "@solana/errors" "2.0.0-preview.2" - -"@solana/codecs@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-preview.2.tgz#d6615fec98f423166fb89409f9a4ad5b74c10935" - integrity sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA== - dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-data-structures" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" - "@solana/codecs-strings" "2.0.0-preview.2" - "@solana/options" "2.0.0-preview.2" - -"@solana/errors@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-preview.2.tgz#e0ea8b008c5c02528d5855bc1903e5e9bbec322e" - integrity sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA== - dependencies: - chalk "^5.3.0" - commander "^12.0.0" - -"@solana/options@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-preview.2.tgz#13ff008bf43a5056ef9a091dc7bb3f39321e867e" - integrity sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w== - dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" +"@solana/codecs-core@2.0.0-experimental.8618508": + version "2.0.0-experimental.8618508" + resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-experimental.8618508.tgz#4f6709dd50e671267f3bea7d09209bc6471b7ad0" + integrity sha512-JCz7mKjVKtfZxkuDtwMAUgA7YvJcA2BwpZaA1NOLcted4OMC4Prwa3DUe3f3181ixPYaRyptbF0Ikq2MbDkYEA== + +"@solana/codecs-data-structures@2.0.0-experimental.8618508": + version "2.0.0-experimental.8618508" + resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-experimental.8618508.tgz#c16a704ac0f743a2e0bf73ada42d830b3402d848" + integrity sha512-sLpjL9sqzaDdkloBPV61Rht1tgaKq98BCtIKRuyscIrmVPu3wu0Bavk2n/QekmUzaTsj7K1pVSniM0YqCdnEBw== + dependencies: + "@solana/codecs-core" "2.0.0-experimental.8618508" + "@solana/codecs-numbers" "2.0.0-experimental.8618508" + +"@solana/codecs-numbers@2.0.0-experimental.8618508": + version "2.0.0-experimental.8618508" + resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-experimental.8618508.tgz#d84f9ed0521b22e19125eefc7d51e217fcaeb3e4" + integrity sha512-EXQKfzFr3CkKKNzKSZPOOOzchXsFe90TVONWsSnVkonO9z+nGKALE0/L9uBmIFGgdzhhU9QQVFvxBMclIDJo2Q== + dependencies: + "@solana/codecs-core" "2.0.0-experimental.8618508" + +"@solana/codecs-strings@2.0.0-experimental.8618508": + version "2.0.0-experimental.8618508" + resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-experimental.8618508.tgz#72457b884d9be80b59b263bcce73892b081e9402" + integrity sha512-b2yhinr1+oe+JDmnnsV0641KQqqDG8AQ16Z/x7GVWO+AWHMpRlHWVXOq8U1yhPMA4VXxl7i+D+C6ql0VGFp0GA== + dependencies: + "@solana/codecs-core" "2.0.0-experimental.8618508" + "@solana/codecs-numbers" "2.0.0-experimental.8618508" + +"@solana/options@2.0.0-experimental.8618508": + version "2.0.0-experimental.8618508" + resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-experimental.8618508.tgz#95385340e85f9e8a81b2bfba089404a61c8e9520" + integrity sha512-fy/nIRAMC3QHvnKi63KEd86Xr/zFBVxNW4nEpVEU2OT0gCEKwHY4Z55YHf7XujhyuM3PNpiBKg/YYw5QlRU4vg== + dependencies: + "@solana/codecs-core" "2.0.0-experimental.8618508" + "@solana/codecs-numbers" "2.0.0-experimental.8618508" "@solana/spl-token-metadata@^0.1.2": version "0.1.2" @@ -7539,11 +7515,6 @@ bignumber.js@9.1.2, bignumber.js@^9.0.0, bignumber.js@^9.0.1, bignumber.js@^9.1. resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz" integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== -bignumber.js@^7.2.1: - version "7.2.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" - integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== - binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" @@ -7912,7 +7883,7 @@ buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -buffer@^5.2.1, buffer@^5.5.0: +buffer@^5.5.0: version "5.7.1" resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -8118,11 +8089,6 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" - integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== - change-case-all@1.0.14: version "1.0.14" resolved "https://registry.npmjs.org/change-case-all/-/change-case-all-1.0.14.tgz" @@ -8459,11 +8425,6 @@ commander@^10.0.1: resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -commander@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" - integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== - commander@^2.20.0, commander@^2.20.3: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" @@ -15807,7 +15768,7 @@ ripple-lib@^1.10.1: ripple-lib-transactionparser "0.8.2" ws "^7.2.0" -rlp@^2.1.0, rlp@^2.2.4: +rlp@^2.2.4: version "2.2.7" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== From 2a6316bc1a19a1dbc5231686a8d7d0bcb9c5ba94 Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Wed, 8 May 2024 19:18:12 +0700 Subject: [PATCH 004/176] feat: add osmojs lib to cosmos chain (#206) * feat: add osmojs lib to cosmos chain * feat: add osmojs lib to cosmos chain * feat: add changeset file * Update rude-planets-explode.md --------- Co-authored-by: dp <25910069+davidp94@users.noreply.github.com> --- .changeset/rude-planets-explode.md | 5 +++++ yarn.lock | 31 +++--------------------------- 2 files changed, 8 insertions(+), 28 deletions(-) create mode 100644 .changeset/rude-planets-explode.md diff --git a/.changeset/rude-planets-explode.md b/.changeset/rude-planets-explode.md new file mode 100644 index 00000000..afc58c8c --- /dev/null +++ b/.changeset/rude-planets-explode.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +Feat: add osmojs lib and types/converters in esm diff --git a/yarn.lock b/yarn.lock index 9f74cbec..2f74a15f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16543,7 +16543,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -16561,15 +16561,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -16640,7 +16631,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -16661,13 +16652,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -18213,7 +18197,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18231,15 +18215,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From a591cb5c39ab9725effb3ce4f62249ef313e7510 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 14 Jun 2024 11:45:29 +0300 Subject: [PATCH 005/176] feat: add base58 encoding to solana package (#242) * feat: add base58 encoding to solana package * feat: add signMessage method to solana signers * fix: lint * fix: lint * chore: update changeset --------- Co-authored-by: dp <25910069+davidp94@users.noreply.github.com> --- .changeset/sixty-feet-study.md | 7 ++++ examples/react/pages/signer.tsx | 41 ++++++++++--------- packages/core/src/core/interfaces/index.ts | 1 + packages/solana/package.json | 3 +- packages/solana/src/index.ts | 1 + packages/solana/src/msg.ts | 34 +++++++++++---- packages/solana/src/signers/ledger.signer.ts | 1 + .../src/signers/private-key.signer.spec.ts | 11 +++++ .../solana/src/signers/private-key.signer.ts | 16 ++++++++ .../src/signers/seed-phrase.signer.spec.ts | 27 +++++++++++- .../solana/src/signers/seed-phrase.signer.ts | 21 ++++++++++ packages/solana/src/types.ts | 6 +++ utility-packages/graphql/src/gql/gql.ts | 40 +++++++++--------- yarn.lock | 7 +++- 14 files changed, 165 insertions(+), 51 deletions(-) create mode 100644 .changeset/sixty-feet-study.md create mode 100644 packages/solana/src/types.ts diff --git a/.changeset/sixty-feet-study.md b/.changeset/sixty-feet-study.md new file mode 100644 index 00000000..41c834eb --- /dev/null +++ b/.changeset/sixty-feet-study.md @@ -0,0 +1,7 @@ +--- +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +--- + +feat: add base58 to msg encoding for solana chain +feat: add signMessage for solana signers diff --git a/examples/react/pages/signer.tsx b/examples/react/pages/signer.tsx index 55e05198..02b4ee16 100644 --- a/examples/react/pages/signer.tsx +++ b/examples/react/pages/signer.tsx @@ -1,28 +1,31 @@ 'use clients'; -import React, { useCallback, useState} from 'react'; +import React, { useCallback, useState } from 'react'; import type { NextPage } from 'next'; -import { - Container, - Typography, - TextField, - Box, -} from '@mui/material'; +import { Container, Typography, TextField, Box } from '@mui/material'; import { PrivateKeySigner } from '@xdefi-tech/chains-evm/dist/signers/web'; -import {EvmProvider, IndexerDataSource, EVM_MANIFESTS} from '@xdefi-tech/chains-evm' +import { + EvmProvider, + IndexerDataSource, + EVM_MANIFESTS, +} from '@xdefi-tech/chains-evm'; const SignerPage: NextPage = () => { - const [pk, setPk] = useState(''); - const [address, setAddress] = useState(''); - const provider = new EvmProvider(new IndexerDataSource(EVM_MANIFESTS.ethereum), { signers: [PrivateKeySigner]}); + const [pk, setPk] = useState(''); + const [address, setAddress] = useState(''); + const provider = new EvmProvider( + new IndexerDataSource(EVM_MANIFESTS.ethereum), + { signers: [PrivateKeySigner] } + ); - const handleGetAddress = useCallback ( - (event) => { - setPk(event.target.value); - const SignerProvider = provider.getSigners()[0]; - const signer = new SignerProvider(event.target.value); - signer.getAddress('').then(res => setAddress(res)).catch(error => setAddress('')); - }, [] - ) + const handleGetAddress = useCallback((event) => { + setPk(event.target.value); + const SignerProvider = provider.getSigners()[0]; + const signer = new SignerProvider(event.target.value); + signer + .getAddress('') + .then((res) => setAddress(res)) + .catch((error) => setAddress('')); + }, []); return ( diff --git a/packages/core/src/core/interfaces/index.ts b/packages/core/src/core/interfaces/index.ts index 11044dea..b12849cf 100644 --- a/packages/core/src/core/interfaces/index.ts +++ b/packages/core/src/core/interfaces/index.ts @@ -14,6 +14,7 @@ export enum MsgEncoding { buffer = 'buffer', object = 'object', base64 = 'base64', + base58 = 'base58', string = 'string', unsigned = 'unsigned', } diff --git a/packages/solana/package.json b/packages/solana/package.json index 8a90f9e8..bfe9b9c7 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -37,7 +37,8 @@ "reflect-metadata": "0.1.13", "rimraf": "4.4.0", "rxjs": "7.8.0", - "ts-node": "10.7.0" + "ts-node": "10.7.0", + "tweetnacl": "1.0.3" }, "scripts": { "build": "tsup --minify --clean", diff --git a/packages/solana/src/index.ts b/packages/solana/src/index.ts index 81dad49c..8f381002 100644 --- a/packages/solana/src/index.ts +++ b/packages/solana/src/index.ts @@ -2,3 +2,4 @@ export * from './chain.provider'; export * from './manifests'; export * from './datasource'; export * from './msg'; +export * from './types'; diff --git a/packages/solana/src/msg.ts b/packages/solana/src/msg.ts index 4929c046..bdb19de0 100644 --- a/packages/solana/src/msg.ts +++ b/packages/solana/src/msg.ts @@ -1,27 +1,28 @@ import { + Coin, FeeEstimation, GasFeeSpeed, Msg as BasMsg, MsgEncoding, NumberIsh, - Coin, } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import { + ComputeBudgetProgram, + LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction as SolanaTransaction, TransactionInstruction, - LAMPORTS_PER_SOL, VersionedTransaction, - ComputeBudgetProgram, } from '@solana/web3.js'; import { - TOKEN_PROGRAM_ID, - getMint, createTransferInstruction, getAssociatedTokenAddress, + getMint, + TOKEN_PROGRAM_ID, } from '@solana/spl-token'; +import bs58 from 'bs58'; import type { SolanaProvider } from './chain.provider'; import { DEFAULT_FEE } from './constants'; @@ -51,6 +52,13 @@ export interface TxBody { fromTokenAddress?: string; memo?: string; encoding?: MsgEncoding; + txType?: TransactionType; +} + +export enum TransactionType { + Message = 0, + Legacy = 1, + Versioned = 2, } export class ChainMsg extends BasMsg { @@ -71,10 +79,18 @@ export class ChainMsg extends BasMsg { let gasPrice = msgData.gasPrice; let programId; - if (this.encoding === MsgEncoding.base64) { - const versionedTransaction = VersionedTransaction.deserialize( - Buffer.from(msgData.data, 'base64') - ); + if ( + this.encoding === MsgEncoding.base64 || + this.encoding === MsgEncoding.base58 + ) { + let buffer; + if (this.encoding === MsgEncoding.base64) { + buffer = Buffer.from(msgData.data, 'base64'); + } else { + buffer = bs58.decode(msgData.data); + } + + const versionedTransaction = VersionedTransaction.deserialize(buffer); return { tx: versionedTransaction, diff --git a/packages/solana/src/signers/ledger.signer.ts b/packages/solana/src/signers/ledger.signer.ts index b4954f85..e9f9e0c0 100644 --- a/packages/solana/src/signers/ledger.signer.ts +++ b/packages/solana/src/signers/ledger.signer.ts @@ -51,6 +51,7 @@ export class LedgerSigner extends Signer.Provider { ); break; case MsgEncoding.base64: + case MsgEncoding.base58: const versionedTransaction = tx as VersionedTransaction; signedTx = await app.signTransaction( derivation, diff --git a/packages/solana/src/signers/private-key.signer.spec.ts b/packages/solana/src/signers/private-key.signer.spec.ts index e31c0ae1..65e804e2 100644 --- a/packages/solana/src/signers/private-key.signer.spec.ts +++ b/packages/solana/src/signers/private-key.signer.spec.ts @@ -80,4 +80,15 @@ describe('private-key.signer', () => { it('should get a private key', async () => { expect(await signer.getPrivateKey('')).toEqual(privateKey); }); + + it('should return signature for solana message', async () => { + const message = provider.createMsg({ + data: '726eSG6YzuM2gGVRSbGZptsMzM17zPZP5KAv8GM96CxdtDX4BkZBVV4JbRQgrdGs83mqFBPh2j7XiFsQVhskmq7cEd3TS561e1VPTw84Z9LnXPTxJHZTgucPkmmUrDQTgtGeYMw1BiKyHYg4j9aPAULMwihHVvmjMzYwVKQVqr3PNMeYcLcw8oYNWkWfBddzoL2gJL8W8pAHGhrV46F3me4hJLxU59VU1GBKThv6LHo5frUcS3j15YFkWVaFipVQeoemiKQgjfL3q21ziEkaA8LvvoFfJmaXfAKAoyhKhrzWTzDzfk1t2UPX5qxgzXy5K7Qcst6hG1w3MSTtEbenDDLjNgmrspFw83hNftzeU2pdKQ2wjwjCAnLgzSLZBtrLNUcU9fqf5EbXYernV8qtZvRxChnzvt7ekyoyuDktVY8rk3JJDGNoyMqDF9zkrrA625eUWjSC9fedgfBACys1Q8gjBj3ET1qrj5Q9ZAst1yQtwKhzuC3tfJBtevjRByu9dgLVhW4n76DbgEPgSDjqwsGEymP6gtfbFJT8ZhhyW8yrxKASv44zkpEo3EqQuVFjteDHs3GtpP4qoMQwYHQbomccPtcv2KoDCLj45ueRsF4gsQS8QgVWS664zgPvBBqKdHqxA4gmuQpH7kL6T3w3BiTRGCZ4zZMHWbbssiDfrouYsxGJ518FfL7pMPiDvzGiJsAiDzU7mnpJpc52SmREH3ahjqf4DEiBMhorrjxKYPJ6KB5KuZv8BVmmpDgsdkt1wPbNBjJK13qmGzaueW9GVb7W1kq8wRCMhRqb6uHuofRMGZ9awcN5TKKeSCGaN68H2mHKMWbzgj7CVLAHstgTWcaqEauHxnTjfZT7njnA3WjG5vE46BSDKwBvXQcctjDEDUkGBqadKfFyvECoTF5uVwg3NizpoCEg43YJ2ACsJmkobmvsNPirnFCkY19h8FWe8fp3X2T4f4tTVeeSE3wQr6JqffZjZ4b5qzTYWLvtXoB9z5sqaJ3HoQthEvQzExByj2PLvuNGFcPZeMy7DStysnmZVb1WJhWGwA4374iQpR5Vi7Sa6yQyFhRbv2ZFE66PXziH4AKgKTQs3CKikV7cwwq5LqktFFoonr2g9EPz536zcBka4rdan6SbrVo2gTzgYDusJRjU9Yf9XRscMmx6nt246wDvVCrHdBdukCyiajzngKkJrQY9SMfh7VHhq34YtVjS6dDtLqCJmw6vnhFvjspTSoJ8czZjsadfcnki7B7fJbBjPY6iL8fFSyZtsHdu21NQxttqCQiBGk1mFj1ohwTr7a3rCLpHsn8yyaJ66iGXHruBX2CZeL61gX8wuDM', + }); + const signature = await signer.signMessage(message as ChainMsg); + expect(signature).toEqual({ + pubKey: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', + sig: 'LvYxkcdz3E2NmhwAX2EAnPgudhaWyGRkxkNdEu7ZnPaBcyU4giu8VjCM7TMyYPmVn2rsvJvWfYpmhLK5HL7GPiE', + }); + }); }); diff --git a/packages/solana/src/signers/private-key.signer.ts b/packages/solana/src/signers/private-key.signer.ts index a401bea1..80da00a9 100644 --- a/packages/solana/src/signers/private-key.signer.ts +++ b/packages/solana/src/signers/private-key.signer.ts @@ -5,8 +5,11 @@ import { Transaction as SolanaTransaction, VersionedTransaction, } from '@solana/web3.js'; +import bs58 from 'bs58'; +import nacl from 'tweetnacl'; import { ChainMsg } from '../msg'; +import { SolanaSignature } from '../types'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { @@ -39,6 +42,7 @@ export class PrivateKeySigner extends Signer.Provider { serializedTx = transaction.serialize(); break; case MsgEncoding.base64: + case MsgEncoding.base58: const versionedTransaction = tx as VersionedTransaction; versionedTransaction.sign([account]); serializedTx = Buffer.from(versionedTransaction.serialize()); @@ -53,6 +57,18 @@ export class PrivateKeySigner extends Signer.Provider { msg.sign(serializedTx); } + + async signMessage(msg: ChainMsg): Promise { + const message = msg.toData(); + const account = Keypair.fromSecretKey(Buffer.from(this.key, 'hex')); + const decoded = bs58.decode(message.data); + const signature = nacl.sign.detached(decoded, account.secretKey); + + return { + pubKey: account.publicKey.toString(), + sig: bs58.encode(signature), + }; + } } export default PrivateKeySigner; diff --git a/packages/solana/src/signers/seed-phrase.signer.spec.ts b/packages/solana/src/signers/seed-phrase.signer.spec.ts index 2f571928..ba1e6017 100644 --- a/packages/solana/src/signers/seed-phrase.signer.spec.ts +++ b/packages/solana/src/signers/seed-phrase.signer.spec.ts @@ -59,7 +59,7 @@ describe('seed-phrase.signer', () => { ); }); - it('should sign swap transaction using a seed phrase', async () => { + it('should sign swap base64 transaction using a seed phrase', async () => { // { data: unsigned_transaction } const message = provider.createMsg( { @@ -74,6 +74,20 @@ describe('seed-phrase.signer', () => { ); }); + it('should sign base58 transaction using a seed phrase', async () => { + const message = provider.createMsg( + { + data: '726eSG6YzuM2gGVRSbGZptsMzM17zPZP5KAv8GM96CxdtDX4BkZBVV4JbRQgrdGs83mqFBPh2j7XiFsQVhskmq7cEd3TS561e1VPTw84Z9LnXPTxJHZTgucPkmmUrDQTgtGeYMw1BiKyHYg4j9aPAULMwihHVvmjMzYwVKQVqr3PNMeYcLcw8oYNWkWfBddzoL2gJL8W8pAHGhrV46F3me4hJLxU59VU1GBKThv6LHo5frUcS3j15YFkWVaFipVQeoemiKQgjfL3q21ziEkaA8LvvoFfJmaXfAKAoyhKhrzWTzDzfk1t2UPX5qxgzXy5K7Qcst6hG1w3MSTtEbenDDLjNgmrspFw83hNftzeU2pdKQ2wjwjCAnLgzSLZBtrLNUcU9fqf5EbXYernV8qtZvRxChnzvt7ekyoyuDktVY8rk3JJDGNoyMqDF9zkrrA625eUWjSC9fedgfBACys1Q8gjBj3ET1qrj5Q9ZAst1yQtwKhzuC3tfJBtevjRByu9dgLVhW4n76DbgEPgSDjqwsGEymP6gtfbFJT8ZhhyW8yrxKASv44zkpEo3EqQuVFjteDHs3GtpP4qoMQwYHQbomccPtcv2KoDCLj45ueRsF4gsQS8QgVWS664zgPvBBqKdHqxA4gmuQpH7kL6T3w3BiTRGCZ4zZMHWbbssiDfrouYsxGJ518FfL7pMPiDvzGiJsAiDzU7mnpJpc52SmREH3ahjqf4DEiBMhorrjxKYPJ6KB5KuZv8BVmmpDgsdkt1wPbNBjJK13qmGzaueW9GVb7W1kq8wRCMhRqb6uHuofRMGZ9awcN5TKKeSCGaN68H2mHKMWbzgj7CVLAHstgTWcaqEauHxnTjfZT7njnA3WjG5vE46BSDKwBvXQcctjDEDUkGBqadKfFyvECoTF5uVwg3NizpoCEg43YJ2ACsJmkobmvsNPirnFCkY19h8FWe8fp3X2T4f4tTVeeSE3wQr6JqffZjZ4b5qzTYWLvtXoB9z5sqaJ3HoQthEvQzExByj2PLvuNGFcPZeMy7DStysnmZVb1WJhWGwA4374iQpR5Vi7Sa6yQyFhRbv2ZFE66PXziH4AKgKTQs3CKikV7cwwq5LqktFFoonr2g9EPz536zcBka4rdan6SbrVo2gTzgYDusJRjU9Yf9XRscMmx6nt246wDvVCrHdBdukCyiajzngKkJrQY9SMfh7VHhq34YtVjS6dDtLqCJmw6vnhFvjspTSoJ8czZjsadfcnki7B7fJbBjPY6iL8fFSyZtsHdu21NQxttqCQiBGk1mFj1ohwTr7a3rCLpHsn8yyaJ66iGXHruBX2CZeL61gX8wuDM', + }, + MsgEncoding.base58 + ); + await signer.sign(message as ChainMsg, derivation); + + expect(message.signedTransaction.toString('hex')).toBe( + '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' + ); + }); + it('should return false when verifing an invalid address', async () => { expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); }); @@ -85,6 +99,17 @@ describe('seed-phrase.signer', () => { it('should get a private key', async () => { expect(await signer.getPrivateKey(derivation)).toEqual(privateKey); }); + + it('should return signature for solana message', async () => { + const message = provider.createMsg({ + data: '726eSG6YzuM2gGVRSbGZptsMzM17zPZP5KAv8GM96CxdtDX4BkZBVV4JbRQgrdGs83mqFBPh2j7XiFsQVhskmq7cEd3TS561e1VPTw84Z9LnXPTxJHZTgucPkmmUrDQTgtGeYMw1BiKyHYg4j9aPAULMwihHVvmjMzYwVKQVqr3PNMeYcLcw8oYNWkWfBddzoL2gJL8W8pAHGhrV46F3me4hJLxU59VU1GBKThv6LHo5frUcS3j15YFkWVaFipVQeoemiKQgjfL3q21ziEkaA8LvvoFfJmaXfAKAoyhKhrzWTzDzfk1t2UPX5qxgzXy5K7Qcst6hG1w3MSTtEbenDDLjNgmrspFw83hNftzeU2pdKQ2wjwjCAnLgzSLZBtrLNUcU9fqf5EbXYernV8qtZvRxChnzvt7ekyoyuDktVY8rk3JJDGNoyMqDF9zkrrA625eUWjSC9fedgfBACys1Q8gjBj3ET1qrj5Q9ZAst1yQtwKhzuC3tfJBtevjRByu9dgLVhW4n76DbgEPgSDjqwsGEymP6gtfbFJT8ZhhyW8yrxKASv44zkpEo3EqQuVFjteDHs3GtpP4qoMQwYHQbomccPtcv2KoDCLj45ueRsF4gsQS8QgVWS664zgPvBBqKdHqxA4gmuQpH7kL6T3w3BiTRGCZ4zZMHWbbssiDfrouYsxGJ518FfL7pMPiDvzGiJsAiDzU7mnpJpc52SmREH3ahjqf4DEiBMhorrjxKYPJ6KB5KuZv8BVmmpDgsdkt1wPbNBjJK13qmGzaueW9GVb7W1kq8wRCMhRqb6uHuofRMGZ9awcN5TKKeSCGaN68H2mHKMWbzgj7CVLAHstgTWcaqEauHxnTjfZT7njnA3WjG5vE46BSDKwBvXQcctjDEDUkGBqadKfFyvECoTF5uVwg3NizpoCEg43YJ2ACsJmkobmvsNPirnFCkY19h8FWe8fp3X2T4f4tTVeeSE3wQr6JqffZjZ4b5qzTYWLvtXoB9z5sqaJ3HoQthEvQzExByj2PLvuNGFcPZeMy7DStysnmZVb1WJhWGwA4374iQpR5Vi7Sa6yQyFhRbv2ZFE66PXziH4AKgKTQs3CKikV7cwwq5LqktFFoonr2g9EPz536zcBka4rdan6SbrVo2gTzgYDusJRjU9Yf9XRscMmx6nt246wDvVCrHdBdukCyiajzngKkJrQY9SMfh7VHhq34YtVjS6dDtLqCJmw6vnhFvjspTSoJ8czZjsadfcnki7B7fJbBjPY6iL8fFSyZtsHdu21NQxttqCQiBGk1mFj1ohwTr7a3rCLpHsn8yyaJ66iGXHruBX2CZeL61gX8wuDM', + }); + const signature = await signer.signMessage(message as ChainMsg, derivation); + expect(signature).toEqual({ + pubKey: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', + sig: 'LvYxkcdz3E2NmhwAX2EAnPgudhaWyGRkxkNdEu7ZnPaBcyU4giu8VjCM7TMyYPmVn2rsvJvWfYpmhLK5HL7GPiE', + }); + }); }); describe('seed-phase.addressGeneration', () => { diff --git a/packages/solana/src/signers/seed-phrase.signer.ts b/packages/solana/src/signers/seed-phrase.signer.ts index a54429ca..3fda1b43 100644 --- a/packages/solana/src/signers/seed-phrase.signer.ts +++ b/packages/solana/src/signers/seed-phrase.signer.ts @@ -7,8 +7,11 @@ import { } from '@solana/web3.js'; import * as bip39 from 'bip39'; import { derivePath } from 'ed25519-hd-key'; +import bs58 from 'bs58'; +import nacl from 'tweetnacl'; import { ChainMsg } from '../msg'; +import { SolanaSignature } from '../types'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { @@ -52,6 +55,7 @@ export class SeedPhraseSigner extends Signer.Provider { serializedTx = transaction.serialize(); break; case MsgEncoding.base64: + case MsgEncoding.base58: const versionedTransaction = tx as VersionedTransaction; versionedTransaction.sign([account]); serializedTx = Buffer.from(versionedTransaction.serialize()); @@ -66,6 +70,23 @@ export class SeedPhraseSigner extends Signer.Provider { msg.sign(serializedTx); } + + async signMessage( + msg: ChainMsg, + derivation: string + ): Promise { + const message = msg.toData(); + const account = Keypair.fromSecretKey( + Buffer.from(await this.getPrivateKey(derivation), 'hex') + ); + const decoded = bs58.decode(message.data); + const signature = nacl.sign.detached(decoded, account.secretKey); + + return { + pubKey: account.publicKey.toString(), + sig: bs58.encode(signature), + }; + } } export default SeedPhraseSigner; diff --git a/packages/solana/src/types.ts b/packages/solana/src/types.ts new file mode 100644 index 00000000..04cb6ebf --- /dev/null +++ b/packages/solana/src/types.ts @@ -0,0 +1,6 @@ +export type Base58String = string; + +export interface SolanaSignature { + pubKey: string; + sig: Base58String; +} diff --git a/utility-packages/graphql/src/gql/gql.ts b/utility-packages/graphql/src/gql/gql.ts index f3b42088..7d48ea96 100644 --- a/utility-packages/graphql/src/gql/gql.ts +++ b/utility-packages/graphql/src/gql/gql.ts @@ -74,121 +74,121 @@ export function gql(source: string): unknown; */ export function gql( source: 'query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}' -): typeof documents['query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}']; +): (typeof documents)['query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): typeof documents['query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): (typeof documents)['query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): typeof documents['query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): (typeof documents)['query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}' -): typeof documents['query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}']; +): (typeof documents)['query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): typeof documents['query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): (typeof documents)['query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}' -): typeof documents['query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}']; +): (typeof documents)['query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): typeof documents['query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): (typeof documents)['query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}' -): typeof documents['query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}']; +): (typeof documents)['query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}' -): typeof documents['query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}']; +): (typeof documents)['query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}' -): typeof documents['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; +): (typeof documents)['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; export function gql(source: string) { return (documents as any)[source] ?? {}; diff --git a/yarn.lock b/yarn.lock index 2f74a15f..c3adaea9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17356,7 +17356,12 @@ turbo@latest: turbo-windows-64 "1.13.2" turbo-windows-arm64 "1.13.2" -tweetnacl@1.0.3, tweetnacl@^1.0.3: +tweetnacl@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== From ab8a44d564d7dafbe75b9a85d38a2340e3faa2fb Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 14 Jun 2024 08:47:36 +0000 Subject: [PATCH 006/176] Version packages --- .changeset/sixty-feet-study.md | 7 ------- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/solana/CHANGELOG.md | 9 ++++++++ packages/solana/package.json | 2 +- yarn.lock | 38 ++++++++++++++++++++++++++-------- 6 files changed, 47 insertions(+), 18 deletions(-) delete mode 100644 .changeset/sixty-feet-study.md diff --git a/.changeset/sixty-feet-study.md b/.changeset/sixty-feet-study.md deleted file mode 100644 index 41c834eb..00000000 --- a/.changeset/sixty-feet-study.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch ---- - -feat: add base58 to msg encoding for solana chain -feat: add signMessage for solana signers diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 0558a76a..fb011db6 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @xdefi-tech/chains-core +## 2.0.15 + +### Patch Changes + +- 5a5b9ef: feat: add base58 to msg encoding for solana chain + feat: add signMessage for solana signers + ## 2.0.14 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index a7f71855..9298d648 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.14", + "version": "2.0.15", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 75fc503b..28fd68fb 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-solana +## 2.0.19 + +### Patch Changes + +- 5a5b9ef: feat: add base58 to msg encoding for solana chain + feat: add signMessage for solana signers +- Updated dependencies [5a5b9ef] + - @xdefi-tech/chains-core@2.0.15 + ## 2.0.18 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index bfe9b9c7..401660ad 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.18", + "version": "2.0.19", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/yarn.lock b/yarn.lock index c3adaea9..fd6db27e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16543,7 +16543,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -16561,6 +16561,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -16631,7 +16640,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -16652,6 +16661,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -17356,16 +17372,11 @@ turbo@latest: turbo-windows-64 "1.13.2" turbo-windows-arm64 "1.13.2" -tweetnacl@1.0.3: +tweetnacl@1.0.3, tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== -tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" @@ -18202,7 +18213,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18220,6 +18231,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From bfae64833a1a571e02e8ccd75e811ea24314f713 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:36:47 +0300 Subject: [PATCH 007/176] feat: move verifyAddress method to provider, make it static (#241) * feat: move verifyAddress method to provider, make it static Co-authored-by: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Co-authored-by: sotatek-tyler-nguyen4 Co-authored-by: cicd Co-authored-by: dp <25910069+davidp94@users.noreply.github.com> --- .changeset/chatty-rings-laugh.md | 17 + packages/binance/src/chain.provider.spec.ts | 33 ++ packages/binance/src/chain.provider.ts | 5 + .../binance/src/signers/ledger.signer.spec.ts | 8 - packages/binance/src/signers/ledger.signer.ts | 4 - .../src/signers/private-key.signer.spec.ts | 8 - .../binance/src/signers/private-key.signer.ts | 7 - .../src/signers/seed-phrase.signer.spec.ts | 8 - .../binance/src/signers/seed-phrase.signer.ts | 4 - .../binance/src/signers/trezor.signer.spec.ts | 8 - packages/binance/src/signers/trezor.signer.ts | 5 - packages/bitcoin/src/chain.provider.spec.ts | 32 ++ packages/bitcoin/src/chain.provider.ts | 10 + .../bitcoin/src/signers/ledger.signer.spec.ts | 8 - packages/bitcoin/src/signers/ledger.signer.ts | 9 - .../src/signers/private-key.signer.spec.ts | 8 - .../bitcoin/src/signers/private-key.signer.ts | 12 - .../src/signers/seed-phrase.signer.spec.ts | 8 - .../bitcoin/src/signers/seed-phrase.signer.ts | 12 - .../bitcoin/src/signers/trezor.signer.spec.ts | 8 - packages/bitcoin/src/signers/trezor.signer.ts | 10 - .../bitcoincash/src/chain.provider.spec.ts | 26 ++ packages/bitcoincash/src/chain.provider.ts | 10 + .../src/signers/ledger.signer.spec.ts | 8 - .../bitcoincash/src/signers/ledger.signer.ts | 6 +- .../src/signers/private-key.signer.spec.ts | 8 - .../src/signers/private-key.signer.ts | 9 - .../src/signers/seed-phrase.signer.spec.ts | 8 - .../src/signers/seed-phrase.signer.ts | 10 - .../src/signers/trezor.signer.spec.ts | 8 - .../bitcoincash/src/signers/trezor.signer.ts | 9 - .../core/src/core/chain/chain.provider.ts | 11 + .../core/src/core/signer/signer.provider.ts | 9 - packages/cosmos/src/chain.provider.spec.ts | 120 +++++-- packages/cosmos/src/chain.provider.ts | 18 ++ .../{queries => gql}/operations.graphql | 0 .../src/datasource/indexer/gql/terra.graphql | 42 +++ .../indexer/queries/balances.query.ts | 5 + .../datasource/indexer/queries/fees.query.ts | 5 + .../datasource/indexer/queries/nfts.query.ts | 23 +- .../cosmos/src/signers/ledger.signer.spec.ts | 8 - packages/cosmos/src/signers/ledger.signer.ts | 13 - .../src/signers/private-key.signer.spec.ts | 19 -- .../cosmos/src/signers/private-key.signer.ts | 29 +- .../src/signers/seed-phrase.signer.spec.ts | 35 --- .../cosmos/src/signers/seed-phrase.signer.ts | 28 +- packages/dogecoin/src/chain.provider.spec.ts | 18 ++ packages/dogecoin/src/chain.provider.ts | 13 + .../src/signers/ledger.signer.spec.ts | 8 - .../dogecoin/src/signers/ledger.signer.ts | 9 - .../src/signers/private-key.signer.spec.ts | 8 - .../src/signers/private-key.signer.ts | 10 - .../src/signers/seed-phrase.signer.spec.ts | 8 - .../src/signers/seed-phrase.signer.ts | 10 - .../src/signers/trezor.signer.spec.ts | 8 - .../dogecoin/src/signers/trezor.signer.ts | 8 - packages/evm/src/chain.provider.spec.ts | 22 +- packages/evm/src/chain.provider.ts | 10 +- .../evm/src/signers/ledger.signer.spec.ts | 8 - packages/evm/src/signers/ledger.signer.ts | 4 - .../src/signers/private-key.signer.spec.ts | 10 - .../evm/src/signers/private-key.signer.ts | 6 +- .../src/signers/seed-phrase.signer.spec.ts | 9 - .../evm/src/signers/seed-phrase.signer.ts | 4 - .../evm/src/signers/trezor.signer.spec.ts | 8 - packages/evm/src/signers/trezor.signer.ts | 6 +- packages/litecoin/src/chain.provider.spec.ts | 20 ++ packages/litecoin/src/chain.provider.ts | 14 + .../src/signers/ledger.signer.spec.ts | 8 - .../litecoin/src/signers/ledger.signer.ts | 9 - .../src/signers/private-key.signer.spec.ts | 8 - .../src/signers/private-key.signer.ts | 10 - .../src/signers/seed-phrase.signer.spec.ts | 8 - .../src/signers/seed-phrase.signer.ts | 10 - .../src/signers/trezor.signer.spec.ts | 8 - .../litecoin/src/signers/trezor.signer.ts | 8 - packages/solana/package.json | 3 +- packages/solana/src/chain.provider.spec.ts | 12 + packages/solana/src/chain.provider.ts | 11 +- packages/solana/src/msg.spec.ts | 1 - .../solana/src/signers/ledger.signer.spec.ts | 8 - packages/solana/src/signers/ledger.signer.ts | 9 - .../src/signers/private-key.signer.spec.ts | 8 - .../solana/src/signers/private-key.signer.ts | 10 - .../src/signers/seed-phrase.signer.spec.ts | 16 +- .../solana/src/signers/seed-phrase.signer.ts | 10 - packages/thor/src/chain.provider.spec.ts | 22 ++ packages/thor/src/chain.provider.ts | 10 + packages/thor/src/msg.spec.ts | 2 +- .../thor/src/signers/ledger.signer.spec.ts | 14 - packages/thor/src/signers/ledger.signer.ts | 11 - .../src/signers/private-key.signer.spec.ts | 20 -- .../thor/src/signers/private-key.signer.ts | 13 - .../src/signers/seed-phrase.signer.spec.ts | 9 - .../thor/src/signers/seed-phrase.signer.ts | 13 - packages/tron/.eslintignore | 2 + packages/tron/jest-setup-file.ts | 5 + packages/tron/package.json | 10 +- packages/tron/src/chain.provider.spec.d..ts | 1 - packages/tron/src/chain.provider.spec.ts | 11 +- packages/tron/src/chain.provider.ts | 11 +- .../tron/src/signers/ledger.signer.spec.ts | 8 - packages/tron/src/signers/ledger.signer.ts | 11 +- .../src/signers/private-key.signer.spec.ts | 8 - .../tron/src/signers/private-key.signer.ts | 10 +- .../src/signers/seed-phrase.signer.spec.ts | 8 - .../tron/src/signers/seed-phrase.signer.ts | 10 +- packages/tron/tsconfig.json | 14 +- .../chains-controller/package.json | 2 +- .../chains-controller/src/provider-factory.ts | 1 + utility-packages/graphql/src/gql/gql.ts | 48 +-- utility-packages/graphql/src/gql/graphql.ts | 295 +++++++++++++++++- yarn.lock | 31 +- 113 files changed, 848 insertions(+), 821 deletions(-) create mode 100644 .changeset/chatty-rings-laugh.md create mode 100644 packages/binance/src/chain.provider.spec.ts rename packages/cosmos/src/datasource/indexer/{queries => gql}/operations.graphql (100%) create mode 100644 packages/cosmos/src/datasource/indexer/gql/terra.graphql create mode 100644 packages/tron/jest-setup-file.ts delete mode 100644 packages/tron/src/chain.provider.spec.d..ts diff --git a/.changeset/chatty-rings-laugh.md b/.changeset/chatty-rings-laugh.md new file mode 100644 index 00000000..ab292ec8 --- /dev/null +++ b/.changeset/chatty-rings-laugh.md @@ -0,0 +1,17 @@ +--- +'@xdefi-tech/chains-controller': patch +'@xdefi-tech/chains-graphql': patch +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-evm': patch +--- + +Feat: move verifyAddress to provider, make it static diff --git a/packages/binance/src/chain.provider.spec.ts b/packages/binance/src/chain.provider.spec.ts new file mode 100644 index 00000000..8a6db10a --- /dev/null +++ b/packages/binance/src/chain.provider.spec.ts @@ -0,0 +1,33 @@ +import { BinanceProvider } from './chain.provider'; + +describe('binance/chain.provider', () => { + it('should return false when verifying an invalid address', () => { + expect(BinanceProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid address', () => { + expect( + BinanceProvider.verifyAddress( + 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid testnet address', () => { + expect( + BinanceProvider.verifyAddress( + 'tbnb1q82g2h9q0kfe7sysnj5w7nlak92csfjztymp39', + 'tbnb' + ) + ).toBe(true); + }); + + it('should return false when verifying valid address for testnet', () => { + expect( + BinanceProvider.verifyAddress( + 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + 'tbnb' + ) + ).toBe(false); + }); +}); diff --git a/packages/binance/src/chain.provider.ts b/packages/binance/src/chain.provider.ts index bdfd55c8..829c3555 100644 --- a/packages/binance/src/chain.provider.ts +++ b/packages/binance/src/chain.provider.ts @@ -14,6 +14,7 @@ import { TransactionStatus, } from '@xdefi-tech/chains-core'; import { BncClient } from '@binance-chain/javascript-sdk/lib/client'; +import * as crypto from '@binance-chain/javascript-sdk/lib/crypto'; import axios, { Axios } from 'axios'; import { IndexerDataSource } from './datasource'; @@ -131,6 +132,10 @@ export class BinanceProvider extends Chain.Provider { }; } + static verifyAddress(address: string, prefix = 'bnb'): boolean { + return crypto.checkAddress(address, prefix); + } + static get dataSourceList() { return { IndexerDataSource: IndexerDataSource, diff --git a/packages/binance/src/signers/ledger.signer.spec.ts b/packages/binance/src/signers/ledger.signer.spec.ts index 84a1cdfe..ce45f756 100644 --- a/packages/binance/src/signers/ledger.signer.spec.ts +++ b/packages/binance/src/signers/ledger.signer.spec.ts @@ -71,14 +71,6 @@ describe('binance::ledger.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/binance/src/signers/ledger.signer.ts b/packages/binance/src/signers/ledger.signer.ts index 52843b72..0aac9fec 100644 --- a/packages/binance/src/signers/ledger.signer.ts +++ b/packages/binance/src/signers/ledger.signer.ts @@ -16,10 +16,6 @@ export class LedgerSigner extends Signer.Provider { this.transport = transport; } - verifyAddress(address: string, prefix = 'bnb'): boolean { - return crypto.checkAddress(address, prefix); - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Ledger device'); } diff --git a/packages/binance/src/signers/private-key.signer.spec.ts b/packages/binance/src/signers/private-key.signer.spec.ts index 6aa940fd..112fb0ae 100644 --- a/packages/binance/src/signers/private-key.signer.spec.ts +++ b/packages/binance/src/signers/private-key.signer.spec.ts @@ -47,14 +47,6 @@ describe('private-key.signer', () => { expect(message.signedTransaction.toString('hex')).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey('')).toEqual(privateKey); }); diff --git a/packages/binance/src/signers/private-key.signer.ts b/packages/binance/src/signers/private-key.signer.ts index 72eddd77..3707179a 100644 --- a/packages/binance/src/signers/private-key.signer.ts +++ b/packages/binance/src/signers/private-key.signer.ts @@ -7,10 +7,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string, prefix = 'bnb'): boolean { - return crypto.checkAddress(address, prefix); - } - async getPrivateKey(_derivation: string) { return this.key; } @@ -66,9 +62,6 @@ export class PrivateKeySigner extends Signer.Provider { }, ], }; - /* eslint-enable */ - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore const tx = new Transaction({ accountNumber: txData.accountNumber, chainId: txData.chainId, diff --git a/packages/binance/src/signers/seed-phrase.signer.spec.ts b/packages/binance/src/signers/seed-phrase.signer.spec.ts index 98c2c68a..8bc843dc 100644 --- a/packages/binance/src/signers/seed-phrase.signer.spec.ts +++ b/packages/binance/src/signers/seed-phrase.signer.spec.ts @@ -44,14 +44,6 @@ describe('seed-phrase.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey(derivation)).toEqual( '0c72be62d9433a853a7bdbf0455a69ded80669f7a7e9ce05d12e02adf353cf51' diff --git a/packages/binance/src/signers/seed-phrase.signer.ts b/packages/binance/src/signers/seed-phrase.signer.ts index e480948e..fc4b4e03 100644 --- a/packages/binance/src/signers/seed-phrase.signer.ts +++ b/packages/binance/src/signers/seed-phrase.signer.ts @@ -7,10 +7,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string, prefix = 'bnb'): boolean { - return crypto.checkAddress(address, prefix); - } - async getPrivateKey(derivation: string) { let index = 0; if (derivation) { diff --git a/packages/binance/src/signers/trezor.signer.spec.ts b/packages/binance/src/signers/trezor.signer.spec.ts index 0856b08d..b82eb61b 100644 --- a/packages/binance/src/signers/trezor.signer.spec.ts +++ b/packages/binance/src/signers/trezor.signer.spec.ts @@ -89,14 +89,6 @@ describe('trezor.signer', () => { expect(message.signedTransaction).toEqual('SIGNED'); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('btc123')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/binance/src/signers/trezor.signer.ts b/packages/binance/src/signers/trezor.signer.ts index ba74192d..a22d2f5f 100644 --- a/packages/binance/src/signers/trezor.signer.ts +++ b/packages/binance/src/signers/trezor.signer.ts @@ -4,16 +4,11 @@ import { IsTrezorInitialized, } from '@xdefi-tech/chains-core'; import TrezorConnect, * as connectWeb from '@trezor/connect-web'; -import * as crypto from '@binance-chain/javascript-sdk/lib/crypto'; import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.TREZOR) export class TrezorSigner extends Signer.TrezorProvider { - verifyAddress(address: string, prefix = 'bnb'): boolean { - return crypto.checkAddress(address, prefix); - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Trezor device'); } diff --git a/packages/bitcoin/src/chain.provider.spec.ts b/packages/bitcoin/src/chain.provider.spec.ts index b0989a2b..a6347300 100644 --- a/packages/bitcoin/src/chain.provider.spec.ts +++ b/packages/bitcoin/src/chain.provider.spec.ts @@ -123,4 +123,36 @@ describe('chain.provider', () => { memo ); }); + + it('should return false when verifying an invalid address', () => { + expect(BitcoinProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid address starts with "bc1" and 39 characters', () => { + expect( + BitcoinProvider.verifyAddress( + 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid address starts with "bc1" and 59 characters', () => { + expect( + BitcoinProvider.verifyAddress( + 'bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid address starts with "1"', () => { + expect( + BitcoinProvider.verifyAddress('1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF') + ).toBe(true); + }); + + it('should return true when verifying a valid address starts with "3"', () => { + expect( + BitcoinProvider.verifyAddress('34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo') + ).toBe(true); + }); }); diff --git a/packages/bitcoin/src/chain.provider.ts b/packages/bitcoin/src/chain.provider.ts index 562486d2..02302986 100644 --- a/packages/bitcoin/src/chain.provider.ts +++ b/packages/bitcoin/src/chain.provider.ts @@ -6,6 +6,7 @@ import { TransactionData, } from '@xdefi-tech/chains-core'; import { UtxoProvider } from '@xdefi-tech/chains-utxo'; +import * as Bitcoin from 'bitcoinjs-lib'; import { IndexerDataSource } from './datasource'; import { ChainMsg, MsgBody } from './msg'; @@ -42,4 +43,13 @@ export class BitcoinProvider extends UtxoProvider { public async scanUTXOs(address: string) { return this.dataSource.scanUTXOs(address); } + + static verifyAddress(address: string): boolean { + try { + Bitcoin.address.toOutputScript(address); + return true; + } catch (err) { + return false; + } + } } diff --git a/packages/bitcoin/src/signers/ledger.signer.spec.ts b/packages/bitcoin/src/signers/ledger.signer.spec.ts index 8207f6ad..5b6f3ab8 100644 --- a/packages/bitcoin/src/signers/ledger.signer.spec.ts +++ b/packages/bitcoin/src/signers/ledger.signer.spec.ts @@ -98,14 +98,6 @@ describe('ledger.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/bitcoin/src/signers/ledger.signer.ts b/packages/bitcoin/src/signers/ledger.signer.ts index a6cf06a5..2077eae4 100644 --- a/packages/bitcoin/src/signers/ledger.signer.ts +++ b/packages/bitcoin/src/signers/ledger.signer.ts @@ -16,15 +16,6 @@ export class LedgerSigner extends Signer.Provider { this.transport = transport; } - verifyAddress(address: string): boolean { - try { - Bitcoin.address.toOutputScript(address); - return true; - } catch (err) { - return false; - } - } - async getAddress( derivation: string, type: 'legacy' | 'p2sh' | 'bech32' | 'bech32m' | 'cashaddr' = 'legacy' diff --git a/packages/bitcoin/src/signers/private-key.signer.spec.ts b/packages/bitcoin/src/signers/private-key.signer.spec.ts index 665b9e82..66a60b74 100644 --- a/packages/bitcoin/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoin/src/signers/private-key.signer.spec.ts @@ -99,14 +99,6 @@ describe('private-key.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey('')).toEqual(privateKey); }); diff --git a/packages/bitcoin/src/signers/private-key.signer.ts b/packages/bitcoin/src/signers/private-key.signer.ts index f89b1182..c17707c4 100644 --- a/packages/bitcoin/src/signers/private-key.signer.ts +++ b/packages/bitcoin/src/signers/private-key.signer.ts @@ -8,18 +8,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - if (btc.Address().decode(address)) { - return true; - } - - return false; - } catch (err) { - return false; - } - } - async getPrivateKey(_derivation?: string): Promise { if (!this.key) { throw new Error('Private key not set!'); diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts index e13ca291..6a470eb2 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts @@ -103,14 +103,6 @@ describe('seed-phrase.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key from a seed phrase', async () => { expect(await signer.getPrivateKey(derivation)).toEqual(privateKey); }); diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.ts b/packages/bitcoin/src/signers/seed-phrase.signer.ts index a0d91034..c4486bac 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.ts @@ -10,18 +10,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - if (btc.Address().decode(address)) { - return true; - } - - return false; - } catch (err) { - return false; - } - } - async getPrivateKey(derivation: string): Promise { if (!this.key) { throw new Error('Seed phrase not set!'); diff --git a/packages/bitcoin/src/signers/trezor.signer.spec.ts b/packages/bitcoin/src/signers/trezor.signer.spec.ts index e4192965..ebbd47d4 100644 --- a/packages/bitcoin/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoin/src/signers/trezor.signer.spec.ts @@ -91,14 +91,6 @@ describe('trezor.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('btc123')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/bitcoin/src/signers/trezor.signer.ts b/packages/bitcoin/src/signers/trezor.signer.ts index 667d17c4..db088edd 100644 --- a/packages/bitcoin/src/signers/trezor.signer.ts +++ b/packages/bitcoin/src/signers/trezor.signer.ts @@ -1,4 +1,3 @@ -import * as Bitcoin from 'bitcoinjs-lib'; import { Signer, SignerDecorator, @@ -9,15 +8,6 @@ import { UTXO, ChainMsg } from '@xdefi-tech/chains-utxo'; @SignerDecorator(Signer.SignerType.TREZOR) export class TrezorSigner extends Signer.TrezorProvider { - verifyAddress(address: string): boolean { - try { - Bitcoin.address.toOutputScript(address); - return true; - } catch (err) { - return false; - } - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Trezor device'); } diff --git a/packages/bitcoincash/src/chain.provider.spec.ts b/packages/bitcoincash/src/chain.provider.spec.ts index b0f7fc7d..dd1b75a1 100644 --- a/packages/bitcoincash/src/chain.provider.spec.ts +++ b/packages/bitcoincash/src/chain.provider.spec.ts @@ -101,4 +101,30 @@ describe('chain.provider', () => { memo ); }); + + it('should return false when verifying an invalid address', () => { + expect(BitcoinCashProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid address with network prefix', () => { + expect( + BitcoinCashProvider.verifyAddress( + 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid address without network prefix', () => { + expect( + BitcoinCashProvider.verifyAddress( + 'qq8s9kmuyl9avm5ef7jlgsnv9x80ygj7scyzcr6vad' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid legacy address', () => { + expect( + BitcoinCashProvider.verifyAddress('1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR') + ).toBe(true); + }); }); diff --git a/packages/bitcoincash/src/chain.provider.ts b/packages/bitcoincash/src/chain.provider.ts index 6cb26dc2..13b71223 100644 --- a/packages/bitcoincash/src/chain.provider.ts +++ b/packages/bitcoincash/src/chain.provider.ts @@ -6,6 +6,7 @@ import { TransactionData, } from '@xdefi-tech/chains-core'; import { MsgBody, UtxoProvider } from '@xdefi-tech/chains-utxo'; +import bchaddr from 'bchaddrjs'; import { IndexerDataSource } from './datasource'; import { ChainMsg } from './msg'; @@ -42,4 +43,13 @@ export class BitcoinCashProvider extends UtxoProvider { public async scanUTXOs(address: string) { return this.dataSource.scanUTXOs(address); } + + static verifyAddress(address: string): boolean { + try { + const _address = bchaddr.toCashAddress(address); + return bchaddr.isValidAddress(_address); + } catch (err) { + return false; + } + } } diff --git a/packages/bitcoincash/src/signers/ledger.signer.spec.ts b/packages/bitcoincash/src/signers/ledger.signer.spec.ts index ea35d01d..b4afdbc9 100644 --- a/packages/bitcoincash/src/signers/ledger.signer.spec.ts +++ b/packages/bitcoincash/src/signers/ledger.signer.spec.ts @@ -97,14 +97,6 @@ describe('ledger.signer', () => { expect(message.signedTransaction).toEqual('SIGNEDTX'); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/bitcoincash/src/signers/ledger.signer.ts b/packages/bitcoincash/src/signers/ledger.signer.ts index ae9b4ea2..96677d6c 100644 --- a/packages/bitcoincash/src/signers/ledger.signer.ts +++ b/packages/bitcoincash/src/signers/ledger.signer.ts @@ -4,7 +4,7 @@ import Transport from '@ledgerhq/hw-transport'; import { Signer, SignerDecorator, utils } from '@xdefi-tech/chains-core'; import { UTXO } from '@xdefi-tech/chains-utxo'; import * as Bitcoin from 'bitcoinjs-lib'; -import { isValidAddress, toLegacyAddress } from 'bchaddrjs'; +import { toLegacyAddress } from 'bchaddrjs'; import { ChainMsg } from '../msg'; @@ -51,10 +51,6 @@ export class LedgerSigner extends Signer.Provider { bech32: 'bch', }; - verifyAddress(address: string): boolean { - return isValidAddress(address); - } - async getAddress( derivation: string, type: 'legacy' | 'p2sh' | 'bech32' | 'bech32m' | 'cashaddr' = 'cashaddr' diff --git a/packages/bitcoincash/src/signers/private-key.signer.spec.ts b/packages/bitcoincash/src/signers/private-key.signer.spec.ts index 970ef524..06d44d78 100644 --- a/packages/bitcoincash/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoincash/src/signers/private-key.signer.spec.ts @@ -100,14 +100,6 @@ describe('private-key.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey('')).toEqual(privateKey); }); diff --git a/packages/bitcoincash/src/signers/private-key.signer.ts b/packages/bitcoincash/src/signers/private-key.signer.ts index 3fa455c1..c81db076 100644 --- a/packages/bitcoincash/src/signers/private-key.signer.ts +++ b/packages/bitcoincash/src/signers/private-key.signer.ts @@ -10,15 +10,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - const _address = bchaddr.toCashAddress(address); - return bchaddr.isValidAddress(_address); - } catch (err) { - return false; - } - } - async getPrivateKey(_derivation: string): Promise { return this.key; } diff --git a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts index 68056100..b76c5400 100644 --- a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts @@ -106,14 +106,6 @@ describe('seed-phrase.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key from a seed phrase', async () => { expect(await signer.getPrivateKey(derivation)).toEqual(privateKey); }); diff --git a/packages/bitcoincash/src/signers/seed-phrase.signer.ts b/packages/bitcoincash/src/signers/seed-phrase.signer.ts index eac6ec81..a1a95286 100644 --- a/packages/bitcoincash/src/signers/seed-phrase.signer.ts +++ b/packages/bitcoincash/src/signers/seed-phrase.signer.ts @@ -3,7 +3,6 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { UTXO } from '@xdefi-tech/chains-utxo'; import * as bip32 from 'bip32'; import * as bip39 from 'bip39'; -/*eslint import/namespace: [2, { allowComputed: true }]*/ import * as BitcoinCash from '@psf/bitcoincashjs-lib'; import * as Bitcoin from 'bitcoinjs-lib'; import coininfo from 'coininfo'; @@ -13,15 +12,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - const _address = bchaddr.toCashAddress(address); - return bchaddr.isValidAddress(_address); - } catch (err) { - return false; - } - } - async getPrivateKey(derivation: string): Promise { if (!this.key) { throw new Error('Seed phrase not set!'); diff --git a/packages/bitcoincash/src/signers/trezor.signer.spec.ts b/packages/bitcoincash/src/signers/trezor.signer.spec.ts index 4a99dc73..6bdf05a6 100644 --- a/packages/bitcoincash/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoincash/src/signers/trezor.signer.spec.ts @@ -93,14 +93,6 @@ describe('trezor.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('btc123')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/bitcoincash/src/signers/trezor.signer.ts b/packages/bitcoincash/src/signers/trezor.signer.ts index 4121ed85..48f78f16 100644 --- a/packages/bitcoincash/src/signers/trezor.signer.ts +++ b/packages/bitcoincash/src/signers/trezor.signer.ts @@ -1,4 +1,3 @@ -import { isValidAddress } from 'bchaddrjs'; import { Signer, SignerDecorator, @@ -13,14 +12,6 @@ import { UTXO, ChainMsg } from '@xdefi-tech/chains-utxo'; @SignerDecorator(Signer.SignerType.TREZOR) export class TrezorSigner extends Signer.TrezorProvider { - verifyAddress(address: string): boolean { - if (isValidAddress(address)) { - return true; - } else { - return false; - } - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Trezor device'); } diff --git a/packages/core/src/core/chain/chain.provider.ts b/packages/core/src/core/chain/chain.provider.ts index dfe0c44a..a5536181 100644 --- a/packages/core/src/core/chain/chain.provider.ts +++ b/packages/core/src/core/chain/chain.provider.ts @@ -251,4 +251,15 @@ export abstract class Provider { static get dataSourceList(): Record { return {}; } + + /** + * Verifies if the given address is valid. + * + * @param {string} _address - The address to verify. + * @param {any} _rest - rest props for custom signer + * @returns {boolean} True if the address is valid, false otherwise. + */ + static verifyAddress(_address: string, ..._rest: any): boolean { + throw new Error('Method not implemented.'); + } } diff --git a/packages/core/src/core/signer/signer.provider.ts b/packages/core/src/core/signer/signer.provider.ts index fe0df02a..f6bd97d6 100644 --- a/packages/core/src/core/signer/signer.provider.ts +++ b/packages/core/src/core/signer/signer.provider.ts @@ -31,15 +31,6 @@ export abstract class Provider { throw new Error('Method not implemented.'); } - /** - * Verifies if the given address is valid. - * - * @param {string} address - The address to verify. - * @param {any} rest - rest props for custom signer - * @returns {boolean} True if the address is valid, false otherwise. - */ - abstract verifyAddress(address: string, ...rest: any): boolean; - get key(): string { if (!this._key) { throw new Error('key is required'); diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index 4c97476f..0b329ac6 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -31,41 +31,103 @@ jest.mock('./datasource/indexer/queries/balances.query', () => ({ return []; }, })); + describe('chain.provider', () => { - describe('Provider', () => { - let provider: CosmosProvider; + let provider: CosmosProvider; + + beforeEach(() => { + provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.cosmos) + ); + }); - beforeEach(() => { - provider = new CosmosProvider( - new IndexerDataSource(COSMOS_MANIFESTS.cosmos) - ); + it('createMsg(): should create message with data', () => { + const msg = provider.createMsg({ + to: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', + from: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', + amount: 0.000001, }); - it('createMsg(): should create message with data', () => { - const msg = provider.createMsg({ - to: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', - from: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', - amount: 0.000001, - }); + expect(msg).toBeInstanceOf(ChainMsg); + }); - expect(msg).toBeInstanceOf(ChainMsg); - }); + it('should get a transaction from the blockchain', async () => { + const txData = await provider.getTransaction( + '0269644F832384D033D2223226A5FC25BD17A3646EE2BEF5C1F9009FD19E66B9' + ); + expect(txData?.hash).toEqual( + '0269644F832384D033D2223226A5FC25BD17A3646EE2BEF5C1F9009FD19E66B9' + ); + }); - it('should get a transaction from the blockchain', async () => { - const txData = await provider.getTransaction( - '0269644F832384D033D2223226A5FC25BD17A3646EE2BEF5C1F9009FD19E66B9' - ); - expect(txData?.hash).toEqual( - '0269644F832384D033D2223226A5FC25BD17A3646EE2BEF5C1F9009FD19E66B9' - ); - }); + it('should get a balance', async () => { + const balance = await provider.getBalance( + 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4' + ); + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(0); + }); - it('should get a balance', async () => { - const balance = await provider.getBalance( - 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4' - ); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); - }); + it('should return false when verifying an invalid address', () => { + expect(CosmosProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid cosmos address', () => { + expect( + CosmosProvider.verifyAddress( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ) + ).toBe(true); + }); + + it('should return false when verifying a valid cosmos address with "osmo" prefix', () => { + expect( + CosmosProvider.verifyAddress( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + 'osmo' + ) + ).toBe(false); + }); + + it('should return true when verifying a valid osmosis address', () => { + expect( + CosmosProvider.verifyAddress( + 'osmo13r2x8duq3k88xjhcksd43phnmdpj97frx32qux', + 'osmo' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid mars address', () => { + expect( + CosmosProvider.verifyAddress( + 'mars13r2x8duq3k88xjhcksd43phnmdpj97frnhqfl0', + 'mars' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid terra address', () => { + expect( + CosmosProvider.verifyAddress( + 'terra10wn9ztf5vnms746nf07nsajlcqmn0s3q2nm6yz', + 'terra' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid ethermint address', () => { + expect( + CosmosProvider.verifyAddress( + 'evmos14gya7fnnuxhrlnywmp6uzvd4y3yul9vpp7tu6m', + 'evmos' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid EVM address', () => { + expect( + CosmosProvider.verifyAddress('0x74EeF25048bA28542600804F68fBF71cCf520C59') + ).toBe(true); }); }); diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index 7f127270..7bd60946 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -24,6 +24,9 @@ import { BroadcastTxError, Account } from '@cosmjs/stargate'; import { some } from 'lodash'; import axios, { AxiosInstance } from 'axios'; import 'reflect-metadata'; +import { bech32 } from 'bech32'; +import { utils } from 'ethers'; +import { AccAddress } from '@terra-money/feather.js'; import { ChainMsg } from './msg'; import * as manifests from './manifests'; @@ -241,4 +244,19 @@ export class CosmosProvider extends Chain.Provider { getIBCDestAsset, }; } + + static verifyAddress(address: string, prefix = 'cosmos'): boolean { + try { + if (address.substring(0, 2) === '0x') { + return utils.isAddress(address); + } else if (address.substring(0, 5) === 'terra') { + return AccAddress.validate(address); + } else { + const result = bech32.decode(address); + return result.prefix === prefix && result.words.length === 32; + } + } catch (err) { + return false; + } + } } diff --git a/packages/cosmos/src/datasource/indexer/queries/operations.graphql b/packages/cosmos/src/datasource/indexer/gql/operations.graphql similarity index 100% rename from packages/cosmos/src/datasource/indexer/queries/operations.graphql rename to packages/cosmos/src/datasource/indexer/gql/operations.graphql diff --git a/packages/cosmos/src/datasource/indexer/gql/terra.graphql b/packages/cosmos/src/datasource/indexer/gql/terra.graphql new file mode 100644 index 00000000..9bc118a4 --- /dev/null +++ b/packages/cosmos/src/datasource/indexer/gql/terra.graphql @@ -0,0 +1,42 @@ +query TerraBalance($address: String!) { + terra { + balances(address: $address) { + address + amount { + value + } + asset { + chain + contract + decimals + id + image + name + price { + amount + scalingFactor + dayPriceChange + } + symbol + } + } + } +} + +query GetTerraFees { + terra { + fee { + high + low + medium + } + } +} + +query GetTerraStatus { + terra { + status { + lastBlock + } + } +} \ No newline at end of file diff --git a/packages/cosmos/src/datasource/indexer/queries/balances.query.ts b/packages/cosmos/src/datasource/indexer/queries/balances.query.ts index 9c1ebe61..754d2d77 100644 --- a/packages/cosmos/src/datasource/indexer/queries/balances.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/balances.query.ts @@ -12,6 +12,7 @@ import { KujiraBalanceDocument, StrideBalanceDocument, MarsBalanceDocument, + TerraBalanceDocument, Balance, } from '@xdefi-tech/chains-graphql'; @@ -77,6 +78,10 @@ const getChainParams = (chain: string): CosmosChainParams => { params.query = MarsBalanceDocument; params.queryName = 'mars'; break; + case CosmosHubChains.terra: + params.query = TerraBalanceDocument; + params.queryName = 'terra'; + break; } return params; diff --git a/packages/cosmos/src/datasource/indexer/queries/fees.query.ts b/packages/cosmos/src/datasource/indexer/queries/fees.query.ts index 5bc7b592..18dc776c 100644 --- a/packages/cosmos/src/datasource/indexer/queries/fees.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/fees.query.ts @@ -12,6 +12,7 @@ import { GetKujiraFeesDocument, GetStrideFeesDocument, GetMarsFeesDocument, + GetTerraFeesDocument, DefaultGasFee, } from '@xdefi-tech/chains-graphql'; @@ -77,6 +78,10 @@ const getChainParams = (chain: string): CosmosChainParams => { params.query = GetMarsFeesDocument; params.queryName = 'mars'; break; + case CosmosHubChains.terra: + params.query = GetTerraFeesDocument; + params.queryName = 'terra'; + break; } return params; diff --git a/packages/cosmos/src/datasource/indexer/queries/nfts.query.ts b/packages/cosmos/src/datasource/indexer/queries/nfts.query.ts index 83bd0138..96e93dde 100644 --- a/packages/cosmos/src/datasource/indexer/queries/nfts.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/nfts.query.ts @@ -1,8 +1,8 @@ import { gql } from 'graphql-tag'; -import { gqlClient } from '@xdefi-tech/chains-core'; +import { gqlClient, LEGACY_NFTS_FRAGMENT } from '@xdefi-tech/chains-core'; export const STARGAZE_NFTS_QUERY = gql` - query NFTS($address: String!) { + query STARGAZE_NFTS($address: String!) { stargaze { nfts(address: $address) { attributes { @@ -50,7 +50,7 @@ export const STARGAZE_NFTS_QUERY = gql` `; export const JUNO_NFTS_QUERY = gql` - query NFTS($address: String!) { + query JUNO_NFTS($address: String!) { juno { nfts(address: $address) { attributes { @@ -97,6 +97,18 @@ export const JUNO_NFTS_QUERY = gql` } `; +export const TERRA_NFTS_QUERY = gql` + query TerraNFTS($address: String!) { + terra { + legacyNFTs(address: $address) { + ...LegacyNftData + } + } + } + + ${LEGACY_NFTS_FRAGMENT} +`; + export const getNFTBalance = async (chain: string, address: string) => { let query; let chainName; @@ -109,9 +121,14 @@ export const getNFTBalance = async (chain: string, address: string) => { query = STARGAZE_NFTS_QUERY; chainName = 'stargaze'; break; + case 'terra': + query = TERRA_NFTS_QUERY; + chainName = 'terra'; + break; default: throw new Error('Chain do not support NFTs'); } + const { data: response } = await gqlClient.query({ query: query, variables: { diff --git a/packages/cosmos/src/signers/ledger.signer.spec.ts b/packages/cosmos/src/signers/ledger.signer.spec.ts index 69789779..98a4e876 100644 --- a/packages/cosmos/src/signers/ledger.signer.spec.ts +++ b/packages/cosmos/src/signers/ledger.signer.spec.ts @@ -100,14 +100,6 @@ describe('cosmos::ledger.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF', 'cosmos')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from, 'cosmos')).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/cosmos/src/signers/ledger.signer.ts b/packages/cosmos/src/signers/ledger.signer.ts index 103ed893..771ed31c 100644 --- a/packages/cosmos/src/signers/ledger.signer.ts +++ b/packages/cosmos/src/signers/ledger.signer.ts @@ -1,6 +1,5 @@ import { LedgerSigner as LedgerApp } from '@cosmjs/ledger-amino'; import { stringToPath } from '@cosmjs/crypto'; -import { fromBech32 } from '@cosmjs/encoding'; import Transport from '@ledgerhq/hw-transport'; import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; @@ -20,18 +19,6 @@ export class LedgerSigner extends Signer.Provider { this.transport = transport; } - verifyAddress(address: string, requiredPrefix: string): boolean { - try { - const { prefix, data } = fromBech32(address); - if (prefix !== requiredPrefix) { - return false; - } - return data.length === 20; - } catch { - return false; - } - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Ledger device'); } diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index 6194c3ca..72e82966 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -139,25 +139,6 @@ describe('private-key.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(cosmosSigner.verifyAddress('0xDEADBEEF', 'cosmos')).toBe(false); - }); - - it('should return false when verifing an invalid address with no prefix specified', async () => { - expect(cosmosSigner.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(cosmosSigner.verifyAddress(txInput.from, 'cosmos')).toBe(true); - expect(cosmosSigner.verifyAddress(txInput.from)).toBe(true); - expect( - cosmosSigner.verifyAddress('0xcD558EBF5E7D94CB08BD34FFf7674aC95E3EBd9d') - ).toBe(true); - expect( - cosmosSigner.verifyAddress('terra1dcegyrekltswvyy0xy69ydgxn9x8x32zdtapd8') - ).toBe(true); - }); - it('should create msg from raw msg and sign it with private key', async () => { const msg = await provider.createMsg( { data: backendSwapTransaction.unsignedStdTx }, diff --git a/packages/cosmos/src/signers/private-key.signer.ts b/packages/cosmos/src/signers/private-key.signer.ts index 118d3db9..876001cb 100644 --- a/packages/cosmos/src/signers/private-key.signer.ts +++ b/packages/cosmos/src/signers/private-key.signer.ts @@ -1,15 +1,15 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing'; import { SigningStargateClient } from '@cosmjs/stargate'; -import { fromBase64, fromHex } from '@cosmjs/encoding'; +import { fromHex } from '@cosmjs/encoding'; import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { bech32 } from 'bech32'; import { stringToPath, pathToString, } from '@cosmjs/launchpad/node_modules/@cosmjs/crypto'; -import { utils, Wallet } from 'ethers'; -import { AccAddress, RawKey, LCDClient } from '@terra-money/feather.js'; +import { Wallet } from 'ethers'; +import { RawKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; @@ -18,23 +18,6 @@ import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string, prefix?: string): boolean { - try { - if (address.substring(0, 2) === '0x') { - return utils.isAddress(address); - } else if (address.substring(0, 5) === 'terra') { - return AccAddress.validate(address); - } else { - const result = bech32.decode(address); - return ( - result.prefix === (prefix ?? 'cosmos') && result.words.length === 32 - ); - } - } catch (err) { - return false; - } - } - async getPrivateKey(_derivation?: string) { return this.key; } @@ -60,13 +43,7 @@ export class PrivateKeySigner extends Signer.Provider { return key.accAddress('terra'); } else { - if (!prefix) { - prefix = 'cosmos'; - } const [{ address }] = await wallet.getAccounts(); - if (!this.verifyAddress(address, prefix)) { - throw new Error('Invalid address'); - } return address; } } diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index 292c5135..60d912b3 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -108,41 +108,6 @@ describe('seed-phrase.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - - // it('should sign a terra transaction using a seed phrase', async () => { - // const terraProvider = new CosmosProvider( - // new IndexerDataSource(COSMOS_MANIFESTS.terra) - // ); - - // const terraMessage = terraProvider.createMsg(txInput); - - // await signer.sign( - // terraMessage as ChainMsg, - // derivations.terra, - // CosmosChainType.Terra - // ); - - // expect(message.signedTransaction).toBeTruthy(); - // }); - - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF', 'cosmos')).toBe(false); - }); - - it('should return false when verifing an invalid address with no prefix specified', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from, 'cosmos')).toBe(true); - expect(signer.verifyAddress(txInput.from)).toBe(true); - expect( - signer.verifyAddress('0xcD558EBF5E7D94CB08BD34FFf7674aC95E3EBd9d') - ).toBe(true); - expect( - signer.verifyAddress('terra1dcegyrekltswvyy0xy69ydgxn9x8x32zdtapd8') - ).toBe(true); - }); }); describe('seed-phase.addressGeneration', () => { diff --git a/packages/cosmos/src/signers/seed-phrase.signer.ts b/packages/cosmos/src/signers/seed-phrase.signer.ts index 192f940b..8963a66a 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.ts @@ -7,8 +7,8 @@ import { stringToPath, pathToString, } from '@cosmjs/launchpad/node_modules/@cosmjs/crypto'; -import { utils, Wallet } from 'ethers'; -import { MnemonicKey, AccAddress, LCDClient } from '@terra-money/feather.js'; +import { Wallet } from 'ethers'; +import { MnemonicKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; @@ -17,23 +17,6 @@ import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string, prefix?: string): boolean { - try { - if (address.substring(0, 2) === '0x') { - return utils.isAddress(address); - } else if (address.substring(0, 5) === 'terra') { - return AccAddress.validate(address); - } else { - const result = bech32.decode(address); - return ( - result.prefix === (prefix ?? 'cosmos') && result.words.length === 32 - ); - } - } catch (err) { - return false; - } - } - async getAddress(derivation: string, prefix?: string): Promise { const hdPath = stringToPath(derivation); @@ -62,14 +45,7 @@ export class SeedPhraseSigner extends Signer.Provider { return wallet.accAddress('terra'); } else { - if (!prefix) { - prefix = 'cosmos'; - } - const [{ address }] = await wallet.getAccounts(); - if (!this.verifyAddress(address, prefix)) { - throw new Error('Invalid address'); - } return address; } } diff --git a/packages/dogecoin/src/chain.provider.spec.ts b/packages/dogecoin/src/chain.provider.spec.ts index 3f27e102..28d70a9a 100644 --- a/packages/dogecoin/src/chain.provider.spec.ts +++ b/packages/dogecoin/src/chain.provider.spec.ts @@ -98,4 +98,22 @@ describe('chain.provider', () => { memo ); }); + + it('should return false when verifying an invalid address', () => { + expect(DogecoinProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid dogecoin address', () => { + expect( + DogecoinProvider.verifyAddress('D9z79s25depHTjWpFRt9X3S5KD7ivPze3e') + ).toBe(true); + }); + + it('should return false when verifying a valid bitcoin address', () => { + expect( + DogecoinProvider.verifyAddress( + 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw' + ) + ).toBe(false); + }); }); diff --git a/packages/dogecoin/src/chain.provider.ts b/packages/dogecoin/src/chain.provider.ts index 0f43667f..769410b3 100644 --- a/packages/dogecoin/src/chain.provider.ts +++ b/packages/dogecoin/src/chain.provider.ts @@ -6,6 +6,8 @@ import { TransactionData, } from '@xdefi-tech/chains-core'; import { MsgBody, UtxoProvider } from '@xdefi-tech/chains-utxo'; +import coininfo from 'coininfo'; +import * as btc from '@scure/btc-signer'; import { IndexerDataSource } from './datasource'; import { ChainMsg } from './msg'; @@ -42,4 +44,15 @@ export class DogecoinProvider extends UtxoProvider { public async scanUTXOs(address: string) { return this.dataSource.scanUTXOs(address); } + + static verifyAddress(address: string): boolean { + try { + const _address = btc + .Address(coininfo.dogecoin.main.toBitcoinJS()) + .decode(address); + return Boolean(_address); + } catch (err) { + return false; + } + } } diff --git a/packages/dogecoin/src/signers/ledger.signer.spec.ts b/packages/dogecoin/src/signers/ledger.signer.spec.ts index f50f179d..43a00021 100644 --- a/packages/dogecoin/src/signers/ledger.signer.spec.ts +++ b/packages/dogecoin/src/signers/ledger.signer.spec.ts @@ -120,14 +120,6 @@ describe('ledger.signer', () => { expect(message.signedTransaction).toEqual('SIGNEDTX'); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/dogecoin/src/signers/ledger.signer.ts b/packages/dogecoin/src/signers/ledger.signer.ts index 41239111..6948a023 100644 --- a/packages/dogecoin/src/signers/ledger.signer.ts +++ b/packages/dogecoin/src/signers/ledger.signer.ts @@ -41,15 +41,6 @@ export class LedgerSigner extends Signer.Provider { bech32: '', }; - verifyAddress(address: string): boolean { - try { - Dogecoin.address.toOutputScript(address, this.network); - return true; - } catch (err) { - return false; - } - } - async getAddress(derivation: string): Promise { const app = new BtcOld({ transport: this.transport as Transport, diff --git a/packages/dogecoin/src/signers/private-key.signer.spec.ts b/packages/dogecoin/src/signers/private-key.signer.spec.ts index 61fc666c..6985c30c 100644 --- a/packages/dogecoin/src/signers/private-key.signer.spec.ts +++ b/packages/dogecoin/src/signers/private-key.signer.spec.ts @@ -100,14 +100,6 @@ describe('private-key.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey('')).toEqual(privateKey); }); diff --git a/packages/dogecoin/src/signers/private-key.signer.ts b/packages/dogecoin/src/signers/private-key.signer.ts index e2a265de..b95e653f 100644 --- a/packages/dogecoin/src/signers/private-key.signer.ts +++ b/packages/dogecoin/src/signers/private-key.signer.ts @@ -9,16 +9,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - return btc.Address(coininfo.dogecoin.main.toBitcoinJS()).decode(address) - ? true - : false; - } catch (err) { - return false; - } - } - async getPrivateKey(_derivation?: string): Promise { if (!this.key) { throw new Error('Private key not set!'); diff --git a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts index eff0dbc1..0570030f 100644 --- a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts @@ -102,14 +102,6 @@ describe('seed-phrase.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key from a seed phrase', async () => { expect(await signer.getPrivateKey(derivation)).toEqual(privateKey); }); diff --git a/packages/dogecoin/src/signers/seed-phrase.signer.ts b/packages/dogecoin/src/signers/seed-phrase.signer.ts index a4991246..a3ae8903 100644 --- a/packages/dogecoin/src/signers/seed-phrase.signer.ts +++ b/packages/dogecoin/src/signers/seed-phrase.signer.ts @@ -11,16 +11,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - return btc.Address(coininfo.dogecoin.main.toBitcoinJS()).decode(address) - ? true - : false; - } catch (err) { - return false; - } - } - async getPrivateKey(derivation: string): Promise { if (!this.key) { throw new Error('Private key not set!'); diff --git a/packages/dogecoin/src/signers/trezor.signer.spec.ts b/packages/dogecoin/src/signers/trezor.signer.spec.ts index 1c383709..93dca831 100644 --- a/packages/dogecoin/src/signers/trezor.signer.spec.ts +++ b/packages/dogecoin/src/signers/trezor.signer.spec.ts @@ -118,14 +118,6 @@ describe('trezor.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('btc123')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/dogecoin/src/signers/trezor.signer.ts b/packages/dogecoin/src/signers/trezor.signer.ts index 5f4ba3fa..35c7fcf5 100644 --- a/packages/dogecoin/src/signers/trezor.signer.ts +++ b/packages/dogecoin/src/signers/trezor.signer.ts @@ -8,14 +8,6 @@ import { UTXO, ChainMsg } from '@xdefi-tech/chains-utxo'; @SignerDecorator(Signer.SignerType.TREZOR) export class TrezorSigner extends Signer.TrezorProvider { - verifyAddress(address: string): boolean { - if (address.startsWith('D') && address.length == 34) { - return true; - } else { - return false; - } - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Trezor device'); } diff --git a/packages/evm/src/chain.provider.spec.ts b/packages/evm/src/chain.provider.spec.ts index 03b5dc6a..165261cb 100644 --- a/packages/evm/src/chain.provider.spec.ts +++ b/packages/evm/src/chain.provider.spec.ts @@ -5,18 +5,6 @@ import { EvmProvider } from './chain.provider'; import { IndexerDataSource } from './datasource'; import { EVM_MANIFESTS } from './manifests'; -// const ADDRESS_MOCK = { -// address: '0xCbA98362e199c41E1864D0923AF9646d3A648451', -// publicKey: -// '04df00ad3869baad7ce54f4d560ba7f268d542df8f2679a5898d78a690c3db8f9833d2973671cb14b088e91bdf7c0ab00029a576473c0e12f84d252e630bb3809b', -// }; - -// const SIGN_MOCK = { -// v: '1', -// r: '2', -// s: '3', -// }; - describe('chain.provider', () => { let evmProvider: EvmProvider; let arbitrumProvider: EvmProvider; @@ -197,4 +185,14 @@ describe('chain.provider', () => { ); expect((await getBalancePromise).getData).rejects.toThrow(); }); + + it('should return false when verifying an invalid address', () => { + expect(EvmProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid address', () => { + expect( + EvmProvider.verifyAddress('0x74EeF25048bA28542600804F68fBF71cCf520C59') + ).toBe(true); + }); }); diff --git a/packages/evm/src/chain.provider.ts b/packages/evm/src/chain.provider.ts index aa7fd9b7..b0d02821 100644 --- a/packages/evm/src/chain.provider.ts +++ b/packages/evm/src/chain.provider.ts @@ -15,7 +15,7 @@ import { TransactionData, TransactionStatus, } from '@xdefi-tech/chains-core'; -import { providers } from 'ethers'; +import { providers, utils } from 'ethers'; import { some } from 'lodash'; import { ChainDataSource, IndexerDataSource } from './datasource'; @@ -139,4 +139,12 @@ export class EvmProvider extends Chain.Provider { decryptParams, }; } + + static verifyAddress(address: string): boolean { + try { + return utils.isAddress(address); + } catch (e) { + return false; + } + } } diff --git a/packages/evm/src/signers/ledger.signer.spec.ts b/packages/evm/src/signers/ledger.signer.spec.ts index 765ebb46..080079d7 100644 --- a/packages/evm/src/signers/ledger.signer.spec.ts +++ b/packages/evm/src/signers/ledger.signer.spec.ts @@ -74,14 +74,6 @@ describe('ledger.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/evm/src/signers/ledger.signer.ts b/packages/evm/src/signers/ledger.signer.ts index fa92d37f..c77b8202 100644 --- a/packages/evm/src/signers/ledger.signer.ts +++ b/packages/evm/src/signers/ledger.signer.ts @@ -15,10 +15,6 @@ export class LedgerSigner extends Signer.Provider { this.transport = transport; } - verifyAddress(address: string): boolean { - return utils.isAddress(address); - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Ledger device'); } diff --git a/packages/evm/src/signers/private-key.signer.spec.ts b/packages/evm/src/signers/private-key.signer.spec.ts index 5915e714..3ade6671 100644 --- a/packages/evm/src/signers/private-key.signer.spec.ts +++ b/packages/evm/src/signers/private-key.signer.spec.ts @@ -1,5 +1,4 @@ import { Msg } from '@xdefi-tech/chains-core'; -import { utils } from 'ethers'; import { EvmProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; @@ -10,7 +9,6 @@ import { MsgBody, SignatureType, TypedDataField, - EIP712Data, } from '../msg'; import PrivateKeySigner from './private-key.signer'; @@ -93,14 +91,6 @@ describe('private-key.signer', () => { expect(chainMsg.signedTransaction).toEqual(signature); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey()).toEqual(privateKey); }); diff --git a/packages/evm/src/signers/private-key.signer.ts b/packages/evm/src/signers/private-key.signer.ts index 7322bbd1..a4bfe227 100644 --- a/packages/evm/src/signers/private-key.signer.ts +++ b/packages/evm/src/signers/private-key.signer.ts @@ -1,15 +1,11 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import { utils, Wallet } from 'ethers'; +import { Wallet } from 'ethers'; import EthCrypto from 'eth-crypto'; import { ChainMsg, EvmTypedData, SignatureType, EncryptedObject } from '../msg'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string): boolean { - return utils.isAddress(address); - } - async getPrivateKey(): Promise { return this.key; } diff --git a/packages/evm/src/signers/seed-phrase.signer.spec.ts b/packages/evm/src/signers/seed-phrase.signer.spec.ts index c8e17eae..470bbea0 100644 --- a/packages/evm/src/signers/seed-phrase.signer.spec.ts +++ b/packages/evm/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,4 @@ import { Msg } from '@xdefi-tech/chains-core'; -import { utils } from 'ethers'; import { EvmProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; @@ -107,14 +106,6 @@ describe('seed-phrase.signer', () => { expect(chainMsg.signedTransaction).toEqual(signature); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey(derivation)).toEqual( 'd2a6956c6db5563b9755303795cc7e15be20e04c08b1fc8644f197e13190cbad' diff --git a/packages/evm/src/signers/seed-phrase.signer.ts b/packages/evm/src/signers/seed-phrase.signer.ts index 9da79f37..42e56055 100644 --- a/packages/evm/src/signers/seed-phrase.signer.ts +++ b/packages/evm/src/signers/seed-phrase.signer.ts @@ -6,10 +6,6 @@ import { ChainMsg, EvmTypedData, SignatureType, EncryptedObject } from '../msg'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string): boolean { - return utils.isAddress(address); - } - async getPrivateKey(derivation: string) { const wallet = Wallet.fromMnemonic(this.key, derivation); return utils.isHexString(wallet.privateKey) diff --git a/packages/evm/src/signers/trezor.signer.spec.ts b/packages/evm/src/signers/trezor.signer.spec.ts index b181a80f..8a123ef3 100644 --- a/packages/evm/src/signers/trezor.signer.spec.ts +++ b/packages/evm/src/signers/trezor.signer.spec.ts @@ -100,14 +100,6 @@ describe('trezor.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/evm/src/signers/trezor.signer.ts b/packages/evm/src/signers/trezor.signer.ts index d4045aaa..33682892 100644 --- a/packages/evm/src/signers/trezor.signer.ts +++ b/packages/evm/src/signers/trezor.signer.ts @@ -13,15 +13,11 @@ import { ChainMsg, EIP712Data, Signature } from '../msg'; @SignerDecorator(Signer.SignerType.TREZOR) export class TrezorSigner extends Signer.TrezorProvider { - verifyAddress(address: string): boolean { - return utils.isAddress(address); - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Trezor device'); } - async getPublicKey(derivation: string) { + async getPublicKey(_derivation: string) { throw new Error('Cannot extract public key from Trezor device'); } diff --git a/packages/litecoin/src/chain.provider.spec.ts b/packages/litecoin/src/chain.provider.spec.ts index 26526fcf..7d541fe9 100644 --- a/packages/litecoin/src/chain.provider.spec.ts +++ b/packages/litecoin/src/chain.provider.spec.ts @@ -97,4 +97,24 @@ describe('chain.provider', () => { memo ); }); + + it('should return false when verifying an invalid address', () => { + expect(LitecoinProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid litecoin address', () => { + expect( + LitecoinProvider.verifyAddress( + 'ltc1qldh5lt4kw63rl9s8d6wfm438ekwswf6d2ucrat' + ) + ).toBe(true); + }); + + it('should return false when verifying a valid bitcoin address', () => { + expect( + LitecoinProvider.verifyAddress( + 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw' + ) + ).toBe(false); + }); }); diff --git a/packages/litecoin/src/chain.provider.ts b/packages/litecoin/src/chain.provider.ts index 97265129..fa1d54ad 100644 --- a/packages/litecoin/src/chain.provider.ts +++ b/packages/litecoin/src/chain.provider.ts @@ -6,6 +6,8 @@ import { TransactionData, } from '@xdefi-tech/chains-core'; import { MsgBody, UtxoProvider } from '@xdefi-tech/chains-utxo'; +import * as Litecoin from 'bitcoinjs-lib'; +import coininfo from 'coininfo'; import { IndexerDataSource } from './datasource'; import { ChainMsg } from './msg'; @@ -42,4 +44,16 @@ export class LitecoinProvider extends UtxoProvider { public async scanUTXOs(address: string) { return this.dataSource.scanUTXOs(address); } + + static verifyAddress(address: string): boolean { + try { + Litecoin.address.toOutputScript( + address, + coininfo.litecoin.main.toBitcoinJS() + ); + return true; + } catch (err) { + return false; + } + } } diff --git a/packages/litecoin/src/signers/ledger.signer.spec.ts b/packages/litecoin/src/signers/ledger.signer.spec.ts index 9f04f0d9..3cdda88a 100644 --- a/packages/litecoin/src/signers/ledger.signer.spec.ts +++ b/packages/litecoin/src/signers/ledger.signer.spec.ts @@ -100,14 +100,6 @@ describe('ledger.signer', () => { expect(message.signedTransaction).toEqual('SIGNEDTX'); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/litecoin/src/signers/ledger.signer.ts b/packages/litecoin/src/signers/ledger.signer.ts index 1000f819..fbffd3c4 100644 --- a/packages/litecoin/src/signers/ledger.signer.ts +++ b/packages/litecoin/src/signers/ledger.signer.ts @@ -28,15 +28,6 @@ export class LedgerSigner extends Signer.Provider { wif: 0xb0, }; - verifyAddress(address: string): boolean { - try { - Litecoin.address.toOutputScript(address, this.network); - return true; - } catch (err) { - return false; - } - } - async getAddress(derivation: string): Promise { const app = new BtcOld({ transport: this.transport as Transport, diff --git a/packages/litecoin/src/signers/private-key.signer.spec.ts b/packages/litecoin/src/signers/private-key.signer.spec.ts index 3ad11483..830226f6 100644 --- a/packages/litecoin/src/signers/private-key.signer.spec.ts +++ b/packages/litecoin/src/signers/private-key.signer.spec.ts @@ -100,14 +100,6 @@ describe('private-key.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey()).toEqual(privateKey); }); diff --git a/packages/litecoin/src/signers/private-key.signer.ts b/packages/litecoin/src/signers/private-key.signer.ts index 445f27ac..7f30bbf9 100644 --- a/packages/litecoin/src/signers/private-key.signer.ts +++ b/packages/litecoin/src/signers/private-key.signer.ts @@ -9,16 +9,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - return btc.Address(coininfo.litecoin.main.toBitcoinJS()).decode(address) - ? true - : false; - } catch (err) { - return false; - } - } - async getPrivateKey(_derivation?: string): Promise { if (!this.key) { throw new Error('Private key not set!'); diff --git a/packages/litecoin/src/signers/seed-phrase.signer.spec.ts b/packages/litecoin/src/signers/seed-phrase.signer.spec.ts index b775ff52..18a8bd9e 100644 --- a/packages/litecoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/litecoin/src/signers/seed-phrase.signer.spec.ts @@ -103,14 +103,6 @@ describe('seed-phrase.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key from a seed phrase', async () => { expect(await signer.getPrivateKey(derivation)).toEqual(privateKey); }); diff --git a/packages/litecoin/src/signers/seed-phrase.signer.ts b/packages/litecoin/src/signers/seed-phrase.signer.ts index f8ff8a5e..3ff22281 100644 --- a/packages/litecoin/src/signers/seed-phrase.signer.ts +++ b/packages/litecoin/src/signers/seed-phrase.signer.ts @@ -11,16 +11,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - return btc.Address(coininfo.litecoin.main.toBitcoinJS()).decode(address) - ? true - : false; - } catch (err) { - return false; - } - } - async getPrivateKey(derivation: string): Promise { if (!this.key) { throw new Error('Private key not set!'); diff --git a/packages/litecoin/src/signers/trezor.signer.spec.ts b/packages/litecoin/src/signers/trezor.signer.spec.ts index ed47fdac..dec846ea 100644 --- a/packages/litecoin/src/signers/trezor.signer.spec.ts +++ b/packages/litecoin/src/signers/trezor.signer.spec.ts @@ -95,14 +95,6 @@ describe('trezor.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('btc123')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/litecoin/src/signers/trezor.signer.ts b/packages/litecoin/src/signers/trezor.signer.ts index 6412e2c6..ed8f9a26 100644 --- a/packages/litecoin/src/signers/trezor.signer.ts +++ b/packages/litecoin/src/signers/trezor.signer.ts @@ -12,14 +12,6 @@ import { UTXO, ChainMsg } from '@xdefi-tech/chains-utxo'; @SignerDecorator(Signer.SignerType.TREZOR) export class TrezorSigner extends Signer.TrezorProvider { - verifyAddress(address: string): boolean { - if (new RegExp(/^[LM3][a-km-zA-HJ-NP-Z1-9]{26,33}$/).test(address)) { - return true; - } else { - return false; - } - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Trezor device'); } diff --git a/packages/solana/package.json b/packages/solana/package.json index 401660ad..49440b35 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -17,7 +17,8 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "xhr2": "0.2.1" }, "dependencies": { "@ledgerhq/hw-app-solana": "7.1.3", diff --git a/packages/solana/src/chain.provider.spec.ts b/packages/solana/src/chain.provider.spec.ts index c50b00f3..f4c9f7c7 100644 --- a/packages/solana/src/chain.provider.spec.ts +++ b/packages/solana/src/chain.provider.spec.ts @@ -83,4 +83,16 @@ describe('chain.provider', () => { ) ).rejects.toThrow(); }); + + it('should return false when verifying an invalid address', () => { + expect(SolanaProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid address', () => { + expect( + SolanaProvider.verifyAddress( + 'BujFXMX9ZmniuJCM2VRKQqe1enmcoFxfUBmRqCMqKGic' + ) + ).toBe(true); + }); }); diff --git a/packages/solana/src/chain.provider.ts b/packages/solana/src/chain.provider.ts index c9195545..c58abcc8 100644 --- a/packages/solana/src/chain.provider.ts +++ b/packages/solana/src/chain.provider.ts @@ -15,7 +15,7 @@ import { TransactionData, TransactionStatus, } from '@xdefi-tech/chains-core'; -import { Connection } from '@solana/web3.js'; +import { Connection, PublicKey } from '@solana/web3.js'; import { some } from 'lodash'; import { IndexerDataSource } from './datasource'; @@ -120,4 +120,13 @@ export class SolanaProvider extends Chain.Provider { IndexerDataSource: IndexerDataSource, }; } + + static verifyAddress(address: string): boolean { + try { + const publicKey = new PublicKey(address); + return publicKey.toBase58() === address; + } catch (error) { + return false; + } + } } diff --git a/packages/solana/src/msg.spec.ts b/packages/solana/src/msg.spec.ts index f806d73d..2490432d 100644 --- a/packages/solana/src/msg.spec.ts +++ b/packages/solana/src/msg.spec.ts @@ -2,7 +2,6 @@ import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import { LAMPORTS_PER_SOL } from '@solana/web3.js'; -import { DEFAULT_FEE } from './constants'; import { ChainMsg } from './msg'; describe('msg', () => { diff --git a/packages/solana/src/signers/ledger.signer.spec.ts b/packages/solana/src/signers/ledger.signer.spec.ts index 334c4495..73b38f2a 100644 --- a/packages/solana/src/signers/ledger.signer.spec.ts +++ b/packages/solana/src/signers/ledger.signer.spec.ts @@ -79,14 +79,6 @@ describe('ledger.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/solana/src/signers/ledger.signer.ts b/packages/solana/src/signers/ledger.signer.ts index e9f9e0c0..2528fa06 100644 --- a/packages/solana/src/signers/ledger.signer.ts +++ b/packages/solana/src/signers/ledger.signer.ts @@ -18,15 +18,6 @@ export class LedgerSigner extends Signer.Provider { this.transport = transport; } - verifyAddress(address: string): boolean { - try { - const publicKey = new PublicKey(address); - return publicKey.toBase58() === address; - } catch (error) { - return false; - } - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Ledger device'); } diff --git a/packages/solana/src/signers/private-key.signer.spec.ts b/packages/solana/src/signers/private-key.signer.spec.ts index 65e804e2..87ab3ada 100644 --- a/packages/solana/src/signers/private-key.signer.spec.ts +++ b/packages/solana/src/signers/private-key.signer.spec.ts @@ -69,14 +69,6 @@ describe('private-key.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey('')).toEqual(privateKey); }); diff --git a/packages/solana/src/signers/private-key.signer.ts b/packages/solana/src/signers/private-key.signer.ts index 80da00a9..883c4b46 100644 --- a/packages/solana/src/signers/private-key.signer.ts +++ b/packages/solana/src/signers/private-key.signer.ts @@ -1,7 +1,6 @@ import { MsgEncoding, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { Keypair, - PublicKey, Transaction as SolanaTransaction, VersionedTransaction, } from '@solana/web3.js'; @@ -13,15 +12,6 @@ import { SolanaSignature } from '../types'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - const publicKey = new PublicKey(address); - return publicKey.toBase58() === address; - } catch (error) { - return false; - } - } - async getPrivateKey(_derivation: string): Promise { return this.key; } diff --git a/packages/solana/src/signers/seed-phrase.signer.spec.ts b/packages/solana/src/signers/seed-phrase.signer.spec.ts index ba1e6017..716b527d 100644 --- a/packages/solana/src/signers/seed-phrase.signer.spec.ts +++ b/packages/solana/src/signers/seed-phrase.signer.spec.ts @@ -88,12 +88,18 @@ describe('seed-phrase.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); + it('should sign base58 transaction using a seed phrase', async () => { + const message = provider.createMsg( + { + data: '726eSG6YzuM2gGVRSbGZptsMzM17zPZP5KAv8GM96CxdtDX4BkZBVV4JbRQgrdGs83mqFBPh2j7XiFsQVhskmq7cEd3TS561e1VPTw84Z9LnXPTxJHZTgucPkmmUrDQTgtGeYMw1BiKyHYg4j9aPAULMwihHVvmjMzYwVKQVqr3PNMeYcLcw8oYNWkWfBddzoL2gJL8W8pAHGhrV46F3me4hJLxU59VU1GBKThv6LHo5frUcS3j15YFkWVaFipVQeoemiKQgjfL3q21ziEkaA8LvvoFfJmaXfAKAoyhKhrzWTzDzfk1t2UPX5qxgzXy5K7Qcst6hG1w3MSTtEbenDDLjNgmrspFw83hNftzeU2pdKQ2wjwjCAnLgzSLZBtrLNUcU9fqf5EbXYernV8qtZvRxChnzvt7ekyoyuDktVY8rk3JJDGNoyMqDF9zkrrA625eUWjSC9fedgfBACys1Q8gjBj3ET1qrj5Q9ZAst1yQtwKhzuC3tfJBtevjRByu9dgLVhW4n76DbgEPgSDjqwsGEymP6gtfbFJT8ZhhyW8yrxKASv44zkpEo3EqQuVFjteDHs3GtpP4qoMQwYHQbomccPtcv2KoDCLj45ueRsF4gsQS8QgVWS664zgPvBBqKdHqxA4gmuQpH7kL6T3w3BiTRGCZ4zZMHWbbssiDfrouYsxGJ518FfL7pMPiDvzGiJsAiDzU7mnpJpc52SmREH3ahjqf4DEiBMhorrjxKYPJ6KB5KuZv8BVmmpDgsdkt1wPbNBjJK13qmGzaueW9GVb7W1kq8wRCMhRqb6uHuofRMGZ9awcN5TKKeSCGaN68H2mHKMWbzgj7CVLAHstgTWcaqEauHxnTjfZT7njnA3WjG5vE46BSDKwBvXQcctjDEDUkGBqadKfFyvECoTF5uVwg3NizpoCEg43YJ2ACsJmkobmvsNPirnFCkY19h8FWe8fp3X2T4f4tTVeeSE3wQr6JqffZjZ4b5qzTYWLvtXoB9z5sqaJ3HoQthEvQzExByj2PLvuNGFcPZeMy7DStysnmZVb1WJhWGwA4374iQpR5Vi7Sa6yQyFhRbv2ZFE66PXziH4AKgKTQs3CKikV7cwwq5LqktFFoonr2g9EPz536zcBka4rdan6SbrVo2gTzgYDusJRjU9Yf9XRscMmx6nt246wDvVCrHdBdukCyiajzngKkJrQY9SMfh7VHhq34YtVjS6dDtLqCJmw6vnhFvjspTSoJ8czZjsadfcnki7B7fJbBjPY6iL8fFSyZtsHdu21NQxttqCQiBGk1mFj1ohwTr7a3rCLpHsn8yyaJ66iGXHruBX2CZeL61gX8wuDM', + }, + MsgEncoding.base58 + ); + await signer.sign(message as ChainMsg, derivation); - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); + expect(message.signedTransaction.toString('hex')).toBe( + '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' + ); }); it('should get a private key', async () => { diff --git a/packages/solana/src/signers/seed-phrase.signer.ts b/packages/solana/src/signers/seed-phrase.signer.ts index 3fda1b43..9d9716eb 100644 --- a/packages/solana/src/signers/seed-phrase.signer.ts +++ b/packages/solana/src/signers/seed-phrase.signer.ts @@ -1,7 +1,6 @@ import { MsgEncoding, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { Keypair, - PublicKey, Transaction as SolanaTransaction, VersionedTransaction, } from '@solana/web3.js'; @@ -15,15 +14,6 @@ import { SolanaSignature } from '../types'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string): boolean { - try { - const publicKey = new PublicKey(address); - return publicKey.toBase58() === address; - } catch (error) { - return false; - } - } - async getPrivateKey(derivation: string): Promise { if (!this.key) { throw new Error('No seed phrase set!'); diff --git a/packages/thor/src/chain.provider.spec.ts b/packages/thor/src/chain.provider.spec.ts index 19a8bc1a..f7556c2d 100644 --- a/packages/thor/src/chain.provider.spec.ts +++ b/packages/thor/src/chain.provider.spec.ts @@ -133,4 +133,26 @@ describe('chain.provider', () => { const balanceData = await balance.getData(); expect(balanceData.length).toEqual(0); }); + + it('should return false when verifying an invalid address', () => { + expect(ThorProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid thorchain address', () => { + expect( + ThorProvider.verifyAddress( + 'thor1x843445a6z2e3edem9se22hnekurl7tauza6ft', + 'thor' + ) + ).toBe(true); + }); + + it('should return true when verifying a valid mayachain address', () => { + expect( + ThorProvider.verifyAddress( + 'maya1x843445a6z2e3edem9se22hnekurl7tau4rklm', + 'maya' + ) + ).toBe(true); + }); }); diff --git a/packages/thor/src/chain.provider.ts b/packages/thor/src/chain.provider.ts index 10f613f1..6a990d56 100644 --- a/packages/thor/src/chain.provider.ts +++ b/packages/thor/src/chain.provider.ts @@ -15,6 +15,7 @@ import { } from '@xdefi-tech/chains-core'; import axios, { Axios } from 'axios'; import { some } from 'lodash'; +import { bech32 } from 'bech32'; import { ChainMsg, MsgBody } from './msg'; import { ThorManifest } from './manifests'; @@ -140,4 +141,13 @@ export class ThorProvider extends Chain.Provider { ChainDataSource: ChainDataSource, }; } + + static verifyAddress(address: string, prefix = 'thor'): boolean { + try { + const result = bech32.decode(address); + return result.prefix === prefix && result.words.length === 32; + } catch (err) { + return false; + } + } } diff --git a/packages/thor/src/msg.spec.ts b/packages/thor/src/msg.spec.ts index c8c127e0..d2653daa 100644 --- a/packages/thor/src/msg.spec.ts +++ b/packages/thor/src/msg.spec.ts @@ -1,4 +1,4 @@ -import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; +import { MsgEncoding } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import { ChainMsg } from './msg'; diff --git a/packages/thor/src/signers/ledger.signer.spec.ts b/packages/thor/src/signers/ledger.signer.spec.ts index 24b7ff91..93566647 100644 --- a/packages/thor/src/signers/ledger.signer.spec.ts +++ b/packages/thor/src/signers/ledger.signer.spec.ts @@ -70,20 +70,6 @@ describe('ledger.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should return false when verifing an address without prefix(thor, maya)', async () => { - expect( - signer.verifyAddress('test1hccrcavupf7wnl2klud40lan00zp0q3u807g94') - ).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInput.from)).toBe(true); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/thor/src/signers/ledger.signer.ts b/packages/thor/src/signers/ledger.signer.ts index 1f5db8e4..f64f497a 100644 --- a/packages/thor/src/signers/ledger.signer.ts +++ b/packages/thor/src/signers/ledger.signer.ts @@ -1,7 +1,6 @@ import THORChainApp from '@thorchain/ledger-thorchain'; import Transport from '@ledgerhq/hw-transport'; import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import { bech32 } from 'bech32'; import { ChainMsg } from '../msg'; @@ -14,16 +13,6 @@ export class LedgerSigner extends Signer.Provider { this.transport = transport; } - verifyAddress(address: string): boolean { - try { - const prefix = bech32.decode(address).prefix; - if (prefix === 'thor' || prefix === 'maya') return true; - return false; - } catch (error) { - return false; - } - } - async getPrivateKey(_derivation: string) { throw new Error('Cannot extract private key from Ledger device'); } diff --git a/packages/thor/src/signers/private-key.signer.spec.ts b/packages/thor/src/signers/private-key.signer.spec.ts index fb2da518..d6fae6dd 100644 --- a/packages/thor/src/signers/private-key.signer.spec.ts +++ b/packages/thor/src/signers/private-key.signer.spec.ts @@ -83,24 +83,4 @@ describe('private-key.signer', () => { 'ClAKTgoOL3R5cGVzLk1zZ1NlbmQSPAoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGg4KBWNhY2FvEgUxMDAwMBJiClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIOCgoKBWNhY2FvEgEwEAAaQCz7DsyqQcbgDK9007gTSz++N38eLd+ghHCBEyzm9bJtKSWnHwiKLBNHFMLc42GfBv8VSqHwxu/6bKthgrgE+m8=' ); }); - - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect( - signer.verifyAddress( - txInputs.thorchain.from, - THORCHAIN_MANIFESTS.thorchain.prefix - ) - ).toBe(true); - - expect( - signer.verifyAddress( - txInputs.mayachain.from, - THORCHAIN_MANIFESTS.mayachain.prefix - ) - ).toBe(true); - }); }); diff --git a/packages/thor/src/signers/private-key.signer.ts b/packages/thor/src/signers/private-key.signer.ts index ff9eeb39..b529f642 100644 --- a/packages/thor/src/signers/private-key.signer.ts +++ b/packages/thor/src/signers/private-key.signer.ts @@ -1,24 +1,11 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import cosmosclient from '@cosmos-client/core'; -import { bech32 } from 'bech32'; import Long from 'long'; import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { - verifyAddress(address: string, prefix?: string): boolean { - if (!prefix) { - prefix = 'thor'; - } - try { - const result = bech32.decode(address); - return result.prefix === prefix && result.words.length === 32; - } catch (err) { - return false; - } - } - async getPrivateKey(_derivation?: string | null) { return this.key; } diff --git a/packages/thor/src/signers/seed-phrase.signer.spec.ts b/packages/thor/src/signers/seed-phrase.signer.spec.ts index bb3a8493..6445beaf 100644 --- a/packages/thor/src/signers/seed-phrase.signer.spec.ts +++ b/packages/thor/src/signers/seed-phrase.signer.spec.ts @@ -75,15 +75,6 @@ describe('seed-phrase.signer', () => { ); }); - it('should return false when verifing an invalid address', async () => { - expect(signer.verifyAddress('0xDEADBEEF')).toBe(false); - }); - - it('should validate an address', async () => { - expect(signer.verifyAddress(txInputs.thorchain.from, 'thor')).toBe(true); - expect(signer.verifyAddress(txInputs.mayachain.from, 'maya')).toBe(true); - }); - it('should get a private key', async () => { expect(await signer.getPrivateKey(derivation)).toEqual(privateKey); }); diff --git a/packages/thor/src/signers/seed-phrase.signer.ts b/packages/thor/src/signers/seed-phrase.signer.ts index a5104c0e..45ad3aa4 100644 --- a/packages/thor/src/signers/seed-phrase.signer.ts +++ b/packages/thor/src/signers/seed-phrase.signer.ts @@ -1,6 +1,5 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import cosmosclient from '@cosmos-client/core'; -import { bech32 } from 'bech32'; import * as bip39 from 'bip39'; import * as bip32 from 'bip32'; import Long from 'long'; @@ -14,18 +13,6 @@ import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { - verifyAddress(address: string, prefix?: string): boolean { - if (!prefix) { - prefix = 'thor'; - } - try { - const result = bech32.decode(address); - return result.prefix === prefix && result.words.length === 32; - } catch (err) { - return false; - } - } - async getPrivateKey(derivation: string) { const cosmosPrivateKey = await this.getCosmosPrivateKey(derivation); return Buffer.from(cosmosPrivateKey.key).toString('hex'); diff --git a/packages/tron/.eslintignore b/packages/tron/.eslintignore index e69de29b..f1a15b1f 100644 --- a/packages/tron/.eslintignore +++ b/packages/tron/.eslintignore @@ -0,0 +1,2 @@ +.eslintrc.cjs +jest-setup-file.ts \ No newline at end of file diff --git a/packages/tron/jest-setup-file.ts b/packages/tron/jest-setup-file.ts new file mode 100644 index 00000000..f41e7609 --- /dev/null +++ b/packages/tron/jest-setup-file.ts @@ -0,0 +1,5 @@ +import 'reflect-metadata'; +// @ts-ignore +import XMLHttpRequest from 'xhr2'; + +global.XMLHttpRequest = XMLHttpRequest; diff --git a/packages/tron/package.json b/packages/tron/package.json index 160b2a56..52316c1b 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -68,17 +68,19 @@ "target": "ES6" }, "jest": { - "setupFiles": [], + "setupFiles": [ + "./jest-setup-file.ts" + ], "preset": "ts-jest", "transform": { ".+\\.(t|j)s$": "ts-jest" }, - "moduleNameMapper": { - "axios": "axios/dist/node/axios.cjs" - }, "modulePathIgnorePatterns": [ "/dist/" ], + "moduleNameMapper": { + "axios": "axios/dist/node/axios.cjs" + }, "watchPlugins": [ "jest-watch-typeahead/filename", "jest-watch-typeahead/testname" diff --git a/packages/tron/src/chain.provider.spec.d..ts b/packages/tron/src/chain.provider.spec.d..ts deleted file mode 100644 index 9baeecac..00000000 --- a/packages/tron/src/chain.provider.spec.d..ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'xhr2'; diff --git a/packages/tron/src/chain.provider.spec.ts b/packages/tron/src/chain.provider.spec.ts index ebc8ef44..143eab28 100644 --- a/packages/tron/src/chain.provider.spec.ts +++ b/packages/tron/src/chain.provider.spec.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import TronWeb from 'tronweb'; -import XMLHttpRequest from 'xhr2'; import { ChainMsg, TokenType } from './msg'; import { TronProvider } from './chain.provider'; @@ -288,4 +287,14 @@ describe('chain.providers.chain', () => { expect(balanceData[0].amount.toNumber()).toBeGreaterThanOrEqual(0); expect(balanceData[0].asset.name).toEqual('Tron'); }); + + it('should return false when verifying an invalid address', () => { + expect(TronProvider.verifyAddress('0xDEADBEEF')).toBe(false); + }); + + it('should return true when verifying a valid address', () => { + expect( + TronProvider.verifyAddress('THBrvgLEVC9uR6CWfZn792qqze7A7RSpuk') + ).toBe(true); + }); }); diff --git a/packages/tron/src/chain.provider.ts b/packages/tron/src/chain.provider.ts index 9a7af5fe..f98c8295 100644 --- a/packages/tron/src/chain.provider.ts +++ b/packages/tron/src/chain.provider.ts @@ -19,8 +19,7 @@ import TronWeb, { TronTransaction, TronTransactionRawData } from 'tronweb'; import { AbiCoder } from 'ethers'; import { ChainMsg, MsgBody, TokenType, TronFee } from './msg'; -import { ChainDataSource } from './datasource/chain/chain.data-source'; -import { IndexerDataSource } from './datasource'; +import { IndexerDataSource, ChainDataSource } from './datasource'; @ChainDecorator('TronProvider', { deps: [], @@ -166,6 +165,14 @@ export class TronProvider extends Chain.Provider { return transactions; } + static verifyAddress(address: string): boolean { + try { + return TronWeb.isAddress(address); + } catch (e) { + return false; + } + } + async getTransaction(txHash: string): Promise { const tx = await this.rpcProvider.trx.getTransaction(txHash); if (!tx) { diff --git a/packages/tron/src/signers/ledger.signer.spec.ts b/packages/tron/src/signers/ledger.signer.spec.ts index 1e23d28f..09285bea 100644 --- a/packages/tron/src/signers/ledger.signer.spec.ts +++ b/packages/tron/src/signers/ledger.signer.spec.ts @@ -60,14 +60,6 @@ describe('ledger.signer', () => { expect(message.signedTransaction).toBeTruthy(); }); - it('should return true for a valid address', () => { - expect(signer.verifyAddress(txInput.from, TRON_MANIFEST)).toBe(true); - }); - - it('should return false for an invalid address', () => { - expect(signer.verifyAddress('invalid-address', TRON_MANIFEST)).toBe(false); - }); - it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); diff --git a/packages/tron/src/signers/ledger.signer.ts b/packages/tron/src/signers/ledger.signer.ts index 57ee1578..7da24ec9 100644 --- a/packages/tron/src/signers/ledger.signer.ts +++ b/packages/tron/src/signers/ledger.signer.ts @@ -1,7 +1,6 @@ import Transport from '@ledgerhq/hw-transport'; import Trx from '@ledgerhq/hw-app-trx'; -import { Chain, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import TronWeb from 'tronweb'; +import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { ChainMsg } from '../msg'; @@ -14,14 +13,6 @@ export class LedgerSigner extends Signer.Provider { this.transport = transport; } - verifyAddress(address: string, manifest: Chain.Manifest): boolean { - const tronWeb = new TronWeb({ - fullHost: manifest.rpcURL, - }); - - return tronWeb.isAddress(address); - } - async getAddress(derivation: string): Promise { const trx = new Trx(this.transport as Transport); const address = await trx.getAddress(derivation); diff --git a/packages/tron/src/signers/private-key.signer.spec.ts b/packages/tron/src/signers/private-key.signer.spec.ts index 842039d2..fe376579 100644 --- a/packages/tron/src/signers/private-key.signer.spec.ts +++ b/packages/tron/src/signers/private-key.signer.spec.ts @@ -28,14 +28,6 @@ describe('tron private-key.signer', () => { provider = new TronProvider(new IndexerDataSource(TRON_MANIFEST)); }); - it('should return true for a valid address', () => { - expect(signer.verifyAddress(txInput.from, TRON_MANIFEST)).toBe(true); - }); - - it('should return false for an invalid address', () => { - expect(signer.verifyAddress('invalid-address', TRON_MANIFEST)).toBe(false); - }); - it('should return the correct address for a valid private key', async () => { const address = await signer.getAddress(); expect(address).toBe(txInput.from); diff --git a/packages/tron/src/signers/private-key.signer.ts b/packages/tron/src/signers/private-key.signer.ts index c1b1f520..5910bc96 100644 --- a/packages/tron/src/signers/private-key.signer.ts +++ b/packages/tron/src/signers/private-key.signer.ts @@ -1,4 +1,4 @@ -import { Chain, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; +import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import TronWeb from 'tronweb'; import type { TronManifest } from 'src/manifests'; @@ -14,14 +14,6 @@ export class PrivateKeySigner extends Signer.Provider { this.manifest = manifest; } - verifyAddress(address: string, manifest: Chain.Manifest): boolean { - const tronWeb = new TronWeb({ - fullHost: manifest.rpcURL, - }); - - return tronWeb.isAddress(address); - } - async getPrivateKey(_derivation: string): Promise { return this.key; } diff --git a/packages/tron/src/signers/seed-phrase.signer.spec.ts b/packages/tron/src/signers/seed-phrase.signer.spec.ts index 529502ab..98f42804 100644 --- a/packages/tron/src/signers/seed-phrase.signer.spec.ts +++ b/packages/tron/src/signers/seed-phrase.signer.spec.ts @@ -32,14 +32,6 @@ describe('tron seed-phrase.signer', () => { provider = new TronProvider(new ChainDataSource(TRON_MANIFEST)); }); - it('should return true for a valid address', () => { - expect(signer.verifyAddress(txInput.from, TRON_MANIFEST)).toBe(true); - }); - - it('should return false for an invalid address', () => { - expect(signer.verifyAddress('invalid-address', TRON_MANIFEST)).toBe(false); - }); - it('should return the correct address for a valid private key', async () => { const address = await signer.getAddress(deriviationPath); expect(address).toBe(txInput.from); diff --git a/packages/tron/src/signers/seed-phrase.signer.ts b/packages/tron/src/signers/seed-phrase.signer.ts index 9a212750..4fd77634 100644 --- a/packages/tron/src/signers/seed-phrase.signer.ts +++ b/packages/tron/src/signers/seed-phrase.signer.ts @@ -1,4 +1,4 @@ -import { Chain, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; +import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import TronWeb from 'tronweb'; import type { TronManifest } from 'src/manifests'; @@ -14,14 +14,6 @@ export class SeedPhraseSigner extends Signer.Provider { this.manifest = manifest; } - verifyAddress(address: string, manifest: Chain.Manifest): boolean { - const tronWeb = new TronWeb({ - fullHost: manifest.rpcURL, - }); - - return tronWeb.isAddress(address); - } - async getPrivateKey(derivation: string): Promise { const tronWeb = TronWeb.fromMnemonic(this.key, derivation); return tronWeb.privateKey; diff --git a/packages/tron/tsconfig.json b/packages/tron/tsconfig.json index 31fd0ff9..3d3de259 100644 --- a/packages/tron/tsconfig.json +++ b/packages/tron/tsconfig.json @@ -1,16 +1,10 @@ { "extends": "tsconfig/base.json", "compilerOptions": { - "lib": [ - "esnext", - "dom" - ], + "lib": ["esnext", "dom"], "baseUrl": "./", - "outDir": "./dist", - "declaration": true, + "outDir": "./dist" }, - "include": [ - "./src/**/*" - ], - "exclude": [] + "allowJs": true, + "include": ["!./src/custom.d.ts", "./src/**/*"] } diff --git a/utility-packages/chains-controller/package.json b/utility-packages/chains-controller/package.json index 8eb55c8b..0b4f8d8f 100644 --- a/utility-packages/chains-controller/package.json +++ b/utility-packages/chains-controller/package.json @@ -79,7 +79,7 @@ "moduleNameMapper": { "axios": "axios/dist/node/axios.cjs" }, - "testEnvironment": "jsdom", + "testEnvironment": "node", "watchPlugins": [ "jest-watch-typeahead/filename", "jest-watch-typeahead/testname" diff --git a/utility-packages/chains-controller/src/provider-factory.ts b/utility-packages/chains-controller/src/provider-factory.ts index 61a92db4..fe0f12e3 100644 --- a/utility-packages/chains-controller/src/provider-factory.ts +++ b/utility-packages/chains-controller/src/provider-factory.ts @@ -73,6 +73,7 @@ export class ProviderFactory { const ProviderClass = this.providerList[className as ProviderNames]; const { dataSourceClassName, ...providerOptions } = options; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const dataSource = new ProviderClass.dataSourceList[dataSourceClassName]( manifest diff --git a/utility-packages/graphql/src/gql/gql.ts b/utility-packages/graphql/src/gql/gql.ts index 7d48ea96..c2d90b21 100644 --- a/utility-packages/graphql/src/gql/gql.ts +++ b/utility-packages/graphql/src/gql/gql.ts @@ -23,6 +23,8 @@ const documents = { types.GetAssetsWithFilterDocument, 'query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}': types.CosmosBalanceDocument, + 'query TerraBalance($address: String!) {\n terra {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetTerraFees {\n terra {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetTerraStatus {\n terra {\n status {\n lastBlock\n }\n }\n}': + types.TerraBalanceDocument, 'query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}': types.DogecoinBalanceDocument, 'query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}': @@ -74,121 +76,127 @@ export function gql(source: string): unknown; */ export function gql( source: 'query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}' -): (typeof documents)['query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}']; +): typeof documents['query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): (typeof documents)['query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): typeof documents['query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): (typeof documents)['query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): typeof documents['query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}' -): (typeof documents)['query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}']; +): typeof documents['query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query TerraBalance($address: String!) {\n terra {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetTerraFees {\n terra {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetTerraStatus {\n terra {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query TerraBalance($address: String!) {\n terra {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetTerraFees {\n terra {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetTerraStatus {\n terra {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): (typeof documents)['query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): typeof documents['query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}' -): (typeof documents)['query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}']; +): typeof documents['query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' -): (typeof documents)['query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; +): typeof documents['query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}' -): (typeof documents)['query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}']; +): typeof documents['query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}' -): (typeof documents)['query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}']; +): typeof documents['query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( source: 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}' -): (typeof documents)['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; +): typeof documents['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; export function gql(source: string) { return (documents as any)[source] ?? {}; diff --git a/utility-packages/graphql/src/gql/graphql.ts b/utility-packages/graphql/src/gql/graphql.ts index 38b1a838..12a35e90 100644 --- a/utility-packages/graphql/src/gql/graphql.ts +++ b/utility-packages/graphql/src/gql/graphql.ts @@ -297,6 +297,7 @@ export type ArbitrumBalancesArgs = { export type ArbitrumLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type ArbitrumNftsArgs = { @@ -760,6 +761,7 @@ export type AuroraBalancesArgs = { export type AuroraLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type AuroraNftsArgs = { @@ -798,6 +800,7 @@ export type AvalancheBalancesArgs = { export type AvalancheLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type AvalancheNftsArgs = { @@ -878,6 +881,7 @@ export type BinanceSmartChainBalancesArgs = { export type BinanceSmartChainLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type BinanceSmartChainNftsArgs = { @@ -958,6 +962,7 @@ export type BitcoinChainGetTransactionByHashV5Args = { export type BitcoinChainLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type BitcoinChainTransactionsArgs = { @@ -1179,6 +1184,7 @@ export type CantoEvmBalancesArgs = { export type CantoEvmLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type CantoEvmNftsArgs = { @@ -1401,6 +1407,7 @@ export type CronosEvmBalancesArgs = { export type CronosEvmLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type CronosEvmNftsArgs = { @@ -1705,6 +1712,7 @@ export type EthereumBalancesArgs = { export type EthereumLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type EthereumNftsArgs = { @@ -1780,6 +1788,7 @@ export type FantomBalancesArgs = { export type FantomLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type FantomNftsArgs = { @@ -1879,6 +1888,7 @@ export type Gnosis = { export type GnosisLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type ImageType = { @@ -2058,7 +2068,7 @@ export type Marketplace = { marketplaceId: Scalars['String']; marketplaceName: Scalars['String']; nftUrl: Scalars['String']; - verified: Scalars['Boolean']; + verified?: Maybe; }; export type MayaChain = { @@ -2189,10 +2199,10 @@ export type NftCollectionV3 = { address: Scalars['String']; collectionItemsAmount?: Maybe; collectionItemsOwnersAmount?: Maybe; - floorPrices: Array; - marketplaces: Array; + floorPrices?: Maybe>; + marketplaces?: Maybe>; media?: Maybe; - name: Scalars['String']; + name?: Maybe; symbol: Scalars['String']; }; @@ -2412,6 +2422,7 @@ export type OptimismBalancesArgs = { export type OptimismLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type OptimismNftsArgs = { @@ -2494,6 +2505,7 @@ export type PolygonBalancesArgs = { export type PolygonLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type PolygonNftsArgs = { @@ -3528,6 +3540,7 @@ export type SolanaChainBalancesArgs = { export type SolanaChainLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type SolanaChainNftsArgs = { @@ -3642,6 +3655,7 @@ export type TerraChainBalancesArgs = { export type TerraChainLegacyNfTsArgs = { address: Scalars['String']; + tokenId?: InputMaybe; }; export type ThorChain = { @@ -6179,6 +6193,63 @@ export type GetStargazeStatusQuery = { }; }; +export type TerraBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type TerraBalanceQuery = { + __typename?: 'Query'; + terra: { + __typename?: 'TerraChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetTerraFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetTerraFeesQuery = { + __typename?: 'Query'; + terra: { + __typename?: 'TerraChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetTerraStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetTerraStatusQuery = { + __typename?: 'Query'; + terra: { + __typename?: 'TerraChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + export type DogecoinBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; @@ -17440,6 +17511,222 @@ export const GetStargazeStatusDocument = { GetStargazeStatusQuery, GetStargazeStatusQueryVariables >; +export const TerraBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'TerraBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'terra' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetTerraFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetTerraFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'terra' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetTerraStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetTerraStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'terra' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; export const DogecoinBalanceDocument = { kind: 'Document', definitions: [ diff --git a/yarn.lock b/yarn.lock index fd6db27e..90a1546d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16543,7 +16543,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -16561,15 +16561,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -16640,7 +16631,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -16661,13 +16652,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -18213,7 +18197,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18231,15 +18215,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From 6b17b72e310247eb4fe452e2fa7368c1e16f64ec Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 14 Jun 2024 09:39:01 +0000 Subject: [PATCH 008/176] Version packages --- .changeset/chatty-rings-laugh.md | 17 ----------------- packages/binance/CHANGELOG.md | 9 +++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 9 +++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 9 +++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 9 +++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 9 +++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 9 +++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 9 +++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 9 +++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 9 +++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 9 +++++++++ packages/tron/package.json | 2 +- .../chains-controller/CHANGELOG.md | 18 ++++++++++++++++++ .../chains-controller/package.json | 2 +- utility-packages/graphql/CHANGELOG.md | 8 ++++++++ utility-packages/graphql/package.json | 2 +- 27 files changed, 135 insertions(+), 30 deletions(-) delete mode 100644 .changeset/chatty-rings-laugh.md diff --git a/.changeset/chatty-rings-laugh.md b/.changeset/chatty-rings-laugh.md deleted file mode 100644 index ab292ec8..00000000 --- a/.changeset/chatty-rings-laugh.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@xdefi-tech/chains-controller': patch -'@xdefi-tech/chains-graphql': patch -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-evm': patch ---- - -Feat: move verifyAddress to provider, make it static diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index eb1962b1..e973fbc7 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-binance +## 2.0.13 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.12 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 76639d3d..346dd8cd 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.12", + "version": "2.0.13", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 5cb1d9cb..33255b86 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoin +## 2.0.18 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.17 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index d34a7045..02ceff31 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.17", + "version": "2.0.18", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 15686acc..a7de70f1 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.18 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.17 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 197aa9e2..0433629d 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.17", + "version": "2.0.18", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index fb011db6..3f4a3342 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.16 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static + ## 2.0.15 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 9298d648..28ae8bc2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.15", + "version": "2.0.16", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index cf555046..170af565 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-cosmos +## 2.0.18 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.17 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index ddda3428..68f7f8a4 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.17", + "version": "2.0.18", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 89d72e15..7807502d 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-dogecoin +## 2.0.17 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.16 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 02223c0e..c5219ef9 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.16", + "version": "2.0.17", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 6258f3b7..f32dfb18 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-evm +## 2.0.26 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.25 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 1d3a9ebf..811fbaa1 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.25", + "version": "2.0.26", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 78c0d508..a28548a8 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-litecoin +## 2.0.16 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.15 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 11bf8872..9222f1dd 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.15", + "version": "2.0.16", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 28fd68fb..82fb0c45 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-solana +## 2.0.20 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.19 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 49440b35..0f8dbb56 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.19", + "version": "2.0.20", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 836780ab..ef73c1e6 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-thor +## 2.0.18 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.17 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 798e1162..e5039927 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.17", + "version": "2.0.18", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 2863f6c3..7bfae545 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-tron +## 2.0.19 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-core@2.0.16 + ## 2.0.18 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 52316c1b..3e65e42f 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.18", + "version": "2.0.19", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/utility-packages/chains-controller/CHANGELOG.md b/utility-packages/chains-controller/CHANGELOG.md index ebaccc38..102c3f7e 100644 --- a/utility-packages/chains-controller/CHANGELOG.md +++ b/utility-packages/chains-controller/CHANGELOG.md @@ -1,5 +1,23 @@ # @xdefi-tech/chains-controller +## 2.0.6 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-graphql@1.2.15 + - @xdefi-tech/chains-bitcoincash@2.0.18 + - @xdefi-tech/chains-dogecoin@2.0.17 + - @xdefi-tech/chains-litecoin@2.0.16 + - @xdefi-tech/chains-binance@2.0.13 + - @xdefi-tech/chains-bitcoin@2.0.18 + - @xdefi-tech/chains-cosmos@2.0.18 + - @xdefi-tech/chains-solana@2.0.20 + - @xdefi-tech/chains-core@2.0.16 + - @xdefi-tech/chains-thor@2.0.18 + - @xdefi-tech/chains-evm@2.0.26 + ## 2.0.5 ### Patch Changes diff --git a/utility-packages/chains-controller/package.json b/utility-packages/chains-controller/package.json index 0b4f8d8f..6720b763 100644 --- a/utility-packages/chains-controller/package.json +++ b/utility-packages/chains-controller/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-controller", - "version": "2.0.5", + "version": "2.0.6", "license": "MIT", "repository": "https://github.com/XDeFi-tech/chains/", "main": "dist/index.js", diff --git a/utility-packages/graphql/CHANGELOG.md b/utility-packages/graphql/CHANGELOG.md index da944cce..df449035 100644 --- a/utility-packages/graphql/CHANGELOG.md +++ b/utility-packages/graphql/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-graphql +## 1.2.15 + +### Patch Changes + +- 3d8f054: Feat: move verifyAddress to provider, make it static +- Updated dependencies [3d8f054] + - @xdefi-tech/chains-core@2.0.16 + ## 1.2.14 ### Patch Changes diff --git a/utility-packages/graphql/package.json b/utility-packages/graphql/package.json index 1881490a..e1b9b6e3 100644 --- a/utility-packages/graphql/package.json +++ b/utility-packages/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-graphql", - "version": "1.2.14", + "version": "1.2.15", "license": "MIT", "repository": "https://github.com/XDeFi-tech/chains/", "main": "dist/index.js", From d448ed8638b96cfda0842a13b2d0a70b6f062ab0 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:30:49 +0700 Subject: [PATCH 009/176] feat: gasFeeOptions for chain and indexer should get data from rpc by default (#227) * feat: gasFeeOptions for chain and indexer should get data from rpc by default * feat: Add unit test for get fee options * add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/eight-seals-push.md | 6 ++ .../src/core/datasource/base.data-source.ts | 2 +- packages/evm/src/chain.provider.spec.ts | 97 ++++++++++++++++++- packages/evm/src/chain.provider.ts | 10 +- .../src/datasource/chain/chain.data-source.ts | 18 +++- .../datasource/indexer/indexer.data-source.ts | 78 ++++++++++++++- packages/evm/src/manifests.ts | 4 +- packages/evm/src/msg.ts | 4 +- 8 files changed, 209 insertions(+), 10 deletions(-) create mode 100644 .changeset/eight-seals-push.md diff --git a/.changeset/eight-seals-push.md b/.changeset/eight-seals-push.md new file mode 100644 index 00000000..8b4088af --- /dev/null +++ b/.changeset/eight-seals-push.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-evm': patch +--- + +feat: gasFeeOptions for chain and indexer on EVM should default to getting data from RPC diff --git a/packages/core/src/core/datasource/base.data-source.ts b/packages/core/src/core/datasource/base.data-source.ts index bb58a2d4..6d771893 100644 --- a/packages/core/src/core/datasource/base.data-source.ts +++ b/packages/core/src/core/datasource/base.data-source.ts @@ -54,7 +54,7 @@ export abstract class DataSource { abstract estimateFee(msgs: Msg[], speed: GasFeeSpeed): Promise; - abstract gasFeeOptions(): Promise; + abstract gasFeeOptions(options?: { useFeeService: boolean }): Promise; async getNonce(_address: string): Promise { return 0; diff --git a/packages/evm/src/chain.provider.spec.ts b/packages/evm/src/chain.provider.spec.ts index 165261cb..fecfea2d 100644 --- a/packages/evm/src/chain.provider.spec.ts +++ b/packages/evm/src/chain.provider.spec.ts @@ -1,8 +1,9 @@ -import { providers } from 'ethers'; +import { BigNumber, providers } from 'ethers'; +import { Eip1559Fee } from '@xdefi-tech/chains-graphql'; import { ChainMsg } from './msg'; import { EvmProvider } from './chain.provider'; -import { IndexerDataSource } from './datasource'; +import { ChainDataSource, IndexerDataSource } from './datasource'; import { EVM_MANIFESTS } from './manifests'; describe('chain.provider', () => { @@ -196,3 +197,95 @@ describe('chain.provider', () => { ).toBe(true); }); }); + +jest.mock('ethers', () => { + const originalModule = jest.requireActual('ethers'); + return { + __esModule: true, + ...originalModule, + }; +}); + +describe('chain.provider gas fee', () => { + describe('ChainDataSource get fee options', () => { + let provider: EvmProvider; + let originalGetFeeData: () => Promise; + + beforeEach(() => { + originalGetFeeData = providers.Provider.prototype.getFeeData; + provider = new EvmProvider(new ChainDataSource(EVM_MANIFESTS.ethereum)); + }); + + afterEach(() => { + providers.Provider.prototype.getFeeData = originalGetFeeData; + }); + + it('Should return EIP-1559 transaction fee options', async () => { + providers.Provider.prototype.getFeeData = jest.fn().mockResolvedValue({ + lastBaseFeePerGas: BigNumber.from('0x019653bedb'), + maxFeePerGas: BigNumber.from('0x03860facb6'), + maxPriorityFeePerGas: BigNumber.from('0x59682f00'), + gasPrice: BigNumber.from('0x01a1d320c9'), + }); + const gasFeeOptions = await provider.gasFeeOptions(); + expect(gasFeeOptions).not.toBeNull(); + expect(gasFeeOptions?.high).toBeInstanceOf(Object); + expect((gasFeeOptions?.high as Eip1559Fee).baseFeePerGas).toBeTruthy(); + expect((gasFeeOptions?.high as Eip1559Fee).maxFeePerGas).toBeTruthy(); + expect( + (gasFeeOptions?.high as Eip1559Fee).priorityFeePerGas + ).toBeTruthy(); + }); + + it('Should return legacy transaction fee options', async () => { + providers.Provider.prototype.getFeeData = jest.fn().mockResolvedValue({ + lastBaseFeePerGas: null, + maxFeePerGas: null, + maxPriorityFeePerGas: null, + gasPrice: null, + }); + const gasFeeOptions = await provider.gasFeeOptions(); + expect(gasFeeOptions).not.toBeNull(); + expect(typeof gasFeeOptions?.high).toBe('number'); + }); + }); + + describe('IndexedDataSource get fee options', () => { + let provider: EvmProvider; + let originalGetFeeData: () => Promise; + + beforeEach(() => { + originalGetFeeData = providers.Provider.prototype.getFeeData; + provider = new EvmProvider(new IndexerDataSource(EVM_MANIFESTS.ethereum)); + }); + + afterEach(() => { + providers.Provider.prototype.getFeeData = originalGetFeeData; + }); + + it('Should call to RPC to get fee', async () => { + providers.Provider.prototype.getFeeData = jest.fn().mockResolvedValue({ + lastBaseFeePerGas: BigNumber.from('0x019653bedb'), + maxFeePerGas: BigNumber.from('0x03860facb6'), + maxPriorityFeePerGas: BigNumber.from('0x59682f00'), + gasPrice: BigNumber.from('0x01a1d320c9'), + }); + const gasFeeOptions = await provider.gasFeeOptions(); + expect(providers.Provider.prototype.getFeeData).toHaveBeenCalled(); + expect(gasFeeOptions).not.toBeNull(); + }); + + it('Should call to fee service to get fee', async () => { + providers.Provider.prototype.getFeeData = jest.fn().mockResolvedValue({ + lastBaseFeePerGas: BigNumber.from('0x019653bedb'), + maxFeePerGas: BigNumber.from('0x03860facb6'), + maxPriorityFeePerGas: BigNumber.from('0x59682f00'), + gasPrice: BigNumber.from('0x01a1d320c9'), + }); + await provider.gasFeeOptions({ + useFeeService: true, + }); + expect(providers.Provider.prototype.getFeeData).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/packages/evm/src/chain.provider.ts b/packages/evm/src/chain.provider.ts index b0d02821..5e0cc15b 100644 --- a/packages/evm/src/chain.provider.ts +++ b/packages/evm/src/chain.provider.ts @@ -41,6 +41,10 @@ export class EvmProvider extends Chain.Provider { ); } + public get manifest(): Chain.Manifest & { maxGapAmount?: number } { + return this.dataSource.manifest; + } + createMsg(data: MsgData, encoding: MsgEncoding = MsgEncoding.object): Msg { return new ChainMsg(data, this, encoding); } @@ -90,8 +94,10 @@ export class EvmProvider extends Chain.Provider { ); } - async gasFeeOptions(): Promise { - return this.dataSource.gasFeeOptions(); + async gasFeeOptions(options?: { + useFeeService: boolean; + }): Promise { + return this.dataSource.gasFeeOptions(options); } async getNonce(address: string): Promise { diff --git a/packages/evm/src/datasource/chain/chain.data-source.ts b/packages/evm/src/datasource/chain/chain.data-source.ts index fd585b45..7cbdc760 100644 --- a/packages/evm/src/datasource/chain/chain.data-source.ts +++ b/packages/evm/src/datasource/chain/chain.data-source.ts @@ -302,10 +302,24 @@ export class ChainDataSource extends DataSource { return feeData; } - async gasFeeOptions(): Promise { + async gasFeeOptions(): Promise { const fee = await this.rpcProvider.getFeeData(); if (!fee.gasPrice || !fee.maxFeePerGas || !fee.maxPriorityFeePerGas) { - return null; + const gasPrice = await this.rpcProvider.getGasPrice(); + return { + [GasFeeSpeed.high]: new BigNumber(formatFixed(gasPrice)) + .multipliedBy(this.manifest.feeGasStep.high) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + [GasFeeSpeed.medium]: new BigNumber(formatFixed(gasPrice)) + .multipliedBy(this.manifest.feeGasStep.medium) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + [GasFeeSpeed.low]: new BigNumber(formatFixed(gasPrice)) + .multipliedBy(this.manifest.feeGasStep.low) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + }; } return { diff --git a/packages/evm/src/datasource/indexer/indexer.data-source.ts b/packages/evm/src/datasource/indexer/indexer.data-source.ts index 444a5e93..8d796186 100644 --- a/packages/evm/src/datasource/indexer/indexer.data-source.ts +++ b/packages/evm/src/datasource/indexer/indexer.data-source.ts @@ -20,6 +20,7 @@ import { from, Observable } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import axios, { Axios } from 'axios'; import BigNumber from 'bignumber.js'; +import { formatFixed } from '@ethersproject/bignumber'; import { parseGwei } from '../../utils'; import { EVMChains } from '../../manifests'; @@ -284,7 +285,16 @@ export class IndexerDataSource extends DataSource { return feeData; } - async gasFeeOptions(): Promise { + async gasFeeOptions(options?: { + useFeeService: boolean; + }): Promise { + if (options?.useFeeService) { + return this._getFeeOptionsByFeeService(); + } + return this._getFeeOptionsFromRpc(); + } + + private async _getFeeOptionsByFeeService(): Promise { const fee = await getFees(this.manifest.chain); // fee in gwei let result: FeeOptions | null = null; @@ -315,6 +325,72 @@ export class IndexerDataSource extends DataSource { return result; } + private async _getFeeOptionsFromRpc(): Promise { + const fee = await this.rpcProvider.getFeeData(); + if (!fee.gasPrice || !fee.maxFeePerGas || !fee.maxPriorityFeePerGas) { + const gasPrice = await this.rpcProvider.getGasPrice(); + return { + [GasFeeSpeed.high]: new BigNumber(formatFixed(gasPrice)) + .multipliedBy(this.manifest.feeGasStep.high) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + [GasFeeSpeed.medium]: new BigNumber(formatFixed(gasPrice)) + .multipliedBy(this.manifest.feeGasStep.medium) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + [GasFeeSpeed.low]: new BigNumber(formatFixed(gasPrice)) + .multipliedBy(this.manifest.feeGasStep.low) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + }; + } + + return { + [GasFeeSpeed.high]: { + baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + .multipliedBy(this.manifest.feeGasStep.high) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + maxFeePerGas: new BigNumber(formatFixed(fee.maxFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.high) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + priorityFeePerGas: new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.high) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + }, + [GasFeeSpeed.medium]: { + baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + .multipliedBy(this.manifest.feeGasStep.medium) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + maxFeePerGas: new BigNumber(formatFixed(fee.maxFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.medium) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + priorityFeePerGas: new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.medium) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + }, + [GasFeeSpeed.low]: { + baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + .multipliedBy(this.manifest.feeGasStep.low) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + maxFeePerGas: new BigNumber(formatFixed(fee.maxFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.low) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + priorityFeePerGas: new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.low) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber(), + }, + }; + } + async getNonce(address: string): Promise { return this.rpcProvider.getTransactionCount(address); } diff --git a/packages/evm/src/manifests.ts b/packages/evm/src/manifests.ts index 46de6efe..0f29c582 100644 --- a/packages/evm/src/manifests.ts +++ b/packages/evm/src/manifests.ts @@ -14,7 +14,9 @@ export enum EVMChains { cronos = 'cronos', } -export const EVM_MANIFESTS: { [key in EVMChains]: Chain.Manifest } = { +export const EVM_MANIFESTS: { + [key in EVMChains]: Chain.Manifest & { maxGapAmount?: number }; +} = { [EVMChains.ethereum]: { name: 'Ethereum', description: '', diff --git a/packages/evm/src/msg.ts b/packages/evm/src/msg.ts index 60c3d498..f7870902 100644 --- a/packages/evm/src/msg.ts +++ b/packages/evm/src/msg.ts @@ -219,7 +219,9 @@ export class ChainMsg extends BasMsg { feeOptions.gasLimit = contractFeeEstimation[0].gasLimit; feeOptions.gasPrice = contractFeeEstimation[0].gasPrice; feeOptions.maxFeePerGas = contractFeeEstimation[0].maxFeePerGas; - feeOptions.baseFeePerGas = contractFeeEstimation[0].baseFeePerGas; + feeOptions.baseFeePerGas = ( + contractFeeEstimation[0] as any + ).baseFeePerGas; feeOptions.maxPriorityFeePerGas = contractFeeEstimation[0].maxPriorityFeePerGas; } From b00970113067cf9ed3bdd0b5578207db16072cbe Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 19 Jun 2024 06:33:07 +0000 Subject: [PATCH 010/176] Version packages --- .changeset/eight-seals-push.md | 6 ------ packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 .changeset/eight-seals-push.md diff --git a/.changeset/eight-seals-push.md b/.changeset/eight-seals-push.md deleted file mode 100644 index 8b4088af..00000000 --- a/.changeset/eight-seals-push.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-evm': patch ---- - -feat: gasFeeOptions for chain and indexer on EVM should default to getting data from RPC diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 3f4a3342..8e28a776 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.17 + +### Patch Changes + +- 0a8c0a56: feat: gasFeeOptions for chain and indexer on EVM should default to getting data from RPC + ## 2.0.16 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 28ae8bc2..b85a586e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.16", + "version": "2.0.17", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index f32dfb18..88ee6046 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.27 + +### Patch Changes + +- 0a8c0a56: feat: gasFeeOptions for chain and indexer on EVM should default to getting data from RPC +- Updated dependencies [0a8c0a56] + - @xdefi-tech/chains-core@2.0.17 + ## 2.0.26 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 811fbaa1..9e49fdcf 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.26", + "version": "2.0.27", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 8e7838b9b024f33d59d820de5f8323d6aba8c0cb Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:25:46 +0700 Subject: [PATCH 011/176] =?UTF-8?q?fix:=20Add=20the=20logic=20to=20fetch?= =?UTF-8?q?=20native=20token=20balance=20using=20multicall=20and=20?= =?UTF-8?q?=E2=80=A6=20(#246)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Add the logic to fetch native token balance using multicall and batch call * chore: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/metal-dancers-jog.md | 5 +++ packages/evm/README.md | 11 +++++ packages/evm/src/chain.provider.spec.ts | 14 ++++-- .../datasource/batch-rpc/evm.batch-call.ts | 21 ++++++++- .../datasource/indexer/indexer.data-source.ts | 45 +++++++++++++------ 5 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 .changeset/metal-dancers-jog.md diff --git a/.changeset/metal-dancers-jog.md b/.changeset/metal-dancers-jog.md new file mode 100644 index 00000000..d726d60c --- /dev/null +++ b/.changeset/metal-dancers-jog.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +fix: add the logic to fetch native token balance using multicall and batch call diff --git a/packages/evm/README.md b/packages/evm/README.md index 0e1431bc..8b1a29d9 100644 --- a/packages/evm/README.md +++ b/packages/evm/README.md @@ -62,6 +62,9 @@ const provider = new EvmProvider( medium: 1.25, low: 1, }, + // Provide multicall contract to use multicall for fetching balance, + // otherwise use batch call + multicallContractAddress: '0xcA11bde05977b3631167028862bE2a173976CA11', }) ); @@ -70,6 +73,14 @@ const response = await provider.getBalance( '0x1234567890123456789012345678901234567890' ); const data = await response.getData(); + +// Fetches balance with multicall or batch calls +// Add list token addresses. Use zero address to fetch the native token amount +const response = await provider.getBalance( + '0x1234567890123456789012345678901234567890', + ['0x0000000000000000000000000000000000000000'] // List token addresses +); +const data = await response.getData(); ``` ## Usage ethers provides diff --git a/packages/evm/src/chain.provider.spec.ts b/packages/evm/src/chain.provider.spec.ts index fecfea2d..279cdf22 100644 --- a/packages/evm/src/chain.provider.spec.ts +++ b/packages/evm/src/chain.provider.spec.ts @@ -73,13 +73,19 @@ describe('chain.provider', () => { it('should get a token balance', async () => { const balance = await evmProvider.getBalance( '0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACC', - ['0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84'] + [ + '0x0000000000000000000000000000000000000000', + '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', + '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', + ] ); const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(1); + expect(balanceData.length).toEqual(2); expect(balanceData[0].amount.toString()).toEqual('0'); - expect(balanceData[0].asset.symbol).toEqual('stETH'); - expect(balanceData[0].asset.name).toEqual('Liquid staked Ether 2.0'); + expect(balanceData[0].asset.name).toEqual('Ethereum'); + expect(balanceData[1].amount.toString()).toEqual('0'); + expect(balanceData[1].asset.symbol).toEqual('stETH'); + expect(balanceData[1].asset.name).toEqual('Liquid staked Ether 2.0'); }); it('should throw error for a non-existant address wallet', async () => { diff --git a/packages/evm/src/datasource/batch-rpc/evm.batch-call.ts b/packages/evm/src/datasource/batch-rpc/evm.batch-call.ts index 32e63afa..04decea3 100644 --- a/packages/evm/src/datasource/batch-rpc/evm.batch-call.ts +++ b/packages/evm/src/datasource/batch-rpc/evm.batch-call.ts @@ -4,11 +4,30 @@ import erc20Abi from '../../consts/erc20.json'; export const getBalanceByBatch = async ( rpc: string, walletAddress: string, - tokenAddresses: string[] + tokenAddresses: string[], + nativeTokenInfo: { + name: string; + symbol: string; + contract: string | null; + decimals: number; + } ) => { try { const provider = new ethers.providers.JsonRpcBatchProvider(rpc); const callPromise = tokenAddresses.map(async (tokenAddress) => { + if (tokenAddress === ethers.constants.AddressZero) { + const balance = await provider.getBalance(walletAddress); + return { + address: walletAddress, + amount: { + value: ethers.BigNumber.from(balance).toString(), + scalingFactor: ethers.BigNumber.from( + nativeTokenInfo.decimals + ).toString(), + }, + asset: nativeTokenInfo, + }; + } const contract = new ethers.Contract(tokenAddress, erc20Abi, provider); const [balanceOf, symbol, name, decimal] = await Promise.all([ contract.balanceOf(walletAddress), diff --git a/packages/evm/src/datasource/indexer/indexer.data-source.ts b/packages/evm/src/datasource/indexer/indexer.data-source.ts index 8d796186..c07db49e 100644 --- a/packages/evm/src/datasource/indexer/indexer.data-source.ts +++ b/packages/evm/src/datasource/indexer/indexer.data-source.ts @@ -15,7 +15,7 @@ import { EIP1559FeeOptions, DefaultFeeOptions, } from '@xdefi-tech/chains-core'; -import { providers } from 'ethers'; +import { ethers, providers } from 'ethers'; import { from, Observable } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import axios, { Axios } from 'axios'; @@ -64,19 +64,38 @@ export class IndexerDataSource extends DataSource { let balances; if (!tokenAddresses) { balances = await getBalance(this.manifest.chain as EVMChains, address); - } else if (tokenAddresses && this.manifest.multicallContractAddress) { - balances = await getEvmBalance( - this.manifest.rpcURL, - this.manifest.name, - address, - tokenAddresses - ); - } else if (tokenAddresses) { - balances = await getBalanceByBatch( - this.manifest.rpcURL, - address, - tokenAddresses + } else { + // Remove duplicate addresses + const uniqueAddresses = Array.from(new Set(tokenAddresses)); + + // Multicall contracts only call deployed contracts, so they can't query native token balances. + const isFetchNativeTokenBalance = uniqueAddresses.some( + (address) => address === ethers.constants.AddressZero ); + const nativeTokenInfo = { + name: this.manifest.name, + contract: null, + decimals: this.manifest.decimals, + symbol: this.manifest.chainSymbol, + }; + if ( + this.manifest.multicallContractAddress && + !isFetchNativeTokenBalance + ) { + balances = await getEvmBalance( + this.manifest.rpcURL, + this.manifest.name, + address, + uniqueAddresses + ); + } else { + balances = await getBalanceByBatch( + this.manifest.rpcURL, + address, + uniqueAddresses, + nativeTokenInfo + ); + } } if (!balances) { From 2cb014f3d268e0102fe08995539e7087351b459f Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 19 Jun 2024 08:27:56 +0000 Subject: [PATCH 012/176] Version packages --- .changeset/metal-dancers-jog.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/metal-dancers-jog.md diff --git a/.changeset/metal-dancers-jog.md b/.changeset/metal-dancers-jog.md deleted file mode 100644 index d726d60c..00000000 --- a/.changeset/metal-dancers-jog.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -fix: add the logic to fetch native token balance using multicall and batch call diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 88ee6046..5c50441c 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.28 + +### Patch Changes + +- b340836e: fix: add the logic to fetch native token balance using multicall and batch call + ## 2.0.27 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 9e49fdcf..914cb693 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.27", + "version": "2.0.28", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From fe0444549dc3de50adfa6e388d7762c7ec6674e1 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 19 Jun 2024 21:49:29 +0700 Subject: [PATCH 013/176] feat: implement fee abstraction on osmosis chain (#204) * feat: implement fee abstraction on osmosis chain * feat: implement fee abstraction on osmosis chain * fix: remove not used function * chore: setup test abstraction fee * feat: custom estimate fee with ibc token as fees * feat: update get max amount to send with ibc fee * add changeset * chore: resolve conflict * chore: update unit tests --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/pretty-actors-watch.md | 5 + .../send-tx-abstraction-fee.component.tsx | 103 ++++++++ examples/react/pages/transfer.tsx | 29 ++ packages/cosmos/README.md | 65 +++++ packages/cosmos/src/chain.provider.spec.ts | 46 ++++ packages/cosmos/src/chain.provider.ts | 32 +++ .../src/datasource/chain/chain.data-source.ts | 46 ++-- .../datasource/indexer/indexer.data-source.ts | 21 +- packages/cosmos/src/msg.spec.ts | 248 +++++++++--------- packages/cosmos/src/msg.ts | 60 ++++- .../src/signers/seed-phrase.signer.spec.ts | 50 ++++ yarn.lock | 31 ++- 12 files changed, 574 insertions(+), 162 deletions(-) create mode 100644 .changeset/pretty-actors-watch.md create mode 100644 examples/react/components/send-tx-abstraction-fee.component.tsx create mode 100644 examples/react/pages/transfer.tsx diff --git a/.changeset/pretty-actors-watch.md b/.changeset/pretty-actors-watch.md new file mode 100644 index 00000000..fc2e5a5e --- /dev/null +++ b/.changeset/pretty-actors-watch.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +feat: implement fee abstraction on osmosis chain diff --git a/examples/react/components/send-tx-abstraction-fee.component.tsx b/examples/react/components/send-tx-abstraction-fee.component.tsx new file mode 100644 index 00000000..836217ff --- /dev/null +++ b/examples/react/components/send-tx-abstraction-fee.component.tsx @@ -0,0 +1,103 @@ +import React, { useState } from 'react'; +import { + CosmosProvider, + ChainMsg, + COSMOS_MANIFESTS, + IndexerDataSource, + TxData, + MsgBody, + CosmosChainType, +} from '@xdefi-tech/chains-cosmos'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-cosmos/dist/signers/web'; +import { GasFeeSpeed } from '@xdefi-tech/chains-core'; + +const provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) +); + +const TransferForm = () => { + const [to, setTo] = useState(''); + const [amount, setAmount] = useState(''); + const [denom, setDenom] = useState(''); + + const handleToChange = (e) => { + setTo(e.target.value); + }; + + const handleAmountChange = (e) => { + setAmount(e.target.value); + }; + + const handleDenomChange = (e) => { + setDenom(e.target.value); + }; + + const handleSend = async () => { + const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); + const derivation = "m/44'/118'/0'/0/0"; + const txInput: MsgBody = { + from: 'osmo1txd2s5ulx6fetq8qhx0u8mkhhk2rh5cv2fzyw9', + to: 'osmo1txd2s5ulx6fetq8qhx0u8mkhhk2rh5cv2fzyw9', + amount, + denom, + feeOptions: { + gasAdjustment: 1, + gasFee: { + denom, + }, + }, + }; + const transferMsg = provider.createMsg(txInput); + const [estimationFee] = await provider.estimateFee( + [transferMsg], + GasFeeSpeed.low + ); + console.log('🚀 ~ handleSend ~ estimationFee:', estimationFee); + const estimateAbstractionFee = await provider.calculateFeeAbs( + estimationFee, + denom + ); + console.log( + '🚀 ~ handleSend ~ estimateAbstractionFee:', + estimateAbstractionFee + ); + // const txInputWithAbsFee = { + // ...txInput, + // ...estimateAbstractionFee, + // from: await signer.getAddress(derivation, 'osmo'), + // }; + // const newTransferMsg = provider.createMsg(txInputWithAbsFee); + // await signer.sign(newTransferMsg as ChainMsg, derivation); + // console.log('🚀 ~ handleSend ~ newTransferMsg - after:', newTransferMsg); + // await provider.broadcast([newTransferMsg as ChainMsg]); + // console.log('🚀 ~ handleSend ~ tx:', txInput); + // setTo(''); + // setAmount(''); + }; + + return ( +
+ + + + +
+ ); +}; + +export default TransferForm; diff --git a/examples/react/pages/transfer.tsx b/examples/react/pages/transfer.tsx new file mode 100644 index 00000000..e3439eb9 --- /dev/null +++ b/examples/react/pages/transfer.tsx @@ -0,0 +1,29 @@ +import { createTheme } from '@mui/material/styles'; +import TransferForm from '../components/send-tx-abstraction-fee.component'; +import { NextPage } from 'next'; + +const darkTheme = createTheme({ + palette: { + mode: 'dark', + common: { + black: '#252829', + }, + background: { + default: '#1C1E1F', + paper: '#30363B', + }, + text: { + secondary: '#969DA3', + }, + }, +}); + +const Transfer: NextPage = () => { + return ( +
+ +
+ ); +}; + +export default Transfer; diff --git a/packages/cosmos/README.md b/packages/cosmos/README.md index 9e5909ea..95b9e7b0 100644 --- a/packages/cosmos/README.md +++ b/packages/cosmos/README.md @@ -36,3 +36,68 @@ Cosmos specific fields: - `lcdURL`: The URL of the LCD (Light Client Daemon) server used to query information from the Cosmos Hub blockchain. - `denom`: The denomination or name of the native currency of the Cosmos Hub blockchain, which is "uatom". - `prefix`: A prefix used in some contexts or operations related to the Cosmos Hub blockchain, which is "cosmos". + +## Abstraction fee + +This feature allows you to customize the fee for transactions using the IBC token as fee token. You can learn more about the abstraction fee in [here](https://docs.osmosis.zone/overview/features/fee-abstraction/) + +- To get a list of fee tokens: + +```typescript +const provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) +); +// Retrieve the list of fee tokens, +// which includes the denom of the IBC token +// and the poolID on Osmosis. +const feeTokens = await provider.getFeeTokens(); +``` + +- Estimate the abstract fee for a transaction: + +```typescript +const provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) +); + +const txInput = { + // Here is the msg information +}; +const msg = provider.createMsg(txInput); + +// Retrieve the gas information with native token +const [estimationFee] = await provider.estimateFee( + [transferMsg], + GasFeeSpeed.low +); + +// Calculate the abstraction fee from native token fee +const estimateAbstractionFee = await provider.calculateFeeAbs( + estimationFee, + denom // the denom of the IBC token using for fee payments +); +``` + +- Create the transaction with the IBC token as payment fee + +```typescript + const provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); + + const txInputWithAbsFee = { + // Here is the msg information + feeOptions: { + gasAdjustment: 1 // GasLimit = GasLimit(Gas Usage) * gasAdjustment + gasFee: { + denom: '' // the denom of IBC token + } + } + } + + const msg = provider.createMsg(txInputWithAbsFee); + // Sign the tx + await signer.sign(msg as ChainMsg, derivation); + // Send tx to the chain + const tx = await provider.broadcast([msg as ChainMsg]); +``` diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index 0b329ac6..e1bc98fe 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -1,3 +1,5 @@ +import { GasFeeSpeed } from '@xdefi-tech/chains-core'; + import { ChainMsg } from './msg'; import { CosmosProvider } from './chain.provider'; import { IndexerDataSource } from './datasource'; @@ -131,3 +133,47 @@ describe('chain.provider', () => { ).toBe(true); }); }); + +describe('chain.provider', () => { + let provider: CosmosProvider; + + beforeEach(() => { + provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); + }); + + it('getFeeTokens(): should get a list of fee tokens', async () => { + const feeTokens = await provider.getFeeTokens(); + expect(Array.isArray(feeTokens)).toBe(true); + expect( + feeTokens.every( + (token) => + typeof token.denom === 'string' && typeof token.poolID === 'bigint' + ) + ).toBeTruthy(); + }); + + it('estimateGas(): should get a list of fee tokens', async () => { + const ibcToken = + 'ibc/B547DC9B897E7C3AA5B824696110B8E3D2C31E3ED3F02FF363DCBAD82457E07E'; // uxki; + const txInput = { + from: 'osmo1tkh70hsnd44544s4gfhu0rpfrhkxd37pfueyfs', + to: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + amount: '0.000001', + msgs: [], + feeOptions: { + gasAdjustment: 2, + gasFee: { + denom: ibcToken, + }, + }, + }; + const msg = provider.createMsg(txInput); + const estimateFee = await provider.estimateFee( + [msg as ChainMsg], + GasFeeSpeed.low + ); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); +}); diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index 7bd60946..19711dcb 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -27,6 +27,7 @@ import 'reflect-metadata'; import { bech32 } from 'bech32'; import { utils } from 'ethers'; import { AccAddress } from '@terra-money/feather.js'; +import { osmosis } from 'osmojs'; import { ChainMsg } from './msg'; import * as manifests from './manifests'; @@ -91,6 +92,37 @@ export class CosmosProvider extends Chain.Provider { return this.dataSource.estimateFee(msgs as ChainMsg[], speed); } + async getFeeTokens() { + try { + const { createRPCQueryClient } = osmosis.ClientFactory; + const client = await createRPCQueryClient({ + rpcEndpoint: this.manifest.rpcURL, + }); + const { feeTokens } = await client.osmosis.txfees.v1beta1.feeTokens(); + return feeTokens; + } catch (error) { + throw new Error('Abstraction fee not available for this chain'); + } + } + + async calculateFeeAbs(nativeFee: FeeData, denom: string) { + try { + const { createRPCQueryClient } = osmosis.ClientFactory; + const client = await createRPCQueryClient({ + rpcEndpoint: this.manifest.rpcURL, + }); + if (!nativeFee.gasPrice) return nativeFee; + const { spotPrice: twap } = + await client.osmosis.txfees.v1beta1.denomSpotPrice({ denom }); + return { + gasLimit: nativeFee.gasLimit, + gasPrice: Number(nativeFee.gasPrice) / Number(twap), + }; + } catch (error) { + throw new Error('Abstraction fee not available for this chain'); + } + } + async getNFTBalance(address: string) { return this.dataSource.getNFTBalance(address); } diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 196d7a76..29da365c 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -14,7 +14,7 @@ import { import { Observable } from 'rxjs'; import BigNumber from 'bignumber.js'; import { - BankBalancesResponse, + Coin as CosmosCoin, LcdClient, setupBankExtension, } from '@cosmjs/launchpad'; @@ -48,14 +48,14 @@ export class ChainDataSource extends DataSource { constructor(manifest: manifests.CosmosManifest) { super(manifest); - this.rpcProvider = LcdClient.withExtensions( - { apiUrl: this.manifest.lcdURL }, - setupBankExtension - ); this.cosmosSDK = new cosmosclient.CosmosSDK( this.manifest.lcdURL, this.manifest.chainId ); + this.rpcProvider = LcdClient.withExtensions( + { apiUrl: this.manifest.lcdURL }, + setupBankExtension + ); this.lcdAxiosClient = axios.create({ baseURL: this.manifest.lcdURL, headers: { @@ -72,24 +72,22 @@ export class ChainDataSource extends DataSource { const { address } = filter; const response = await this.lcdAxiosClient.get( - `/bank/balances/${address}?timestamp=${new Date().getTime()}` + `cosmos/bank/v1beta1/balances/${address}?timestamp=${new Date().getTime()}` ); - const balances = response.data as BankBalancesResponse; + const balances = response.data.balances as CosmosCoin[]; const chain = capitalize(this.manifest.chain) as AddressChain; - const cryptoAssetsInput = balances.result.map( - ({ denom }) => ({ - chain: chain, - contract: this.manifest.denom === denom ? null : denom, - }) - ); + const cryptoAssetsInput = balances.map(({ denom }) => ({ + chain: chain, + contract: this.manifest.denom === denom ? null : denom, + })); const { data: { assets: { cryptoAssets: assets }, }, } = await getCryptoAssets(cryptoAssetsInput); - return balances.result.reduce((result: Coin[], { amount }, index) => { + return balances.reduce((result: Coin[], { amount }, index) => { const asset = assets && assets[index]; if (!asset) { return result; @@ -195,6 +193,24 @@ export class ChainDataSource extends DataSource { }; }); + const _feeAmount = msgs.map((m) => { + const messageData = m.toData(); + if (messageData.feeOptions) { + return { + denom: messageData.feeOptions.gasFee.denom, + amount: new BigNumber(this.manifest.feeGasStep[speed]) + .multipliedBy(10 ** this.manifest.decimals) + .toString(), + }; + } + return { + denom: this.manifest.denom, + amount: new BigNumber(this.manifest.feeGasStep[speed]) + .multipliedBy(10 ** this.manifest.decimals) + .toString(), + }; + }); + const account = await this.getAccount(fromAddress); if (!account) { return [ @@ -224,7 +240,7 @@ export class ChainDataSource extends DataSource { }), ], fee: Fee.fromPartial({ - amount: [], + amount: _feeAmount as any, }), }).finish(), signatures: [new Uint8Array(64)], diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index 0a118b67..6fe0c826 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -158,6 +158,25 @@ export class IndexerDataSource extends DataSource { }).finish(), }; }); + + const _feeAmount = msgs.map((m) => { + const messageData = m.toData(); + if (messageData.feeOptions) { + return { + denom: messageData.feeOptions.gasFee.denom, + amount: new BigNumber(this.manifest.feeGasStep[speed]) + .multipliedBy(10 ** this.manifest.decimals) + .toString(), + }; + } + return { + denom: this.manifest.denom, + amount: new BigNumber(this.manifest.feeGasStep[speed]) + .multipliedBy(10 ** this.manifest.decimals) + .toString(), + }; + }); + const account = await this.getAccount(fromAddress); if (!account) { return [ @@ -187,7 +206,7 @@ export class IndexerDataSource extends DataSource { }), ], fee: Fee.fromPartial({ - amount: [], + amount: _feeAmount as any, }), }).finish(), signatures: [new Uint8Array(64)], diff --git a/packages/cosmos/src/msg.spec.ts b/packages/cosmos/src/msg.spec.ts index 5dbc1646..add9ddbb 100644 --- a/packages/cosmos/src/msg.spec.ts +++ b/packages/cosmos/src/msg.spec.ts @@ -1,144 +1,85 @@ -import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; +import { Asset, Coin } from '@xdefi-tech/chains-core'; -import { ChainMsg } from './msg'; +import { ChainDataSource } from './datasource'; +import { COSMOS_MANIFESTS } from './manifests'; +import { CosmosProvider } from './chain.provider'; -describe('msg', () => { - let mockProvider: any; - - beforeEach(() => { - mockProvider = { - getBalance: jest.fn(() => - Promise.resolve({ - getData: jest.fn(() => - Promise.resolve([ - { - asset: { - chainId: 'cosmoshub-4', - name: 'Cosmos Hub', - symbol: 'ATOM', - icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/cosmos/info/logo.png', - native: true, - id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', - price: '443.21', - decimals: 18, - }, - amount: '1000', - }, - { - asset: { - chainId: 'cosmoshub-4', - name: 'Neutron', - symbol: 'NTRN', - icon: null, - native: false, - address: '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48', - decimals: 18, - }, - amount: '1000', - }, - ]) - ), - }) - ), - getFee: jest.fn(() => - Promise.resolve({ - high: 0.033, - low: 0.011, - medium: 0.0275, - }) - ), - estimateFee: jest.fn(() => - Promise.resolve([ - { - gasLimit: 31500, - gasPrice: 0.1, - maxFeePerGas: 5390000000, - maxPriorityFeePerGas: 560000000, - }, - ]) - ), - manifest: { - name: 'Cosmos Hub', - description: '', - rpcURL: 'https://rpc-proxy.xdefi.services/cosmos/rpc/mainnet', - lcdURL: 'https://rpc-proxy.xdefi.services/cosmos/lcd/mainnet', - chainSymbol: 'ATOM', - blockExplorerURL: 'https://www.mintscan.io/cosmos/account', - chainId: 'cosmoshub-4', - chain: 'cosmos', - denom: 'uatom', - decimals: 6, - prefix: 'cosmos', - feeGasStep: { - high: 0.003, - medium: 0.0025, - low: 0.001, - }, - maxGapAmount: 0.0001, - }, - }; - }); +jest.mock('./chain.provider', () => { + const originModule = jest.requireActual('./chain.provider'); - it('getFee should return fee estimation', async () => { - const chainMsg = new ChainMsg( - { - from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - amount: '0.000001', - }, - mockProvider, - MsgEncoding.object - ); - - const response = await chainMsg.getFee(GasFeeSpeed.medium); + return { + __esModule: true, + ...originModule, + }; +}); - const [feeEstimation] = await mockProvider.estimateFee( - [chainMsg], - GasFeeSpeed.medium - ); +describe('msg', () => { + let provider: CosmosProvider; - expect(response.fee).toEqual( - new BigNumber(feeEstimation.gasLimit.toString()) - .multipliedBy(feeEstimation.gasPrice.toString()) - .dividedBy(10 ** mockProvider.manifest.decimals) - .toString() + beforeEach(() => { + provider = new CosmosProvider( + new ChainDataSource(COSMOS_MANIFESTS.osmosis) ); - expect(response.maxFee).toBeNull(); + CosmosProvider.prototype.getBalance = jest.fn().mockResolvedValue({ + getData: () => + new Promise((resolve) => + resolve([ + new Coin( + new Asset({ + chainId: 'osmosis-1', + name: 'Cosmos Hub', + symbol: 'ATOM', + icon: 'https://assets.coingecko.com/coins/images/1481/large/cosmos_hub.png?1555657960', + native: false, + id: 'ffd6b64f-ce52-455b-8eb5-250e76d8fc4c', + address: + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2', + price: '8.33', + }), + new BigNumber(1000) + ), + new Coin( + new Asset({ + chainId: 'osmosis-1', + name: 'Osmosis', + symbol: 'OSMO', + icon: 'https://raw.githubusercontent.com/cosmostation/cosmostation_token_resource/master/coin_image/tokens/token-osmosis.svg', + native: true, + id: '77c3401d-f6e2-41dd-8747-75afbbcaa477', + price: '0.817933', + }), + new BigNumber(1000) + ), + ]) + ), + }); }); it('getMaxAmountToSend should throw an error with invalid token', async () => { - const chainMsg = new ChainMsg( - { - from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - amount: '0.000001', - }, - mockProvider, - MsgEncoding.object - ); + const chainMsg = provider.createMsg({ + from: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + to: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + amount: '0.000001', + }); const response = chainMsg.getMaxAmountToSend('invalid'); - await expect(response).rejects.toThrowError(); + await expect(response).rejects.toThrowError('No balance found'); }); it('should return MaxAmountToSend with native token', async () => { - const chainMsg = new ChainMsg( - { - from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - amount: '0.000001', - }, - mockProvider, - MsgEncoding.object - ); + const chainMsg = provider.createMsg({ + from: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + to: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + amount: '0.000001', + }); const response = await chainMsg.getMaxAmountToSend(); const feeEstimation = await chainMsg.getFee(); - const gap = chainMsg.provider.manifest?.maxGapAmount || 0; + const gap = provider.manifest?.maxGapAmount || 0; expect(response).toEqual( new BigNumber('1000') @@ -148,21 +89,68 @@ describe('msg', () => { ); }); - it('should return MaxAmountToSend with non-native-token', async () => { - const chainMsg = new ChainMsg( - { - from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - amount: '0.000001', + it('should return MaxAmountToSend with ibc token as fee', async () => { + const chainMsg = provider.createMsg({ + from: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + to: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + amount: '0.000001', + feeOptions: { + gasAdjustment: 1, + gasFee: { + denom: + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2', + }, }, - mockProvider, - MsgEncoding.object + }); + + const response = await chainMsg.getMaxAmountToSend( + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' ); + const feeEstimation = await chainMsg.getFee(); + const gap = provider.manifest?.maxGapAmount || 0; + + expect(response).toEqual( + new BigNumber('1000') + .minus(feeEstimation.fee || 0) + .minus(gap) + .toString() + ); + }); + + it('should reject if not hold token', async () => { + const chainMsg = provider.createMsg({ + from: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + to: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + amount: '0.000001', + feeOptions: { + gasAdjustment: 1, + gasFee: { + denom: + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2', + }, + }, + }); + + await expect( + chainMsg.getMaxAmountToSend( + 'ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518' + ) + ).rejects.toThrowError('No balance found'); + }); + + it('should return the full amount', async () => { + const chainMsg = provider.createMsg({ + from: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + to: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', + amount: '0.000001', + }); + const response = await chainMsg.getMaxAmountToSend( - '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48' + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' ); - const gap = chainMsg.provider.manifest?.maxGapAmount || 0; + + const gap = provider.manifest?.maxGapAmount || 0; expect(response).toEqual(new BigNumber('1000').minus(gap).toString()); }); diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index ed8984cf..937f8b9a 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -26,6 +26,12 @@ export type MsgBody = { nftId?: string; msgs?: any[]; data?: string; + feeOptions?: { + gasAdjustment: number; + gasFee: { + denom: string; + }; + }; }; export interface TxData { @@ -172,16 +178,24 @@ export class ChainMsg extends BasMsg { } const { typeUrl, msgs } = this.getMsgToSend(); + const feeOptions = msgData.feeOptions; const fee = { amount: [ { - amount: new BigNumber(msgData.gasPrice) - .multipliedBy(10 ** this.provider.manifest.decimals) - .toString(), - denom: this.provider.manifest.denom, + amount: feeOptions + ? new BigNumber(msgData.gasLimit) + .multipliedBy(feeOptions.gasAdjustment) + .multipliedBy(msgData.gasPrice) + .toFixed(0) + : new BigNumber(msgData.gasPrice) + .multipliedBy(10 ** this.provider.manifest.decimals) + .toString(), + denom: feeOptions?.gasFee.denom ?? this.provider.manifest.denom, }, ], - gas: new BigNumber(msgData.gasLimit).toString(), + gas: new BigNumber(msgData.gasLimit) + .multipliedBy(feeOptions?.gasAdjustment ?? 1) + .toString(), }; const acc = await this.provider.getAccount(msgData.from); @@ -213,21 +227,40 @@ export class ChainMsg extends BasMsg { maxFee: null, }; + const feeOptions = data.feeOptions; + if (!data.gasLimit && !data.gasPrice && this.provider) { const [feeEstimation] = await this.provider.estimateFee( [this], speed || GasFeeSpeed.medium ); if (feeEstimation.gasPrice && feeEstimation.gasLimit) { - estimation.fee = new BigNumber(feeEstimation.gasLimit.toString()) - .multipliedBy(feeEstimation.gasPrice.toString()) - .dividedBy(10 ** this.provider.manifest.decimals) - .toString(); + if (feeOptions) { + const feeAbstractionEstimation = await this.provider.calculateFeeAbs( + feeEstimation, + feeOptions.gasFee.denom + ); + if (!feeAbstractionEstimation.gasPrice) { + throw new Error('Cannot calculate fee abstraction'); + } + estimation.fee = new BigNumber( + feeAbstractionEstimation.gasLimit.toString() + ) + .multipliedBy(feeOptions.gasAdjustment) + .multipliedBy(feeAbstractionEstimation.gasPrice.toString()) + .toFixed(0); + } else { + estimation.fee = new BigNumber(feeEstimation.gasLimit.toString()) + .multipliedBy(feeEstimation.gasPrice.toString()) + .dividedBy(10 ** this.provider.manifest.decimals) + .toString(); + } } } else if (data.gasLimit && data.gasPrice) { estimation.fee = new BigNumber(data.gasLimit) + .multipliedBy(feeOptions?.gasAdjustment ?? 1) .multipliedBy(data.gasPrice) - .dividedBy(10 ** this.provider.manifest.decimals) + .dividedBy(10 ** (feeOptions ? 0 : this.provider.manifest.decimals)) .toString(); } @@ -240,7 +273,6 @@ export class ChainMsg extends BasMsg { const gap = new BigNumber(this.provider.manifest?.maxGapAmount || 0); let balance: Coin | undefined; - if (!contract) { balance = (await balances.getData()).find( (b) => @@ -253,12 +285,14 @@ export class ChainMsg extends BasMsg { b.asset.address === contract ); } - if (!balance) throw new Error('No balance found'); let maxAmount: BigNumber = new BigNumber(balance.amount).minus(gap); - if (balance.asset.native) { + if ( + (balance.asset.native && contract !== this.provider.manifest.denom) || + (msgData.feeOptions && msgData.feeOptions.gasFee.denom === contract) + ) { const feeEstimation = await this.getFee(); maxAmount = maxAmount.minus(feeEstimation.fee || 0); } diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index 60d912b3..6e957130 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -363,6 +363,56 @@ describe('seed-phase.addressGeneration', () => { }); }); +describe('abstrction fee', () => { + let mnemonic: string; + let signer: SeedPhraseSigner; + let provider: CosmosProvider; + let derivation: string; + + beforeEach(() => { + jest.setTimeout(15 * 1000); + mnemonic = + 'question unusual episode tree fresh lawn enforce vocal attitude quarter solution shove early arch topic'; + signer = new SeedPhraseSigner(mnemonic); + + derivation = "m/44'/118'/0'/0/0"; + + provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); + }); + + it('should sign a transaction using a seed phrase', async () => { + const ibcToken = + 'ibc/B547DC9B897E7C3AA5B824696110B8E3D2C31E3ED3F02FF363DCBAD82457E07E'; // uxki; + const txInput = { + from: 'osmosis1g6qu6hm4v3s3vq7438jehn9fzxg9p720hzad6a', + to: 'osmosis1g6qu6hm4v3s3vq7438jehn9fzxg9p720hzad6a', + amount: '0.000001', + msgs: [], + feeOptions: { + gasAdjustment: 2, + gasFee: { + denom: ibcToken, + }, + }, + }; + const message = provider.createMsg(txInput); + const { fee } = await message.getFee(); + const gasInfo = { + gasLimit: 200000, + gasPrice: '0.025', + }; + const abstractionFee = await provider.calculateFeeAbs(gasInfo, ibcToken); + const newInputTx = { ...txInput, ...abstractionFee }; + const newMessage = provider.createMsg(newInputTx); + const buildTxData = await newMessage.buildTx(); + await signer.sign(message as ChainMsg, derivation); + expect(message.signedTransaction).toBeTruthy(); + expect((buildTxData as any).fee.amount[0].amount).toEqual(fee); + }); +}); + describe('IBC token transfer', () => { let mnemonic: string; let signer: SeedPhraseSigner; diff --git a/yarn.lock b/yarn.lock index 90a1546d..fd6db27e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16543,7 +16543,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -16561,6 +16561,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -16631,7 +16640,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -16652,6 +16661,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -18197,7 +18213,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18215,6 +18231,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From d6fd8b2566d779286fd2830d39a5990ad503a6aa Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 19 Jun 2024 14:51:40 +0000 Subject: [PATCH 014/176] Version packages --- .changeset/pretty-actors-watch.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/pretty-actors-watch.md diff --git a/.changeset/pretty-actors-watch.md b/.changeset/pretty-actors-watch.md deleted file mode 100644 index fc2e5a5e..00000000 --- a/.changeset/pretty-actors-watch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -feat: implement fee abstraction on osmosis chain diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 170af565..81a04094 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.19 + +### Patch Changes + +- 6fc03319: feat: implement fee abstraction on osmosis chain + ## 2.0.18 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 68f7f8a4..6e2b8b0e 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.18", + "version": "2.0.19", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 9c61609f1476f3931b19454d9988379693ac8796 Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:29:43 +0700 Subject: [PATCH 015/176] feat: XDEFI-7555 build size improvements (#214) * feat: optimize cosmos and solana * feat: optimize binance lib and evm lib * chore: resolved review comment * chore: remove import from dist * chore: fix run testcase from core * chore: add changeset * chore: update changeset --- .changeset/breezy-wombats-fetch.md | 9 + packages/binance/package.json | 2 +- packages/core/src/core/asset/asset.ts | 2 +- packages/core/tsup.config.cjs | 16 + packages/cosmos/package.json | 2 +- .../src/datasource/chain/chain.data-source.ts | 2 +- .../datasource/indexer/indexer.data-source.ts | 2 +- packages/cosmos/src/utils.ts | 4 +- packages/evm/package.json | 8 +- packages/solana/package.json | 4 +- yarn.lock | 2247 +++++++++++------ 11 files changed, 1459 insertions(+), 839 deletions(-) create mode 100644 .changeset/breezy-wombats-fetch.md create mode 100644 packages/core/tsup.config.cjs diff --git a/.changeset/breezy-wombats-fetch.md b/.changeset/breezy-wombats-fetch.md new file mode 100644 index 00000000..943ddabf --- /dev/null +++ b/.changeset/breezy-wombats-fetch.md @@ -0,0 +1,9 @@ +--- +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-evm': patch +--- + +Upgrade version for core package of binance lib, cosmos lib, solana lib, core lib and evm lid. diff --git a/packages/binance/package.json b/packages/binance/package.json index 346dd8cd..47a16d36 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -20,7 +20,7 @@ "typescript": "4.8.3" }, "dependencies": { - "@binance-chain/javascript-sdk": "4.2.1", + "@binance-chain/javascript-sdk": "4.2.2", "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@xdefi-tech/chains-core": "*", diff --git a/packages/core/src/core/asset/asset.ts b/packages/core/src/core/asset/asset.ts index 8953870e..d0f169f6 100644 --- a/packages/core/src/core/asset/asset.ts +++ b/packages/core/src/core/asset/asset.ts @@ -1,4 +1,4 @@ -import { ChainID } from 'core/chain'; +import { ChainID } from 'core/chain/interfaces/chain.interface'; export interface AssetData { id?: string; diff --git a/packages/core/tsup.config.cjs b/packages/core/tsup.config.cjs new file mode 100644 index 00000000..601e454b --- /dev/null +++ b/packages/core/tsup.config.cjs @@ -0,0 +1,16 @@ +const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + splitting: true, + dts: true, + shims: true, + types: ['./dist/index.d.ts'], + platform: 'browser', + target: 'ES6', + external: ['crypto', 'stream', '@cosmjs'], + plugins: [NodeModulesPolyfillPlugin()], + }, +}; diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 6e2b8b0e..10c63400 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -44,7 +44,7 @@ "ethers": "5.6.4", "lodash": "4.17.21", "os-browserify": "0.3.0", - "osmojs": "16.5.1", + "osmojs": "16.14.0", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", "rxjs": "7.8.0", diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 29da365c..2a9ba100 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -236,7 +236,7 @@ export class ChainDataSource extends DataSource { }, multi: void 0, }, - sequence: account.sequence.toString(), + sequence: BigInt(account.sequence), }), ], fee: Fee.fromPartial({ diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index 6fe0c826..a8df1b8d 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -202,7 +202,7 @@ export class IndexerDataSource extends DataSource { }, multi: void 0, }, - sequence: account.sequence.toString(), + sequence: BigInt(account.sequence), }), ], fee: Fee.fromPartial({ diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index 7aede5ac..feb8a0f9 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -6,11 +6,11 @@ import { import { AminoTypes } from '@cosmjs/stargate/build/aminotypes'; import { toUtf8 } from '@cosmjs/encoding'; import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; -import { Registry } from '@cosmjs/proto-signing'; +import { Registry } from '@cosmjs/proto-signing/build/registry'; import { osmosisProtoRegistry, osmosisAminoConverters, -} from 'osmojs/dist/codegen/osmosis/client'; +} from 'osmojs/osmosis/client'; import axios from 'axios'; import { COSMOS_MANIFESTS, CosmosHubChains } from './manifests'; diff --git a/packages/evm/package.json b/packages/evm/package.json index 914cb693..d4ea3ba1 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -23,10 +23,10 @@ "typescript": "4.8.3" }, "dependencies": { - "@ledgerhq/cryptoassets": "9.1.0", - "@ledgerhq/hw-app-eth": "6.35.4", - "@ledgerhq/hw-transport": "6.30.3", - "@ledgerhq/hw-transport-webhid": "6.28.3", + "@ledgerhq/cryptoassets": "13.0.0", + "@ledgerhq/hw-app-eth": "6.36.1", + "@ledgerhq/hw-transport": "6.30.6", + "@ledgerhq/hw-transport-webhid": "6.28.6", "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-graphql": "*", diff --git a/packages/solana/package.json b/packages/solana/package.json index 0f8dbb56..1a6d33d0 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -25,8 +25,8 @@ "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@metaplex-foundation/mpl-token-metadata": "2.13.0", - "@solana/spl-token": "0.3.8", - "@solana/web3.js": "1.78.5", + "@solana/spl-token": "0.4.6", + "@solana/web3.js": "1.91.8", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-graphql": "*", "bignumber.js": "9.1.2", diff --git a/yarn.lock b/yarn.lock index fd6db27e..f47f6510 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,7 +19,7 @@ "@agrozyme/types-tronweb@5.3.2": version "5.3.2" - resolved "https://registry.npmjs.org/@agrozyme/types-tronweb/-/types-tronweb-5.3.2.tgz" + resolved "https://registry.yarnpkg.com/@agrozyme/types-tronweb/-/types-tronweb-5.3.2.tgz#29e2fac8fd812873a9d1473a3ce4a02d46cfc5e8" integrity sha512-j02xjgxiHoKz779dea6Zf1zH/sDN2B0sCzb1drpW50KFPtAe3nPNN3h7ThLsMMmvZpLZgqqGiasw7YDnJOx7Zw== "@ampproject/remapping@^2.2.0": @@ -32,7 +32,7 @@ "@apollo/client@3.6.9": version "3.6.9" - resolved "https://registry.npmjs.org/@apollo/client/-/client-3.6.9.tgz" + resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.6.9.tgz#ad0ee2e3a3c92dbed4acd6917b6158a492739d94" integrity sha512-Y1yu8qa2YeaCUBVuw08x8NHenFi0sw2I3KCu7Kw9mDSu86HmmtHJkCAifKVrN2iPgDTW/BbP3EpSV8/EQCcxZA== dependencies: "@graphql-typed-document-node/core" "^3.1.1" @@ -93,11 +93,24 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" +"@babel/code-frame@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.6.tgz#ab88da19344445c3d8889af2216606d3329f3ef2" + integrity sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA== + dependencies: + "@babel/highlight" "^7.24.6" + picocolors "^1.0.0" + "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.3", "@babel/compat-data@^7.23.5": version "7.23.5" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz" integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== +"@babel/compat-data@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.6.tgz#b3600217688cabb26e25f8e467019e66d71b7ae2" + integrity sha512-aC2DGhBq5eEdyXWqrDInSqQjO0k8xtPRf5YylULqx8MCd6jBtzqfta/3ETMRpuKIc5hyswfO80ObyA1MvkCcUQ== + "@babel/core@7.21.8": version "7.21.8" resolved "https://registry.npmjs.org/@babel/core/-/core-7.21.8.tgz" @@ -119,7 +132,28 @@ json5 "^2.2.2" semver "^6.3.0" -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.13.16", "@babel/core@^7.14.0", "@babel/core@^7.20.0", "@babel/core@^7.7.2", "@babel/core@^7.8.0": +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.6.tgz#8650e0e4b03589ebe886c4e4a60398db0a7ec787" + integrity sha512-qAHSfAdVyFmIvl0VHELib8xar7ONuSHrE2hLnsaWkYNTI68dmi1x8GYDhJjMI/e7XWal9QBlZkwbOnkcw7Z8gQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.6" + "@babel/generator" "^7.24.6" + "@babel/helper-compilation-targets" "^7.24.6" + "@babel/helper-module-transforms" "^7.24.6" + "@babel/helpers" "^7.24.6" + "@babel/parser" "^7.24.6" + "@babel/template" "^7.24.6" + "@babel/traverse" "^7.24.6" + "@babel/types" "^7.24.6" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/core@^7.13.16", "@babel/core@^7.14.0", "@babel/core@^7.20.0": version "7.23.9" resolved "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz" integrity sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw== @@ -140,7 +174,7 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.14.0", "@babel/generator@^7.18.13", "@babel/generator@^7.20.0", "@babel/generator@^7.21.5", "@babel/generator@^7.23.6", "@babel/generator@^7.7.2": +"@babel/generator@^7.14.0", "@babel/generator@^7.18.13", "@babel/generator@^7.20.0", "@babel/generator@^7.21.5", "@babel/generator@^7.23.6": version "7.23.6" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz" integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== @@ -150,6 +184,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.24.6", "@babel/generator@^7.7.2": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.6.tgz#dfac82a228582a9d30c959fe50ad28951d4737a7" + integrity sha512-S7m4eNa6YAPJRHmKsLHIDJhNAGNKoWNiWefz1MBbpnt8g9lvMDl1hir4P9bo/57bQEmuwEhnRU/AMWsD0G/Fbg== + dependencies: + "@babel/types" "^7.24.6" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz" @@ -157,6 +201,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-annotate-as-pure@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.6.tgz#517af93abc77924f9b2514c407bbef527fb8938d" + integrity sha512-DitEzDfOMnd13kZnDqns1ccmftwJTS9DMkyn9pYTxulS7bZxUxpMly3Nf23QQ6NwA4UB8lAqjbqWtyvElEMAkg== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-builder-binary-assignment-operator-visitor@^7.22.15": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz" @@ -175,6 +226,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.6.tgz#4a51d681f7680043d38e212715e2a7b1ad29cb51" + integrity sha512-VZQ57UsDGlX/5fFA7GkVPplZhHsVc+vuErWgdOiysI9Ksnw0Pbbd6pnPiR/mmJyKHgyIW0c7KT32gmhiF+cirg== + dependencies: + "@babel/compat-data" "^7.24.6" + "@babel/helper-validator-option" "^7.24.6" + browserslist "^4.22.2" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0", "@babel/helper-create-class-features-plugin@^7.22.15", "@babel/helper-create-class-features-plugin@^7.23.6", "@babel/helper-create-class-features-plugin@^7.23.9": version "7.23.10" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.10.tgz" @@ -190,6 +252,21 @@ "@babel/helper-split-export-declaration" "^7.22.6" semver "^6.3.1" +"@babel/helper-create-class-features-plugin@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.6.tgz#c50b86fa1c4ca9b7a890dc21884f097b6c4b5286" + integrity sha512-djsosdPJVZE6Vsw3kk7IPRWethP94WHGOhQTc67SNXE0ZzMhHgALw8iGmYS0TD1bbMM0VDROy43od7/hN6WYcA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.24.6" + "@babel/helper-environment-visitor" "^7.24.6" + "@babel/helper-function-name" "^7.24.6" + "@babel/helper-member-expression-to-functions" "^7.24.6" + "@babel/helper-optimise-call-expression" "^7.24.6" + "@babel/helper-replace-supers" "^7.24.6" + "@babel/helper-skip-transparent-expression-wrappers" "^7.24.6" + "@babel/helper-split-export-declaration" "^7.24.6" + semver "^6.3.1" + "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz" @@ -227,6 +304,11 @@ resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== +"@babel/helper-environment-visitor@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.6.tgz#ac7ad5517821641550f6698dd5468f8cef78620d" + integrity sha512-Y50Cg3k0LKLMjxdPjIl40SdJgMB85iXn27Vk/qbHZCFx/o5XO3PSnpi675h1KEmmDb6OFArfd5SCQEQ5Q4H88g== + "@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz" @@ -235,6 +317,14 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" +"@babel/helper-function-name@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.24.6.tgz#cebdd063386fdb95d511d84b117e51fc68fec0c8" + integrity sha512-xpeLqeeRkbxhnYimfr2PC+iA0Q7ljX/d1eZ9/inYbmfG2jpl8Lu3DyXvpOAnrS5kxkfOWJjioIMQsaMBXFI05w== + dependencies: + "@babel/template" "^7.24.6" + "@babel/types" "^7.24.6" + "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz" @@ -242,6 +332,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-hoist-variables@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.6.tgz#8a7ece8c26756826b6ffcdd0e3cf65de275af7f9" + integrity sha512-SF/EMrC3OD7dSta1bLJIlrsVxwtd0UpjRJqLno6125epQMJ/kyFmpTT4pbvPbdQHzCHg+biQ7Syo8lnDtbR+uA== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.23.0": version "7.23.0" resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz" @@ -249,6 +346,13 @@ dependencies: "@babel/types" "^7.23.0" +"@babel/helper-member-expression-to-functions@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.6.tgz#86084f3e0e4e2169a134754df3870bc7784db71e" + integrity sha512-OTsCufZTxDUsv2/eDXanw/mUZHWOxSbEmC3pP8cgjcy5rgeVPWWMStnv274DV60JtHxTk0adT0QrCzC4M9NWGg== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.22.15": version "7.22.15" resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz" @@ -256,6 +360,13 @@ dependencies: "@babel/types" "^7.22.15" +"@babel/helper-module-imports@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.6.tgz#65e54ffceed6a268dc4ce11f0433b82cfff57852" + integrity sha512-a26dmxFJBF62rRO9mmpgrfTLsAuyHk4e1hKTUkD/fcMfynt8gvEKwQPQDVxWhca8dHoDck+55DFt42zV0QMw5g== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-module-transforms@^7.21.5", "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz" @@ -267,6 +378,17 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" +"@babel/helper-module-transforms@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.24.6.tgz#22346ed9df44ce84dee850d7433c5b73fab1fe4e" + integrity sha512-Y/YMPm83mV2HJTbX1Qh2sjgjqcacvOlhbzdCCsSlblOKjSYmQqEbO6rUniWQyRo9ncyfjT8hnUjlG06RXDEmcA== + dependencies: + "@babel/helper-environment-visitor" "^7.24.6" + "@babel/helper-module-imports" "^7.24.6" + "@babel/helper-simple-access" "^7.24.6" + "@babel/helper-split-export-declaration" "^7.24.6" + "@babel/helper-validator-identifier" "^7.24.6" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz" @@ -274,11 +396,23 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-optimise-call-expression@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.6.tgz#f7836e3ccca3dfa02f15d2bc8b794efe75a5256e" + integrity sha512-3SFDJRbx7KuPRl8XDUr8O7GAEB8iGyWPjLKJh/ywP/Iy9WOmEfMrsWbaZpvBu2HSYn4KQygIsz0O7m8y10ncMA== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.21.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz" integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== +"@babel/helper-plugin-utils@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.6.tgz#fa02a32410a15a6e8f8185bcbf608f10528d2a24" + integrity sha512-MZG/JcWfxybKwsA9N9PmtF2lOSFSEMVCpIRrbxccZFLJPrJciJdG/UhSh5W96GEteJI2ARqm5UAHxISwRDLSNg== + "@babel/helper-remap-async-to-generator@^7.18.9", "@babel/helper-remap-async-to-generator@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz" @@ -297,6 +431,15 @@ "@babel/helper-member-expression-to-functions" "^7.22.15" "@babel/helper-optimise-call-expression" "^7.22.5" +"@babel/helper-replace-supers@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.24.6.tgz#3ea87405a2986a49ab052d10e540fe036d747c71" + integrity sha512-mRhfPwDqDpba8o1F8ESxsEkJMQkUF8ZIWrAc0FtWhxnjfextxMWxr22RtFizxxSYLjVHDeMgVsRq8BBZR2ikJQ== + dependencies: + "@babel/helper-environment-visitor" "^7.24.6" + "@babel/helper-member-expression-to-functions" "^7.24.6" + "@babel/helper-optimise-call-expression" "^7.24.6" + "@babel/helper-simple-access@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz" @@ -304,6 +447,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-simple-access@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.6.tgz#1d6e04d468bba4fc963b4906f6dac6286cfedff1" + integrity sha512-nZzcMMD4ZhmB35MOOzQuiGO5RzL6tJbsT37Zx8M5L/i9KSrukGXWTjLe1knIbb/RmxoJE9GON9soq0c0VEMM5g== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz" @@ -311,6 +461,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-skip-transparent-expression-wrappers@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.6.tgz#c47e9b33b7ea50d1073e125ebc26661717cb7040" + integrity sha512-jhbbkK3IUKc4T43WadP96a27oYti9gEf1LdyGSP2rHGH77kwLwfhO7TgwnWvxxQVmke0ImmCSS47vcuxEMGD3Q== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-split-export-declaration@^7.18.6", "@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz" @@ -318,21 +475,43 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-split-export-declaration@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.6.tgz#e830068f7ba8861c53b7421c284da30ae656d7a3" + integrity sha512-CvLSkwXGWnYlF9+J3iZUvwgAxKiYzK3BWuo+mLzD/MDGOZDj7Gq8+hqaOkMxmJwmlv0iu86uH5fdADd9Hxkymw== + dependencies: + "@babel/types" "^7.24.6" + "@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz#28583c28b15f2a3339cfafafeaad42f9a0e828df" + integrity sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q== + "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz#08bb6612b11bdec78f3feed3db196da682454a5e" + integrity sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw== + "@babel/helper-validator-option@^7.21.0", "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== +"@babel/helper-validator-option@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.6.tgz#59d8e81c40b7d9109ab7e74457393442177f460a" + integrity sha512-Jktc8KkF3zIkePb48QO+IapbXlSapOW9S+ogZZkcO6bABgYAxtZcjZ/O005111YLf+j4M84uEgwYoidDkXbCkQ== + "@babel/helper-wrap-function@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz" @@ -351,6 +530,14 @@ "@babel/traverse" "^7.23.9" "@babel/types" "^7.23.9" +"@babel/helpers@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.6.tgz#cd124245299e494bd4e00edda0e4ea3545c2c176" + integrity sha512-V2PI+NqnyFu1i0GyTd/O/cTpxzQCYioSkUIRmgo7gFEHKKCg5w46+r/A6WeUR1+P3TeQ49dspGPNd/E3n9AnnA== + dependencies: + "@babel/template" "^7.24.6" + "@babel/types" "^7.24.6" + "@babel/highlight@^7.10.4", "@babel/highlight@^7.23.4": version "7.23.4" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz" @@ -360,7 +547,22 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.13.16", "@babel/parser@^7.14.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.8", "@babel/parser@^7.20.0", "@babel/parser@^7.20.7", "@babel/parser@^7.21.8", "@babel/parser@^7.23.9": +"@babel/highlight@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.6.tgz#6d610c1ebd2c6e061cade0153bf69b0590b7b3df" + integrity sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ== + dependencies: + "@babel/helper-validator-identifier" "^7.24.6" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.24.6": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.6.tgz#5e030f440c3c6c78d195528c3b688b101a365328" + integrity sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q== + +"@babel/parser@^7.13.16", "@babel/parser@^7.14.0", "@babel/parser@^7.16.8", "@babel/parser@^7.20.0", "@babel/parser@^7.21.8", "@babel/parser@^7.23.9": version "7.23.9" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz" integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== @@ -560,7 +762,7 @@ "@babel/plugin-syntax-bigint@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" @@ -712,13 +914,20 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.20.0", "@babel/plugin-syntax-typescript@^7.23.3", "@babel/plugin-syntax-typescript@^7.7.2": +"@babel/plugin-syntax-typescript@^7.20.0", "@babel/plugin-syntax-typescript@^7.23.3": version "7.23.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz" integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-typescript@^7.24.6", "@babel/plugin-syntax-typescript@^7.7.2": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.6.tgz#769daf2982d60308bc83d8936eaecb7582463c87" + integrity sha512-TzCtxGgVTEJWWwcYwQhCIQ6WaKlo80/B+Onsk4RRCcYqpYGFcG9etPW94VToGte5AAcxRrhjPUFvUS3Y2qKi4A== + dependencies: + "@babel/helper-plugin-utils" "^7.24.6" + "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz" @@ -1146,7 +1355,17 @@ "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-typescript" "^7.20.0" -"@babel/plugin-transform-typescript@^7.21.0", "@babel/plugin-transform-typescript@^7.23.3", "@babel/plugin-transform-typescript@^7.5.0": +"@babel/plugin-transform-typescript@^7.21.0": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.24.6.tgz#339c6127a783c32e28a5b591e6c666f899b57db0" + integrity sha512-H0i+hDLmaYYSt6KU9cZE0gb3Cbssa/oxWis7PX4ofQzbvsfix9Lbh8SRk7LCPDlLWJHUiFeHU0qRRpF/4Zv7mQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.24.6" + "@babel/helper-create-class-features-plugin" "^7.24.6" + "@babel/helper-plugin-utils" "^7.24.6" + "@babel/plugin-syntax-typescript" "^7.24.6" + +"@babel/plugin-transform-typescript@^7.23.3", "@babel/plugin-transform-typescript@^7.5.0": version "7.23.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.6.tgz" integrity sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA== @@ -1386,7 +1605,7 @@ "@babel/preset-typescript@7.21.0": version "7.21.0" - resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.21.0.tgz" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.21.0.tgz#bcbbca513e8213691fe5d4b23d9251e01f00ebff" integrity sha512-myc9mpoVA5m1rF8K8DgLEatOYFDpwC+RkMkjZ0Du6uI62YvDe8uxIEYVs/VCdSJ097nlALiU/yBC7//3nI+hNg== dependencies: "@babel/helper-plugin-utils" "^7.20.2" @@ -1427,21 +1646,21 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.1", "@babel/runtime@^7.20.13", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.6", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.4", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.1", "@babel/runtime@^7.20.13", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.4", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.23.9" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz" integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw== dependencies: regenerator-runtime "^0.14.0" -"@babel/runtime@^7.25.0": +"@babel/runtime@^7.23.2", "@babel/runtime@^7.24.5", "@babel/runtime@^7.25.0": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" integrity sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ== dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.0.0", "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.23.9", "@babel/template@^7.3.3": +"@babel/template@^7.0.0", "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.23.9": version "7.23.9" resolved "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz" integrity sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA== @@ -1450,7 +1669,16 @@ "@babel/parser" "^7.23.9" "@babel/types" "^7.23.9" -"@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.20.0", "@babel/traverse@^7.21.5", "@babel/traverse@^7.23.9", "@babel/traverse@^7.7.2": +"@babel/template@^7.24.6", "@babel/template@^7.3.3": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.6.tgz#048c347b2787a6072b24c723664c8d02b67a44f9" + integrity sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw== + dependencies: + "@babel/code-frame" "^7.24.6" + "@babel/parser" "^7.24.6" + "@babel/types" "^7.24.6" + +"@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.20.0", "@babel/traverse@^7.21.5", "@babel/traverse@^7.23.9": version "7.23.9" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz" integrity sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg== @@ -1466,7 +1694,23 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.8", "@babel/types@^7.18.13", "@babel/types@^7.20.0", "@babel/types@^7.20.7", "@babel/types@^7.21.5", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.4", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/traverse@^7.24.6", "@babel/traverse@^7.7.2": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.6.tgz#0941ec50cdeaeacad0911eb67ae227a4f8424edc" + integrity sha512-OsNjaJwT9Zn8ozxcfoBc+RaHdj3gFmCmYoQLUII1o6ZrUwku0BMg80FoOTPx+Gi6XhcQxAYE4xyjPTo4SxEQqw== + dependencies: + "@babel/code-frame" "^7.24.6" + "@babel/generator" "^7.24.6" + "@babel/helper-environment-visitor" "^7.24.6" + "@babel/helper-function-name" "^7.24.6" + "@babel/helper-hoist-variables" "^7.24.6" + "@babel/helper-split-export-declaration" "^7.24.6" + "@babel/parser" "^7.24.6" + "@babel/types" "^7.24.6" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.16.8", "@babel/types@^7.18.13", "@babel/types@^7.20.0", "@babel/types@^7.21.5", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.4", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.4.4": version "7.23.9" resolved "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz" integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== @@ -1475,15 +1719,24 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.20.7", "@babel/types@^7.24.6", "@babel/types@^7.3.3": + version "7.24.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.6.tgz#ba4e1f59870c10dc2fa95a274ac4feec23b21912" + integrity sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ== + dependencies: + "@babel/helper-string-parser" "^7.24.6" + "@babel/helper-validator-identifier" "^7.24.6" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" - resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@binance-chain/javascript-sdk@4.2.1": - version "4.2.1" - resolved "https://registry.npmjs.org/@binance-chain/javascript-sdk/-/javascript-sdk-4.2.1.tgz" - integrity sha512-Vr0WkX3DQ1kmIBJvT0tfnIbFgYTd3x00Keb/7ojDGJn//zwL3Nyt2psOlwZWT2zcRg8L01Bq/qxPmUl7oGa7iQ== +"@binance-chain/javascript-sdk@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@binance-chain/javascript-sdk/-/javascript-sdk-4.2.2.tgz#912f3c5e8fa88f63eba00e4519901fb5ca0669ee" + integrity sha512-WLYdnlLWzyAVOTO7oqBlrgh5MOlVBsNHqCh8rGkearxEKb1Q7YC7M2+u1dWO1s1UGA8TlhH16shaqhL+DhvYzA== dependencies: "@babel/runtime" "^7.10.4" "@ledgerhq/hw-transport-u2f" "^5.9.0" @@ -1508,7 +1761,7 @@ bn.js "^4.11.8" camelcase "^5.3.1" crypto-browserify "^3.12.0" - crypto-js "^3.1.9-1" + crypto-js "^4.2.0" elliptic "^6.5.4" eslint-utils "^1.4.2" events "^3.0.0" @@ -1744,16 +1997,6 @@ "@cosmjs/math" "0.27.1" "@cosmjs/utils" "0.27.1" -"@cosmjs/amino@0.29.3": - version "0.29.3" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.29.3.tgz#5aa338a301ea970a93e15522706615efea507c10" - integrity sha512-BFz1++ERerIggiFc7iGHhGe1CeV3rCv8BvkoBQTBN/ZwzHOaKvqQj8smDlRGlQxX3HWlTwgiLN2A+OB5yX4ZRw== - dependencies: - "@cosmjs/crypto" "^0.29.3" - "@cosmjs/encoding" "^0.29.3" - "@cosmjs/math" "^0.29.3" - "@cosmjs/utils" "^0.29.3" - "@cosmjs/amino@0.32.3", "@cosmjs/amino@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff" @@ -1764,16 +2007,6 @@ "@cosmjs/math" "^0.32.3" "@cosmjs/utils" "^0.32.3" -"@cosmjs/amino@^0.29.3", "@cosmjs/amino@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.29.5.tgz#053b4739a90b15b9e2b781ccd484faf64bd49aec" - integrity sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw== - dependencies: - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - "@cosmjs/crypto@0.27.1": version "0.27.1" resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz" @@ -1790,19 +2023,6 @@ ripemd160 "^2.0.2" sha.js "^2.4.11" -"@cosmjs/crypto@^0.29.3", "@cosmjs/crypto@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.29.5.tgz#ab99fc382b93d8a8db075780cf07487a0f9519fd" - integrity sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ== - dependencies: - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - "@noble/hashes" "^1" - bn.js "^5.2.0" - elliptic "^6.5.4" - libsodium-wrappers "^0.7.6" - "@cosmjs/crypto@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.3.tgz#787f8e659709678722068ee1ddf379f65051a25e" @@ -1834,23 +2054,6 @@ bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/encoding@^0.29.3", "@cosmjs/encoding@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.29.5.tgz#009a4b1c596cdfd326f30ccfa79f5e56daa264f2" - integrity sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - -"@cosmjs/json-rpc@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.29.5.tgz#5e483a9bd98a6270f935adf0dfd8a1e7eb777fe4" - integrity sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w== - dependencies: - "@cosmjs/stream" "^0.29.5" - xstream "^11.14.0" - "@cosmjs/json-rpc@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.3.tgz#ccffdd7f722cecfab6daaa7463843b92f5d25355" @@ -1892,13 +2095,6 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/math@^0.29.3", "@cosmjs/math@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.29.5.tgz#722c96e080d6c2b62215ce9f4c70da7625b241b6" - integrity sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q== - dependencies: - bn.js "^5.2.0" - "@cosmjs/math@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9" @@ -1906,19 +2102,6 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@0.29.3": - version "0.29.3" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.29.3.tgz#fa5ed609ed2a0007d8d5eacbeb1f5a89ba1b77ff" - integrity sha512-Ai3l9THjMOrLJ4Ebn1Dgptwg6W5ZIRJqtnJjijHhGwTVC1WT0WdYU3aMZ7+PwubcA/cA1rH4ZTK7jrfYbra63g== - dependencies: - "@cosmjs/amino" "^0.29.3" - "@cosmjs/crypto" "^0.29.3" - "@cosmjs/encoding" "^0.29.3" - "@cosmjs/math" "^0.29.3" - "@cosmjs/utils" "^0.29.3" - cosmjs-types "^0.5.2" - long "^4.0.0" - "@cosmjs/proto-signing@0.32.3", "@cosmjs/proto-signing@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d" @@ -1931,29 +2114,6 @@ "@cosmjs/utils" "^0.32.3" cosmjs-types "^0.9.0" -"@cosmjs/proto-signing@^0.29.3": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz#af3b62a46c2c2f1d2327d678b13b7262db1fe87c" - integrity sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA== - dependencies: - "@cosmjs/amino" "^0.29.5" - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - cosmjs-types "^0.5.2" - long "^4.0.0" - -"@cosmjs/socket@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.29.5.tgz#a48df6b4c45dc6a6ef8e47232725dd4aa556ac2d" - integrity sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ== - dependencies: - "@cosmjs/stream" "^0.29.5" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" - "@cosmjs/socket@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.3.tgz#fa5c36bf58e87c0ad865d6318ecb0f8d9c89a28a" @@ -1964,24 +2124,6 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.29.3": - version "0.29.3" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.29.3.tgz#9bd303bfd32a7399a233e662864e7cc32e2607af" - integrity sha512-455TgXStCi6E8KDjnhDAM8wt6aLSjobH4Dixvd7Up1DfCH6UB9NkC/G0fMJANNcNXMaM4wSX14niTXwD1d31BA== - dependencies: - "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.29.3" - "@cosmjs/encoding" "^0.29.3" - "@cosmjs/math" "^0.29.3" - "@cosmjs/proto-signing" "^0.29.3" - "@cosmjs/stream" "^0.29.3" - "@cosmjs/tendermint-rpc" "^0.29.3" - "@cosmjs/utils" "^0.29.3" - cosmjs-types "^0.5.2" - long "^4.0.0" - protobufjs "~6.11.3" - xstream "^11.14.0" - "@cosmjs/stargate@0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.3.tgz#5a92b222ada960ebecea72cc9f366370763f4b66" @@ -1998,13 +2140,6 @@ cosmjs-types "^0.9.0" xstream "^11.14.0" -"@cosmjs/stream@^0.29.3", "@cosmjs/stream@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.29.5.tgz#350981cac496d04939b92ee793b9b19f44bc1d4e" - integrity sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA== - dependencies: - xstream "^11.14.0" - "@cosmjs/stream@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.3.tgz#7522579aaf18025d322c2f33d6fb7573220395d6" @@ -2028,44 +2163,22 @@ readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/tendermint-rpc@^0.29.3": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz#f205c10464212bdf843f91bb2e4a093b618cb5c2" - integrity sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w== - dependencies: - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/json-rpc" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/socket" "^0.29.5" - "@cosmjs/stream" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - axios "^0.21.2" - readonly-date "^1.0.0" - xstream "^11.14.0" - "@cosmjs/utils@0.27.1": version "0.27.1" resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz" integrity sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg== -"@cosmjs/utils@^0.29.3", "@cosmjs/utils@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.29.5.tgz#3fed1b3528ae8c5f1eb5d29b68755bebfd3294ee" - integrity sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ== - "@cosmjs/utils@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg== -"@cosmology/lcd@^0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@cosmology/lcd/-/lcd-0.12.0.tgz#a6594fc00a8c84c7341e90840627e62a7e63fd1b" - integrity sha512-f2mcySYO1xdislAhuWtNFmg4q/bzY3Aem2UkDzYzI0ZELVev5i2Pi0bQrYUNTeNg1isAo0Kyrdqj/4YPqEwjGA== +"@cosmology/lcd@^0.13.3": + version "0.13.3" + resolved "https://registry.yarnpkg.com/@cosmology/lcd/-/lcd-0.13.3.tgz#4072178cfe979b948ab596c9378b56c4f320d192" + integrity sha512-lihAHCoap0GN/32qcOhiMp6HcoZP8A7GeScZMlmmvBtBk6ocGAStNHjvBR4MayrvyHSCOZCvCAWPh36iFTT8Sw== dependencies: - "@babel/runtime" "^7.21.0" - axios "0.27.2" + axios "1.6.0" "@cosmos-client/core@0.47.1": version "0.47.1" @@ -2208,7 +2321,7 @@ "@esbuild-plugins/node-modules-polyfill@0.2.2": version "0.2.2" - resolved "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz" + resolved "https://registry.yarnpkg.com/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz#cefa3dc0bd1c16277a8338b52833420c94987327" integrity sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA== dependencies: escape-string-regexp "^4.0.0" @@ -2231,7 +2344,7 @@ "@esbuild/darwin-arm64@0.17.19": version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== "@esbuild/darwin-x64@0.17.19": @@ -2326,7 +2439,7 @@ "@eslint/eslintrc@^1.2.1", "@eslint/eslintrc@^1.3.2": version "1.4.1" - resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== dependencies: ajv "^6.12.4" @@ -3399,7 +3512,7 @@ "@graphql-codegen/add@^4.0.1": version "4.0.1" - resolved "https://registry.npmjs.org/@graphql-codegen/add/-/add-4.0.1.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/add/-/add-4.0.1.tgz#c187af820fdd2fc7a9c1c2453bc389cd4e16699e" integrity sha512-A7k+9eRfrKyyNfhWEN/0eKz09R5cp4XXxUuNLQAVm/aohmVI2xdMV4lM02rTlM6Pyou3cU/v0iZnhgo6IRpqeg== dependencies: "@graphql-codegen/plugin-helpers" "^4.1.0" @@ -3407,7 +3520,7 @@ "@graphql-codegen/cli@3.2.2": version "3.2.2" - resolved "https://registry.npmjs.org/@graphql-codegen/cli/-/cli-3.2.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-3.2.2.tgz#1a94bc1ff9cfb7d618859336017d523689ab7d15" integrity sha512-u+dm/SW1heLnUL4Tyf5Uv0AxOFhTCmUPHKwRLq2yE8MPhv7+Ti4vxxUP/XGoaMNRuHlN37wLI7tpFLV1Hhm22Q== dependencies: "@babel/generator" "^7.18.13" @@ -3448,7 +3561,7 @@ "@graphql-codegen/client-preset@2.1.1": version "2.1.1" - resolved "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-2.1.1.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/client-preset/-/client-preset-2.1.1.tgz#acf065d9520cde7e34ad0a9adada615e7502b884" integrity sha512-yDFiO2CimwjkH/YE5nwRcLkXoAVz31NC+WWvFQdyrR1UKQqe2tqV/bKLUifnSbBGS238ajHJ6AEzVlzIvI8OYQ== dependencies: "@babel/helper-plugin-utils" "^7.20.2" @@ -3467,7 +3580,7 @@ "@graphql-codegen/core@^3.1.0": version "3.1.0" - resolved "https://registry.npmjs.org/@graphql-codegen/core/-/core-3.1.0.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-3.1.0.tgz#ad859d52d509a4eb2ebe5aabba6543a628fb181b" integrity sha512-DH1/yaR7oJE6/B+c6ZF2Tbdh7LixF1K8L+8BoSubjNyQ8pNwR4a70mvc1sv6H7qgp6y1bPQ9tKE+aazRRshysw== dependencies: "@graphql-codegen/plugin-helpers" "^4.1.0" @@ -3477,7 +3590,7 @@ "@graphql-codegen/gql-tag-operations@2.0.2": version "2.0.2" - resolved "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-2.0.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-2.0.2.tgz#6fb693ede76d9ac67c1d7755aa0fc01c42b2be82" integrity sha512-FB4/Q0xP/lIjwnlxdeGAfGFAiL7AhzIJB9keNrosd4Xe9r8V8NuZ0+0/hGc7KdzHhojYF/ycmJD7V2JLWaf23Q== dependencies: "@graphql-codegen/plugin-helpers" "^4.1.0" @@ -3488,7 +3601,7 @@ "@graphql-codegen/named-operations-object@2.3.1": version "2.3.1" - resolved "https://registry.npmjs.org/@graphql-codegen/named-operations-object/-/named-operations-object-2.3.1.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/named-operations-object/-/named-operations-object-2.3.1.tgz#9553c94c4c97b3de306c3c6c4c6713157227f299" integrity sha512-RVjt+1CbVzFUsWerWZaywkYJexeccwDYtPotnZODCem7fTkdBbto6q82jhXRMbsknnjRx/yeFlVkaG9PqrBZZw== dependencies: "@graphql-codegen/plugin-helpers" "^2.6.2" @@ -3497,7 +3610,7 @@ "@graphql-codegen/near-operation-file-preset@2.5.0": version "2.5.0" - resolved "https://registry.npmjs.org/@graphql-codegen/near-operation-file-preset/-/near-operation-file-preset-2.5.0.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/near-operation-file-preset/-/near-operation-file-preset-2.5.0.tgz#987d9bb8d0101e944b9afc406b77d098a4c1e978" integrity sha512-S9PNJP5tTkUWBQ6inbviOsTREzsMxYVqJGrtPcIdMWkKLZAAItAfAb60klB1T64vt6Oru+nUf8IYUNrchJ8MYg== dependencies: "@graphql-codegen/add" "^3.2.1" @@ -3521,7 +3634,7 @@ "@graphql-codegen/plugin-helpers@^3.1.1": version "3.1.2" - resolved "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-3.1.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-3.1.2.tgz#69a2e91178f478ea6849846ade0a59a844d34389" integrity sha512-emOQiHyIliVOIjKVKdsI5MXj312zmRDwmHpyUTZMjfpvxq/UVAHUJIVdVf+lnjjrI+LXBTgMlTWTgHQfmICxjg== dependencies: "@graphql-tools/utils" "^9.0.0" @@ -3533,7 +3646,7 @@ "@graphql-codegen/plugin-helpers@^4.1.0", "@graphql-codegen/plugin-helpers@^4.2.0": version "4.2.0" - resolved "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-4.2.0.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-4.2.0.tgz#8324914d0f99162a223cfa01796cdd6be972d2ae" integrity sha512-THFTCfg+46PXlXobYJ/OoCX6pzjI+9woQqCjdyKtgoI0tn3Xq2HUUCiidndxUpEYVrXb5pRiRXb7b/ZbMQqD0A== dependencies: "@graphql-tools/utils" "^9.0.0" @@ -3545,7 +3658,7 @@ "@graphql-codegen/schema-ast@^3.0.1": version "3.0.1" - resolved "https://registry.npmjs.org/@graphql-codegen/schema-ast/-/schema-ast-3.0.1.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/schema-ast/-/schema-ast-3.0.1.tgz#37b458bb57b95715a9eb4259341c856dae2a461d" integrity sha512-rTKTi4XiW4QFZnrEqetpiYEWVsOFNoiR/v3rY9mFSttXFbIwNXPme32EspTiGWmEEdHY8UuTDtZN3vEcs/31zw== dependencies: "@graphql-codegen/plugin-helpers" "^4.1.0" @@ -3554,7 +3667,7 @@ "@graphql-codegen/typed-document-node@^3.0.2": version "3.0.2" - resolved "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-3.0.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typed-document-node/-/typed-document-node-3.0.2.tgz#afdf039c38f1b02a946854b6f487af764429eec8" integrity sha512-RqX46y0GoMAcCfXjkUabOWpeSQ7tazpS5WyzWJNakpzXxNACx8NACaghU8zTEM+gjqtIp6YbFY/S92HQ34HbRQ== dependencies: "@graphql-codegen/plugin-helpers" "^4.1.0" @@ -3565,7 +3678,7 @@ "@graphql-codegen/typescript-document-nodes@3.0.2": version "3.0.2" - resolved "https://registry.npmjs.org/@graphql-codegen/typescript-document-nodes/-/typescript-document-nodes-3.0.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-document-nodes/-/typescript-document-nodes-3.0.2.tgz#5788177c31ddd3ba25925097165f55261f63ce5f" integrity sha512-zNVPkHjlM1zQvLUwu2OpU3CrzYGPfUuySG7IyE1BDyVWLSKIK0k7IdINUfK4ZqeMBP1Hrhnsc/izfZI6ksIMjA== dependencies: "@graphql-codegen/plugin-helpers" "^4.1.0" @@ -3575,7 +3688,7 @@ "@graphql-codegen/typescript-operations@^3.0.2": version "3.0.4" - resolved "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-3.0.4.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-3.0.4.tgz#60163c07f0ef73655779ece450d02c1172c44027" integrity sha512-6yE2OL2+WJ1vd5MwFEGXpaxsFGzjAGUytPVHDML3Bi3TwP1F3lnQlIko4untwvHW0JhZEGQ7Ck30H9HjcxpdKA== dependencies: "@graphql-codegen/plugin-helpers" "^4.2.0" @@ -3586,7 +3699,7 @@ "@graphql-codegen/typescript@^3.0.2", "@graphql-codegen/typescript@^3.0.4": version "3.0.4" - resolved "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-3.0.4.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-3.0.4.tgz#e12dc106a2722ebc7d18556980ccf47fa9d0805f" integrity sha512-x4O47447DZrWNtE/l5CU9QzzW4m1RbmCEdijlA3s2flG/y1Ckqdemob4CWfilSm5/tZ3w1junVDY616RDTSvZw== dependencies: "@graphql-codegen/plugin-helpers" "^4.2.0" @@ -3613,7 +3726,7 @@ "@graphql-codegen/visitor-plugin-common@3.0.2": version "3.0.2" - resolved "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-3.0.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-3.0.2.tgz#784c0faaa7e0773072ea5de464fdcae8d7765564" integrity sha512-dKblRFrB0Fdl3+nPlzlLBka+TN/EGwr/q09mwry0H58z3j6gXkMbsdPr+dc8MhgOV7w/8egRvSPIvd7m6eFCnw== dependencies: "@graphql-codegen/plugin-helpers" "^4.1.0" @@ -3629,7 +3742,7 @@ "@graphql-codegen/visitor-plugin-common@3.1.1", "@graphql-codegen/visitor-plugin-common@^3.0.2": version "3.1.1" - resolved "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-3.1.1.tgz" + resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-3.1.1.tgz#50c2aa3c537a805ce68d2f115d0a9811b151428c" integrity sha512-uAfp+zu/009R3HUAuTK2AamR1bxIltM6rrYYI6EXSmkM3rFtFsLTuJhjUDj98HcUCszJZrADppz8KKLGRUVlNg== dependencies: "@graphql-codegen/plugin-helpers" "^4.2.0" @@ -3645,7 +3758,7 @@ "@graphql-tools/apollo-engine-loader@^7.3.6": version "7.3.26" - resolved "https://registry.npmjs.org/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-7.3.26.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-7.3.26.tgz#91e54460d5579933e42a2010b8688c3459c245d8" integrity sha512-h1vfhdJFjnCYn9b5EY1Z91JTF0KB3hHVJNQIsiUV2mpQXZdeOXQoaWeYEKaiI5R6kwBw5PP9B0fv3jfUIG8LyQ== dependencies: "@ardatan/sync-fetch" "^0.0.1" @@ -3655,7 +3768,7 @@ "@graphql-tools/batch-execute@^8.5.22": version "8.5.22" - resolved "https://registry.npmjs.org/@graphql-tools/batch-execute/-/batch-execute-8.5.22.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.5.22.tgz#a742aa9d138fe794e786d8fb6429665dc7df5455" integrity sha512-hcV1JaY6NJQFQEwCKrYhpfLK8frSXDbtNMoTur98u10Cmecy1zrqNKSqhEyGetpgHxaJRqszGzKeI3RuroDN6A== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3665,7 +3778,7 @@ "@graphql-tools/code-file-loader@^7.3.17": version "7.3.23" - resolved "https://registry.npmjs.org/@graphql-tools/code-file-loader/-/code-file-loader-7.3.23.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-7.3.23.tgz#33793f9a1f8e74981f8ae6ec4ab7061f9713db15" integrity sha512-8Wt1rTtyTEs0p47uzsPJ1vAtfAx0jmxPifiNdmo9EOCuUPyQGEbMaik/YkqZ7QUFIEYEQu+Vgfo8tElwOPtx5Q== dependencies: "@graphql-tools/graphql-tag-pluck" "7.5.2" @@ -3676,7 +3789,7 @@ "@graphql-tools/delegate@^9.0.31": version "9.0.35" - resolved "https://registry.npmjs.org/@graphql-tools/delegate/-/delegate-9.0.35.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-9.0.35.tgz#94683f4bcec63520b4a6c8b2abf2e2e9324ea4f1" integrity sha512-jwPu8NJbzRRMqi4Vp/5QX1vIUeUPpWmlQpOkXQD2r1X45YsVceyUUBnktCrlJlDB4jPRVy7JQGwmYo3KFiOBMA== dependencies: "@graphql-tools/batch-execute" "^8.5.22" @@ -3689,7 +3802,7 @@ "@graphql-tools/documents@^0.1.0": version "0.1.0" - resolved "https://registry.npmjs.org/@graphql-tools/documents/-/documents-0.1.0.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/documents/-/documents-0.1.0.tgz#9c27faea5a17ab271dbd99edd8d52eee0e43573e" integrity sha512-1WQeovHv5S1M3xMzQxbSrG3yl6QOnsq2JUBnlg5/0aMM5R4GNMx6Ms+ROByez/dnuA81kstRuSK+2qpe+GaRIw== dependencies: lodash.sortby "^4.7.0" @@ -3697,7 +3810,7 @@ "@graphql-tools/executor-graphql-ws@^0.0.14": version "0.0.14" - resolved "https://registry.npmjs.org/@graphql-tools/executor-graphql-ws/-/executor-graphql-ws-0.0.14.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor-graphql-ws/-/executor-graphql-ws-0.0.14.tgz#e0f53fc4cfc8a06cc461b2bc1edb4bb9a8e837ed" integrity sha512-P2nlkAsPZKLIXImFhj0YTtny5NQVGSsKnhi7PzXiaHSXc6KkzqbWZHKvikD4PObanqg+7IO58rKFpGXP7eeO+w== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3710,7 +3823,7 @@ "@graphql-tools/executor-http@^0.1.7", "@graphql-tools/executor-http@^0.1.9": version "0.1.10" - resolved "https://registry.npmjs.org/@graphql-tools/executor-http/-/executor-http-0.1.10.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor-http/-/executor-http-0.1.10.tgz#faf48e18e62a925796c9653c2f50cf2095bc8e6f" integrity sha512-hnAfbKv0/lb9s31LhWzawQ5hghBfHS+gYWtqxME6Rl0Aufq9GltiiLBcl7OVVOnkLF0KhwgbYP1mB5VKmgTGpg== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3724,7 +3837,7 @@ "@graphql-tools/executor-legacy-ws@^0.0.11": version "0.0.11" - resolved "https://registry.npmjs.org/@graphql-tools/executor-legacy-ws/-/executor-legacy-ws-0.0.11.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor-legacy-ws/-/executor-legacy-ws-0.0.11.tgz#a1e12be8279e92a363a23d4105461a34cd9e389e" integrity sha512-4ai+NnxlNfvIQ4c70hWFvOZlSUN8lt7yc+ZsrwtNFbFPH/EroIzFMapAxM9zwyv9bH38AdO3TQxZ5zNxgBdvUw== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3735,7 +3848,7 @@ "@graphql-tools/executor@^0.0.20": version "0.0.20" - resolved "https://registry.npmjs.org/@graphql-tools/executor/-/executor-0.0.20.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-0.0.20.tgz#d51d159696e839522dd49d936636af251670e425" integrity sha512-GdvNc4vszmfeGvUqlcaH1FjBoguvMYzxAfT6tDd4/LgwymepHhinqLNA5otqwVLW+JETcDaK7xGENzFomuE6TA== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3746,7 +3859,7 @@ "@graphql-tools/git-loader@^7.2.13": version "7.3.0" - resolved "https://registry.npmjs.org/@graphql-tools/git-loader/-/git-loader-7.3.0.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-7.3.0.tgz#ca10c17d4f58c4592432d9d2ac1c2b393aebad16" integrity sha512-gcGAK+u16eHkwsMYqqghZbmDquh8QaO24Scsxq+cVR+vx1ekRlsEiXvu+yXVDbZdcJ6PBIbeLcQbEu+xhDLmvQ== dependencies: "@graphql-tools/graphql-tag-pluck" "7.5.2" @@ -3758,7 +3871,7 @@ "@graphql-tools/github-loader@^7.3.20": version "7.3.28" - resolved "https://registry.npmjs.org/@graphql-tools/github-loader/-/github-loader-7.3.28.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/github-loader/-/github-loader-7.3.28.tgz#a7166b136e8442bd8b3ab943ad3b66c84bcabfcf" integrity sha512-OK92Lf9pmxPQvjUNv05b3tnVhw0JRfPqOf15jZjyQ8BfdEUrJoP32b4dRQQem/wyRL24KY4wOfArJNqzpsbwCA== dependencies: "@ardatan/sync-fetch" "^0.0.1" @@ -3771,7 +3884,7 @@ "@graphql-tools/graphql-file-loader@^7.3.7", "@graphql-tools/graphql-file-loader@^7.5.0": version "7.5.17" - resolved "https://registry.npmjs.org/@graphql-tools/graphql-file-loader/-/graphql-file-loader-7.5.17.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-file-loader/-/graphql-file-loader-7.5.17.tgz#7c281617ea3ab4db4d42a2bdb49850f2b937f0f9" integrity sha512-hVwwxPf41zOYgm4gdaZILCYnKB9Zap7Ys9OhY1hbwuAuC4MMNY9GpUjoTU3CQc3zUiPoYStyRtUGkHSJZ3HxBw== dependencies: "@graphql-tools/import" "6.7.18" @@ -3782,7 +3895,7 @@ "@graphql-tools/graphql-tag-pluck@7.5.2", "@graphql-tools/graphql-tag-pluck@^7.4.6": version "7.5.2" - resolved "https://registry.npmjs.org/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-7.5.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-7.5.2.tgz#502f1e066e19d832ebdeba5f571d7636dc27572d" integrity sha512-RW+H8FqOOLQw0BPXaahYepVSRjuOHw+7IL8Opaa5G5uYGOBxoXR7DceyQ7BcpMgktAOOmpDNQ2WtcboChOJSRA== dependencies: "@babel/parser" "^7.16.8" @@ -3794,7 +3907,7 @@ "@graphql-tools/import@6.7.18": version "6.7.18" - resolved "https://registry.npmjs.org/@graphql-tools/import/-/import-6.7.18.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-6.7.18.tgz#ad092d8a4546bb6ffc3e871e499eec7ac368680b" integrity sha512-XQDdyZTp+FYmT7as3xRWH/x8dx0QZA2WZqfMF5EWb36a0PiH7WwlRQYIdyYXj8YCLpiWkeBXgBRHmMnwEYR8iQ== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3803,7 +3916,7 @@ "@graphql-tools/json-file-loader@^7.3.7", "@graphql-tools/json-file-loader@^7.4.1": version "7.4.18" - resolved "https://registry.npmjs.org/@graphql-tools/json-file-loader/-/json-file-loader-7.4.18.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/json-file-loader/-/json-file-loader-7.4.18.tgz#d78ae40979bde51cfc59717757354afc9e35fba2" integrity sha512-AJ1b6Y1wiVgkwsxT5dELXhIVUPs/u3VZ8/0/oOtpcoyO/vAeM5rOvvWegzicOOnQw8G45fgBRMkkRfeuwVt6+w== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3813,7 +3926,7 @@ "@graphql-tools/load@^7.5.5", "@graphql-tools/load@^7.8.0": version "7.8.14" - resolved "https://registry.npmjs.org/@graphql-tools/load/-/load-7.8.14.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/load/-/load-7.8.14.tgz#f2356f9a5f658a42e33934ae036e4b2cadf2d1e9" integrity sha512-ASQvP+snHMYm+FhIaLxxFgVdRaM0vrN9wW2BKInQpktwWTXVyk+yP5nQUCEGmn0RTdlPKrffBaigxepkEAJPrg== dependencies: "@graphql-tools/schema" "^9.0.18" @@ -3823,7 +3936,7 @@ "@graphql-tools/merge@^8.2.6", "@graphql-tools/merge@^8.4.1": version "8.4.2" - resolved "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.4.2.tgz#95778bbe26b635e8d2f60ce9856b388f11fe8288" integrity sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw== dependencies: "@graphql-tools/utils" "^9.2.1" @@ -3838,7 +3951,7 @@ "@graphql-tools/prisma-loader@^7.2.49": version "7.2.72" - resolved "https://registry.npmjs.org/@graphql-tools/prisma-loader/-/prisma-loader-7.2.72.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-7.2.72.tgz#6304fc23600458396f3ede713d8e2371df7850e3" integrity sha512-0a7uV7Fky6yDqd0tI9+XMuvgIo6GAqiVzzzFV4OSLry4AwiQlI3igYseBV7ZVOGhedOTqj/URxjpiv07hRcwag== dependencies: "@graphql-tools/url-loader" "^7.17.18" @@ -3871,7 +3984,7 @@ "@graphql-tools/schema@^9.0.0", "@graphql-tools/schema@^9.0.18", "@graphql-tools/schema@^9.0.19": version "9.0.19" - resolved "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-9.0.19.tgz#c4ad373b5e1b8a0cf365163435b7d236ebdd06e7" integrity sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w== dependencies: "@graphql-tools/merge" "^8.4.1" @@ -3881,7 +3994,7 @@ "@graphql-tools/url-loader@^7.13.2", "@graphql-tools/url-loader@^7.17.18", "@graphql-tools/url-loader@^7.9.7": version "7.17.18" - resolved "https://registry.npmjs.org/@graphql-tools/url-loader/-/url-loader-7.17.18.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-7.17.18.tgz#3e253594d23483e4c0dd3a4c3dd2ad5cd0141192" integrity sha512-ear0CiyTj04jCVAxi7TvgbnGDIN2HgqzXzwsfcqiVg9cvjT40NcMlZ2P1lZDgqMkZ9oyLTV8Bw6j+SyG6A+xPw== dependencies: "@ardatan/sync-fetch" "^0.0.1" @@ -3915,7 +4028,7 @@ "@graphql-tools/wrap@^9.4.2": version "9.4.2" - resolved "https://registry.npmjs.org/@graphql-tools/wrap/-/wrap-9.4.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-9.4.2.tgz#30835587c4c73be1780908a7cb077d8013aa2703" integrity sha512-DFcd9r51lmcEKn0JW43CWkkI2D6T9XI1juW/Yo86i04v43O9w2/k4/nx2XTJv4Yv+iXwUw7Ok81PGltwGJSDSA== dependencies: "@graphql-tools/delegate" "^9.0.31" @@ -3926,7 +4039,7 @@ "@graphql-typed-document-node/core@3.1.2": version "3.1.2" - resolved "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.2.tgz" + resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.2.tgz#6fc464307cbe3c8ca5064549b806360d84457b04" integrity sha512-9anpBMM9mEgZN4wr2v8wHJI2/u5TnnggewRN6OlvXTTnuVyoY19X6rOv9XTqKRw6dcGKwZsBi8n0kDE2I5i4VA== "@graphql-typed-document-node/core@3.2.0", "@graphql-typed-document-node/core@^3.1.0", "@graphql-typed-document-node/core@^3.1.1", "@graphql-typed-document-node/core@^3.2.0": @@ -3948,7 +4061,7 @@ "@humanwhocodes/config-array@^0.10.4": version "0.10.7" - resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.7.tgz#6d53769fd0c222767e6452e8ebda825c22e9f0dc" integrity sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w== dependencies: "@humanwhocodes/object-schema" "^1.2.1" @@ -3966,7 +4079,7 @@ "@humanwhocodes/config-array@^0.9.2": version "0.9.5" - resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== dependencies: "@humanwhocodes/object-schema" "^1.2.1" @@ -3975,7 +4088,7 @@ "@humanwhocodes/gitignore-to-minimatch@^1.0.2": version "1.0.2" - resolved "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== "@humanwhocodes/module-importer@^1.0.1": @@ -3985,7 +4098,7 @@ "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" - resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@humanwhocodes/object-schema@^2.0.2": @@ -4014,7 +4127,7 @@ "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" - resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== dependencies: camelcase "^5.3.1" @@ -4025,12 +4138,12 @@ "@istanbuljs/schema@^0.1.2": version "0.1.3" - resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== "@jest/console@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== dependencies: "@jest/types" "^27.5.1" @@ -4042,7 +4155,7 @@ "@jest/core@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/core/-/core-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== dependencies: "@jest/console" "^27.5.1" @@ -4083,7 +4196,7 @@ "@jest/environment@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/environment/-/environment-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== dependencies: "@jest/fake-timers" "^27.5.1" @@ -4103,7 +4216,7 @@ "@jest/fake-timers@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== dependencies: "@jest/types" "^27.5.1" @@ -4127,7 +4240,7 @@ "@jest/globals@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/globals/-/globals-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== dependencies: "@jest/environment" "^27.5.1" @@ -4136,7 +4249,7 @@ "@jest/reporters@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== dependencies: "@bcoe/v8-coverage" "^0.2.3" @@ -4174,7 +4287,7 @@ "@jest/source-map@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== dependencies: callsites "^3.0.0" @@ -4183,7 +4296,7 @@ "@jest/test-result@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== dependencies: "@jest/console" "^27.5.1" @@ -4193,7 +4306,7 @@ "@jest/test-sequencer@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== dependencies: "@jest/test-result" "^27.5.1" @@ -4203,7 +4316,7 @@ "@jest/transform@^27.5.1": version "27.5.1" - resolved "https://registry.npmjs.org/@jest/transform/-/transform-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== dependencies: "@babel/core" "^7.1.0" @@ -4275,6 +4388,15 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz" @@ -4285,6 +4407,11 @@ resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + "@jridgewell/source-map@^0.3.3": version "0.3.5" resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz" @@ -4306,6 +4433,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@keplr-wallet/common@0.12.82": version "0.12.82" resolved "https://registry.yarnpkg.com/@keplr-wallet/common/-/common-0.12.82.tgz#25bff69def216533f31702ec96da1c01f50b12bf" @@ -4377,17 +4512,10 @@ big-integer "^1.6.48" utility-types "^3.10.0" -"@ledgerhq/cryptoassets@9.1.0": - version "9.1.0" - resolved "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-9.1.0.tgz" - integrity sha512-tzcZbjJDzZBUKct/4dLGy+HHMwRHw3/cnYLeDMj4+KIbE2+MXK3czkqsZbZVOPIxnJgkwHONICqQ4VUpaIQhXQ== - dependencies: - invariant "2" - -"@ledgerhq/cryptoassets@^11.4.0": - version "11.4.0" - resolved "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-11.4.0.tgz" - integrity sha512-1M0iNyZlmf4MbLGk6vl5CK3gyHAT0yeUzkMbQn+Eo3JL0Y8ng7bl39GGRVasD7X7d/ue2nrG1bX6peGhLcDL/Q== +"@ledgerhq/cryptoassets@13.0.0", "@ledgerhq/cryptoassets@^13.0.0": + version "13.0.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-13.0.0.tgz#c300884830399750ca6b23edfb4cb0d4a39459f5" + integrity sha512-Gvy3YQqOZpNtQ6/TTPJRUp4Qba/SmGtHGOeeIYTaF2y94W2x2hyf/dtttOc2nwyp6ARggkqr6VZyMAzgnP7fyQ== dependencies: axios "^1.6.0" bs58check "^2.1.2" @@ -4413,14 +4541,24 @@ rxjs "^7.8.1" semver "^7.3.5" -"@ledgerhq/domain-service@^1.1.17": - version "1.1.17" - resolved "https://registry.npmjs.org/@ledgerhq/domain-service/-/domain-service-1.1.17.tgz" - integrity sha512-EAnbuuuWJpFYHp1a4fMh8cNk5Lic+4Rwf4xGXAOHKcUUT90Q3/VYiom1+ZZwKA8PBgebbxE695UDKK1SzPvh8Q== +"@ledgerhq/devices@^8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-8.3.0.tgz#a1e1a21608e162fb3a512f57863bf9842b29493f" + integrity sha512-h5Scr+yIae8yjPOViCHLdMjpqn4oC2Whrsq8LinRxe48LEGMdPqSV1yY7+3Ch827wtzNpMv+/ilKnd8rY+rTlg== dependencies: - "@ledgerhq/errors" "^6.16.1" + "@ledgerhq/errors" "^6.16.4" "@ledgerhq/logs" "^6.12.0" - "@ledgerhq/types-live" "^6.44.0" + rxjs "^7.8.1" + semver "^7.3.5" + +"@ledgerhq/domain-service@^1.1.21": + version "1.1.21" + resolved "https://registry.yarnpkg.com/@ledgerhq/domain-service/-/domain-service-1.1.21.tgz#c8f1be996890687318e698eebf008f281f521296" + integrity sha512-/2CPZYXQV2GQS/XkjUQwbfHBlteLDEFUpfMX0YvwriJ5hOmu//sl1Zgc+/FZ2hDQwpFQBCBCbvqreqeyHIVawA== + dependencies: + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/logs" "^6.12.0" + "@ledgerhq/types-live" "^6.47.0" axios "^1.3.4" eip55 "^2.1.1" react "^18.2.0" @@ -4436,14 +4574,19 @@ resolved "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.1.tgz" integrity sha512-4D4wKecGzQpIu7sx03Sg4uE1e8g1oZUndWgw9gw776H8h9ov9c5TxPaldTn2j6orPECAERViLf7LTO4L5pE2Cw== -"@ledgerhq/evm-tools@^1.0.14": - version "1.0.14" - resolved "https://registry.npmjs.org/@ledgerhq/evm-tools/-/evm-tools-1.0.14.tgz" - integrity sha512-L1fj3mbcZPueCJ/ZwxKXQegpY561NkxGd8nljF/JVqwH/B1N+usdZb9HZswrsgWjQdxqeQykgz7ZZgYolU+vlg== +"@ledgerhq/errors@^6.16.4": + version "6.16.4" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.16.4.tgz#a38baffe8b096d9fff3ad839cadb55704c8d8e7b" + integrity sha512-M57yFaLYSN+fZCX0E0zUqOmrV6eipK+s5RhijHoUNlHUqrsvUz7iRQgpd5gRgHB5VkIjav7KdaZjKiWGcHovaQ== + +"@ledgerhq/evm-tools@^1.0.19": + version "1.0.19" + resolved "https://registry.yarnpkg.com/@ledgerhq/evm-tools/-/evm-tools-1.0.19.tgz#6e202253ee587d431644423f0ee0e03546457a4b" + integrity sha512-Xt0lj5PRPpErWSNsq3MJXpUj3ME+TUt+EDxdTydTYAQSYT7Ai11jYhFUzY8QPud/sT6gWo+PGo4vbfps0jU19A== dependencies: - "@ledgerhq/cryptoassets" "^11.4.0" - "@ledgerhq/live-env" "^0.9.0" - "@ledgerhq/live-network" "^1.1.11" + "@ledgerhq/cryptoassets" "^13.0.0" + "@ledgerhq/live-env" "^2.0.2" + axios "^1.6.5" crypto-js "4.2.0" ethers "5.7.2" @@ -4465,21 +4608,21 @@ tiny-secp256k1 "1.1.6" varuint-bitcoin "1.1.2" -"@ledgerhq/hw-app-eth@6.35.4": - version "6.35.4" - resolved "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-6.35.4.tgz" - integrity sha512-afTaEr7AxDLoFI4ThyJTFEKSjCVTcYynQhg/WSH9nZoTEY4Qg9sF6iUvRIC7iyoEv5tjT7L+Ooz/9Q4sh201zQ== +"@ledgerhq/hw-app-eth@6.36.1": + version "6.36.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.36.1.tgz#a1fd499e53a1bd7cffa7c031886fe4c6725b152e" + integrity sha512-S7r1gk87x8AgNX3jaFab+Yzb7TcsknRmWQqNNgf0gPmRYoii9Arrh1RhD/45r072mXEIDXKQCepPPNWGBGBfLw== dependencies: "@ethersproject/abi" "^5.5.0" "@ethersproject/rlp" "^5.5.0" - "@ledgerhq/cryptoassets" "^11.4.0" - "@ledgerhq/domain-service" "^1.1.17" - "@ledgerhq/errors" "^6.16.1" - "@ledgerhq/evm-tools" "^1.0.14" - "@ledgerhq/hw-transport" "^6.30.3" - "@ledgerhq/hw-transport-mocker" "^6.28.3" + "@ledgerhq/cryptoassets" "^13.0.0" + "@ledgerhq/domain-service" "^1.1.21" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/evm-tools" "^1.0.19" + "@ledgerhq/hw-transport" "^6.30.6" + "@ledgerhq/hw-transport-mocker" "^6.28.6" "@ledgerhq/logs" "^6.12.0" - "@ledgerhq/types-live" "^6.44.0" + "@ledgerhq/types-live" "^6.47.0" axios "^1.3.4" bignumber.js "^9.1.2" @@ -4494,12 +4637,12 @@ "@ledgerhq/hw-app-trx@6.28.1": version "6.28.1" - resolved "https://registry.npmjs.org/@ledgerhq/hw-app-trx/-/hw-app-trx-6.28.1.tgz" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.28.1.tgz#26b32756793dff29be7e1434516e70942d4c71e2" integrity sha512-2qIWOAMQWkdwyOA4aynyWO6s1w3XCH12USlUf0mI8D5H+oDq09QJhHvxFxQcUdnGTQJ/LgsSe393hxMPTi6W3w== dependencies: "@ledgerhq/hw-transport" "^6.30.1" -"@ledgerhq/hw-transport-mocker@6.28.3", "@ledgerhq/hw-transport-mocker@^6.28.3": +"@ledgerhq/hw-transport-mocker@6.28.3": version "6.28.3" resolved "https://registry.npmjs.org/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.3.tgz" integrity sha512-V5hf6oPytSgoBx+3eaCMoSZGFHXwEP+89g3somX1paGwJXwnzNX1+ADVr0a/xYQE+l7j3Os8TdVmEj0eF0U75A== @@ -4508,6 +4651,15 @@ "@ledgerhq/logs" "^6.12.0" rxjs "^7.8.1" +"@ledgerhq/hw-transport-mocker@^6.28.6": + version "6.28.6" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.6.tgz#820ff1abe490a1abbf3925f53526f846ee0f470d" + integrity sha512-JDO2kqMOTRCQWNZr1KVlyX1AqE6WBzHjJDS3FnSI8Z/Bj2KSc2/1H/4lW6+Ap64yLtlmOW3GchdafFmLgYAgqw== + dependencies: + "@ledgerhq/hw-transport" "^6.30.6" + "@ledgerhq/logs" "^6.12.0" + rxjs "^7.8.1" + "@ledgerhq/hw-transport-node-hid-noevents@^5.51.1": version "5.51.1" resolved "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.51.1.tgz" @@ -4564,7 +4716,17 @@ "@ledgerhq/hw-transport" "^6.30.3" "@ledgerhq/logs" "^6.12.0" -"@ledgerhq/hw-transport@6.30.3", "@ledgerhq/hw-transport@^6.2.0", "@ledgerhq/hw-transport@^6.28.1", "@ledgerhq/hw-transport@^6.30.1", "@ledgerhq/hw-transport@^6.30.3": +"@ledgerhq/hw-transport-webhid@6.28.6": + version "6.28.6" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webhid/-/hw-transport-webhid-6.28.6.tgz#94562750136d869774cb56304573a1875ca6375f" + integrity sha512-npU1mgL97KovpTUgcdORoOZ7eVFgwCA7zt0MpgUGUMRNJWDgCFsJslx7KrVXlCGOg87gLfDojreIre502I5pYg== + dependencies: + "@ledgerhq/devices" "^8.3.0" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/hw-transport" "^6.30.6" + "@ledgerhq/logs" "^6.12.0" + +"@ledgerhq/hw-transport@6.30.3", "@ledgerhq/hw-transport@^6.2.0", "@ledgerhq/hw-transport@^6.28.1", "@ledgerhq/hw-transport@^6.30.3": version "6.30.3" resolved "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.3.tgz" integrity sha512-eqtTCGy8wFCxl+hZSEpjVqn1EDjQhFCne/qUyY0aA36efhWUF6bCRAhkq1e5i7g2P6TbxcIM5P5PW67dILuqIQ== @@ -4574,6 +4736,16 @@ "@ledgerhq/logs" "^6.12.0" events "^3.3.0" +"@ledgerhq/hw-transport@6.30.6", "@ledgerhq/hw-transport@^6.30.1", "@ledgerhq/hw-transport@^6.30.6": + version "6.30.6" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.30.6.tgz#c6d84672ac4828f311831998f4101ea205215a6d" + integrity sha512-fT0Z4IywiuJuZrZE/+W0blkV5UCotDPFTYKLkKCLzYzuE6javva7D/ajRaIeR+hZ4kTmKF4EqnsmDCXwElez+w== + dependencies: + "@ledgerhq/devices" "^8.3.0" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/logs" "^6.12.0" + events "^3.3.0" + "@ledgerhq/hw-transport@^5.25.0", "@ledgerhq/hw-transport@^5.34.0", "@ledgerhq/hw-transport@^5.51.1": version "5.51.1" resolved "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz" @@ -4583,34 +4755,14 @@ "@ledgerhq/errors" "^5.50.0" events "^3.3.0" -"@ledgerhq/live-env@^0.9.0": - version "0.9.0" - resolved "https://registry.npmjs.org/@ledgerhq/live-env/-/live-env-0.9.0.tgz" - integrity sha512-IRRyYw17Bc5TepOY1c0E1fG9YaCD7Mjl8SCn6VGhGtH932nJkqaGwPqJnrFhFjHXDx4unMSYedmMRWoaR2j0+Q== +"@ledgerhq/live-env@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-env/-/live-env-2.0.2.tgz#d9fdc1fb55ace9ad1b725a576796abb6bbe00064" + integrity sha512-kRHzLUPiIvJm1elfYmGBHPfqJEknqrAQrOYqagufLLip5/GDyeBQVOVdTJQoTra8VsxVRxilsRNGDiB+h8lwLQ== dependencies: rxjs "^7.8.1" utility-types "^3.10.0" -"@ledgerhq/live-network@^1.1.11": - version "1.1.11" - resolved "https://registry.npmjs.org/@ledgerhq/live-network/-/live-network-1.1.11.tgz" - integrity sha512-TamiftFWGC8tPkDNv1xSWtPxEbpu5xCmTbmXo9QD+pjjCApWqukuaJeNrW7VkkRYWdY7K8HA4Jz/PgPllNKs5A== - dependencies: - "@ledgerhq/errors" "^6.16.1" - "@ledgerhq/live-env" "^0.9.0" - "@ledgerhq/live-promise" "^0.0.3" - "@ledgerhq/logs" "^6.12.0" - axios "0.26.1" - invariant "^2.2.2" - lru-cache "^7.14.1" - -"@ledgerhq/live-promise@^0.0.3": - version "0.0.3" - resolved "https://registry.npmjs.org/@ledgerhq/live-promise/-/live-promise-0.0.3.tgz" - integrity sha512-/49dRz5XoxUw4TFq0kytU2Vz9w+FoGgG28U8RH9nuUWVPjVhAPvhY/QXUQA+7qqaorEIAYPHF0Rappalawhr+g== - dependencies: - "@ledgerhq/logs" "^6.12.0" - "@ledgerhq/logs@^5.30.0", "@ledgerhq/logs@^5.50.0": version "5.50.0" resolved "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.50.0.tgz" @@ -4621,10 +4773,10 @@ resolved "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.12.0.tgz" integrity sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA== -"@ledgerhq/types-live@^6.44.0": - version "6.44.0" - resolved "https://registry.npmjs.org/@ledgerhq/types-live/-/types-live-6.44.0.tgz" - integrity sha512-WFXLHsgAm+rJ5oxCl5c+Cr0lNVsX0av0wctEQjLZUF2FSWFvAiqmGMLUd5B0NsLhJaQYFw+iFo7C178DRfoh3w== +"@ledgerhq/types-live@^6.47.0": + version "6.47.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/types-live/-/types-live-6.47.0.tgz#1582594fc8d940355630471ae5485b25235627b0" + integrity sha512-81R+/qOq+AFMA90LcCfIs3Q3g3taXQWrdLaSvCs/YiG2BeZnXIOnRx6FcbGX25W+LQNSyqYRhYJePAgAeuMiBQ== dependencies: bignumber.js "^9.1.2" rxjs "^7.8.1" @@ -4788,7 +4940,7 @@ "@next/eslint-plugin-next@13.2.4": version "13.2.4" - resolved "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.2.4.tgz" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.2.4.tgz#3e124cd10ce24dab5d3448ce04104b4f1f4c6ca7" integrity sha512-ck1lI+7r1mMJpqLNa3LJ5pxCfOB1lfJncKmRJeJxcJqcngaFwylreLP7da6Rrjr6u2gVRTfmnkSkjc80IiQCwQ== dependencies: glob "7.1.7" @@ -4865,14 +5017,14 @@ dependencies: "@noble/hashes" "1.3.2" -"@noble/curves@1.3.0", "@noble/curves@^1.0.0", "@noble/curves@^1.2.0", "@noble/curves@~1.3.0": +"@noble/curves@1.3.0", "@noble/curves@^1.2.0", "@noble/curves@~1.3.0": version "1.3.0" resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.3.0.tgz" integrity sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA== dependencies: "@noble/hashes" "1.3.3" -"@noble/curves@^1.4.2": +"@noble/curves@^1.4.0", "@noble/curves@^1.4.2": version "1.6.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b" integrity sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ== @@ -4884,7 +5036,7 @@ resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@1.3.3", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.3.2", "@noble/hashes@~1.3.2", "@noble/hashes@~1.3.3": +"@noble/hashes@1.3.3", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.2", "@noble/hashes@~1.3.2", "@noble/hashes@~1.3.3": version "1.3.3" resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== @@ -4931,88 +5083,88 @@ mkdirp "^1.0.4" rimraf "^3.0.2" -"@parcel/watcher-android-arm64@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.0.tgz#9c93763794153e4f76920994a423b6ea3257059d" - integrity sha512-+fPtO/GsbYX1LJnCYCaDVT3EOBjvSFdQN9Mrzh9zWAOOfvidPWyScTrHIZHHfJBvlHzNA0Gy0U3NXFA/M7PHUA== +"@parcel/watcher-android-arm64@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz#c2c19a3c442313ff007d2d7a9c2c1dd3e1c9ca84" + integrity sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg== -"@parcel/watcher-darwin-arm64@2.4.0": - version "2.4.0" - resolved "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.0.tgz" - integrity sha512-T/At5pansFuQ8VJLRx0C6C87cgfqIYhW2N/kBfLCUvDhCah0EnLLwaD/6MW3ux+rpgkpQAnMELOCTKlbwncwiA== +"@parcel/watcher-darwin-arm64@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz#c817c7a3b4f3a79c1535bfe54a1c2818d9ffdc34" + integrity sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA== -"@parcel/watcher-darwin-x64@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.0.tgz#23d82f198c5d033f047467c68d7c335f3df49b46" - integrity sha512-vZMv9jl+szz5YLsSqEGCMSllBl1gU1snfbRL5ysJU03MEa6gkVy9OMcvXV1j4g0++jHEcvzhs3Z3LpeEbVmY6Q== +"@parcel/watcher-darwin-x64@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.1.tgz#1a3f69d9323eae4f1c61a5f480a59c478d2cb020" + integrity sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg== -"@parcel/watcher-freebsd-x64@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.0.tgz#7310cc86abc27dacd57624bcdba1f0ba092e76df" - integrity sha512-dHTRMIplPDT1M0+BkXjtMN+qLtqq24sLDUhmU+UxxLP2TEY2k8GIoqIJiVrGWGomdWsy5IO27aDV1vWyQ6gfHA== +"@parcel/watcher-freebsd-x64@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.1.tgz#0d67fef1609f90ba6a8a662bc76a55fc93706fc8" + integrity sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w== -"@parcel/watcher-linux-arm-glibc@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.0.tgz#c31b76e695027eeb1078d3d6f1d641d0b900c335" - integrity sha512-9NQXD+qk46RwATNC3/UB7HWurscY18CnAPMTFcI9Y8CTbtm63/eex1SNt+BHFinEQuLBjaZwR2Lp+n7pmEJPpQ== +"@parcel/watcher-linux-arm-glibc@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.1.tgz#ce5b340da5829b8e546bd00f752ae5292e1c702d" + integrity sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA== -"@parcel/watcher-linux-arm64-glibc@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.0.tgz#56e09b86e9d8a4096f606be118b588da6e965080" - integrity sha512-QuJTAQdsd7PFW9jNGaV9Pw+ZMWV9wKThEzzlY3Lhnnwy7iW23qtQFPql8iEaSFMCVI5StNNmONUopk+MFKpiKg== +"@parcel/watcher-linux-arm64-glibc@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.1.tgz#6d7c00dde6d40608f9554e73998db11b2b1ff7c7" + integrity sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA== -"@parcel/watcher-linux-arm64-musl@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.0.tgz#27ffd5ca5f510ecd638f9ad22e2e813049db54e7" - integrity sha512-oyN+uA9xcTDo/45bwsd6TFHa7Lc7hKujyMlvwrCLvSckvWogndCEoVYFNfZ6JJ2KNL/6fFiGPcbjp8jJmEh5Ng== +"@parcel/watcher-linux-arm64-musl@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.1.tgz#bd39bc71015f08a4a31a47cd89c236b9d6a7f635" + integrity sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA== -"@parcel/watcher-linux-x64-glibc@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.0.tgz#44cbbb1e5884a1ca900655f47a0775218318f934" - integrity sha512-KphV8awJmxU3q52JQvJot0QMu07CIyEjV+2Tb2ZtbucEgqyRcxOBDMsqp1JNq5nuDXtcCC0uHQICeiEz38dPBQ== +"@parcel/watcher-linux-x64-glibc@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.1.tgz#0ce29966b082fb6cdd3de44f2f74057eef2c9e39" + integrity sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg== -"@parcel/watcher-linux-x64-musl@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.0.tgz#4c33993618c8d5113722852806239cb80360494b" - integrity sha512-7jzcOonpXNWcSijPpKD5IbC6xC7yTibjJw9jviVzZostYLGxbz8LDJLUnLzLzhASPlPGgpeKLtFUMjAAzM+gSA== +"@parcel/watcher-linux-x64-musl@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.1.tgz#d2ebbf60e407170bb647cd6e447f4f2bab19ad16" + integrity sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ== -"@parcel/watcher-win32-arm64@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.0.tgz#2a172fd2fda95fe5389298ca3e70b5a96316162a" - integrity sha512-NOej2lqlq8bQNYhUMnOD0nwvNql8ToQF+1Zhi9ULZoG+XTtJ9hNnCFfyICxoZLXor4bBPTOnzs/aVVoefYnjIg== +"@parcel/watcher-win32-arm64@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.1.tgz#eb4deef37e80f0b5e2f215dd6d7a6d40a85f8adc" + integrity sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg== -"@parcel/watcher-win32-ia32@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.0.tgz#279225b2ebe1fadd3c5137c9b2365ad422656904" - integrity sha512-IO/nM+K2YD/iwjWAfHFMBPz4Zqn6qBDqZxY4j2n9s+4+OuTSRM/y/irksnuqcspom5DjkSeF9d0YbO+qpys+JA== +"@parcel/watcher-win32-ia32@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.1.tgz#94fbd4b497be39fd5c8c71ba05436927842c9df7" + integrity sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw== -"@parcel/watcher-win32-x64@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.0.tgz#93e0bd0ad1bda2c9a688764b9b30b71dc5b72a71" - integrity sha512-pAUyUVjfFjWaf/pShmJpJmNxZhbMvJASUpdes9jL6bTEJ+gDxPRSpXTIemNyNsb9AtbiGXs9XduP1reThmd+dA== +"@parcel/watcher-win32-x64@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz#4bf920912f67cae5f2d264f58df81abfea68dadf" + integrity sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A== "@parcel/watcher@^2.1.0": - version "2.4.0" - resolved "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.0.tgz" - integrity sha512-XJLGVL0DEclX5pcWa2N9SX1jCGTDd8l972biNooLFtjneuGqodupPQh6XseXIBBeVIMaaJ7bTcs3qGvXwsp4vg== + version "2.4.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.4.1.tgz#a50275151a1bb110879c6123589dba90c19f1bf8" + integrity sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA== dependencies: detect-libc "^1.0.3" is-glob "^4.0.3" micromatch "^4.0.5" node-addon-api "^7.0.0" optionalDependencies: - "@parcel/watcher-android-arm64" "2.4.0" - "@parcel/watcher-darwin-arm64" "2.4.0" - "@parcel/watcher-darwin-x64" "2.4.0" - "@parcel/watcher-freebsd-x64" "2.4.0" - "@parcel/watcher-linux-arm-glibc" "2.4.0" - "@parcel/watcher-linux-arm64-glibc" "2.4.0" - "@parcel/watcher-linux-arm64-musl" "2.4.0" - "@parcel/watcher-linux-x64-glibc" "2.4.0" - "@parcel/watcher-linux-x64-musl" "2.4.0" - "@parcel/watcher-win32-arm64" "2.4.0" - "@parcel/watcher-win32-ia32" "2.4.0" - "@parcel/watcher-win32-x64" "2.4.0" + "@parcel/watcher-android-arm64" "2.4.1" + "@parcel/watcher-darwin-arm64" "2.4.1" + "@parcel/watcher-darwin-x64" "2.4.1" + "@parcel/watcher-freebsd-x64" "2.4.1" + "@parcel/watcher-linux-arm-glibc" "2.4.1" + "@parcel/watcher-linux-arm64-glibc" "2.4.1" + "@parcel/watcher-linux-arm64-musl" "2.4.1" + "@parcel/watcher-linux-x64-glibc" "2.4.1" + "@parcel/watcher-linux-x64-musl" "2.4.1" + "@parcel/watcher-win32-arm64" "2.4.1" + "@parcel/watcher-win32-ia32" "2.4.1" + "@parcel/watcher-win32-x64" "2.4.1" "@peculiar/asn1-schema@^2.3.8": version "2.3.8" @@ -5338,7 +5490,7 @@ "@repeaterjs/repeater@3.0.4": version "3.0.4" - resolved "https://registry.npmjs.org/@repeaterjs/repeater/-/repeater-3.0.4.tgz" + resolved "https://registry.yarnpkg.com/@repeaterjs/repeater/-/repeater-3.0.4.tgz#a04d63f4d1bf5540a41b01a921c9a7fddc3bd1ca" integrity sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA== "@repeaterjs/repeater@^3.0.4": @@ -5347,9 +5499,9 @@ integrity sha512-l3YHBLAol6d/IKnB9LhpD0cEZWAoe3eFKUyTYWmFmCO2Q/WOckxLQAUyMZWwZV2M/m3+4vgRoaolFqaII82/TA== "@rushstack/eslint-patch@^1.1.3": - version "1.7.2" - resolved "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz" - integrity sha512-RbhOOTCNoCrbfkRyoXODZp75MlpiHMgbE5MEBZAnnnLyQNgrigEj4p0lzsMDyc1zVsJDLrivB58tgg3emX0eEA== + version "1.10.3" + resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.3.tgz#391d528054f758f81e53210f1a1eebcf1a8b1d20" + integrity sha512-qC/xYId4NMebE6w/V33Fh9gWxLgURiNYgVNObbJl2LZv0GUUItCcCqC5axQSwRaAgaxl2mELq1rMzlswaQ0Zxg== "@scure/base@~1.1.4", "@scure/base@~1.1.5": version "1.1.5" @@ -5415,7 +5567,7 @@ "@sinonjs/commons@^1.7.0": version "1.8.6" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== dependencies: type-detect "4.0.8" @@ -5436,7 +5588,7 @@ "@sinonjs/fake-timers@^8.0.1": version "8.1.0" - resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== dependencies: "@sinonjs/commons" "^1.7.0" @@ -5463,6 +5615,20 @@ resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-experimental.8618508.tgz#4f6709dd50e671267f3bea7d09209bc6471b7ad0" integrity sha512-JCz7mKjVKtfZxkuDtwMAUgA7YvJcA2BwpZaA1NOLcted4OMC4Prwa3DUe3f3181ixPYaRyptbF0Ikq2MbDkYEA== +"@solana/codecs-core@2.0.0-preview.2": + version "2.0.0-preview.2" + resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-preview.2.tgz#689784d032fbc1fedbde40bb25d76cdcecf6553b" + integrity sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg== + dependencies: + "@solana/errors" "2.0.0-preview.2" + +"@solana/codecs-core@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz#1a2d76b9c7b9e7b7aeb3bd78be81c2ba21e3ce22" + integrity sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ== + dependencies: + "@solana/errors" "2.0.0-rc.1" + "@solana/codecs-data-structures@2.0.0-experimental.8618508": version "2.0.0-experimental.8618508" resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-experimental.8618508.tgz#c16a704ac0f743a2e0bf73ada42d830b3402d848" @@ -5471,6 +5637,24 @@ "@solana/codecs-core" "2.0.0-experimental.8618508" "@solana/codecs-numbers" "2.0.0-experimental.8618508" +"@solana/codecs-data-structures@2.0.0-preview.2": + version "2.0.0-preview.2" + resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz#e82cb1b6d154fa636cd5c8953ff3f32959cc0370" + integrity sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg== + dependencies: + "@solana/codecs-core" "2.0.0-preview.2" + "@solana/codecs-numbers" "2.0.0-preview.2" + "@solana/errors" "2.0.0-preview.2" + +"@solana/codecs-data-structures@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz#d47b2363d99fb3d643f5677c97d64a812982b888" + integrity sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + "@solana/codecs-numbers@2.0.0-experimental.8618508": version "2.0.0-experimental.8618508" resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-experimental.8618508.tgz#d84f9ed0521b22e19125eefc7d51e217fcaeb3e4" @@ -5478,6 +5662,22 @@ dependencies: "@solana/codecs-core" "2.0.0-experimental.8618508" +"@solana/codecs-numbers@2.0.0-preview.2": + version "2.0.0-preview.2" + resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz#56995c27396cd8ee3bae8bd055363891b630bbd0" + integrity sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw== + dependencies: + "@solana/codecs-core" "2.0.0-preview.2" + "@solana/errors" "2.0.0-preview.2" + +"@solana/codecs-numbers@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz#f34978ddf7ea4016af3aaed5f7577c1d9869a614" + integrity sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + "@solana/codecs-strings@2.0.0-experimental.8618508": version "2.0.0-experimental.8618508" resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-experimental.8618508.tgz#72457b884d9be80b59b263bcce73892b081e9402" @@ -5486,6 +5686,62 @@ "@solana/codecs-core" "2.0.0-experimental.8618508" "@solana/codecs-numbers" "2.0.0-experimental.8618508" +"@solana/codecs-strings@2.0.0-preview.2": + version "2.0.0-preview.2" + resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz#8bd01a4e48614d5289d72d743c3e81305d445c46" + integrity sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g== + dependencies: + "@solana/codecs-core" "2.0.0-preview.2" + "@solana/codecs-numbers" "2.0.0-preview.2" + "@solana/errors" "2.0.0-preview.2" + +"@solana/codecs-strings@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz#e1d9167075b8c5b0b60849f8add69c0f24307018" + integrity sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + +"@solana/codecs@2.0.0-preview.2": + version "2.0.0-preview.2" + resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-preview.2.tgz#d6615fec98f423166fb89409f9a4ad5b74c10935" + integrity sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA== + dependencies: + "@solana/codecs-core" "2.0.0-preview.2" + "@solana/codecs-data-structures" "2.0.0-preview.2" + "@solana/codecs-numbers" "2.0.0-preview.2" + "@solana/codecs-strings" "2.0.0-preview.2" + "@solana/options" "2.0.0-preview.2" + +"@solana/codecs@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-rc.1.tgz#146dc5db58bd3c28e04b4c805e6096c2d2a0a875" + integrity sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-data-structures" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/codecs-strings" "2.0.0-rc.1" + "@solana/options" "2.0.0-rc.1" + +"@solana/errors@2.0.0-preview.2": + version "2.0.0-preview.2" + resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-preview.2.tgz#e0ea8b008c5c02528d5855bc1903e5e9bbec322e" + integrity sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA== + dependencies: + chalk "^5.3.0" + commander "^12.0.0" + +"@solana/errors@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-rc.1.tgz#3882120886eab98a37a595b85f81558861b29d62" + integrity sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ== + dependencies: + chalk "^5.3.0" + commander "^12.1.0" + "@solana/options@2.0.0-experimental.8618508": version "2.0.0-experimental.8618508" resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-experimental.8618508.tgz#95385340e85f9e8a81b2bfba089404a61c8e9520" @@ -5494,6 +5750,33 @@ "@solana/codecs-core" "2.0.0-experimental.8618508" "@solana/codecs-numbers" "2.0.0-experimental.8618508" +"@solana/options@2.0.0-preview.2": + version "2.0.0-preview.2" + resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-preview.2.tgz#13ff008bf43a5056ef9a091dc7bb3f39321e867e" + integrity sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w== + dependencies: + "@solana/codecs-core" "2.0.0-preview.2" + "@solana/codecs-numbers" "2.0.0-preview.2" + +"@solana/options@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-rc.1.tgz#06924ba316dc85791fc46726a51403144a85fc4d" + integrity sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-data-structures" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/codecs-strings" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + +"@solana/spl-token-group@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@solana/spl-token-group/-/spl-token-group-0.0.4.tgz#4f45d9526c96a33b9a1929a264d0aa21c7e38a2d" + integrity sha512-7+80nrEMdUKlK37V6kOe024+T7J4nNss0F8LQ9OOPYdWCCfJmsGUzVx2W3oeizZR4IHM6N4yC9v1Xqwc3BTPWw== + dependencies: + "@solana/codecs" "2.0.0-preview.2" + "@solana/spl-type-length-value" "0.1.0" + "@solana/spl-token-metadata@^0.1.2": version "0.1.2" resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.2.tgz#876e13432bd2960bd3cac16b9b0af63e69e37719" @@ -5506,13 +5789,23 @@ "@solana/options" "2.0.0-experimental.8618508" "@solana/spl-type-length-value" "0.1.0" -"@solana/spl-token@0.3.8": - version "0.3.8" - resolved "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.3.8.tgz" - integrity sha512-ogwGDcunP9Lkj+9CODOWMiVJEdRtqHAtX2rWF62KxnnSWtMZtV9rDhTrZFshiyJmxDnRL/1nKE1yJHg4jjs3gg== +"@solana/spl-token-metadata@^0.1.4": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.5.tgz#91616470d6862ec6b762e6cfcf882b8a8a24b1e8" + integrity sha512-DSBlo7vjuLe/xvNn75OKKndDBkFxlqjLdWlq6rf40StnrhRn7TDntHGLZpry1cf3uzQFShqeLROGNPAJwvkPnA== + dependencies: + "@solana/codecs" "2.0.0-rc.1" + "@solana/spl-type-length-value" "0.1.0" + +"@solana/spl-token@0.4.6": + version "0.4.6" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.4.6.tgz#eb44e5080ea7b6fc976abcb39457223211bd9076" + integrity sha512-1nCnUqfHVtdguFciVWaY/RKcQz1IF4b31jnKgAmjU9QVN1q7dRUkTEWJZgTYIEtsULjVnC9jRqlhgGN39WbKKA== dependencies: "@solana/buffer-layout" "^4.0.0" "@solana/buffer-layout-utils" "^0.2.0" + "@solana/spl-token-group" "^0.0.4" + "@solana/spl-token-metadata" "^0.1.4" buffer "^6.0.3" "@solana/spl-token@^0.3.6": @@ -5532,16 +5825,16 @@ dependencies: buffer "^6.0.3" -"@solana/web3.js@1.78.5": - version "1.78.5" - resolved "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.78.5.tgz" - integrity sha512-2ZHsDNqkKdglJQrIvJ3p2DmgS3cGnary3VJyqt9C1SPrpAtLYzcElr3xyXJOznyQTU/8AMw+GoF11lFoKbicKg== +"@solana/web3.js@1.91.8": + version "1.91.8" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.91.8.tgz#0d5eb69626a92c391b53e15bfbb0bad3f6858e51" + integrity sha512-USa6OS1jbh8zOapRJ/CBZImZ8Xb7AJjROZl5adql9TpOoBN9BUzyyouS5oPuZHft7S7eB8uJPuXWYjMi6BHgOw== dependencies: - "@babel/runtime" "^7.22.6" - "@noble/curves" "^1.0.0" - "@noble/hashes" "^1.3.1" - "@solana/buffer-layout" "^4.0.0" - agentkeepalive "^4.3.0" + "@babel/runtime" "^7.24.5" + "@noble/curves" "^1.4.0" + "@noble/hashes" "^1.4.0" + "@solana/buffer-layout" "^4.0.1" + agentkeepalive "^4.5.0" bigint-buffer "^1.1.5" bn.js "^5.2.1" borsh "^0.7.0" @@ -5549,8 +5842,8 @@ buffer "6.0.3" fast-stable-stringify "^1.0.0" jayson "^4.1.0" - node-fetch "^2.6.12" - rpc-websockets "^7.5.1" + node-fetch "^2.7.0" + rpc-websockets "^7.11.0" superstruct "^0.14.2" "@solana/web3.js@^1.32.0": @@ -5675,7 +5968,7 @@ "@tootallnate/once@1": version "1.1.2" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@trezor/analytics@1.0.8": @@ -5853,7 +6146,7 @@ "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.20.5" - resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== dependencies: "@babel/parser" "^7.20.7" @@ -5864,23 +6157,23 @@ "@types/babel__generator@*": version "7.6.8" - resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": version "7.4.4" - resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.20.5" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz" - integrity sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ== + version "7.20.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" + integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== dependencies: "@babel/types" "^7.20.7" @@ -5966,7 +6259,7 @@ "@types/graceful-fs@^4.1.2": version "4.1.9" - resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== dependencies: "@types/node" "*" @@ -6007,7 +6300,7 @@ "@types/jest@27.4.1": version "27.4.1" - resolved "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.1.tgz#185cbe2926eaaf9662d340cc02e548ce9e11ab6d" integrity sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw== dependencies: jest-matcher-utils "^27.0.0" @@ -6033,7 +6326,7 @@ "@types/json-stable-stringify@^1.0.32": version "1.0.36" - resolved "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.0.36.tgz" + resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.36.tgz#fe6c6001a69ff8160a772da08779448a333c7ddd" integrity sha512-b7bq23s4fgBB76n34m2b3RBf6M369B0Z9uRR8aHTMd8kZISRkmDEpPD8hhpYvDFzr3bJCPES96cm3Q6qRNDbQw== "@types/json5@^0.0.29": @@ -6050,7 +6343,7 @@ "@types/lodash@4.14.182": version "4.14.182" - resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== "@types/lodash@^4.14.136", "@types/lodash@^4.14.149": @@ -6087,7 +6380,7 @@ "@types/node@18.7.18": version "18.7.18" - resolved "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.18.tgz#633184f55c322e4fb08612307c274ee6d5ed3154" integrity sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg== "@types/node@^12.12.54", "@types/node@^12.7.1": @@ -6124,7 +6417,7 @@ "@types/prettier@^2.1.5": version "2.7.3" - resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== "@types/prop-types@*", "@types/prop-types@^15.7.11": @@ -6142,7 +6435,7 @@ "@types/react-dom@18.0.6": version "18.0.6" - resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.6.tgz" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.6.tgz#36652900024842b74607a17786b6662dd1e103a1" integrity sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA== dependencies: "@types/react" "*" @@ -6165,7 +6458,7 @@ "@types/react@18.0.20": version "18.0.20" - resolved "https://registry.npmjs.org/@types/react/-/react-18.0.20.tgz" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.20.tgz#e4c36be3a55eb5b456ecf501bd4a00fd4fd0c9ab" integrity sha512-MWul1teSPxujEHVwZl4a5HxQ9vVNsjTchVA+xRqv/VYGCuKGAU6UhfrTdF5aBefwD1BHUD8i/zq+O/vyCm/FrA== dependencies: "@types/prop-types" "*" @@ -6208,7 +6501,7 @@ "@types/uuid@9.0.1": version "9.0.1" - resolved "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.1.tgz#98586dc36aee8dacc98cc396dbca8d0429647aa6" integrity sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA== "@types/uuid@^7.0.0": @@ -6306,7 +6599,7 @@ "@typescript-eslint/parser@^5.42.0": version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7" integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== dependencies: "@typescript-eslint/scope-manager" "5.62.0" @@ -6324,7 +6617,7 @@ "@typescript-eslint/scope-manager@5.62.0": version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== dependencies: "@typescript-eslint/types" "5.62.0" @@ -6347,7 +6640,7 @@ "@typescript-eslint/types@5.62.0": version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== "@typescript-eslint/typescript-estree@5.54.1": @@ -6365,7 +6658,7 @@ "@typescript-eslint/typescript-estree@5.62.0": version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== dependencies: "@typescript-eslint/types" "5.62.0" @@ -6400,7 +6693,7 @@ "@typescript-eslint/visitor-keys@5.62.0": version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== dependencies: "@typescript-eslint/types" "5.62.0" @@ -6595,7 +6888,7 @@ "@wry/context@^0.6.0": version "0.6.1" - resolved "https://registry.npmjs.org/@wry/context/-/context-0.6.1.tgz" + resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.6.1.tgz#c3c29c0ad622adb00f6a53303c4f965ee06ebeb2" integrity sha512-LOmVnY1iTU2D8tv4Xf6MVMZZ+juIJ87Kt/plMijjN20NMAXGmH4u8bS1t0uT74cZ5gwpocYueV58YwyI8y+GKw== dependencies: tslib "^2.3.0" @@ -6609,14 +6902,14 @@ "@wry/equality@^0.5.0": version "0.5.7" - resolved "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.7.tgz#72ec1a73760943d439d56b7b1e9985aec5d497bb" integrity sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw== dependencies: tslib "^2.3.0" "@wry/trie@^0.3.0": version "0.3.2" - resolved "https://registry.npmjs.org/@wry/trie/-/trie-0.3.2.tgz" + resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.3.2.tgz#a06f235dc184bd26396ba456711f69f8c35097e6" integrity sha512-yRTyhWSls2OY/pYLfwff867r8ekooZ4UI+/gxot5Wj8EFwSf2rG+n+Mo/6LoLQm1TKA4GRj2+LCpbfS937dClQ== dependencies: tslib "^2.3.0" @@ -6651,7 +6944,7 @@ JSONStream@^1.3.5: abab@^2.0.3, abab@^2.0.5: version "2.0.6" - resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== abort-controller@^3.0.0: @@ -6676,7 +6969,7 @@ accepts@^1.3.7, accepts@^1.3.8, accepts@~1.3.5, accepts@~1.3.7: acorn-globals@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== dependencies: acorn "^7.1.1" @@ -6694,7 +6987,7 @@ acorn-jsx@^5.3.2: acorn-walk@^7.1.1: version "7.2.0" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== acorn-walk@^8.0.0, acorn-walk@^8.1.1: @@ -6709,7 +7002,7 @@ acorn@7.1.1: acorn@^7.1.1: version "7.4.1" - resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: @@ -6741,7 +7034,7 @@ agent-base@^7.0.2, agent-base@^7.1.0: dependencies: debug "^4.3.4" -agentkeepalive@^4.3.0, agentkeepalive@^4.5.0: +agentkeepalive@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz" integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== @@ -6930,7 +7223,7 @@ argparse@^2.0.1: aria-query@^5.3.0: version "5.3.0" - resolved "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e" integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A== dependencies: dequal "^2.0.3" @@ -6943,7 +7236,7 @@ array-buffer-byte-length@^1.0.0, array-buffer-byte-length@^1.0.1: call-bind "^1.0.5" is-array-buffer "^3.0.4" -array-includes@^3.1.6, array-includes@^3.1.7: +array-includes@^3.1.6: version "3.1.7" resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz" integrity sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ== @@ -6954,31 +7247,45 @@ array-includes@^3.1.6, array-includes@^3.1.7: get-intrinsic "^1.2.1" is-string "^1.0.7" +array-includes@^3.1.7, array-includes@^3.1.8: + version "3.1.8" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" + integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.4" + is-string "^1.0.7" + array-union@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array.prototype.filter@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.3.tgz" - integrity sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw== +array.prototype.findlast@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz#3e4fbcb30a15a7f5bf64cf2faae22d139c2e4904" + integrity sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.7" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-shim-unscopables "^1.0.2" array.prototype.findlastindex@^1.2.3: - version "1.2.4" - resolved "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz" - integrity sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ== + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz#8c35a755c72908719453f87145ca011e39334d0d" + integrity sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== dependencies: - call-bind "^1.0.5" + call-bind "^1.0.7" define-properties "^1.2.1" - es-abstract "^1.22.3" + es-abstract "^1.23.2" es-errors "^1.3.0" + es-object-atoms "^1.0.0" es-shim-unscopables "^1.0.2" array.prototype.flat@^1.2.3, array.prototype.flat@^1.3.1, array.prototype.flat@^1.3.2: @@ -7001,9 +7308,19 @@ array.prototype.flatmap@^1.3.1, array.prototype.flatmap@^1.3.2: es-abstract "^1.22.1" es-shim-unscopables "^1.0.0" -array.prototype.tosorted@^1.1.1: +array.prototype.toreversed@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/array.prototype.toreversed/-/array.prototype.toreversed-1.1.2.tgz#b989a6bf35c4c5051e1dc0325151bf8088954eba" + integrity sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + +array.prototype.tosorted@^1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz" + resolved "https://registry.yarnpkg.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz#c8c89348337e51b8a3c48a9227f9ce93ceedcba8" integrity sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg== dependencies: call-bind "^1.0.5" @@ -7068,7 +7385,7 @@ assert@^2.0.0, assert@^2.1.0: ast-types-flow@^0.0.8: version "0.0.8" - resolved "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.8.tgz#0a85e1c92695769ac13a428bb653e7538bea27d6" integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ== ast-types@0.15.2: @@ -7098,13 +7415,6 @@ async@^3.2.2, async@^3.2.3: resolved "https://registry.npmjs.org/async/-/async-3.2.5.tgz" integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg== -asynciterator.prototype@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz" - integrity sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg== - dependencies: - has-symbols "^1.0.3" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" @@ -7125,26 +7435,18 @@ available-typed-arrays@^1.0.5, available-typed-arrays@^1.0.6: resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz" integrity sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg== +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" + axe-core@=4.7.0: version "4.7.0" - resolved "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.0.tgz#34ba5a48a8b564f67e103f0aa5768d76e15bbbbf" integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ== -axios@0.26.1, axios@^0.26.1: - version "0.26.1" - resolved "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz" - integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== - dependencies: - follow-redirects "^1.14.8" - -axios@0.27.2, axios@^0.27.2: - version "0.27.2" - resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - axios@1.3.4: version "1.3.4" resolved "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz" @@ -7163,6 +7465,15 @@ axios@1.4.0: form-data "^4.0.0" proxy-from-env "^1.1.0" +axios@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" + integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@1.6.1: version "1.6.1" resolved "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz" @@ -7193,6 +7504,21 @@ axios@^0.24.0: dependencies: follow-redirects "^1.14.4" +axios@^0.26.1: + version "0.26.1" + resolved "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz" + integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== + dependencies: + follow-redirects "^1.14.8" + +axios@^0.27.2: + version "0.27.2" + resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz" + integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== + dependencies: + follow-redirects "^1.14.9" + form-data "^4.0.0" + axios@^1.3.4, axios@^1.6.0: version "1.6.7" resolved "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz" @@ -7202,9 +7528,18 @@ axios@^1.3.4, axios@^1.6.0: form-data "^4.0.0" proxy-from-env "^1.1.0" +axios@^1.6.5: + version "1.7.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" + integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axobject-query@^3.2.1: version "3.2.1" - resolved "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.2.1.tgz#39c378a6e3b06ca679f29138151e45b2b32da62a" integrity sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg== dependencies: dequal "^2.0.3" @@ -7221,7 +7556,7 @@ babel-core@^7.0.0-bridge.0: babel-jest@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== dependencies: "@jest/transform" "^27.5.1" @@ -7243,7 +7578,7 @@ babel-loader@9.1.2: babel-plugin-istanbul@^6.1.1: version "6.1.1" - resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -7254,7 +7589,7 @@ babel-plugin-istanbul@^6.1.1: babel-plugin-jest-hoist@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== dependencies: "@babel/template" "^7.3.3" @@ -7342,7 +7677,7 @@ babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: babel-preset-current-node-syntax@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" @@ -7406,7 +7741,7 @@ babel-preset-fbjs@^3.4.0: babel-preset-jest@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== dependencies: babel-plugin-jest-hoist "^27.5.1" @@ -7516,9 +7851,9 @@ bignumber.js@9.1.2, bignumber.js@^9.0.0, bignumber.js@^9.0.1, bignumber.js@^9.1. integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" @@ -7704,13 +8039,20 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2, braces@~3.0.2: +braces@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" +braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + breakword@^1.0.5: version "1.0.6" resolved "https://registry.npmjs.org/breakword/-/breakword-1.0.6.tgz" @@ -7730,7 +8072,7 @@ browser-headers@^0.4.1: browser-process-hrtime@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6, browserify-aes@^1.2.0: @@ -7799,7 +8141,7 @@ browserslist@^4.14.5, browserslist@^4.22.2: bs-logger@0.x: version "0.2.6" - resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== dependencies: fast-json-stable-stringify "2.x" @@ -7904,9 +8246,9 @@ builtins@^1.0.3: integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== bundle-require@^4.0.0: - version "4.0.2" - resolved "https://registry.npmjs.org/bundle-require/-/bundle-require-4.0.2.tgz" - integrity sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag== + version "4.1.0" + resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-4.1.0.tgz#3d5fcd19d5160d4cbac5e95ed5a394d1ecd40ce6" + integrity sha512-FeArRFM+ziGkRViKRnSTbHZc35dgmR9yNog05Kn0+ItI59pOAISGvnnIwW1WgFZQW59IxD9QpJnUPkdIPfZuXg== dependencies: load-tsconfig "^0.2.3" @@ -7936,7 +8278,7 @@ bytes@3.1.2: cac@^6.7.12: version "6.7.14" - resolved "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== cacache@^15.3.0: @@ -7975,7 +8317,7 @@ call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6: call-bind@^1.0.7: version "1.0.7" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== dependencies: es-define-property "^1.0.0" @@ -8089,6 +8431,11 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + change-case-all@1.0.14: version "1.0.14" resolved "https://registry.npmjs.org/change-case-all/-/change-case-all-1.0.14.tgz" @@ -8165,12 +8512,12 @@ change-case@^4.1.2: char-regex@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== char-regex@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/char-regex/-/char-regex-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-2.0.1.tgz#6dafdb25f9d3349914079f010ba8d0e6ff9cd01e" integrity sha512-oSvEeo6ZUD7NepqAat3RqoucZ5SeqLJgOvVIwkafu6IP3V0pO38s/ypdVUmDDK6qIIHNlYHJAKX9E7R7HoKElw== chardet@^0.7.0: @@ -8185,7 +8532,7 @@ charenc@0.0.2, charenc@~0.0.1: chokidar@^3.5.1: version "3.6.0" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== dependencies: anymatch "~3.1.2" @@ -8232,9 +8579,9 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: safe-buffer "^5.0.1" cjs-module-lexer@^1.0.0: - version "1.2.3" - resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz" - integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== + version "1.3.1" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz#c485341ae8fd999ca4ee5af2d7a1c9ae01e0099c" + integrity sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q== clean-stack@^2.0.0: version "2.2.0" @@ -8284,7 +8631,7 @@ cliui@^6.0.0: cliui@^7.0.2: version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" @@ -8331,7 +8678,7 @@ clsx@^2.1.0: co@^4.6.0: version "4.6.0" - resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== code-point-at@^1.0.0: @@ -8371,7 +8718,7 @@ coinstring@^2.0.0: collect-v8-coverage@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== color-convert@^1.9.0: @@ -8425,6 +8772,11 @@ commander@^10.0.1: resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== +commander@^12.0.0, commander@^12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== + commander@^2.20.0, commander@^2.20.3: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" @@ -8571,7 +8923,7 @@ core-util-is@~1.0.0: cosmiconfig@8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.0.0.tgz" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.0.0.tgz#e9feae014eab580f858f8a0288f38997a7bebe97" integrity sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ== dependencies: import-fresh "^3.2.1" @@ -8600,14 +8952,6 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmjs-types@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.5.2.tgz#2d42b354946f330dfb5c90a87fdc2a36f97b965d" - integrity sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg== - dependencies: - long "^4.0.0" - protobufjs "~6.11.2" - cosmjs-types@^0.9.0: version "0.9.0" resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.9.0.tgz" @@ -8656,7 +9000,7 @@ create-require@^1.1.0: cross-fetch@3.1.5: version "3.1.5" - resolved "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== dependencies: node-fetch "2.6.7" @@ -8719,16 +9063,11 @@ crypto-browserify@3.12.0, crypto-browserify@^3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -crypto-js@4.2.0, crypto-js@^4.0.0: +crypto-js@4.2.0, crypto-js@^4.0.0, crypto-js@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz" integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== -crypto-js@^3.1.9-1: - version "3.3.0" - resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz" - integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q== - crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz" @@ -8741,17 +9080,17 @@ crypto-random-string@^2.0.0: cssom@^0.4.4: version "0.4.4" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== cssom@~0.3.6: version "0.3.8" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== cssstyle@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: cssom "~0.3.6" @@ -8793,17 +9132,44 @@ dag-map@~1.0.0: damerau-levenshtein@^1.0.8: version "1.0.8" - resolved "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== -data-urls@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz" - integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== +data-urls@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" + integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== + dependencies: + abab "^2.0.3" + whatwg-mimetype "^2.3.0" + whatwg-url "^8.0.0" + +data-view-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" + integrity sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +data-view-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz#90721ca95ff280677eb793749fce1011347669e2" + integrity sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +data-view-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz#5e0bbfb4828ed2d1b9b400cd8a7d119bca0ff18a" + integrity sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA== dependencies: - abab "^2.0.3" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" + call-bind "^1.0.6" + es-errors "^1.3.0" + is-data-view "^1.0.1" dataloader@^2.2.2: version "2.2.2" @@ -8868,7 +9234,7 @@ decompress-response@^4.2.0: dedent@^0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== deep-extend@^0.6.0: @@ -8888,7 +9254,7 @@ deepmerge@^3.2.0: deepmerge@^4.2.2: version "4.3.1" - resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== default-gateway@^4.2.0: @@ -8916,6 +9282,15 @@ define-data-property@^1.0.1, define-data-property@^1.1.2: gopd "^1.0.1" has-property-descriptors "^1.0.1" +define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz" @@ -8995,7 +9370,7 @@ deprecated-react-native-prop-types@^3.0.1: dequal@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== des.js@^1.0.0: @@ -9023,7 +9398,7 @@ detect-libc@^1.0.3: detect-newline@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== diff-sequences@^25.2.6: @@ -9033,7 +9408,7 @@ diff-sequences@^25.2.6: diff-sequences@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== diff@^4.0.1: @@ -9081,7 +9456,7 @@ dom-helpers@^5.0.1: domexception@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== dependencies: webidl-conversions "^5.0.0" @@ -9246,7 +9621,7 @@ elliptic@^6.4.1: emittery@^0.8.1: version "0.8.1" - resolved "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== emoji-regex@^8.0.0: @@ -9278,7 +9653,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enhanced-resolve@^5.0.0, enhanced-resolve@^5.12.0, enhanced-resolve@^5.14.0, enhanced-resolve@^5.7.0: +enhanced-resolve@^5.0.0, enhanced-resolve@^5.14.0, enhanced-resolve@^5.7.0: version "5.15.0" resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz" integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== @@ -9294,6 +9669,14 @@ enhanced-resolve@^5.10.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.12.0: + version "5.16.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.16.1.tgz#e8bc63d51b826d6f1cbc0a150ecb5a8b0c62e567" + integrity sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enquirer@^2.3.0, enquirer@^2.3.6: version "2.4.1" resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz" @@ -9384,18 +9767,22 @@ es-abstract@^1.22.1, es-abstract@^1.22.3: unbox-primitive "^1.0.2" which-typed-array "^1.1.13" -es-abstract@^1.22.4: - version "1.22.4" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.4.tgz" - integrity sha512-vZYJlk2u6qHYxBOTjAeg7qUxHdNfih64Uu2J8QqWgXZ2cri0ZpJAkzDUK/q593+mvKwlxyaxr6F1Q+3LKoQRgg== +es-abstract@^1.23.0, es-abstract@^1.23.1, es-abstract@^1.23.2, es-abstract@^1.23.3: + version "1.23.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.3.tgz#8f0c5a35cd215312573c5a27c87dfd6c881a0aa0" + integrity sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A== dependencies: array-buffer-byte-length "^1.0.1" arraybuffer.prototype.slice "^1.0.3" - available-typed-arrays "^1.0.6" + available-typed-arrays "^1.0.7" call-bind "^1.0.7" + data-view-buffer "^1.0.1" + data-view-byte-length "^1.0.1" + data-view-byte-offset "^1.0.0" es-define-property "^1.0.0" es-errors "^1.3.0" - es-set-tostringtag "^2.0.2" + es-object-atoms "^1.0.0" + es-set-tostringtag "^2.0.3" es-to-primitive "^1.2.1" function.prototype.name "^1.1.6" get-intrinsic "^1.2.4" @@ -9403,15 +9790,16 @@ es-abstract@^1.22.4: globalthis "^1.0.3" gopd "^1.0.1" has-property-descriptors "^1.0.2" - has-proto "^1.0.1" + has-proto "^1.0.3" has-symbols "^1.0.3" - hasown "^2.0.1" + hasown "^2.0.2" internal-slot "^1.0.7" is-array-buffer "^3.0.4" is-callable "^1.2.7" - is-negative-zero "^2.0.2" + is-data-view "^1.0.1" + is-negative-zero "^2.0.3" is-regex "^1.1.4" - is-shared-array-buffer "^1.0.2" + is-shared-array-buffer "^1.0.3" is-string "^1.0.7" is-typed-array "^1.1.13" is-weakref "^1.0.2" @@ -9419,62 +9807,63 @@ es-abstract@^1.22.4: object-keys "^1.1.1" object.assign "^4.1.5" regexp.prototype.flags "^1.5.2" - safe-array-concat "^1.1.0" + safe-array-concat "^1.1.2" safe-regex-test "^1.0.3" - string.prototype.trim "^1.2.8" - string.prototype.trimend "^1.0.7" - string.prototype.trimstart "^1.0.7" - typed-array-buffer "^1.0.1" - typed-array-byte-length "^1.0.0" - typed-array-byte-offset "^1.0.0" - typed-array-length "^1.0.4" + string.prototype.trim "^1.2.9" + string.prototype.trimend "^1.0.8" + string.prototype.trimstart "^1.0.8" + typed-array-buffer "^1.0.2" + typed-array-byte-length "^1.0.1" + typed-array-byte-offset "^1.0.2" + typed-array-length "^1.0.6" unbox-primitive "^1.0.2" - which-typed-array "^1.1.14" - -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== + which-typed-array "^1.1.15" es-define-property@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== dependencies: get-intrinsic "^1.2.4" -es-errors@^1.0.0, es-errors@^1.1.0, es-errors@^1.2.1, es-errors@^1.3.0: +es-errors@^1.1.0, es-errors@^1.2.1, es-errors@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-iterator-helpers@^1.0.12, es-iterator-helpers@^1.0.15: - version "1.0.17" - resolved "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.17.tgz" - integrity sha512-lh7BsUqelv4KUbR5a/ZTaGGIMLCjPGPqJ6q+Oq24YP0RdyptX1uzm4vvaqzk7Zx3bpl/76YLTTDj9L7uYQ92oQ== +es-iterator-helpers@^1.0.15, es-iterator-helpers@^1.0.19: + version "1.0.19" + resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz#117003d0e5fec237b4b5c08aded722e0c6d50ca8" + integrity sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw== dependencies: - asynciterator.prototype "^1.0.0" call-bind "^1.0.7" define-properties "^1.2.1" - es-abstract "^1.22.4" + es-abstract "^1.23.3" es-errors "^1.3.0" - es-set-tostringtag "^2.0.2" + es-set-tostringtag "^2.0.3" function-bind "^1.1.2" get-intrinsic "^1.2.4" globalthis "^1.0.3" has-property-descriptors "^1.0.2" - has-proto "^1.0.1" + has-proto "^1.0.3" has-symbols "^1.0.3" internal-slot "^1.0.7" iterator.prototype "^1.1.2" - safe-array-concat "^1.1.0" + safe-array-concat "^1.1.2" es-module-lexer@^1.2.1: version "1.4.1" resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz" integrity sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w== -es-set-tostringtag@^2.0.1, es-set-tostringtag@^2.0.2: +es-object-atoms@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" + integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz" integrity sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q== @@ -9483,6 +9872,15 @@ es-set-tostringtag@^2.0.1, es-set-tostringtag@^2.0.2: has-tostringtag "^1.0.0" hasown "^2.0.0" +es-set-tostringtag@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" + integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== + dependencies: + get-intrinsic "^1.2.4" + has-tostringtag "^1.0.2" + hasown "^2.0.1" + es-shim-unscopables@^1.0.0, es-shim-unscopables@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz" @@ -9513,7 +9911,7 @@ es6-promisify@^5.0.0: esbuild@^0.17.6: version "0.17.19" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== optionalDependencies: "@esbuild/android-arm" "0.17.19" @@ -9566,7 +9964,7 @@ escape-string-regexp@^4.0.0: escodegen@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== dependencies: esprima "^4.0.1" @@ -9577,7 +9975,7 @@ escodegen@^2.0.0: eslint-config-next@13.2.4: version "13.2.4" - resolved "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.2.4.tgz" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-13.2.4.tgz#8aa4d42da3a575a814634ba9c88c8d25266c5fdd" integrity sha512-lunIBhsoeqw6/Lfkd6zPt25w1bn0znLA/JCL+au1HoEpSb4/PpsOYsYtgV/q+YPsoKIOzFyU5xnb04iZnXjUvg== dependencies: "@next/eslint-plugin-next" "13.2.4" @@ -9626,7 +10024,7 @@ eslint-import-resolver-typescript@3.5.3: eslint-import-resolver-typescript@^3.5.2: version "3.6.1" - resolved "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz#7b983680edd3f1c5bce1a5829ae0bc2d57fe9efa" integrity sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg== dependencies: debug "^4.3.4" @@ -9637,13 +10035,20 @@ eslint-import-resolver-typescript@^3.5.2: is-core-module "^2.11.0" is-glob "^4.0.3" -eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0: +eslint-module-utils@^2.7.4: version "2.8.0" resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz" integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== dependencies: debug "^3.2.7" +eslint-module-utils@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz#52f2404300c3bd33deece9d7372fb337cc1d7c34" + integrity sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q== + dependencies: + debug "^3.2.7" + eslint-plugin-import@2.27.5: version "2.27.5" resolved "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz" @@ -9667,7 +10072,7 @@ eslint-plugin-import@2.27.5: eslint-plugin-import@^2.26.0: version "2.29.1" - resolved "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz#d45b37b5ef5901d639c15270d74d46d161150643" integrity sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw== dependencies: array-includes "^3.1.7" @@ -9690,7 +10095,7 @@ eslint-plugin-import@^2.26.0: eslint-plugin-jsx-a11y@^6.5.1: version "6.8.0" - resolved "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz#2fa9c701d44fcd722b7c771ec322432857fcbad2" integrity sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA== dependencies: "@babel/runtime" "^7.23.2" @@ -9718,31 +10123,33 @@ eslint-plugin-prettier@4.2.1, eslint-plugin-prettier@^4.0.0: prettier-linter-helpers "^1.0.0" eslint-plugin-react-hooks@^4.5.0: - version "4.6.0" - resolved "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz" - integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== + version "4.6.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz#c829eb06c0e6f484b3fbb85a97e57784f328c596" + integrity sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ== eslint-plugin-react@^7.31.7: - version "7.33.2" - resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz" - integrity sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw== + version "7.34.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.34.2.tgz#2780a1a35a51aca379d86d29b9a72adc6bfe6b66" + integrity sha512-2HCmrU+/JNigDN6tg55cRDKCQWicYAPB38JGSFDQt95jDm8rrvSUo7YPkOIm5l6ts1j1zCvysNcasvfTMQzUOw== dependencies: - array-includes "^3.1.6" - array.prototype.flatmap "^1.3.1" - array.prototype.tosorted "^1.1.1" + array-includes "^3.1.8" + array.prototype.findlast "^1.2.5" + array.prototype.flatmap "^1.3.2" + array.prototype.toreversed "^1.1.2" + array.prototype.tosorted "^1.1.3" doctrine "^2.1.0" - es-iterator-helpers "^1.0.12" + es-iterator-helpers "^1.0.19" estraverse "^5.3.0" jsx-ast-utils "^2.4.1 || ^3.0.0" minimatch "^3.1.2" - object.entries "^1.1.6" - object.fromentries "^2.0.6" - object.hasown "^1.1.2" - object.values "^1.1.6" + object.entries "^1.1.8" + object.fromentries "^2.0.8" + object.hasown "^1.1.4" + object.values "^1.2.0" prop-types "^15.8.1" - resolve "^2.0.0-next.4" + resolve "^2.0.0-next.5" semver "^6.3.1" - string.prototype.matchall "^4.0.8" + string.prototype.matchall "^4.0.11" eslint-plugin-turbo@0.0.9: version "0.0.9" @@ -9796,7 +10203,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: eslint@8.13.0: version "8.13.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-8.13.0.tgz" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.13.0.tgz#6fcea43b6811e655410f5626cfcf328016badcd7" integrity sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ== dependencies: "@eslint/eslintrc" "^1.2.1" @@ -9837,7 +10244,7 @@ eslint@8.13.0: eslint@8.23.1: version "8.23.1" - resolved "https://registry.npmjs.org/eslint/-/eslint-8.23.1.tgz" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.1.tgz#cfd7b3f7fdd07db8d16b4ac0516a29c8d8dca5dc" integrity sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg== dependencies: "@eslint/eslintrc" "^1.3.2" @@ -9971,7 +10378,7 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: estree-walker@^0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== esutils@^2.0.2: @@ -10205,7 +10612,7 @@ execa@^5.0.0: exit@^0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== expand-template@^2.0.3: @@ -10215,7 +10622,7 @@ expand-template@^2.0.3: expect@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/expect/-/expect-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== dependencies: "@jest/types" "^27.5.1" @@ -10503,6 +10910,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + finalhandler@1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz" @@ -10627,6 +11041,11 @@ follow-redirects@^1.14.0, follow-redirects@^1.14.4, follow-redirects@^1.14.8, fo resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz" integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + fontfaceobserver@^2.1.0: version "2.3.0" resolved "https://registry.npmjs.org/fontfaceobserver/-/fontfaceobserver-2.3.0.tgz" @@ -10778,7 +11197,7 @@ function.prototype.name@^1.1.5, function.prototype.name@^1.1.6: functional-red-black-tree@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== functions-have-names@^1.2.3: @@ -10810,7 +11229,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: +get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: version "1.2.4" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz" integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== @@ -10823,7 +11242,7 @@ get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@ get-package-type@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== get-port@^3.2.0: @@ -10853,20 +11272,27 @@ get-symbol-description@^1.0.0: get-symbol-description@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" integrity sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg== dependencies: call-bind "^1.0.5" es-errors "^1.3.0" get-intrinsic "^1.2.4" -get-tsconfig@^4.2.0, get-tsconfig@^4.5.0: +get-tsconfig@^4.2.0: version "4.7.2" resolved "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz" integrity sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A== dependencies: resolve-pkg-maps "^1.0.0" +get-tsconfig@^4.5.0: + version "4.7.5" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.5.tgz#5e012498579e9a6947511ed0cd403272c7acbbaf" + integrity sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw== + dependencies: + resolve-pkg-maps "^1.0.0" + getenv@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/getenv/-/getenv-1.0.0.tgz" @@ -10910,7 +11336,7 @@ glob@7.1.6: glob@7.1.7: version "7.1.7" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== dependencies: fs.realpath "^1.0.0" @@ -11030,7 +11456,7 @@ grapheme-splitter@^1.0.4: graphql-config@^4.5.0: version "4.5.0" - resolved "https://registry.npmjs.org/graphql-config/-/graphql-config-4.5.0.tgz" + resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-4.5.0.tgz#257c2338950b8dce295a27f75c5f6c39f8f777b2" integrity sha512-x6D0/cftpLUJ0Ch1e5sj1TZn6Wcxx4oMfmhaG9shM0DKajA9iR+j1z86GSTQ19fShbGvrSSvbIQsHku6aQ6BBw== dependencies: "@graphql-tools/graphql-file-loader" "^7.3.7" @@ -11067,7 +11493,7 @@ graphql-ws@5.11.1: graphql-ws@5.12.1: version "5.12.1" - resolved "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.12.1.tgz" + resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.12.1.tgz#c62d5ac54dbd409cc6520b0b39de374b3d59d0dd" integrity sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg== graphql@15.8.0: @@ -11116,7 +11542,7 @@ has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.1: has-property-descriptors@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== dependencies: es-define-property "^1.0.0" @@ -11126,12 +11552,17 @@ has-proto@^1.0.1: resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz" integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== +has-proto@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-tostringtag@^1.0.0, has-tostringtag@^1.0.1: +has-tostringtag@^1.0.0, has-tostringtag@^1.0.1, has-tostringtag@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz" integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== @@ -11172,10 +11603,10 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" -hasown@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz" - integrity sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA== +hasown@^2.0.1, hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: function-bind "^1.1.2" @@ -11254,14 +11685,14 @@ hosted-git-info@^3.0.2: html-encoding-sniffer@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== dependencies: whatwg-encoding "^1.0.5" html-escaper@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== http-errors@2.0.0: @@ -11277,7 +11708,7 @@ http-errors@2.0.0: http-proxy-agent@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== dependencies: "@tootallnate/once" "1" @@ -11286,7 +11717,7 @@ http-proxy-agent@^4.0.1: http-proxy-agent@^6.0.0: version "6.1.1" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-6.1.1.tgz" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-6.1.1.tgz#dc04f1a84e09511740cfbd984a56f86cc42e4277" integrity sha512-JRCz+4Whs6yrrIoIlrH+ZTmhrRwtMnmOHsHn8GFEn9O2sVfSE+DAZ3oyyGIKF8tjJEeSJmP89j7aTjVsSqsU0g== dependencies: agent-base "^7.1.0" @@ -11302,7 +11733,7 @@ https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: https-proxy-agent@^6.0.0: version "6.2.1" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-6.2.1.tgz" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-6.2.1.tgz#0965ab47371b3e531cf6794d1eb148710a992ba7" integrity sha512-ONsE3+yfZF2caH5+bJlcddtWqNI3Gvs5A38+ngvljxaBiRXRswym2c7yf8UAeFpRFKjFNHIFEHqR/OLAWJzyiA== dependencies: agent-base "^7.0.2" @@ -11511,7 +11942,7 @@ interpret@^3.1.1: resolved "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz" integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== -invariant@2, invariant@^2.2.2, invariant@^2.2.4: +invariant@2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -11574,7 +12005,7 @@ is-arrayish@^0.2.1: is-async-function@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz" + resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.0.0.tgz#8e4418efd3e5d3a6ebb0164c05ef5afb69aa9646" integrity sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA== dependencies: has-tostringtag "^1.0.0" @@ -11588,7 +12019,7 @@ is-bigint@^1.0.1: is-binary-path@~2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" @@ -11625,6 +12056,13 @@ is-core-module@^2.10.0, is-core-module@^2.11.0, is-core-module@^2.13.0, is-core- dependencies: hasown "^2.0.0" +is-data-view@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.1.tgz#4b4d3a511b70f3dc26d42c03ca9ca515d847759f" + integrity sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w== + dependencies: + is-typed-array "^1.1.13" + is-date-object@^1.0.1, is-date-object@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" @@ -11654,7 +12092,7 @@ is-extglob@^2.1.1: is-finalizationregistry@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz#c8749b65f17c133313e661b1289b95ad3dbd62e6" integrity sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw== dependencies: call-bind "^1.0.2" @@ -11678,7 +12116,7 @@ is-fullwidth-code-point@^3.0.0: is-generator-fn@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-generator-function@^1.0.10, is-generator-function@^1.0.7: @@ -11728,10 +12166,10 @@ is-lower-case@^2.0.2: dependencies: tslib "^2.0.3" -is-map@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz" - integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== +is-map@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" + integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== is-nan@^1.3.2: version "1.3.2" @@ -11746,6 +12184,11 @@ is-negative-zero@^2.0.2: resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== +is-negative-zero@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" + integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== + is-number-object@^1.0.4: version "1.0.7" resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz" @@ -11782,7 +12225,7 @@ is-plain-object@^2.0.4: is-potential-custom-element-name@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== is-regex@^1.1.4: @@ -11805,10 +12248,10 @@ is-root@^2.1.0: resolved "https://registry.npmjs.org/is-root/-/is-root-2.1.0.tgz" integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== -is-set@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz" - integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== +is-set@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" + integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== is-shared-array-buffer@^1.0.2: version "1.0.2" @@ -11817,6 +12260,13 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" +is-shared-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" + integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== + dependencies: + call-bind "^1.0.7" + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" @@ -11857,7 +12307,7 @@ is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.13, is-typed is-typedarray@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== is-unc-path@^1.0.0: @@ -11893,10 +12343,10 @@ is-valid-path@^0.1.1: dependencies: is-invalid-path "^0.1.0" -is-weakmap@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz" - integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== +is-weakmap@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" + integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== is-weakref@^1.0.2: version "1.0.2" @@ -11905,13 +12355,13 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -is-weakset@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz" - integrity sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg== +is-weakset@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.3.tgz#e801519df8c0c43e12ff2834eead84ec9e624007" + integrity sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ== dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" + call-bind "^1.0.7" + get-intrinsic "^1.2.4" is-windows@^1.0.0, is-windows@^1.0.1: version "1.0.2" @@ -11967,12 +12417,12 @@ isomorphic-ws@^4.0.1: istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.2" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.2.1" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== dependencies: "@babel/core" "^7.12.3" @@ -11983,7 +12433,7 @@ istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: istanbul-lib-report@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" @@ -11992,7 +12442,7 @@ istanbul-lib-report@^3.0.0: istanbul-lib-source-maps@^4.0.0: version "4.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" @@ -12000,16 +12450,16 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.1.3: - version "3.1.6" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz" - integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== + version "3.1.7" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" iterator.prototype@^1.1.2: version "1.1.2" - resolved "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz" + resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.2.tgz#5e29c8924f01916cb9335f1ff80619dcff22b0c0" integrity sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w== dependencies: define-properties "^1.2.1" @@ -12075,7 +12525,7 @@ jayson@^4.1.1: jest-changed-files@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== dependencies: "@jest/types" "^27.5.1" @@ -12084,7 +12534,7 @@ jest-changed-files@^27.5.1: jest-circus@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== dependencies: "@jest/environment" "^27.5.1" @@ -12109,7 +12559,7 @@ jest-circus@^27.5.1: jest-cli@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== dependencies: "@jest/core" "^27.5.1" @@ -12127,7 +12577,7 @@ jest-cli@^27.5.1: jest-config@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-config/-/jest-config-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== dependencies: "@babel/core" "^7.8.0" @@ -12167,7 +12617,7 @@ jest-diff@^25.2.1: jest-diff@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== dependencies: chalk "^4.0.0" @@ -12177,14 +12627,14 @@ jest-diff@^27.5.1: jest-docblock@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== dependencies: detect-newline "^3.0.0" jest-each@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-each/-/jest-each-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== dependencies: "@jest/types" "^27.5.1" @@ -12195,7 +12645,7 @@ jest-each@^27.5.1: jest-environment-jsdom@27.5.1, jest-environment-jsdom@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== dependencies: "@jest/environment" "^27.5.1" @@ -12208,7 +12658,7 @@ jest-environment-jsdom@27.5.1, jest-environment-jsdom@^27.5.1: jest-environment-node@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== dependencies: "@jest/environment" "^27.5.1" @@ -12242,12 +12692,12 @@ jest-get-type@^26.3.0: jest-get-type@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== jest-haste-map@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== dependencies: "@jest/types" "^27.5.1" @@ -12267,7 +12717,7 @@ jest-haste-map@^27.5.1: jest-jasmine2@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== dependencies: "@jest/environment" "^27.5.1" @@ -12290,7 +12740,7 @@ jest-jasmine2@^27.5.1: jest-leak-detector@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== dependencies: jest-get-type "^27.5.1" @@ -12298,7 +12748,7 @@ jest-leak-detector@^27.5.1: jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== dependencies: chalk "^4.0.0" @@ -12308,7 +12758,7 @@ jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: jest-message-util@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== dependencies: "@babel/code-frame" "^7.12.13" @@ -12338,7 +12788,7 @@ jest-message-util@^29.7.0: jest-mock@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== dependencies: "@jest/types" "^27.5.1" @@ -12355,7 +12805,7 @@ jest-mock@^29.7.0: jest-pnp-resolver@^1.2.2: version "1.2.3" - resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== jest-regex-util@^27.0.0, jest-regex-util@^27.0.6, jest-regex-util@^27.5.1: @@ -12365,7 +12815,7 @@ jest-regex-util@^27.0.0, jest-regex-util@^27.0.6, jest-regex-util@^27.5.1: jest-resolve-dependencies@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== dependencies: "@jest/types" "^27.5.1" @@ -12374,7 +12824,7 @@ jest-resolve-dependencies@^27.5.1: jest-resolve@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== dependencies: "@jest/types" "^27.5.1" @@ -12390,7 +12840,7 @@ jest-resolve@^27.5.1: jest-runner@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== dependencies: "@jest/console" "^27.5.1" @@ -12417,7 +12867,7 @@ jest-runner@^27.5.1: jest-runtime@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== dependencies: "@jest/environment" "^27.5.1" @@ -12453,7 +12903,7 @@ jest-serializer@^27.0.6, jest-serializer@^27.5.1: jest-snapshot@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== dependencies: "@babel/core" "^7.7.2" @@ -12517,7 +12967,7 @@ jest-validate@^26.5.2: jest-validate@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== dependencies: "@jest/types" "^27.5.1" @@ -12529,7 +12979,7 @@ jest-validate@^27.5.1: jest-watch-typeahead@1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/jest-watch-typeahead/-/jest-watch-typeahead-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/jest-watch-typeahead/-/jest-watch-typeahead-1.0.0.tgz#4de2ca1eb596acb1889752afbab84b74fcd99173" integrity sha512-jxoszalAb394WElmiJTFBMzie/RDCF+W7Q29n5LzOPtcoQoHWfdUtHFkbhgf5NwWe8uMOxvKb/g7ea7CshfkTw== dependencies: ansi-escapes "^4.3.1" @@ -12542,7 +12992,7 @@ jest-watch-typeahead@1.0.0: jest-watcher@^27.0.0, jest-watcher@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== dependencies: "@jest/test-result" "^27.5.1" @@ -12564,7 +13014,7 @@ jest-worker@^27.2.0, jest-worker@^27.4.5, jest-worker@^27.5.1: jest@27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/jest/-/jest-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== dependencies: "@jest/core" "^27.5.1" @@ -12578,7 +13028,7 @@ jimp-compact@0.16.1: jiti@1.17.1: version "1.17.1" - resolved "https://registry.npmjs.org/jiti/-/jiti-1.17.1.tgz" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.17.1.tgz#264daa43ee89a03e8be28c3d712ccc4eb9f1e8ed" integrity sha512-NZIITw8uZQFuzQimqjUxIrIcEdxYDFIe/0xYfIlVXTkiBjjyBEvgasj5bb0/cHtPRD/NziPbT312sFrkI5ALpw== jiti@^1.17.1: @@ -12603,13 +13053,13 @@ join-component@^1.1.0: integrity sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ== jose@^4.11.4: - version "4.15.4" - resolved "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz" - integrity sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ== + version "4.15.5" + resolved "https://registry.yarnpkg.com/jose/-/jose-4.15.5.tgz#6475d0f467ecd3c630a1b5dadd2735a7288df706" + integrity sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg== joycon@^3.0.1: version "3.1.1" - resolved "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz" + resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== js-sdsl@^4.1.4: @@ -12684,7 +13134,7 @@ jscrypto@^1.0.1: jsdom@^16.6.0: version "16.7.0" - resolved "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== dependencies: abab "^2.0.5" @@ -12811,7 +13261,7 @@ json5@^1.0.2: jsonc-parser@^3.0.0: version "3.2.1" - resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== jsonfile@^4.0.0: @@ -12852,7 +13302,7 @@ jsonschema@1.2.2: "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5: version "3.3.5" - resolved "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" integrity sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ== dependencies: array-includes "^3.1.6" @@ -12901,13 +13351,13 @@ kleur@^4.1.5: integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== language-subtag-registry@^0.3.20: - version "0.3.22" - resolved "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz" - integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w== + version "0.3.23" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz#23529e04d9e3b74679d70142df3fd2eb6ec572e7" + integrity sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ== language-tags@^1.0.9: version "1.0.9" - resolved "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.9.tgz#1ffdcd0ec0fafb4b1be7f8b11f306ad0f9c08777" integrity sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA== dependencies: language-subtag-registry "^0.3.20" @@ -12961,7 +13411,7 @@ libsodium@^0.7.13: lilconfig@^2.0.5: version "2.1.0" - resolved "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== lines-and-columns@^1.1.6: @@ -12985,7 +13435,7 @@ listr2@^4.0.5: load-tsconfig@^0.2.3: version "0.2.5" - resolved "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz" + resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.5.tgz#453b8cd8961bfb912dea77eb6c168fe8cca3d3a1" integrity sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg== load-yaml-file@^0.2.0: @@ -13042,7 +13492,7 @@ lodash.flow@^3.3.0: lodash.memoize@4.x: version "4.1.2" - resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== lodash.merge@^4.6.2: @@ -13174,11 +13624,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^7.14.1: - version "7.18.3" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz" - integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== - "lru-cache@^9.1.1 || ^10.0.0": version "10.2.0" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz" @@ -13186,12 +13631,12 @@ lru-cache@^7.14.1: lunr@^2.3.9: version "2.3.9" - resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz" + resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== magic-string@^0.25.3: version "0.25.9" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== dependencies: sourcemap-codec "^1.4.8" @@ -13213,7 +13658,7 @@ make-dir@^3.0.2: make-dir@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== dependencies: semver "^7.5.3" @@ -13247,7 +13692,7 @@ map-obj@^4.0.0: marked@^4.0.12: version "4.3.0" - resolved "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== md5-file@^3.2.3: @@ -13804,7 +14249,7 @@ minimalistic-crypto-utils@^1.0.1: minimatch@4.2.3: version "4.2.3" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-4.2.3.tgz" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.3.tgz#b4dcece1d674dee104bb0fb833ebb85a78cbbca6" integrity sha512-lIUdtK5hdofgCTu3aT0sOaHsYR37viUuIc0rwnnDXImbwFRcumyLMeZaM0t0I/fgxS6s6JMfu0rLD1Wz9pv1ng== dependencies: brace-expansion "^1.1.7" @@ -14049,7 +14494,7 @@ next-compose-plugins@2.2.1: next-transpile-modules@9.0.0: version "9.0.0" - resolved "https://registry.npmjs.org/next-transpile-modules/-/next-transpile-modules-9.0.0.tgz" + resolved "https://registry.yarnpkg.com/next-transpile-modules/-/next-transpile-modules-9.0.0.tgz#133b1742af082e61cc76b02a0f12ffd40ce2bf90" integrity sha512-VCNFOazIAnXn1hvgYYSTYMnoWgKgwlYh4lm1pKbSfiB3kj5ZYLcKVhfh3jkPOg1cnd9DP+pte9yCUocdPEUBTQ== dependencies: enhanced-resolve "^5.7.0" @@ -14147,7 +14592,7 @@ node-dir@^0.1.17: node-fetch@2.6.7: version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" @@ -14260,9 +14705,9 @@ number-is-nan@^1.0.0: integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== nwsapi@^2.2.0: - version "2.2.7" - resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz" - integrity sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ== + version "2.2.10" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.10.tgz#0b77a68e21a0b483db70b11fad055906e867cda8" + integrity sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ== ob1@0.73.10: version "0.73.10" @@ -14307,44 +14752,44 @@ object.assign@^4.1.4, object.assign@^4.1.5: has-symbols "^1.0.3" object-keys "^1.1.1" -object.entries@^1.1.6, object.entries@^1.1.7: - version "1.1.7" - resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz" - integrity sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA== +object.entries@^1.1.7, object.entries@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.8.tgz#bffe6f282e01f4d17807204a24f8edd823599c41" + integrity sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" -object.fromentries@^2.0.6, object.fromentries@^2.0.7: - version "2.0.7" - resolved "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz" - integrity sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA== +object.fromentries@^2.0.7, object.fromentries@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" + integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" object.groupby@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.2.tgz" - integrity sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw== + version "1.0.3" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" + integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== dependencies: - array.prototype.filter "^1.0.3" - call-bind "^1.0.5" + call-bind "^1.0.7" define-properties "^1.2.1" - es-abstract "^1.22.3" - es-errors "^1.0.0" + es-abstract "^1.23.2" -object.hasown@^1.1.2: - version "1.1.3" - resolved "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz" - integrity sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA== +object.hasown@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.4.tgz#e270ae377e4c120cdcb7656ce66884a6218283dc" + integrity sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg== dependencies: - define-properties "^1.2.0" - es-abstract "^1.22.1" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" -object.values@^1.1.6, object.values@^1.1.7: +object.values@^1.1.6: version "1.1.7" resolved "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz" integrity sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng== @@ -14353,6 +14798,15 @@ object.values@^1.1.6, object.values@^1.1.7: define-properties "^1.2.0" es-abstract "^1.22.1" +object.values@^1.1.7, object.values@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.0.tgz#65405a9d92cee68ac2d303002e0b8470a4d9ab1b" + integrity sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + on-finished@2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz" @@ -14416,7 +14870,7 @@ opener@^1.5.2: optimism@^0.16.1: version "0.16.2" - resolved "https://registry.npmjs.org/optimism/-/optimism-0.16.2.tgz" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.2.tgz#519b0c78b3b30954baed0defe5143de7776bf081" integrity sha512-zWNbgWj+3vLEjZNIh/okkY2EUfX+vB9TJopzIZwT1xxaMqC5hRLLraePod4c5n4He08xuXNH+zhKFFCu390wiQ== dependencies: "@wry/context" "^0.7.0" @@ -14484,16 +14938,16 @@ osenv@^0.1.5: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -osmojs@16.5.1: - version "16.5.1" - resolved "https://registry.yarnpkg.com/osmojs/-/osmojs-16.5.1.tgz#38f2fe3cd65dbd4e4b415e9f22f387a24b634155" - integrity sha512-V2Q2yMt7Paax6i+S5Q1l29Km0As/waXKmSVRe8gtd9he42kcbkpwwk/QUCvgS98XsL7Qz+vas2Tca016uBQHTQ== +osmojs@16.14.0: + version "16.14.0" + resolved "https://registry.yarnpkg.com/osmojs/-/osmojs-16.14.0.tgz#5558e74f76b9b05e6f74dd1bd6f57ae768c5a4f4" + integrity sha512-m4A5X0ZYanQ/u4/Xlz6nU9QqZEQbAKSD8SAKaDR/mIQYB6g3JkzWLgQgLMzMxDNJZKFTJCjWxHBp7al502x2aw== dependencies: - "@cosmjs/amino" "0.29.3" - "@cosmjs/proto-signing" "0.29.3" - "@cosmjs/stargate" "0.29.3" - "@cosmjs/tendermint-rpc" "^0.29.3" - "@cosmology/lcd" "^0.12.0" + "@cosmjs/amino" "0.32.3" + "@cosmjs/proto-signing" "0.32.3" + "@cosmjs/stargate" "0.32.3" + "@cosmjs/tendermint-rpc" "0.32.3" + "@cosmology/lcd" "^0.13.3" outdent@^0.5.0: version "0.5.0" @@ -14633,7 +15087,7 @@ parse-png@^2.1.0: parse5@6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== parseurl@~1.3.3: @@ -14806,9 +15260,14 @@ pngjs@^3.3.0: resolved "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz" integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + postcss-load-config@^3.0.1: version "3.1.4" - resolved "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== dependencies: lilconfig "^2.0.5" @@ -14871,7 +15330,7 @@ prettier@2.5.1: prettier@2.6.2: version "2.6.2" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== prettier@^2.7.1: @@ -14906,7 +15365,7 @@ pretty-format@^26.5.2, pretty-format@^26.6.2: pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== dependencies: ansi-regex "^5.0.1" @@ -14991,7 +15450,7 @@ protobufjs@7.2.4: "@types/node" ">=13.7.0" long "^5.0.0" -protobufjs@^6.11.2, protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: +protobufjs@^6.11.2, protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2: version "6.11.4" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz" integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== @@ -15031,7 +15490,7 @@ pseudomap@^1.0.2: psl@^1.1.33: version "1.9.0" - resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== public-encrypt@^4.0.0: @@ -15379,7 +15838,7 @@ readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" @@ -15425,15 +15884,15 @@ reflect-metadata@0.1.13: integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== reflect.getprototypeof@^1.0.4: - version "1.0.5" - resolved "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.5.tgz" - integrity sha512-62wgfC8dJWrmxv44CA36pLDnP6KKl3Vhxb7PL+8+qrrFMMoJij4vgiMP8zV4O8+CBMXY1mHxI5fITGHXFHVmQQ== + version "1.0.6" + resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz#3ab04c32a8390b770712b7a8633972702d278859" + integrity sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg== dependencies: - call-bind "^1.0.5" + call-bind "^1.0.7" define-properties "^1.2.1" - es-abstract "^1.22.3" - es-errors "^1.0.0" - get-intrinsic "^1.2.3" + es-abstract "^1.23.1" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" globalthis "^1.0.3" which-builtin-type "^1.1.3" @@ -15466,16 +15925,6 @@ regenerator-transform@^0.15.2: dependencies: "@babel/runtime" "^7.8.4" -regexp.prototype.flags@^1.5.0, regexp.prototype.flags@^1.5.2: - version "1.5.2" - resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz" - integrity sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw== - dependencies: - call-bind "^1.0.6" - define-properties "^1.2.1" - es-errors "^1.3.0" - set-function-name "^2.0.1" - regexp.prototype.flags@^1.5.1: version "1.5.1" resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz" @@ -15485,6 +15934,16 @@ regexp.prototype.flags@^1.5.1: define-properties "^1.2.0" set-function-name "^2.0.0" +regexp.prototype.flags@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334" + integrity sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw== + dependencies: + call-bind "^1.0.6" + define-properties "^1.2.1" + es-errors "^1.3.0" + set-function-name "^2.0.1" + regexpp@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz" @@ -15610,7 +16069,7 @@ resolve-pkg-maps@^1.0.0: resolve.exports@^1.1.0: version "1.1.1" - resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999" integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== resolve@^1.10.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4: @@ -15622,9 +16081,9 @@ resolve@^1.10.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.2 path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -resolve@^2.0.0-next.4: +resolve@^2.0.0-next.5: version "2.0.0-next.5" - resolved "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" integrity sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA== dependencies: is-core-module "^2.13.0" @@ -15777,7 +16236,7 @@ rlp@^2.2.4: rollup-plugin-inject@^3.0.0: version "3.0.2" - resolved "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz" + resolved "https://registry.yarnpkg.com/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz#e4233855bfba6c0c12a312fd6649dff9a13ee9f4" integrity sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w== dependencies: estree-walker "^0.6.1" @@ -15786,25 +16245,37 @@ rollup-plugin-inject@^3.0.0: rollup-plugin-node-polyfills@^0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz#53092a2744837164d5b8a28812ba5f3ff61109fd" integrity sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA== dependencies: rollup-plugin-inject "^3.0.0" rollup-pluginutils@^2.8.1: version "2.8.2" - resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== dependencies: estree-walker "^0.6.1" rollup@^3.2.5: version "3.29.4" - resolved "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981" integrity sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw== optionalDependencies: fsevents "~2.3.2" +rpc-websockets@^7.11.0: + version "7.11.0" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.11.0.tgz#05451975963a7d1a4cf36d54e200bfc4402a56d7" + integrity sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w== + dependencies: + eventemitter3 "^4.0.7" + uuid "^8.3.2" + ws "^8.5.0" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + rpc-websockets@^7.5.1: version "7.9.0" resolved "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.9.0.tgz" @@ -15867,7 +16338,7 @@ rxjs@^7.4.0, rxjs@^7.5.5, rxjs@^7.8.1: dependencies: tslib "^2.1.0" -safe-array-concat@^1.0.1, safe-array-concat@^1.1.0: +safe-array-concat@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz" integrity sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg== @@ -15877,6 +16348,16 @@ safe-array-concat@^1.0.1, safe-array-concat@^1.1.0: has-symbols "^1.0.3" isarray "^2.0.5" +safe-array-concat@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb" + integrity sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q== + dependencies: + call-bind "^1.0.7" + get-intrinsic "^1.2.4" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" @@ -15913,7 +16394,7 @@ sax@>=0.6.0: saxes@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== dependencies: xmlchars "^2.2.0" @@ -16015,18 +16496,23 @@ semver@7.3.2: resolved "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== -semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3: - version "7.6.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz" - integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== - dependencies: - lru-cache "^6.0.0" +semver@7.x, semver@^7.3.2: + version "7.6.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" + integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== +semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3: + version "7.6.0" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz" + integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== + dependencies: + lru-cache "^6.0.0" + send@0.18.0, send@^0.18.0: version "0.18.0" resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz" @@ -16097,7 +16583,7 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -set-function-length@^1.2.0, set-function-length@^1.2.1: +set-function-length@^1.2.0: version "1.2.1" resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz" integrity sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g== @@ -16109,7 +16595,19 @@ set-function-length@^1.2.0, set-function-length@^1.2.1: gopd "^1.0.1" has-property-descriptors "^1.0.1" -set-function-name@^2.0.0, set-function-name@^2.0.1: +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +set-function-name@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz" integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== @@ -16118,6 +16616,16 @@ set-function-name@^2.0.0, set-function-name@^2.0.1: functions-have-names "^1.2.3" has-property-descriptors "^1.0.0" +set-function-name@^2.0.1, set-function-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" + integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.2" + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" @@ -16182,7 +16690,7 @@ shell-quote@^1.6.1, shell-quote@^1.7.3: shiki@^0.10.1: version "0.10.1" - resolved "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.10.1.tgz#6f9a16205a823b56c072d0f1a0bcd0f2646bef14" integrity sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng== dependencies: jsonc-parser "^3.0.0" @@ -16206,6 +16714,16 @@ side-channel@^1.0.4: get-intrinsic "^1.2.4" object-inspect "^1.13.1" +side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" + signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.7" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" @@ -16371,7 +16889,7 @@ source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.2 source-map@0.8.0-beta.0: version "0.8.0-beta.0" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== dependencies: whatwg-url "^7.0.0" @@ -16393,7 +16911,7 @@ source-map@^0.7.3: sourcemap-codec@^1.4.8: version "1.4.8" - resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== spawndamnit@^2.0.0: @@ -16529,7 +17047,7 @@ string-env-interpolation@1.0.1, string-env-interpolation@^1.0.1: string-length@^4.0.1: version "4.0.2" - resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== dependencies: char-regex "^1.0.2" @@ -16537,7 +17055,7 @@ string-length@^4.0.1: string-length@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/string-length/-/string-length-5.0.1.tgz" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-5.0.1.tgz#3d647f497b6e8e8d41e422f7e0b23bc536c8381e" integrity sha512-9Ep08KAMUn0OadnVaBuRdE2l615CQ508kr0XMadjClfYpdCyvrbFp6Taebo8yyxokQ4viUd/xPPUA4FGgUa0ow== dependencies: char-regex "^2.0.0" @@ -16579,20 +17097,23 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -string.prototype.matchall@^4.0.8: - version "4.0.10" - resolved "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz" - integrity sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ== +string.prototype.matchall@^4.0.11: + version "4.0.11" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz#1092a72c59268d2abaad76582dccc687c0297e0a" + integrity sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg== dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - get-intrinsic "^1.2.1" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.4" + gopd "^1.0.1" has-symbols "^1.0.3" - internal-slot "^1.0.5" - regexp.prototype.flags "^1.5.0" - set-function-name "^2.0.0" - side-channel "^1.0.4" + internal-slot "^1.0.7" + regexp.prototype.flags "^1.5.2" + set-function-name "^2.0.2" + side-channel "^1.0.6" string.prototype.trim@^1.2.8: version "1.2.8" @@ -16603,6 +17124,16 @@ string.prototype.trim@^1.2.8: define-properties "^1.2.0" es-abstract "^1.22.1" +string.prototype.trim@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" + integrity sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.0" + es-object-atoms "^1.0.0" + string.prototype.trimend@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz" @@ -16612,6 +17143,15 @@ string.prototype.trimend@^1.0.7: define-properties "^1.2.0" es-abstract "^1.22.1" +string.prototype.trimend@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz#3651b8513719e8a9f48de7f2f77640b26652b229" + integrity sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + string.prototype.trimstart@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz" @@ -16621,6 +17161,15 @@ string.prototype.trimstart@^1.0.7: define-properties "^1.2.0" es-abstract "^1.22.1" +string.prototype.trimstart@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" + integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -16682,7 +17231,7 @@ strip-bom@^3.0.0: strip-bom@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== strip-eof@^1.0.0: @@ -16831,7 +17380,7 @@ symbol-observable@^4.0.0: symbol-tree@^3.2.4: version "3.2.4" - resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== synckit@^0.8.4: @@ -16972,7 +17521,7 @@ terser@^5.15.0, terser@^5.16.5, terser@^5.26.0: test-exclude@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== dependencies: "@istanbuljs/schema" "^0.1.2" @@ -17010,7 +17559,7 @@ throat@^5.0.0: throat@^6.0.1: version "6.0.2" - resolved "https://registry.npmjs.org/throat/-/throat-6.0.2.tgz" + resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.2.tgz#51a3fbb5e11ae72e2cf74861ed5c8020f89f29fe" integrity sha512-WKexMoJj3vEuK0yFEapj8y64V0A6xcuPuK9Gt1d0R+dzCSJc0lHqQytAbSB4cDAK0dWh4T0E2ETkoLE2WZ41OQ== through2@^2.0.1, through2@^2.0.2, through2@^2.0.3: @@ -17108,9 +17657,9 @@ totalist@^1.0.0: integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== tough-cookie@^4.0.0: - version "4.1.3" - resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz" - integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== + version "4.1.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== dependencies: psl "^1.1.33" punycode "^2.1.1" @@ -17119,14 +17668,14 @@ tough-cookie@^4.0.0: tr46@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== dependencies: punycode "^2.1.0" tr46@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" @@ -17143,7 +17692,7 @@ traverse@~0.6.6: tree-kill@^1.2.2: version "1.2.2" - resolved "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== trim-newlines@^3.0.0: @@ -17184,7 +17733,7 @@ ts-invariant@^0.10.3: ts-jest@27.1.4: version "27.1.4" - resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.4.tgz" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.4.tgz#84d42cf0f4e7157a52e7c64b1492c46330943e00" integrity sha512-qjkZlVPWVctAezwsOD1OPzbZ+k7zA5z3oxII4dGdZo5ggX/PL7kvwTM0pXTr10fAtbiVpJaL3bWd502zAhpgSQ== dependencies: bs-logger "0.x" @@ -17280,12 +17829,12 @@ tslib@~2.4.0: tslib@~2.5.0: version "2.5.3" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== tsup@6.6.3: version "6.6.3" - resolved "https://registry.npmjs.org/tsup/-/tsup-6.6.3.tgz" + resolved "https://registry.yarnpkg.com/tsup/-/tsup-6.6.3.tgz#f6f975a8656cfd9b8e115f33b1aa0f0fd4df78e2" integrity sha512-OLx/jFllYlVeZQ7sCHBuRVEQBBa1tFbouoc/gbYakyipjVQdWy/iQOvmExUA/ewap9iQ7tbJf9pW0PgcEFfJcQ== dependencies: bundle-require "^4.0.0" @@ -17451,12 +18000,12 @@ typed-array-buffer@^1.0.0: get-intrinsic "^1.2.1" is-typed-array "^1.1.10" -typed-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.1.tgz" - integrity sha512-RSqu1UEuSlrBhHTWC8O9FnPjOduNs4M7rJ4pRKoEjtx1zUNOPN2sSXHLDX+Y2WPbHIxbvg4JFo2DNAEfPIKWoQ== +typed-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" + integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== dependencies: - call-bind "^1.0.6" + call-bind "^1.0.7" es-errors "^1.3.0" is-typed-array "^1.1.13" @@ -17470,6 +18019,17 @@ typed-array-byte-length@^1.0.0: has-proto "^1.0.1" is-typed-array "^1.1.10" +typed-array-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" + integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + typed-array-byte-offset@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz" @@ -17481,6 +18041,18 @@ typed-array-byte-offset@^1.0.0: has-proto "^1.0.1" is-typed-array "^1.1.10" +typed-array-byte-offset@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz#f9ec1acb9259f395093e4567eb3c28a580d02063" + integrity sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz" @@ -17490,16 +18062,28 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" +typed-array-length@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.6.tgz#57155207c76e64a3457482dfdc1c9d1d3c4c73a3" + integrity sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + possible-typed-array-names "^1.0.0" + typedarray-to-buffer@^3.1.5: version "3.1.5" - resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== dependencies: is-typedarray "^1.0.0" typedoc@0.22.15: version "0.22.15" - resolved "https://registry.npmjs.org/typedoc/-/typedoc-0.22.15.tgz" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.15.tgz#c6ad7ed9d017dc2c3a06c9189cb392bd8e2d8c3f" integrity sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q== dependencies: glob "^7.2.0" @@ -17624,7 +18208,7 @@ universalify@^0.1.0: universalify@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== universalify@^1.0.0: @@ -17815,12 +18399,12 @@ v8-compile-cache-lib@^3.0.0: v8-compile-cache@^2.0.3: version "2.4.0" - resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== v8-to-istanbul@^8.1.0: version "8.1.1" - resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" @@ -17886,24 +18470,24 @@ vlq@^1.0.0: vscode-oniguruma@^1.6.1: version "1.7.0" - resolved "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz" + resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b" integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA== vscode-textmate@5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz" + resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e" integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ== w3c-hr-time@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== dependencies: browser-process-hrtime "^1.0.0" w3c-xmlserializer@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== dependencies: xml-name-validator "^3.0.0" @@ -17953,17 +18537,17 @@ webidl-conversions@^3.0.0: webidl-conversions@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== webidl-conversions@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== webidl-conversions@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== webpack-bundle-analyzer@4.3.0: @@ -18066,7 +18650,7 @@ websocket-stream@^5.5.0: whatwg-encoding@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: iconv-lite "0.4.24" @@ -18078,7 +18662,7 @@ whatwg-fetch@^3.0.0: whatwg-mimetype@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== whatwg-url@^5.0.0: @@ -18091,7 +18675,7 @@ whatwg-url@^5.0.0: whatwg-url@^7.0.0: version "7.1.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== dependencies: lodash.sortby "^4.7.0" @@ -18100,7 +18684,7 @@ whatwg-url@^7.0.0: whatwg-url@^8.0.0, whatwg-url@^8.5.0: version "8.7.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" @@ -18120,7 +18704,7 @@ which-boxed-primitive@^1.0.2: which-builtin-type@^1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz" + resolved "https://registry.yarnpkg.com/which-builtin-type/-/which-builtin-type-1.1.3.tgz#b1b8443707cc58b6e9bf98d32110ff0c2cbd029b" integrity sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw== dependencies: function.prototype.name "^1.1.5" @@ -18137,14 +18721,14 @@ which-builtin-type@^1.1.3: which-typed-array "^1.1.9" which-collection@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz" - integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" + integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== dependencies: - is-map "^2.0.1" - is-set "^2.0.1" - is-weakmap "^2.0.1" - is-weakset "^2.0.1" + is-map "^2.0.3" + is-set "^2.0.3" + is-weakmap "^2.0.2" + is-weakset "^2.0.3" which-module@^2.0.0: version "2.0.1" @@ -18159,7 +18743,7 @@ which-pm@2.0.0: load-yaml-file "^0.2.0" path-exists "^4.0.0" -which-typed-array@^1.1.13, which-typed-array@^1.1.14, which-typed-array@^1.1.2, which-typed-array@^1.1.9: +which-typed-array@^1.1.13, which-typed-array@^1.1.14, which-typed-array@^1.1.2: version "1.1.14" resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz" integrity sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg== @@ -18170,6 +18754,17 @@ which-typed-array@^1.1.13, which-typed-array@^1.1.14, which-typed-array@^1.1.2, gopd "^1.0.1" has-tostringtag "^1.0.1" +which-typed-array@^1.1.15, which-typed-array@^1.1.9: + version "1.1.15" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" + integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.2" + which@^1.2.9: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" @@ -18265,7 +18860,7 @@ write-file-atomic@^2.3.0: write-file-atomic@^3.0.0: version "3.0.3" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== dependencies: imurmurhash "^0.1.4" @@ -18285,7 +18880,7 @@ ws@7.5.9, ws@^7, ws@^7.2.0, ws@^7.3.1, ws@^7.4.5, ws@^7.4.6, ws@^7.5.1, ws@^7.5. ws@8.13.0: version "8.13.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== ws@8.5.0: @@ -18334,12 +18929,12 @@ xcode@^3.0.1: xhr2@0.2.1: version "0.2.1" - resolved "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz" + resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.2.1.tgz#4e73adc4f9cfec9cbd2157f73efdce3a5f108a93" integrity sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw== xml-name-validator@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== xml2js@0.4.23: @@ -18367,7 +18962,7 @@ xmlbuilder@~11.0.0: xmlchars@^2.2.0: version "2.2.0" - resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== xstream@^11.14.0: @@ -18420,7 +19015,7 @@ yaml@^1.10.0, yaml@^1.10.2: yargs-parser@20.x, yargs-parser@^20.2.2: version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs-parser@^18.1.2, yargs-parser@^18.1.3: @@ -18455,7 +19050,7 @@ yargs@^15.1.0, yargs@^15.3.1: yargs@^16.2.0: version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" From 90fcdde78c148b40cdf9606d9c0161c94ae75522 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 21 Jun 2024 04:32:05 +0000 Subject: [PATCH 016/176] Version packages --- .changeset/breezy-wombats-fetch.md | 9 --------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- 11 files changed, 43 insertions(+), 14 deletions(-) delete mode 100644 .changeset/breezy-wombats-fetch.md diff --git a/.changeset/breezy-wombats-fetch.md b/.changeset/breezy-wombats-fetch.md deleted file mode 100644 index 943ddabf..00000000 --- a/.changeset/breezy-wombats-fetch.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-evm': patch ---- - -Upgrade version for core package of binance lib, cosmos lib, solana lib, core lib and evm lid. diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index e973fbc7..92e48e3e 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.14 + +### Patch Changes + +- b3b380fd: Upgrade version for core package of binance lib, cosmos lib, solana lib, core lib and evm lid. +- Updated dependencies [b3b380fd] + - @xdefi-tech/chains-core@2.0.18 + ## 2.0.13 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 47a16d36..7b8084f7 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.13", + "version": "2.0.14", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 8e28a776..f5d317a5 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.18 + +### Patch Changes + +- b3b380fd: Upgrade version for core package of binance lib, cosmos lib, solana lib, core lib and evm lid. + ## 2.0.17 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index b85a586e..7c413441 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.17", + "version": "2.0.18", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 81a04094..ed0354f6 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.20 + +### Patch Changes + +- b3b380fd: Upgrade version for core package of binance lib, cosmos lib, solana lib, core lib and evm lid. +- Updated dependencies [b3b380fd] + - @xdefi-tech/chains-core@2.0.18 + ## 2.0.19 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 10c63400..e572b7f8 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.19", + "version": "2.0.20", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 5c50441c..8d27519b 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.29 + +### Patch Changes + +- b3b380fd: Upgrade version for core package of binance lib, cosmos lib, solana lib, core lib and evm lid. +- Updated dependencies [b3b380fd] + - @xdefi-tech/chains-core@2.0.18 + ## 2.0.28 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index d4ea3ba1..5fbafd23 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.28", + "version": "2.0.29", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 82fb0c45..d2e9be85 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.21 + +### Patch Changes + +- b3b380fd: Upgrade version for core package of binance lib, cosmos lib, solana lib, core lib and evm lid. +- Updated dependencies [b3b380fd] + - @xdefi-tech/chains-core@2.0.18 + ## 2.0.20 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 1a6d33d0..ddb21cdf 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.20", + "version": "2.0.21", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 62dc1a730369421f0aaede306144157193328636 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:25:31 +0300 Subject: [PATCH 017/176] fix: swap and send nft transactions (#249) --- .changeset/gentle-poets-doubt.md | 5 + packages/cosmos/package.json | 4 +- packages/cosmos/src/msg.ts | 121 ++++++++++++++---- .../src/signers/private-key.signer.spec.ts | 27 +--- packages/cosmos/src/utils.ts | 51 +------- yarn.lock | 56 ++++---- 6 files changed, 139 insertions(+), 125 deletions(-) create mode 100644 .changeset/gentle-poets-doubt.md diff --git a/.changeset/gentle-poets-doubt.md b/.changeset/gentle-poets-doubt.md new file mode 100644 index 00000000..f6bd7a71 --- /dev/null +++ b/.changeset/gentle-poets-doubt.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +Fix: swap and send NFT transactions diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index e572b7f8..4a63528f 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -22,6 +22,7 @@ }, "dependencies": { "@cosmjs/amino": "0.32.3", + "@cosmjs/cosmwasm-stargate": "0.32.3", "@cosmjs/encoding": "0.32.3", "@cosmjs/launchpad": "0.27.1", "@cosmjs/ledger-amino": "0.32.3", @@ -49,7 +50,8 @@ "rimraf": "4.4.0", "rxjs": "7.8.0", "stream-browserify": "3.0.0", - "ts-node": "10.7.0" + "ts-node": "10.7.0", + "xhr2": "^0.2.1" }, "scripts": { "build": "tsup --minify --clean", diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 937f8b9a..d51e6a45 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -7,8 +7,11 @@ import { NumberIsh, Coin, } from '@xdefi-tech/chains-core'; -import { StdTx } from '@cosmjs/amino'; +import { StdTx, Coin as AminoCoin } from '@cosmjs/amino'; import BigNumber from 'bignumber.js'; +import { cosmos, ibc, osmosis } from 'osmojs'; +import Long from 'long'; +import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; import type { CosmosProvider } from './chain.provider'; @@ -73,6 +76,62 @@ export class ChainMsg extends BasMsg { .toString(); } + private getIBCTransferMsg(rawMsg: any) { + const ibcCheck = rawMsg.token.denom.split('/'); + if (ibcCheck?.[0] === 'ibc') { + rawMsg.token.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + } + if (rawMsg.timeoutTimestamp) { + rawMsg.timeoutTimestamp = Long.fromValue(rawMsg.timeoutTimestamp); + } + const ibcTransfer = + ibc.applications.transfer.v1.MsgTransfer.fromPartial(rawMsg); + + return ibc.applications.transfer.v1.MessageComposer.withTypeUrl.transfer( + ibcTransfer + ); + } + + private getSwapMsg(rawMsg: any) { + rawMsg.tokenIn.amount = rawMsg.tokenIn.amount.toString(); + const ibcCheck = rawMsg.tokenIn.denom.split('/'); + if (ibcCheck?.[0] === 'ibc') { + rawMsg.tokenIn.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + } + rawMsg.tokenOutMinAmount = rawMsg.tokenOutMinAmount.toString(); + const msgSwapExactAmountIn = + osmosis.gamm.v1beta1.MsgSwapExactAmountIn.fromPartial(rawMsg); + return osmosis.gamm.v1beta1.MessageComposer.withTypeUrl.swapExactAmountIn( + msgSwapExactAmountIn + ); + } + + private getMsgSend(rawMsg: any) { + rawMsg.amount = rawMsg.amount.map((coin: AminoCoin) => { + const ibcCheck = coin.denom.split('/'); + let denom = coin.denom; + if (ibcCheck?.[0] === 'ibc') { + denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + } + + return { + denom, + amount: coin.amount.toString(), + }; + }); + const msgSend = cosmos.bank.v1beta1.MsgSend.fromPartial(rawMsg); + return cosmos.bank.v1beta1.MessageComposer.withTypeUrl.send(msgSend); + } + + private getExecuteContract(rawMsg: any) { + rawMsg.msg = new Uint8Array(rawMsg.msg); + + return { + typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract', + value: MsgExecuteContract.fromPartial(rawMsg), + }; + } + private getMsgToSend() { const msgData = this.toData(); let msgs; @@ -106,16 +165,16 @@ export class ChainMsg extends BasMsg { msgs = [ { typeUrl: typeUrl, - value: { + value: cosmos.bank.v1beta1.MsgSend.fromPartial({ fromAddress: msgData.from, toAddress: msgData.to, amount: [ { - amount: this.getValue(), denom: msgData.denom || this.provider.manifest.denom, + amount: this.getValue(), }, ], - }, + }), }, ]; } @@ -140,30 +199,48 @@ export class ChainMsg extends BasMsg { signer, } = JSON.parse(msgData.data); - const encodedMsgs = msgs.map( - ({ '@type': type, ...rest }: { '@type': any; [key: string]: any }) => { - let returningValue = rest; - switch (type) { - case '/ibc.applications.transfer.v1.MsgTransfer': - returningValue = { - ...rest, - timeoutTimestamp: - typeof rest.timeoutTimestamp === 'object' - ? rest.timeoutTimestamp.high.toString() - : rest.timeoutTimestamp.toString(), - }; - break; - } + const encodedMsgs = msgs.map((signDocMsg: any) => { + const key: string = + signDocMsg?.['@type'] || + signDocMsg?.['type'] || + signDocMsg?.typeUrl || + ''; + const rawMsg = signDocMsg?.value ?? signDocMsg; - return { typeUrl: type, value: returningValue }; + const isIBCTransfer = + ibc.applications.transfer.v1.AminoConverter[ + key as keyof typeof ibc.applications.transfer.v1.AminoConverter + ]; + if (isIBCTransfer) { + return this.getIBCTransferMsg(rawMsg); } - ); + + const isMsgSwapExactAmountIn = + osmosis.gamm.v1beta1.AminoConverter[ + key as keyof typeof osmosis.gamm.v1beta1.AminoConverter + ]; + if (isMsgSwapExactAmountIn) { + return this.getSwapMsg(rawMsg); + } + + const isMsgSend = + cosmos.bank.v1beta1.AminoConverter[ + key as keyof typeof cosmos.bank.v1beta1.AminoConverter + ]; + if (isMsgSend) { + return this.getMsgSend(rawMsg); + } + + if (key === '/cosmwasm.wasm.v1.MsgExecuteContract') { + return this.getExecuteContract(rawMsg); + } + }); return { msgs: encodedMsgs, fee: { amount: fee.amount.map(({ amount, denom }: any) => ({ - amount: amount.toString(), + amount: Math.ceil(amount).toString(), denom, })), gas: fee.gas.toString(), @@ -184,7 +261,7 @@ export class ChainMsg extends BasMsg { { amount: feeOptions ? new BigNumber(msgData.gasLimit) - .multipliedBy(feeOptions.gasAdjustment) + .multipliedBy(feeOptions.gasAdjustment || 1) .multipliedBy(msgData.gasPrice) .toFixed(0) : new BigNumber(msgData.gasPrice) diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index 72e82966..1584df28 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -10,31 +10,6 @@ import { ChainMsg, MsgBody } from '../msg'; import { PrivateKeySigner } from './private-key.signer'; -jest.mock('@cosmjs/stargate/build/signingstargateclient', () => { - return { - SigningStargateClient: { - createWithSigner: jest.fn().mockResolvedValue({ - sign: jest.fn().mockResolvedValue({}), - }), - connectWithSigner: jest.fn().mockResolvedValue({ - sign: jest.fn().mockResolvedValue({}), - }), - }, - defaultRegistryTypes: [], - createDefaultAminoConverters: jest.fn().mockResolvedValue([]), - }; -}); - -jest.mock('cosmjs-types/cosmos/tx/v1beta1/tx', () => { - return { - TxRaw: { - encode: jest.fn().mockImplementation(() => { - return { finish: jest.fn().mockReturnValue([1, 1, 1]) }; - }), - }, - }; -}); - type CosmosHdPathTypes = { cosmos: string; terra: string; @@ -78,6 +53,8 @@ describe('private-key.signer', () => { from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', amount: '0.000001', + gasLimit: 200000, + gasPrice: COSMOS_MANIFESTS.cosmos.feeGasStep.medium, }; // unsigned msg from backend backendSwapTransaction = { diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index feb8a0f9..1fe1b09a 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -1,39 +1,20 @@ import { createDefaultAminoConverters, defaultRegistryTypes, - Coin, } from '@cosmjs/stargate'; import { AminoTypes } from '@cosmjs/stargate/build/aminotypes'; -import { toUtf8 } from '@cosmjs/encoding'; -import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; import { Registry } from '@cosmjs/proto-signing/build/registry'; import { osmosisProtoRegistry, osmosisAminoConverters, } from 'osmojs/osmosis/client'; import axios from 'axios'; +import { wasmTypes } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/messages'; +import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate'; import { COSMOS_MANIFESTS, CosmosHubChains } from './manifests'; import { MsgBody } from './msg'; -/** - * The Amino JSON representation of [MsgExecuteContract]. - * - * [MsgExecuteContract]: https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/tx.proto#L73-L86 - */ -export interface AminoMsgExecuteContract { - type: 'wasm/MsgExecuteContract'; - value: { - /** Bech32 account address */ - readonly sender: string; - /** Bech32 account address */ - readonly contract: string; - /** Execute message as JavaScript object */ - readonly msg: any; - readonly funds: readonly Coin[]; - }; -} - export interface ChainAsset { denom: string; chain_id: string; @@ -104,36 +85,12 @@ export const STARGATE_CLIENT_OPTIONS = { registry: new Registry([ ...defaultRegistryTypes, ...osmosisProtoRegistry, - ['/cosmwasm.wasm.v1.MsgExecuteContract', MsgExecuteContract], + ...wasmTypes, ]), aminoTypes: new AminoTypes({ ...createDefaultAminoConverters(), ...osmosisAminoConverters, - '/cosmwasm.wasm.v1.MsgExecuteContract': { - aminoType: 'wasm/MsgExecuteContract', - toAmino: ({ - sender, - contract, - msg, - funds, - }: MsgExecuteContract): AminoMsgExecuteContract['value'] => ({ - sender: sender, - contract: contract, - msg: msg, - funds: funds, - }), - fromAmino: ({ - sender, - contract, - msg, - funds, - }: AminoMsgExecuteContract['value']): MsgExecuteContract => ({ - sender: sender, - contract: contract, - msg: toUtf8(JSON.stringify(msg)), - funds: [...funds], - }), - }, + ...createWasmAminoConverters(), }), }; diff --git a/yarn.lock b/yarn.lock index f47f6510..5ff8acd1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2007,6 +2007,22 @@ "@cosmjs/math" "^0.32.3" "@cosmjs/utils" "^0.32.3" +"@cosmjs/cosmwasm-stargate@0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.3.tgz#26a110a6bb0c15fdeef647e3433bd9553a1acd5f" + integrity sha512-pqkt+QsLIPNMTRh9m+igJgIpzXXgn1BxmxfAb9zlC23kvsuzY/12un9M7iAdim1NwKXDFeYw46xC2YkprwQp+g== + dependencies: + "@cosmjs/amino" "^0.32.3" + "@cosmjs/crypto" "^0.32.3" + "@cosmjs/encoding" "^0.32.3" + "@cosmjs/math" "^0.32.3" + "@cosmjs/proto-signing" "^0.32.3" + "@cosmjs/stargate" "^0.32.3" + "@cosmjs/tendermint-rpc" "^0.32.3" + "@cosmjs/utils" "^0.32.3" + cosmjs-types "^0.9.0" + pako "^2.0.2" + "@cosmjs/crypto@0.27.1": version "0.27.1" resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz" @@ -2124,7 +2140,7 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.32.3": +"@cosmjs/stargate@0.32.3", "@cosmjs/stargate@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.3.tgz#5a92b222ada960ebecea72cc9f366370763f4b66" integrity sha512-OQWzO9YWKerUinPIxrO1MARbe84XkeXJAW0lyMIjXIEikajuXZ+PwftiKA5yA+8OyditVmHVLtPud6Pjna2s5w== @@ -15018,6 +15034,11 @@ p-try@^2.0.0: resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +pako@^2.0.2: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + param-case@^2.1.0: version "2.1.1" resolved "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz" @@ -17061,7 +17082,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17079,15 +17100,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -17189,7 +17201,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17210,13 +17222,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -18808,7 +18813,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18826,15 +18831,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" @@ -18927,7 +18923,7 @@ xcode@^3.0.1: simple-plist "^1.1.0" uuid "^7.0.3" -xhr2@0.2.1: +xhr2@0.2.1, xhr2@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.2.1.tgz#4e73adc4f9cfec9cbd2157f73efdce3a5f108a93" integrity sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw== From d926fefd08f1591b4c7077768f00c77bc0a85337 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 25 Jun 2024 10:27:53 +0000 Subject: [PATCH 018/176] Version packages --- .changeset/gentle-poets-doubt.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/gentle-poets-doubt.md diff --git a/.changeset/gentle-poets-doubt.md b/.changeset/gentle-poets-doubt.md deleted file mode 100644 index f6bd7a71..00000000 --- a/.changeset/gentle-poets-doubt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -Fix: swap and send NFT transactions diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index ed0354f6..3322cc4a 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.21 + +### Patch Changes + +- deeeccd0: Fix: swap and send NFT transactions + ## 2.0.20 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 4a63528f..3e95b6f3 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.20", + "version": "2.0.21", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From cd79974d19bfea12d5ab337d19fd8a3eebd35b95 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:24:49 +0700 Subject: [PATCH 019/176] chore: install size limit package to develop (#251) * chore: install size limit package to develop * chore: install size limit package to develop --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 05c3608c..1ba21cc2 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "scripts": { "prepare": "husky install", "build": "turbo run build", + "size-build": "yarn add --dev @size-limit/file@11.1.4 @size-limit/preset-big-lib@11.1.1 size-limit@11.1.4 --ignore-workspace-root-check && turbo run build", "dev": "turbo run dev", "publish:packages": "turbo run build && turbo run publish:packages", "coverage:per-package": "turbo run coverage", From 6ba175e56a7e733c23281b18a9556d85e91b1d61 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:57:31 +0300 Subject: [PATCH 020/176] feat: XDEFI-8304 thorchain nodeurl (#247) * feat: add indexer datasource to thorchain package (WIP) * feat: update manifest with nodeUrl, update testcases --- packages/thor/src/chain.provider.spec.ts | 66 +- packages/thor/src/chain.provider.ts | 5 +- .../src/datasource/chain/chain.data-source.ts | 4 +- packages/thor/src/datasource/index.ts | 1 + .../datasource/indexer/gql/mayachain.graphql | 101 ++ .../datasource/indexer/gql/thorchain.graphql | 101 ++ .../datasource/indexer/indexer.data-source.ts | 164 ++ .../indexer/queries/balances.query.ts | 50 + .../datasource/indexer/queries/fees.query.ts | 47 + .../src/datasource/indexer/queries/index.ts | 3 + .../indexer/queries/transactions.query.ts | 56 + packages/thor/src/manifests.ts | 12 +- packages/thor/src/msg.spec.ts | 3 +- utility-packages/graphql/src/gql/gql.ts | 16 + utility-packages/graphql/src/gql/graphql.ts | 1502 +++++++++++++++++ 15 files changed, 2098 insertions(+), 33 deletions(-) create mode 100644 packages/thor/src/datasource/indexer/gql/mayachain.graphql create mode 100644 packages/thor/src/datasource/indexer/gql/thorchain.graphql create mode 100644 packages/thor/src/datasource/indexer/indexer.data-source.ts create mode 100644 packages/thor/src/datasource/indexer/queries/balances.query.ts create mode 100644 packages/thor/src/datasource/indexer/queries/fees.query.ts create mode 100644 packages/thor/src/datasource/indexer/queries/index.ts create mode 100644 packages/thor/src/datasource/indexer/queries/transactions.query.ts diff --git a/packages/thor/src/chain.provider.spec.ts b/packages/thor/src/chain.provider.spec.ts index f7556c2d..381be02b 100644 --- a/packages/thor/src/chain.provider.spec.ts +++ b/packages/thor/src/chain.provider.spec.ts @@ -1,10 +1,35 @@ -import { Response } from '@xdefi-tech/chains-core'; +import { Response, Coin } from '@xdefi-tech/chains-core'; import { ChainMsg } from './msg'; import { ThorProvider } from './chain.provider'; -import { ChainDataSource } from './datasource'; import { THORCHAIN_MANIFESTS, ThorChains } from './manifests'; +jest.mock('./datasource/indexer/queries/balances.query', () => ({ + getBalance: () => { + return [ + { + address: 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94', + amount: { + value: '100000000', + }, + asset: { + chain: 'THORChain', + contract: null, + decimals: 8, + id: '3147627e-a757-4c58-b98d-dc720bf57af7', + name: 'Rune', + image: + 'https://xdefi-prod-static.s3.eu-west-1.amazonaws.com/thorchain.png', + price: { + amount: '6.12', + }, + symbol: 'RUNE', + }, + }, + ]; + }, +})); + jest.mock('axios', () => ({ create: jest.fn().mockReturnValue({ get: jest.fn().mockResolvedValue({ @@ -13,16 +38,16 @@ jest.mock('axios', () => ({ body: { messages: [ { - from_address: 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94', - to_address: 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94', + from_address: 'thor1x843445a6z2e3edem9se22hnekurl7tauza6ft', + to_address: 'thor1x843445a6z2e3edem9se22hnekurl7tauza6ft', }, ], }, }, tx_response: { - height: '17932843', + height: '16389413', txhash: - '30D580A3E1CA1D440BF2AB4081D9C0D834C833646ADE834EE52F1A255E5053B0', + 'E98E0A382DF95889AD80CAA585596F06F92F700E52F390E71FD0625D31696F20', codespace: '', code: 0, data: '', @@ -30,7 +55,7 @@ jest.mock('axios', () => ({ }, block: { header: { - height: '17932843', + height: '16389413', }, }, }, @@ -41,10 +66,14 @@ jest.mock('axios', () => ({ describe('chain.provider', () => { const providers: Record = { [ThorChains.thorchain]: new ThorProvider( - new ChainDataSource(THORCHAIN_MANIFESTS[ThorChains.thorchain]) + new ThorProvider.dataSourceList.IndexerDataSource( + THORCHAIN_MANIFESTS[ThorChains.thorchain] + ) ), [ThorChains.mayachain]: new ThorProvider( - new ChainDataSource(THORCHAIN_MANIFESTS[ThorChains.mayachain]) + new ThorProvider.dataSourceList.IndexerDataSource( + THORCHAIN_MANIFESTS[ThorChains.mayachain] + ) ), }; @@ -53,7 +82,7 @@ describe('chain.provider', () => { to: 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94', from: 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94', amount: 0.000001, - decimals: 18, + decimals: 8, }); expect(msg).toBeInstanceOf(ChainMsg); @@ -61,10 +90,10 @@ describe('chain.provider', () => { it('should get a transaction from thorchain', async () => { const txData = await providers[ThorChains.thorchain].getTransaction( - '30D580A3E1CA1D440BF2AB4081D9C0D834C833646ADE834EE52F1A255E5053B0' + 'E98E0A382DF95889AD80CAA585596F06F92F700E52F390E71FD0625D31696F20' ); expect(txData?.hash).toEqual( - '30D580A3E1CA1D440BF2AB4081D9C0D834C833646ADE834EE52F1A255E5053B0' + 'E98E0A382DF95889AD80CAA585596F06F92F700E52F390E71FD0625D31696F20' ); }); @@ -77,18 +106,13 @@ describe('chain.provider', () => { }); it('should get a balance from thorchain', async () => { - jest.spyOn(ThorProvider.prototype, 'getBalance').mockResolvedValue( - new Response( - jest.fn().mockImplementation(async () => []), - jest.fn().mockImplementation(async () => []) - ) - ); const balance = await providers[ThorChains.thorchain].getBalance( 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94' ); const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); + expect(balanceData.length).toEqual(1); + expect(balanceData[0]).toBeInstanceOf(Coin); }); it('createMsg(): should create message with data for mayachain', () => { @@ -104,10 +128,10 @@ describe('chain.provider', () => { it('should get a transaction from mayachain', async () => { const txData = await providers[ThorChains.mayachain].getTransaction( - '30D580A3E1CA1D440BF2AB4081D9C0D834C833646ADE834EE52F1A255E5053B0' + 'E98E0A382DF95889AD80CAA585596F06F92F700E52F390E71FD0625D31696F20' ); expect(txData?.hash).toEqual( - '30D580A3E1CA1D440BF2AB4081D9C0D834C833646ADE834EE52F1A255E5053B0' + 'E98E0A382DF95889AD80CAA585596F06F92F700E52F390E71FD0625D31696F20' ); }); diff --git a/packages/thor/src/chain.provider.ts b/packages/thor/src/chain.provider.ts index 6a990d56..ed686b0b 100644 --- a/packages/thor/src/chain.provider.ts +++ b/packages/thor/src/chain.provider.ts @@ -20,7 +20,7 @@ import { bech32 } from 'bech32'; import { ChainMsg, MsgBody } from './msg'; import { ThorManifest } from './manifests'; import { AccountInfo } from './types'; -import { ChainDataSource } from './datasource'; +import { ChainDataSource, IndexerDataSource } from './datasource'; @ChainDecorator('ThorProvider', { deps: [], @@ -33,7 +33,7 @@ export class ThorProvider extends Chain.Provider { constructor(dataSource: DataSource, options?: Chain.IOptions) { super(dataSource, options); - this.rest = axios.create({ baseURL: this.manifest.rpcURL }); + this.rest = axios.create({ baseURL: this.manifest.nodeURL }); } createMsg( @@ -139,6 +139,7 @@ export class ThorProvider extends Chain.Provider { static get dataSourceList() { return { ChainDataSource: ChainDataSource, + IndexerDataSource: IndexerDataSource, }; } diff --git a/packages/thor/src/datasource/chain/chain.data-source.ts b/packages/thor/src/datasource/chain/chain.data-source.ts index 6b24f2e8..0d9a6247 100644 --- a/packages/thor/src/datasource/chain/chain.data-source.ts +++ b/packages/thor/src/datasource/chain/chain.data-source.ts @@ -36,10 +36,10 @@ export class ChainDataSource extends DataSource { constructor(manifest: manifests.ThorManifest) { super(manifest); this.rpcProvider = new cosmosclient.CosmosSDK( - this.manifest.rpcURL, + this.manifest.nodeURL, this.manifest.chainId ); - this.rest = axios.create({ baseURL: this.manifest.rpcURL }); + this.rest = axios.create({ baseURL: this.manifest.nodeURL }); } async getNFTBalance(_address: string) { diff --git a/packages/thor/src/datasource/index.ts b/packages/thor/src/datasource/index.ts index 1b730089..3912d9f4 100644 --- a/packages/thor/src/datasource/index.ts +++ b/packages/thor/src/datasource/index.ts @@ -1 +1,2 @@ export * from './chain/chain.data-source'; +export * from './indexer/indexer.data-source'; diff --git a/packages/thor/src/datasource/indexer/gql/mayachain.graphql b/packages/thor/src/datasource/indexer/gql/mayachain.graphql new file mode 100644 index 00000000..50890076 --- /dev/null +++ b/packages/thor/src/datasource/indexer/gql/mayachain.graphql @@ -0,0 +1,101 @@ +query GetMayachainBalances($address: String!) { + mayachain { + balances(address: $address) { + address + amount { + value + } + asset { + chain + contract + decimals + id + name + image + price { + amount + } + symbol + } + } + } +} + +query GetMayachainTransactions($address: String!, $first: Int!, $after: String) { + mayachain { + transactions(address: $address, first: $first, after: $after) { + pageInfo { + endCursor + hasNextPage + } + edges { + node { + fee { + amount { + value + } + asset { + chain + contract + id + decimals + image + name + symbol + price { + amount + } + type + } + } + hash + status + timestamp + transfers { + amount { + value + } + asset { + ... on CryptoAsset { + chain + contract + decimals + id + image + name + price { + amount + } + symbol + type + } + } + fromAddress + toAddress + } + } + } + } + } +} + +query GetMayachainStatus { + mayachain { + status { + lastBlock + } + } +} + +query GetMayachainFee { + mayachain { + fee { + outboundTransactionFee + nativeTransactionFee + tnsRegisterFee + tnsFeeOnSale + tnsFeePerBlock + } + } +} + diff --git a/packages/thor/src/datasource/indexer/gql/thorchain.graphql b/packages/thor/src/datasource/indexer/gql/thorchain.graphql new file mode 100644 index 00000000..3cd10a7d --- /dev/null +++ b/packages/thor/src/datasource/indexer/gql/thorchain.graphql @@ -0,0 +1,101 @@ +query GetThorchainBalances($address: String!) { + thorchain { + balances(address: $address) { + address + amount { + value + } + asset { + chain + contract + decimals + id + name + image + price { + amount + } + symbol + } + } + } +} + + +query GetThorchainTransactions($address: String!, $first: Int!, $after: String) { + thorchain { + transactions(address: $address, first: $first, after: $after) { + pageInfo { + endCursor + hasNextPage + } + edges { + node { + fee { + amount { + value + } + asset { + chain + contract + id + decimals + image + name + symbol + price { + amount + } + type + } + } + hash + status + timestamp + transfers { + amount { + value + } + asset { + ... on CryptoAsset { + chain + contract + decimals + id + image + name + price { + amount + } + symbol + type + } + } + fromAddress + toAddress + } + } + } + } + } +} + +query GetThorchainStatus { + thorchain { + status { + lastBlock + } + } +} + +query GetThorchainFee { + thorchain { + fee { + outboundTransactionFee + nativeTransactionFee + tnsRegisterFee + tnsFeeOnSale + tnsFeePerBlock + } + } +} \ No newline at end of file diff --git a/packages/thor/src/datasource/indexer/indexer.data-source.ts b/packages/thor/src/datasource/indexer/indexer.data-source.ts new file mode 100644 index 00000000..84d32058 --- /dev/null +++ b/packages/thor/src/datasource/indexer/indexer.data-source.ts @@ -0,0 +1,164 @@ +import { + Asset, + DataSource, + Coin, + FeeOptions, + GasFeeSpeed, + Transaction, + Injectable, + TransactionsFilter, + BalanceFilter, + Balance, + FeeData, +} from '@xdefi-tech/chains-core'; +import { Observable } from 'rxjs'; +import cosmosclient from '@cosmos-client/core'; +import axios, { Axios } from 'axios'; +import Long from 'long'; + +import { ChainMsg } from '../../msg'; +import * as manifests from '../../manifests'; +import { AccountInfo } from '../../types'; + +import { getBalance, getTransactions } from './queries'; + +@Injectable() +export class IndexerDataSource extends DataSource { + declare rpcProvider: cosmosclient.CosmosSDK; + declare manifest: manifests.ThorManifest; + public rest: Axios; + + constructor(manifest: manifests.ThorManifest) { + super(manifest); + this.rpcProvider = new cosmosclient.CosmosSDK( + this.manifest.nodeURL, + this.manifest.chainId + ); + this.rest = axios.create({ baseURL: this.manifest.nodeURL }); + } + + async getNFTBalance(_address: string) { + throw new Error('Method not implemented.'); + } + + async getBalance(filter: BalanceFilter): Promise { + const { address } = filter; + const balances = await getBalance(this.manifest.chain, address); + // cut off balances without asset + const filteredBalances = balances.filter( + (b: any) => b.asset.symbol && b.asset.id + ); + + return filteredBalances.map((balance: any): Coin => { + const { asset, amount } = balance; + + return new Coin( + new Asset({ + id: asset.id, + chainId: this.manifest.chainId, + name: asset.name, + symbol: asset.symbol, + icon: asset.image, + native: !Boolean(asset.contract), + address: asset.contract, + price: asset.price?.amount, + decimals: asset.price?.scalingFactor, + }), + amount.value + ); + }); + } + + async subscribeBalance( + _filter: BalanceFilter + ): Promise> { + throw new Error('Method not implemented.'); + } + + async getTransactions(filter: TransactionsFilter): Promise { + const { address } = filter; + const transactions = await getTransactions(this.manifest.chain, address); + + return transactions.map((transaction) => { + return Transaction.fromData(transaction); + }); + } + + async subscribeTransactions( + _filter: TransactionsFilter + ): Promise> { + throw new Error('Method not implemented.'); + } + + async estimateFee(msgs: ChainMsg[], speed: GasFeeSpeed): Promise { + const result: FeeData[] = []; + const DEFAULT_FEE_DATA = { + gasLimit: 200000, + gasPrice: this.manifest.feeGasStep[speed], + }; + for (const msg of msgs) { + try { + const { txBody, account } = await msg.buildTx(); + if (!txBody) { + result.push(DEFAULT_FEE_DATA); + continue; + } + + const authInfo = new cosmosclient.proto.cosmos.tx.v1beta1.AuthInfo({ + signer_infos: [ + { + mode_info: { + single: { + mode: cosmosclient.proto.cosmos.tx.signing.v1beta1.SignMode + .SIGN_MODE_DIRECT, + }, + }, + sequence: Long.fromString(account?.sequence || '0'), + }, + ], + fee: { + amount: null, + }, + }); + + const tx = new cosmosclient.TxBuilder( + this.rpcProvider, + txBody, + authInfo + ); + tx.addSignature(new Uint8Array(64)); + const { data } = await this.rest.post('/cosmos/tx/v1beta1/simulate', { + txBytes: tx.txBytes(), + }); + result.push({ + gasLimit: Math.ceil(parseInt(data.gas_info.gas_used) * 1.4), + gasPrice: this.manifest.feeGasStep[speed], + }); + } catch (err) { + console.error('Error while estimating fee'); + console.error(err); + result.push(DEFAULT_FEE_DATA); + } + } + return result; + } + + async gasFeeOptions(): Promise { + return this.manifest.feeGasStep as unknown as FeeOptions; + } + + async getNonce(_address: string): Promise { + throw new Error('Method not implemented.'); + } + + async getAccount(address: string): Promise { + try { + const { data: resp } = await this.rest.get( + `/cosmos/auth/v1beta1/accounts/${address}` + ); + return resp.account; + } catch (err) { + return null; + } + } +} diff --git a/packages/thor/src/datasource/indexer/queries/balances.query.ts b/packages/thor/src/datasource/indexer/queries/balances.query.ts new file mode 100644 index 00000000..566fb197 --- /dev/null +++ b/packages/thor/src/datasource/indexer/queries/balances.query.ts @@ -0,0 +1,50 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; +import { + GetMayachainBalancesDocument, + GetThorchainBalancesDocument, +} from '@xdefi-tech/chains-graphql'; + +import { ThorChains } from '../../../manifests'; + +type ThorchainParams = { + query: any; + queryName: string; +}; + +const getChainParams = (chain: string): ThorchainParams => { + const params: ThorchainParams = { + query: null, + queryName: '', + }; + + const formattedChain = chain.toLowerCase(); + switch (formattedChain) { + case ThorChains.mayachain: + params.query = GetMayachainBalancesDocument; + params.queryName = ThorChains.mayachain; + break; + case ThorChains.thorchain: + params.query = GetThorchainBalancesDocument; + params.queryName = ThorChains.thorchain; + break; + } + + return params; +}; + +export const getBalance = async (chain: string, address: string) => { + const params = getChainParams(chain); + + if (!params.query) { + throw new Error('Unsupported thor chain-like chain'); + } + + const response = await gqlClient.query({ + query: params.query, + variables: { + address, + }, + }); + + return response.data[params.queryName].balances; +}; diff --git a/packages/thor/src/datasource/indexer/queries/fees.query.ts b/packages/thor/src/datasource/indexer/queries/fees.query.ts new file mode 100644 index 00000000..2aae249f --- /dev/null +++ b/packages/thor/src/datasource/indexer/queries/fees.query.ts @@ -0,0 +1,47 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; +import { + GetMayachainFeeDocument, + GetThorchainFeeDocument, +} from '@xdefi-tech/chains-graphql'; + +import { ThorChains } from '../../../manifests'; + +type ThorchainParams = { + query: any; + queryName: string; +}; + +const getChainParams = (chain: string): ThorchainParams => { + const params: ThorchainParams = { + query: null, + queryName: '', + }; + + const formattedChain = chain.toLowerCase(); + switch (formattedChain) { + case ThorChains.mayachain: + params.query = GetMayachainFeeDocument; + params.queryName = ThorChains.mayachain; + break; + case ThorChains.thorchain: + params.query = GetThorchainFeeDocument; + params.queryName = ThorChains.thorchain; + break; + } + + return params; +}; + +export const getFees = async (chain: string) => { + const params = getChainParams(chain); + + if (!params.query) { + throw new Error('Unsupported thor chain-like chain'); + } + + const response = await gqlClient.query({ + query: params.query, + }); + + return response.data[params.queryName].fee; +}; diff --git a/packages/thor/src/datasource/indexer/queries/index.ts b/packages/thor/src/datasource/indexer/queries/index.ts new file mode 100644 index 00000000..e99ffd99 --- /dev/null +++ b/packages/thor/src/datasource/indexer/queries/index.ts @@ -0,0 +1,3 @@ +export * from './balances.query'; +export * from './transactions.query'; +export * from './fees.query'; diff --git a/packages/thor/src/datasource/indexer/queries/transactions.query.ts b/packages/thor/src/datasource/indexer/queries/transactions.query.ts new file mode 100644 index 00000000..be5b342c --- /dev/null +++ b/packages/thor/src/datasource/indexer/queries/transactions.query.ts @@ -0,0 +1,56 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; +import { + GetMayachainTransactionsDocument, + GetThorchainTransactionsDocument, + Scalars, +} from '@xdefi-tech/chains-graphql'; +import map from 'lodash/map'; + +import { ThorChains } from '../../../manifests'; + +type ThorchainParams = { + query: any; + queryName: string; +}; + +const getChainParams = (chain: string): ThorchainParams => { + const params: ThorchainParams = { + query: null, + queryName: '', + }; + + const formattedChain = chain.toLowerCase(); + switch (formattedChain) { + case ThorChains.mayachain: + params.query = GetMayachainTransactionsDocument; + params.queryName = ThorChains.mayachain; + break; + case ThorChains.thorchain: + params.query = GetThorchainTransactionsDocument; + params.queryName = ThorChains.thorchain; + break; + } + + return params; +}; + +export const getTransactions = async ( + chain: string, + address: Scalars['String'] +) => { + const params = getChainParams(chain); + + if (!params.query) { + throw new Error('Unsupported thor chain-like chain'); + } + + const response = await gqlClient.query({ + query: params.query, + variables: { + address, + first: 500, + }, + }); + + return map(response.data[params.queryName].transactions.edges, 'node'); +}; diff --git a/packages/thor/src/manifests.ts b/packages/thor/src/manifests.ts index 928fdc6e..b642fb06 100644 --- a/packages/thor/src/manifests.ts +++ b/packages/thor/src/manifests.ts @@ -11,7 +11,8 @@ export const THORCHAIN_MANIFESTS: { [ThorChains.thorchain]: { name: 'Thor', description: '', - rpcURL: 'https://rpc-proxy.xdefi.services/thornode', + rpcURL: '', + nodeURL: 'https://rpc-proxy.xdefi.services/thornode', chainSymbol: 'RUNE', blockExplorerURL: 'https://viewblock.io/thorchain', chainId: 'thorchain-mainnet-v1', @@ -29,7 +30,8 @@ export const THORCHAIN_MANIFESTS: { [ThorChains.mayachain]: { name: 'Maya', description: '', - rpcURL: 'https://rpc-proxy.xdefi.services/mayachain/node', + rpcURL: '', + nodeURL: 'https://rpc-proxy.xdefi.services/mayachain/node', chainSymbol: 'CACAO', blockExplorerURL: 'https://www.mayascan.org/', chainId: 'mayachain-mainnet-v1', @@ -47,11 +49,7 @@ export const THORCHAIN_MANIFESTS: { }; export interface ThorManifest extends Chain.Manifest { - name: string; - decimals: any; - chainId: string; - chain: string; - rpcURL: string; denom: string; prefix: string; + nodeURL: string; } diff --git a/packages/thor/src/msg.spec.ts b/packages/thor/src/msg.spec.ts index d2653daa..b7ca21cc 100644 --- a/packages/thor/src/msg.spec.ts +++ b/packages/thor/src/msg.spec.ts @@ -61,7 +61,8 @@ describe('msg', () => { manifest: { name: 'Thor', description: '', - rpcURL: 'https://rpc-proxy.xdefi.services/thornode', + rpcURL: '', + nodeURL: 'https://rpc-proxy.xdefi.services/thornode', chainSymbol: 'RUNE', blockExplorerURL: 'https://viewblock.io/thorchain', chainId: 'thorchain-mainnet-v1', diff --git a/utility-packages/graphql/src/gql/gql.ts b/utility-packages/graphql/src/gql/gql.ts index c2d90b21..76d6a5ca 100644 --- a/utility-packages/graphql/src/gql/gql.ts +++ b/utility-packages/graphql/src/gql/gql.ts @@ -51,6 +51,10 @@ const documents = { types.LitecoinBalanceDocument, 'query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}': types.GetSolanaBalanceDocument, + 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': + types.GetMayachainBalancesDocument, + 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': + types.GetThorchainBalancesDocument, 'query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}': types.GetTronBalanceDocument, 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}': @@ -185,6 +189,18 @@ export function gql( export function gql( source: 'query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}' ): typeof documents['query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' +): typeof documents['query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' +): typeof documents['query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/utility-packages/graphql/src/gql/graphql.ts b/utility-packages/graphql/src/gql/graphql.ts index 12a35e90..71ed2370 100644 --- a/utility-packages/graphql/src/gql/graphql.ts +++ b/utility-packages/graphql/src/gql/graphql.ts @@ -7879,6 +7879,252 @@ export type GetSolanaFeeQuery = { }; }; +export type GetMayachainBalancesQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetMayachainBalancesQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + name?: string | null; + image?: string | null; + symbol?: string | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }>; + }; +}; + +export type GetMayachainTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetMayachainTransactionsQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + transactions: { + __typename?: 'ThorchainTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'ThorchainTransactionEdge'; + node: { + __typename?: 'ThorchainTransaction'; + hash: string; + status: string; + timestamp?: any | null; + fee?: Array<{ + __typename?: 'ThorchainFee'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + id?: string | null; + decimals?: number | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }> | null; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetMayachainStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetMayachainStatusQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetMayachainFeeQueryVariables = Exact<{ [key: string]: never }>; + +export type GetMayachainFeeQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + fee?: { + __typename?: 'MayaChainFee'; + outboundTransactionFee?: number | null; + nativeTransactionFee?: number | null; + tnsRegisterFee?: number | null; + tnsFeeOnSale?: number | null; + tnsFeePerBlock?: number | null; + } | null; + }; +}; + +export type GetThorchainBalancesQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetThorchainBalancesQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + name?: string | null; + image?: string | null; + symbol?: string | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }>; + }; +}; + +export type GetThorchainTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetThorchainTransactionsQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + transactions: { + __typename?: 'ThorchainTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'ThorchainTransactionEdge'; + node: { + __typename?: 'ThorchainTransaction'; + hash: string; + status: string; + timestamp?: any | null; + fee?: Array<{ + __typename?: 'ThorchainFee'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + id?: string | null; + decimals?: number | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }> | null; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetThorchainStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetThorchainStatusQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetThorchainFeeQueryVariables = Exact<{ [key: string]: never }>; + +export type GetThorchainFeeQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + fee?: { + __typename?: 'ThorChainFee'; + outboundTransactionFee?: number | null; + nativeTransactionFee?: number | null; + tnsRegisterFee?: number | null; + tnsFeeOnSale?: number | null; + tnsFeePerBlock?: number | null; + } | null; + }; +}; + export type GetTronBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; @@ -25137,6 +25383,1262 @@ export const GetSolanaFeeDocument = { }, ], } as unknown as DocumentNode; +export const GetMayachainBalancesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainBalances' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainBalancesQuery, + GetMayachainBalancesQueryVariables +>; +export const GetMayachainTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainTransactionsQuery, + GetMayachainTransactionsQueryVariables +>; +export const GetMayachainStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainStatusQuery, + GetMayachainStatusQueryVariables +>; +export const GetMayachainFeeDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'outboundTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'nativeTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsRegisterFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeeOnSale' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeePerBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainFeeQuery, + GetMayachainFeeQueryVariables +>; +export const GetThorchainBalancesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainBalances' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainBalancesQuery, + GetThorchainBalancesQueryVariables +>; +export const GetThorchainTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainTransactionsQuery, + GetThorchainTransactionsQueryVariables +>; +export const GetThorchainStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainStatusQuery, + GetThorchainStatusQueryVariables +>; +export const GetThorchainFeeDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'outboundTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'nativeTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsRegisterFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeeOnSale' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeePerBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainFeeQuery, + GetThorchainFeeQueryVariables +>; export const GetTronBalanceDocument = { kind: 'Document', definitions: [ From 8581560d69a9e7ab25d8ba1e2c2c817ad11eb607 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:33:14 +0100 Subject: [PATCH 021/176] feat: thor msg deposit (#248) * inital commit for adding msgDeposit * fix: updated proto * fix:lint * fix: toData type * fix: types for createMsg * fix asset parsing * fix: binance * fix: tests * fixed fee for mayachain * fix: test * chore: patch * Update packages/thor/src/msg.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: minor; --------- Co-authored-by: dp <25910069+davidp94@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Danil Kuchmenko --- .changeset/empty-pots-cheer.md | 5 + packages/thor/src/chain.provider.ts | 7 + .../src/datasource/chain/chain.data-source.ts | 3 +- packages/thor/src/msg.ts | 97 +- packages/thor/src/proto/index.d.ts | 1267 ++++++++ packages/thor/src/proto/index.js | 2782 +++++++++++++++++ .../src/signers/private-key.signer.spec.ts | 4 +- .../thor/src/signers/private-key.signer.ts | 7 +- .../src/signers/seed-phrase.signer.spec.ts | 4 +- packages/thor/src/utils.ts | 28 + packages/thor/tsconfig.json | 2 +- utility-packages/graphql/src/gql/graphql.ts | 496 ++- 12 files changed, 4664 insertions(+), 38 deletions(-) create mode 100644 .changeset/empty-pots-cheer.md create mode 100644 packages/thor/src/proto/index.d.ts create mode 100644 packages/thor/src/proto/index.js create mode 100644 packages/thor/src/utils.ts diff --git a/.changeset/empty-pots-cheer.md b/.changeset/empty-pots-cheer.md new file mode 100644 index 00000000..234d973d --- /dev/null +++ b/.changeset/empty-pots-cheer.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-thor': patch +--- + +chore: added msgDeposit to thor diff --git a/packages/thor/src/chain.provider.ts b/packages/thor/src/chain.provider.ts index ed686b0b..d4e19067 100644 --- a/packages/thor/src/chain.provider.ts +++ b/packages/thor/src/chain.provider.ts @@ -21,6 +21,7 @@ import { ChainMsg, MsgBody } from './msg'; import { ThorManifest } from './manifests'; import { AccountInfo } from './types'; import { ChainDataSource, IndexerDataSource } from './datasource'; +import { assetFromString } from './utils'; @ChainDecorator('ThorProvider', { deps: [], @@ -151,4 +152,10 @@ export class ThorProvider extends Chain.Provider { return false; } } + + static get staticUtils() { + return { + assetFromString, + }; + } } diff --git a/packages/thor/src/datasource/chain/chain.data-source.ts b/packages/thor/src/datasource/chain/chain.data-source.ts index 0d9a6247..2c301170 100644 --- a/packages/thor/src/datasource/chain/chain.data-source.ts +++ b/packages/thor/src/datasource/chain/chain.data-source.ts @@ -190,7 +190,8 @@ export class ChainDataSource extends DataSource { authInfo ); tx.addSignature(new Uint8Array(64)); - const { data } = await this.rest.get('/thorchain/network'); + const network = `/${this.manifest.chain.toLowerCase()}/network`; + const { data } = await this.rest.get(network); result.push({ gasLimit: Math.ceil(parseInt(data.native_outbound_fee_rune) * 1.4), diff --git a/packages/thor/src/msg.ts b/packages/thor/src/msg.ts index 40f50ac2..65117968 100644 --- a/packages/thor/src/msg.ts +++ b/packages/thor/src/msg.ts @@ -8,21 +8,30 @@ import { } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import cosmosclient from '@cosmos-client/core'; -import * as protobufjs from 'protobufjs'; import * as bech32Buffer from 'bech32-buffer'; +import { types } from './proto'; import type { ThorProvider } from './chain.provider'; import { AccountInfo } from './types'; +import { assetFromString } from './utils'; + +const MsgSend = types.MsgSend; +const MsgDeposit = types.MsgDeposit; + +export enum MsgType { + MsgDeposit = 'MsgDeposit', + MsgSend = 'MsgSend', +} export interface MsgBody { from: string; to: string; amount: NumberIsh; - decimals: number; + decimals?: number; denom?: string; memo?: string; source?: number; - type?: string; + type?: MsgType; gasLimit?: string; gasPrice?: string; } @@ -47,7 +56,6 @@ export interface TxBody { export class ChainMsg extends BasMsg { declare signedTransaction: string | null; declare provider: ThorProvider; - declare data: any; constructor(data: MsgBody, provider: ThorProvider, encoding: MsgEncoding) { super(data, provider, encoding); @@ -61,30 +69,24 @@ export class ChainMsg extends BasMsg { | cosmosclient.proto.cosmos.tx.v1beta1.TxBody | undefined { const messageData = this.toData(); - const amountData = { - denom: messageData.denom || this.provider.manifest.denom, - decimals: messageData.decimals || this.provider.manifest.decimals, - }; - const transferMsg = { + const denom = messageData.denom || this.provider.manifest.denom; + const decimals = messageData.decimals || this.provider.manifest.decimals; + const amount = new BigNumber(messageData.amount) + .multipliedBy(10 ** decimals) + .integerValue() + .toString(); + const transferMsg: types.IMsgSend = { fromAddress: bech32Buffer.decode(messageData.from).data, toAddress: bech32Buffer.decode(messageData.to).data, amount: [ { - denom: amountData.denom, - amount: new BigNumber(messageData.amount) - .multipliedBy(10 ** this.provider.manifest.decimals) - .integerValue() - .toString(), + denom: denom.toLowerCase(), + amount, }, ], }; - const msgWriter = protobufjs.Writer.create(); - msgWriter.uint32(10).bytes(transferMsg.fromAddress); - msgWriter.uint32(18).bytes(transferMsg.toAddress); - const amountWriter = msgWriter.uint32(26).fork(); - amountWriter.uint32(10).string(transferMsg.amount[0].denom); - amountWriter.uint32(18).string(transferMsg.amount[0].amount); - amountWriter.ldelim(); + + const msgWriter = MsgSend.encode(transferMsg); const msgBytes = new cosmosclient.proto.google.protobuf.Any({ type_url: '/types.MsgSend', value: msgWriter.finish(), @@ -95,10 +97,55 @@ export class ChainMsg extends BasMsg { }); } + public buildDepositBody(): + | cosmosclient.proto.cosmos.tx.v1beta1.TxBody + | undefined { + const messageData = this.toData(); + const denom = messageData.denom || this.provider.manifest.denom; + const decimals = messageData.decimals || this.provider.manifest.decimals; + const signer = bech32Buffer.decode(messageData.from).data; + const memo = messageData.memo || ''; + const amount = new BigNumber(messageData.amount) + .multipliedBy(10 ** decimals) + .integerValue() + .toString(); + const asset = assetFromString(denom); + const body: types.IMsgDeposit = { + coins: [ + { + asset, + amount, + decimals: 0, + }, + ], + memo, + signer, + }; + const msgWriter = MsgDeposit.encode(body); + + const msgBytes = new cosmosclient.proto.google.protobuf.Any({ + type_url: '/types.MsgDeposit', + value: msgWriter.finish(), + }); + return new cosmosclient.proto.cosmos.tx.v1beta1.TxBody({ + messages: [msgBytes], + memo, + }); + } + + buildBody = () => { + const messageData: MsgBody = this.toData(); + const builders = { + [MsgType.MsgDeposit]: this.buildDepositBody, + [MsgType.MsgSend]: this.buildTransferBody, + }; + return builders[messageData.type || MsgType.MsgSend]?.call(this); + }; + async buildTx(): Promise { const msgData = this.toData(); const account = await this.provider.getAccount(msgData.from); - const txBody = this.buildTransferBody(); + const txBody = this.buildBody(); return { txBody, @@ -106,7 +153,9 @@ export class ChainMsg extends BasMsg { to: msgData.to, from: msgData.from, value: new BigNumber(msgData.amount) - .multipliedBy(10 ** this.provider.manifest.decimals) + .multipliedBy( + 10 ** (msgData.decimals || this.provider.manifest.decimals) + ) .integerValue() .toNumber(), chainId: this.provider.manifest.chainId, @@ -118,7 +167,7 @@ export class ChainMsg extends BasMsg { source: msgData.source || 0, denom: msgData.denom || this.provider.manifest.denom, decimals: msgData.decimals || this.provider.manifest.decimals, - gasLimit: msgData.gasLimit || '0', + gasLimit: msgData.gasLimit || '200000', gasPrice: msgData.gasPrice || '0', }; } diff --git a/packages/thor/src/proto/index.d.ts b/packages/thor/src/proto/index.d.ts new file mode 100644 index 00000000..9e6538cf --- /dev/null +++ b/packages/thor/src/proto/index.d.ts @@ -0,0 +1,1267 @@ +import * as $protobuf from 'protobufjs'; +/** Namespace common. */ +export namespace common { + /** Properties of an Asset. */ + interface IAsset { + /** Asset chain */ + chain?: string | null; + + /** Asset symbol */ + symbol?: string | null; + + /** Asset ticker */ + ticker?: string | null; + + /** Asset synth */ + synth?: boolean | null; + } + + /** Represents an Asset. */ + class Asset implements IAsset { + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAsset); + + /** Asset chain. */ + public chain: string; + + /** Asset symbol. */ + public symbol: string; + + /** Asset ticker. */ + public ticker: string; + + /** Asset synth. */ + public synth: boolean; + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: common.IAsset): common.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: common.IAsset, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: common.IAsset, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): common.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): common.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): common.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: common.Asset, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Coin. */ + interface ICoin { + /** Coin asset */ + asset?: common.IAsset | null; + + /** Coin amount */ + amount?: string | null; + + /** Coin decimals */ + decimals?: number | Long | null; + } + + /** Represents a Coin. */ + class Coin implements ICoin { + /** + * Constructs a new Coin. + * @param [properties] Properties to set + */ + constructor(properties?: common.ICoin); + + /** Coin asset. */ + public asset?: common.IAsset | null; + + /** Coin amount. */ + public amount: string; + + /** Coin decimals. */ + public decimals: number | Long; + + /** + * Creates a new Coin instance using the specified properties. + * @param [properties] Properties to set + * @returns Coin instance + */ + public static create(properties?: common.ICoin): common.Coin; + + /** + * Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: common.ICoin, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: common.ICoin, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): common.Coin; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): common.Coin; + + /** + * Verifies a Coin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coin + */ + public static fromObject(object: { [k: string]: any }): common.Coin; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @param message Coin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: common.Coin, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Coin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PubKeySet. */ + interface IPubKeySet { + /** PubKeySet secp256k1 */ + secp256k1?: string | null; + + /** PubKeySet ed25519 */ + ed25519?: string | null; + } + + /** Represents a PubKeySet. */ + class PubKeySet implements IPubKeySet { + /** + * Constructs a new PubKeySet. + * @param [properties] Properties to set + */ + constructor(properties?: common.IPubKeySet); + + /** PubKeySet secp256k1. */ + public secp256k1: string; + + /** PubKeySet ed25519. */ + public ed25519: string; + + /** + * Creates a new PubKeySet instance using the specified properties. + * @param [properties] Properties to set + * @returns PubKeySet instance + */ + public static create(properties?: common.IPubKeySet): common.PubKeySet; + + /** + * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @param message PubKeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: common.IPubKeySet, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @param message PubKeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: common.IPubKeySet, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PubKeySet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): common.PubKeySet; + + /** + * Decodes a PubKeySet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): common.PubKeySet; + + /** + * Verifies a PubKeySet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubKeySet + */ + public static fromObject(object: { [k: string]: any }): common.PubKeySet; + + /** + * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. + * @param message PubKeySet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: common.PubKeySet, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PubKeySet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Tx. */ + interface ITx { + /** Tx id */ + id?: string | null; + + /** Tx chain */ + chain?: string | null; + + /** Tx fromAddress */ + fromAddress?: string | null; + + /** Tx toAddress */ + toAddress?: string | null; + + /** Tx coins */ + coins?: common.ICoin[] | null; + + /** Tx gas */ + gas?: common.ICoin[] | null; + + /** Tx memo */ + memo?: string | null; + } + + /** Represents a Tx. */ + class Tx implements ITx { + /** + * Constructs a new Tx. + * @param [properties] Properties to set + */ + constructor(properties?: common.ITx); + + /** Tx id. */ + public id: string; + + /** Tx chain. */ + public chain: string; + + /** Tx fromAddress. */ + public fromAddress: string; + + /** Tx toAddress. */ + public toAddress: string; + + /** Tx coins. */ + public coins: common.ICoin[]; + + /** Tx gas. */ + public gas: common.ICoin[]; + + /** Tx memo. */ + public memo: string; + + /** + * Creates a new Tx instance using the specified properties. + * @param [properties] Properties to set + * @returns Tx instance + */ + public static create(properties?: common.ITx): common.Tx; + + /** + * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. + * @param message Tx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: common.ITx, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. + * @param message Tx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: common.ITx, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Tx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): common.Tx; + + /** + * Decodes a Tx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): common.Tx; + + /** + * Verifies a Tx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tx + */ + public static fromObject(object: { [k: string]: any }): common.Tx; + + /** + * Creates a plain object from a Tx message. Also converts values to other types if specified. + * @param message Tx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: common.Tx, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Tx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Fee. */ + interface IFee { + /** Fee coins */ + coins?: common.ICoin[] | null; + + /** Fee poolDeduct */ + poolDeduct?: string | null; + } + + /** Represents a Fee. */ + class Fee implements IFee { + /** + * Constructs a new Fee. + * @param [properties] Properties to set + */ + constructor(properties?: common.IFee); + + /** Fee coins. */ + public coins: common.ICoin[]; + + /** Fee poolDeduct. */ + public poolDeduct: string; + + /** + * Creates a new Fee instance using the specified properties. + * @param [properties] Properties to set + * @returns Fee instance + */ + public static create(properties?: common.IFee): common.Fee; + + /** + * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. + * @param message Fee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: common.IFee, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. + * @param message Fee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: common.IFee, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Fee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): common.Fee; + + /** + * Decodes a Fee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): common.Fee; + + /** + * Verifies a Fee message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Fee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fee + */ + public static fromObject(object: { [k: string]: any }): common.Fee; + + /** + * Creates a plain object from a Fee message. Also converts values to other types if specified. + * @param message Fee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: common.Fee, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Fee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } +} + +/** Namespace types. */ +export namespace types { + /** Properties of a MsgDeposit. */ + interface IMsgDeposit { + /** MsgDeposit coins */ + coins?: common.ICoin[] | null; + + /** MsgDeposit memo */ + memo?: string | null; + + /** MsgDeposit signer */ + signer?: Uint8Array | null; + } + + /** Represents a MsgDeposit. */ + class MsgDeposit implements IMsgDeposit { + /** + * Constructs a new MsgDeposit. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMsgDeposit); + + /** MsgDeposit coins. */ + public coins: common.ICoin[]; + + /** MsgDeposit memo. */ + public memo: string; + + /** MsgDeposit signer. */ + public signer: Uint8Array; + + /** + * Creates a new MsgDeposit instance using the specified properties. + * @param [properties] Properties to set + * @returns MsgDeposit instance + */ + public static create(properties?: types.IMsgDeposit): types.MsgDeposit; + + /** + * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @param message MsgDeposit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IMsgDeposit, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @param message MsgDeposit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IMsgDeposit, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.MsgDeposit; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.MsgDeposit; + + /** + * Verifies a MsgDeposit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MsgDeposit + */ + public static fromObject(object: { [k: string]: any }): types.MsgDeposit; + + /** + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. + * @param message MsgDeposit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.MsgDeposit, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this MsgDeposit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MsgSend. */ + interface IMsgSend { + /** MsgSend fromAddress */ + fromAddress?: Uint8Array | null; + + /** MsgSend toAddress */ + toAddress?: Uint8Array | null; + + /** MsgSend amount */ + amount?: cosmos.base.v1beta1.ICoin[] | null; + } + + /** Represents a MsgSend. */ + class MsgSend implements IMsgSend { + /** + * Constructs a new MsgSend. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMsgSend); + + /** MsgSend fromAddress. */ + public fromAddress: Uint8Array; + + /** MsgSend toAddress. */ + public toAddress: Uint8Array; + + /** MsgSend amount. */ + public amount: cosmos.base.v1beta1.ICoin[]; + + /** + * Creates a new MsgSend instance using the specified properties. + * @param [properties] Properties to set + * @returns MsgSend instance + */ + public static create(properties?: types.IMsgSend): types.MsgSend; + + /** + * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @param message MsgSend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IMsgSend, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @param message MsgSend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IMsgSend, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a MsgSend message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.MsgSend; + + /** + * Decodes a MsgSend message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.MsgSend; + + /** + * Verifies a MsgSend message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MsgSend + */ + public static fromObject(object: { [k: string]: any }): types.MsgSend; + + /** + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. + * @param message MsgSend + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.MsgSend, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this MsgSend to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } +} + +/** Namespace cosmos. */ +export namespace cosmos { + /** Namespace base. */ + namespace base { + /** Namespace v1beta1. */ + namespace v1beta1 { + /** Properties of a Coin. */ + interface ICoin { + /** Coin denom */ + denom?: string | null; + + /** Coin amount */ + amount?: string | null; + } + + /** Represents a Coin. */ + class Coin implements ICoin { + /** + * Constructs a new Coin. + * @param [properties] Properties to set + */ + constructor(properties?: cosmos.base.v1beta1.ICoin); + + /** Coin denom. */ + public denom: string; + + /** Coin amount. */ + public amount: string; + + /** + * Creates a new Coin instance using the specified properties. + * @param [properties] Properties to set + * @returns Coin instance + */ + public static create( + properties?: cosmos.base.v1beta1.ICoin + ): cosmos.base.v1beta1.Coin; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: cosmos.base.v1beta1.ICoin, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: cosmos.base.v1beta1.ICoin, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): cosmos.base.v1beta1.Coin; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): cosmos.base.v1beta1.Coin; + + /** + * Verifies a Coin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coin + */ + public static fromObject(object: { + [k: string]: any; + }): cosmos.base.v1beta1.Coin; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @param message Coin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: cosmos.base.v1beta1.Coin, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Coin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DecCoin. */ + interface IDecCoin { + /** DecCoin denom */ + denom?: string | null; + + /** DecCoin amount */ + amount?: string | null; + } + + /** Represents a DecCoin. */ + class DecCoin implements IDecCoin { + /** + * Constructs a new DecCoin. + * @param [properties] Properties to set + */ + constructor(properties?: cosmos.base.v1beta1.IDecCoin); + + /** DecCoin denom. */ + public denom: string; + + /** DecCoin amount. */ + public amount: string; + + /** + * Creates a new DecCoin instance using the specified properties. + * @param [properties] Properties to set + * @returns DecCoin instance + */ + public static create( + properties?: cosmos.base.v1beta1.IDecCoin + ): cosmos.base.v1beta1.DecCoin; + + /** + * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @param message DecCoin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: cosmos.base.v1beta1.IDecCoin, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @param message DecCoin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: cosmos.base.v1beta1.IDecCoin, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecCoin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): cosmos.base.v1beta1.DecCoin; + + /** + * Decodes a DecCoin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): cosmos.base.v1beta1.DecCoin; + + /** + * Verifies a DecCoin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecCoin + */ + public static fromObject(object: { + [k: string]: any; + }): cosmos.base.v1beta1.DecCoin; + + /** + * Creates a plain object from a DecCoin message. Also converts values to other types if specified. + * @param message DecCoin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: cosmos.base.v1beta1.DecCoin, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecCoin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IntProto. */ + interface IIntProto { + /** IntProto int */ + int?: string | null; + } + + /** Represents an IntProto. */ + class IntProto implements IIntProto { + /** + * Constructs a new IntProto. + * @param [properties] Properties to set + */ + constructor(properties?: cosmos.base.v1beta1.IIntProto); + + /** IntProto int. */ + public int: string; + + /** + * Creates a new IntProto instance using the specified properties. + * @param [properties] Properties to set + * @returns IntProto instance + */ + public static create( + properties?: cosmos.base.v1beta1.IIntProto + ): cosmos.base.v1beta1.IntProto; + + /** + * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @param message IntProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: cosmos.base.v1beta1.IIntProto, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @param message IntProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: cosmos.base.v1beta1.IIntProto, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an IntProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): cosmos.base.v1beta1.IntProto; + + /** + * Decodes an IntProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): cosmos.base.v1beta1.IntProto; + + /** + * Verifies an IntProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an IntProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntProto + */ + public static fromObject(object: { + [k: string]: any; + }): cosmos.base.v1beta1.IntProto; + + /** + * Creates a plain object from an IntProto message. Also converts values to other types if specified. + * @param message IntProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: cosmos.base.v1beta1.IntProto, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this IntProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DecProto. */ + interface IDecProto { + /** DecProto dec */ + dec?: string | null; + } + + /** Represents a DecProto. */ + class DecProto implements IDecProto { + /** + * Constructs a new DecProto. + * @param [properties] Properties to set + */ + constructor(properties?: cosmos.base.v1beta1.IDecProto); + + /** DecProto dec. */ + public dec: string; + + /** + * Creates a new DecProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DecProto instance + */ + public static create( + properties?: cosmos.base.v1beta1.IDecProto + ): cosmos.base.v1beta1.DecProto; + + /** + * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @param message DecProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: cosmos.base.v1beta1.IDecProto, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @param message DecProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: cosmos.base.v1beta1.IDecProto, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): cosmos.base.v1beta1.DecProto; + + /** + * Decodes a DecProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): cosmos.base.v1beta1.DecProto; + + /** + * Verifies a DecProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecProto + */ + public static fromObject(object: { + [k: string]: any; + }): cosmos.base.v1beta1.DecProto; + + /** + * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * @param message DecProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: cosmos.base.v1beta1.DecProto, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } +} diff --git a/packages/thor/src/proto/index.js b/packages/thor/src/proto/index.js new file mode 100644 index 00000000..ea571163 --- /dev/null +++ b/packages/thor/src/proto/index.js @@ -0,0 +1,2782 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +'use strict'; + +var $protobuf = require('protobufjs/minimal'); + +// Common aliases +var $Reader = $protobuf.Reader, + $Writer = $protobuf.Writer, + $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots['default'] || ($protobuf.roots['default'] = {}); + +$root.common = (function () { + /** + * Namespace common. + * @exports common + * @namespace + */ + var common = {}; + + common.Asset = (function () { + /** + * Properties of an Asset. + * @memberof common + * @interface IAsset + * @property {string|null} [chain] Asset chain + * @property {string|null} [symbol] Asset symbol + * @property {string|null} [ticker] Asset ticker + * @property {boolean|null} [synth] Asset synth + */ + + /** + * Constructs a new Asset. + * @memberof common + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {common.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset chain. + * @member {string} chain + * @memberof common.Asset + * @instance + */ + Asset.prototype.chain = ''; + + /** + * Asset symbol. + * @member {string} symbol + * @memberof common.Asset + * @instance + */ + Asset.prototype.symbol = ''; + + /** + * Asset ticker. + * @member {string} ticker + * @memberof common.Asset + * @instance + */ + Asset.prototype.ticker = ''; + + /** + * Asset synth. + * @member {boolean} synth + * @memberof common.Asset + * @instance + */ + Asset.prototype.synth = false; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof common.Asset + * @static + * @param {common.IAsset=} [properties] Properties to set + * @returns {common.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages. + * @function encode + * @memberof common.Asset + * @static + * @param {common.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.chain != null && Object.hasOwnProperty.call(message, 'chain')) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.chain); + if ( + message.symbol != null && + Object.hasOwnProperty.call(message, 'symbol') + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.symbol); + if ( + message.ticker != null && + Object.hasOwnProperty.call(message, 'ticker') + ) + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.ticker); + if (message.synth != null && Object.hasOwnProperty.call(message, 'synth')) + writer.uint32(/* id 4, wireType 0 =*/ 32).bool(message.synth); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof common.Asset + * @static + * @param {common.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof common.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.common.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chain = reader.string(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.ticker = reader.string(); + break; + case 4: + message.synth = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof common.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.chain != null && message.hasOwnProperty('chain')) + if (!$util.isString(message.chain)) return 'chain: string expected'; + if (message.symbol != null && message.hasOwnProperty('symbol')) + if (!$util.isString(message.symbol)) return 'symbol: string expected'; + if (message.ticker != null && message.hasOwnProperty('ticker')) + if (!$util.isString(message.ticker)) return 'ticker: string expected'; + if (message.synth != null && message.hasOwnProperty('synth')) + if (typeof message.synth !== 'boolean') + return 'synth: boolean expected'; + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.Asset + * @static + * @param {Object.} object Plain object + * @returns {common.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.common.Asset) return object; + var message = new $root.common.Asset(); + if (object.chain != null) message.chain = String(object.chain); + if (object.symbol != null) message.symbol = String(object.symbol); + if (object.ticker != null) message.ticker = String(object.ticker); + if (object.synth != null) message.synth = Boolean(object.synth); + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof common.Asset + * @static + * @param {common.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.defaults) { + object.chain = ''; + object.symbol = ''; + object.ticker = ''; + object.synth = false; + } + if (message.chain != null && message.hasOwnProperty('chain')) + object.chain = message.chain; + if (message.symbol != null && message.hasOwnProperty('symbol')) + object.symbol = message.symbol; + if (message.ticker != null && message.hasOwnProperty('ticker')) + object.ticker = message.ticker; + if (message.synth != null && message.hasOwnProperty('synth')) + object.synth = message.synth; + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof common.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + common.Coin = (function () { + /** + * Properties of a Coin. + * @memberof common + * @interface ICoin + * @property {common.IAsset|null} [asset] Coin asset + * @property {string|null} [amount] Coin amount + * @property {number|Long|null} [decimals] Coin decimals + */ + + /** + * Constructs a new Coin. + * @memberof common + * @classdesc Represents a Coin. + * @implements ICoin + * @constructor + * @param {common.ICoin=} [properties] Properties to set + */ + function Coin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + + /** + * Coin asset. + * @member {common.IAsset|null|undefined} asset + * @memberof common.Coin + * @instance + */ + Coin.prototype.asset = null; + + /** + * Coin amount. + * @member {string} amount + * @memberof common.Coin + * @instance + */ + Coin.prototype.amount = ''; + + /** + * Coin decimals. + * @member {number|Long} decimals + * @memberof common.Coin + * @instance + */ + Coin.prototype.decimals = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; + + /** + * Creates a new Coin instance using the specified properties. + * @function create + * @memberof common.Coin + * @static + * @param {common.ICoin=} [properties] Properties to set + * @returns {common.Coin} Coin instance + */ + Coin.create = function create(properties) { + return new Coin(properties); + }; + + /** + * Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages. + * @function encode + * @memberof common.Coin + * @static + * @param {common.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, 'asset')) + $root.common.Asset.encode( + message.asset, + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim(); + if ( + message.amount != null && + Object.hasOwnProperty.call(message, 'amount') + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount); + if ( + message.decimals != null && + Object.hasOwnProperty.call(message, 'decimals') + ) + writer.uint32(/* id 3, wireType 0 =*/ 24).int64(message.decimals); + return writer; + }; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages. + * @function encodeDelimited + * @memberof common.Coin + * @static + * @param {common.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @function decode + * @memberof common.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.common.Coin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = $root.common.Asset.decode(reader, reader.uint32()); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.decimals = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coin message. + * @function verify + * @memberof common.Coin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coin.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.asset != null && message.hasOwnProperty('asset')) { + var error = $root.common.Asset.verify(message.asset); + if (error) return 'asset.' + error; + } + if (message.amount != null && message.hasOwnProperty('amount')) + if (!$util.isString(message.amount)) return 'amount: string expected'; + if (message.decimals != null && message.hasOwnProperty('decimals')) + if ( + !$util.isInteger(message.decimals) && + !( + message.decimals && + $util.isInteger(message.decimals.low) && + $util.isInteger(message.decimals.high) + ) + ) + return 'decimals: integer|Long expected'; + return null; + }; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.Coin + * @static + * @param {Object.} object Plain object + * @returns {common.Coin} Coin + */ + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.common.Coin) return object; + var message = new $root.common.Coin(); + if (object.asset != null) { + if (typeof object.asset !== 'object') + throw TypeError('.common.Coin.asset: object expected'); + message.asset = $root.common.Asset.fromObject(object.asset); + } + if (object.amount != null) message.amount = String(object.amount); + if (object.decimals != null) + if ($util.Long) + (message.decimals = $util.Long.fromValue( + object.decimals + )).unsigned = false; + else if (typeof object.decimals === 'string') + message.decimals = parseInt(object.decimals, 10); + else if (typeof object.decimals === 'number') + message.decimals = object.decimals; + else if (typeof object.decimals === 'object') + message.decimals = new $util.LongBits( + object.decimals.low >>> 0, + object.decimals.high >>> 0 + ).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @function toObject + * @memberof common.Coin + * @static + * @param {common.Coin} message Coin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coin.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.amount = ''; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.decimals = + options.longs === String + ? long.toString() + : options.longs === Number + ? long.toNumber() + : long; + } else object.decimals = options.longs === String ? '0' : 0; + } + if (message.asset != null && message.hasOwnProperty('asset')) + object.asset = $root.common.Asset.toObject(message.asset, options); + if (message.amount != null && message.hasOwnProperty('amount')) + object.amount = message.amount; + if (message.decimals != null && message.hasOwnProperty('decimals')) + if (typeof message.decimals === 'number') + object.decimals = + options.longs === String + ? String(message.decimals) + : message.decimals; + else + object.decimals = + options.longs === String + ? $util.Long.prototype.toString.call(message.decimals) + : options.longs === Number + ? new $util.LongBits( + message.decimals.low >>> 0, + message.decimals.high >>> 0 + ).toNumber() + : message.decimals; + return object; + }; + + /** + * Converts this Coin to JSON. + * @function toJSON + * @memberof common.Coin + * @instance + * @returns {Object.} JSON object + */ + Coin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Coin; + })(); + + common.PubKeySet = (function () { + /** + * Properties of a PubKeySet. + * @memberof common + * @interface IPubKeySet + * @property {string|null} [secp256k1] PubKeySet secp256k1 + * @property {string|null} [ed25519] PubKeySet ed25519 + */ + + /** + * Constructs a new PubKeySet. + * @memberof common + * @classdesc Represents a PubKeySet. + * @implements IPubKeySet + * @constructor + * @param {common.IPubKeySet=} [properties] Properties to set + */ + function PubKeySet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + + /** + * PubKeySet secp256k1. + * @member {string} secp256k1 + * @memberof common.PubKeySet + * @instance + */ + PubKeySet.prototype.secp256k1 = ''; + + /** + * PubKeySet ed25519. + * @member {string} ed25519 + * @memberof common.PubKeySet + * @instance + */ + PubKeySet.prototype.ed25519 = ''; + + /** + * Creates a new PubKeySet instance using the specified properties. + * @function create + * @memberof common.PubKeySet + * @static + * @param {common.IPubKeySet=} [properties] Properties to set + * @returns {common.PubKeySet} PubKeySet instance + */ + PubKeySet.create = function create(properties) { + return new PubKeySet(properties); + }; + + /** + * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @function encode + * @memberof common.PubKeySet + * @static + * @param {common.IPubKeySet} message PubKeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubKeySet.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if ( + message.secp256k1 != null && + Object.hasOwnProperty.call(message, 'secp256k1') + ) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.secp256k1); + if ( + message.ed25519 != null && + Object.hasOwnProperty.call(message, 'ed25519') + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.ed25519); + return writer; + }; + + /** + * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @function encodeDelimited + * @memberof common.PubKeySet + * @static + * @param {common.IPubKeySet} message PubKeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubKeySet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubKeySet message from the specified reader or buffer. + * @function decode + * @memberof common.PubKeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.PubKeySet} PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubKeySet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.common.PubKeySet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.secp256k1 = reader.string(); + break; + case 2: + message.ed25519 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubKeySet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.PubKeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.PubKeySet} PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubKeySet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubKeySet message. + * @function verify + * @memberof common.PubKeySet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubKeySet.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.secp256k1 != null && message.hasOwnProperty('secp256k1')) + if (!$util.isString(message.secp256k1)) + return 'secp256k1: string expected'; + if (message.ed25519 != null && message.hasOwnProperty('ed25519')) + if (!$util.isString(message.ed25519)) return 'ed25519: string expected'; + return null; + }; + + /** + * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.PubKeySet + * @static + * @param {Object.} object Plain object + * @returns {common.PubKeySet} PubKeySet + */ + PubKeySet.fromObject = function fromObject(object) { + if (object instanceof $root.common.PubKeySet) return object; + var message = new $root.common.PubKeySet(); + if (object.secp256k1 != null) + message.secp256k1 = String(object.secp256k1); + if (object.ed25519 != null) message.ed25519 = String(object.ed25519); + return message; + }; + + /** + * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. + * @function toObject + * @memberof common.PubKeySet + * @static + * @param {common.PubKeySet} message PubKeySet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubKeySet.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.defaults) { + object.secp256k1 = ''; + object.ed25519 = ''; + } + if (message.secp256k1 != null && message.hasOwnProperty('secp256k1')) + object.secp256k1 = message.secp256k1; + if (message.ed25519 != null && message.hasOwnProperty('ed25519')) + object.ed25519 = message.ed25519; + return object; + }; + + /** + * Converts this PubKeySet to JSON. + * @function toJSON + * @memberof common.PubKeySet + * @instance + * @returns {Object.} JSON object + */ + PubKeySet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PubKeySet; + })(); + + common.Tx = (function () { + /** + * Properties of a Tx. + * @memberof common + * @interface ITx + * @property {string|null} [id] Tx id + * @property {string|null} [chain] Tx chain + * @property {string|null} [fromAddress] Tx fromAddress + * @property {string|null} [toAddress] Tx toAddress + * @property {Array.|null} [coins] Tx coins + * @property {Array.|null} [gas] Tx gas + * @property {string|null} [memo] Tx memo + */ + + /** + * Constructs a new Tx. + * @memberof common + * @classdesc Represents a Tx. + * @implements ITx + * @constructor + * @param {common.ITx=} [properties] Properties to set + */ + function Tx(properties) { + this.coins = []; + this.gas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + + /** + * Tx id. + * @member {string} id + * @memberof common.Tx + * @instance + */ + Tx.prototype.id = ''; + + /** + * Tx chain. + * @member {string} chain + * @memberof common.Tx + * @instance + */ + Tx.prototype.chain = ''; + + /** + * Tx fromAddress. + * @member {string} fromAddress + * @memberof common.Tx + * @instance + */ + Tx.prototype.fromAddress = ''; + + /** + * Tx toAddress. + * @member {string} toAddress + * @memberof common.Tx + * @instance + */ + Tx.prototype.toAddress = ''; + + /** + * Tx coins. + * @member {Array.} coins + * @memberof common.Tx + * @instance + */ + Tx.prototype.coins = $util.emptyArray; + + /** + * Tx gas. + * @member {Array.} gas + * @memberof common.Tx + * @instance + */ + Tx.prototype.gas = $util.emptyArray; + + /** + * Tx memo. + * @member {string} memo + * @memberof common.Tx + * @instance + */ + Tx.prototype.memo = ''; + + /** + * Creates a new Tx instance using the specified properties. + * @function create + * @memberof common.Tx + * @static + * @param {common.ITx=} [properties] Properties to set + * @returns {common.Tx} Tx instance + */ + Tx.create = function create(properties) { + return new Tx(properties); + }; + + /** + * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. + * @function encode + * @memberof common.Tx + * @static + * @param {common.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, 'id')) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.id); + if (message.chain != null && Object.hasOwnProperty.call(message, 'chain')) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.chain); + if ( + message.fromAddress != null && + Object.hasOwnProperty.call(message, 'fromAddress') + ) + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.fromAddress); + if ( + message.toAddress != null && + Object.hasOwnProperty.call(message, 'toAddress') + ) + writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.toAddress); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.common.Coin.encode( + message.coins[i], + writer.uint32(/* id 5, wireType 2 =*/ 42).fork() + ).ldelim(); + if (message.gas != null && message.gas.length) + for (var i = 0; i < message.gas.length; ++i) + $root.common.Coin.encode( + message.gas[i], + writer.uint32(/* id 6, wireType 2 =*/ 50).fork() + ).ldelim(); + if (message.memo != null && Object.hasOwnProperty.call(message, 'memo')) + writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.memo); + return writer; + }; + + /** + * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. + * @function encodeDelimited + * @memberof common.Tx + * @static + * @param {common.ITx} message Tx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tx message from the specified reader or buffer. + * @function decode + * @memberof common.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.common.Tx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.chain = reader.string(); + break; + case 3: + message.fromAddress = reader.string(); + break; + case 4: + message.toAddress = reader.string(); + break; + case 5: + if (!(message.coins && message.coins.length)) message.coins = []; + message.coins.push( + $root.common.Coin.decode(reader, reader.uint32()) + ); + break; + case 6: + if (!(message.gas && message.gas.length)) message.gas = []; + message.gas.push($root.common.Coin.decode(reader, reader.uint32())); + break; + case 7: + message.memo = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.Tx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.Tx} Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tx message. + * @function verify + * @memberof common.Tx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tx.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.id != null && message.hasOwnProperty('id')) + if (!$util.isString(message.id)) return 'id: string expected'; + if (message.chain != null && message.hasOwnProperty('chain')) + if (!$util.isString(message.chain)) return 'chain: string expected'; + if (message.fromAddress != null && message.hasOwnProperty('fromAddress')) + if (!$util.isString(message.fromAddress)) + return 'fromAddress: string expected'; + if (message.toAddress != null && message.hasOwnProperty('toAddress')) + if (!$util.isString(message.toAddress)) + return 'toAddress: string expected'; + if (message.coins != null && message.hasOwnProperty('coins')) { + if (!Array.isArray(message.coins)) return 'coins: array expected'; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.common.Coin.verify(message.coins[i]); + if (error) return 'coins.' + error; + } + } + if (message.gas != null && message.hasOwnProperty('gas')) { + if (!Array.isArray(message.gas)) return 'gas: array expected'; + for (var i = 0; i < message.gas.length; ++i) { + var error = $root.common.Coin.verify(message.gas[i]); + if (error) return 'gas.' + error; + } + } + if (message.memo != null && message.hasOwnProperty('memo')) + if (!$util.isString(message.memo)) return 'memo: string expected'; + return null; + }; + + /** + * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.Tx + * @static + * @param {Object.} object Plain object + * @returns {common.Tx} Tx + */ + Tx.fromObject = function fromObject(object) { + if (object instanceof $root.common.Tx) return object; + var message = new $root.common.Tx(); + if (object.id != null) message.id = String(object.id); + if (object.chain != null) message.chain = String(object.chain); + if (object.fromAddress != null) + message.fromAddress = String(object.fromAddress); + if (object.toAddress != null) + message.toAddress = String(object.toAddress); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError('.common.Tx.coins: array expected'); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== 'object') + throw TypeError('.common.Tx.coins: object expected'); + message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + } + } + if (object.gas) { + if (!Array.isArray(object.gas)) + throw TypeError('.common.Tx.gas: array expected'); + message.gas = []; + for (var i = 0; i < object.gas.length; ++i) { + if (typeof object.gas[i] !== 'object') + throw TypeError('.common.Tx.gas: object expected'); + message.gas[i] = $root.common.Coin.fromObject(object.gas[i]); + } + } + if (object.memo != null) message.memo = String(object.memo); + return message; + }; + + /** + * Creates a plain object from a Tx message. Also converts values to other types if specified. + * @function toObject + * @memberof common.Tx + * @static + * @param {common.Tx} message Tx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tx.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.coins = []; + object.gas = []; + } + if (options.defaults) { + object.id = ''; + object.chain = ''; + object.fromAddress = ''; + object.toAddress = ''; + object.memo = ''; + } + if (message.id != null && message.hasOwnProperty('id')) + object.id = message.id; + if (message.chain != null && message.hasOwnProperty('chain')) + object.chain = message.chain; + if (message.fromAddress != null && message.hasOwnProperty('fromAddress')) + object.fromAddress = message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty('toAddress')) + object.toAddress = message.toAddress; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.common.Coin.toObject( + message.coins[j], + options + ); + } + if (message.gas && message.gas.length) { + object.gas = []; + for (var j = 0; j < message.gas.length; ++j) + object.gas[j] = $root.common.Coin.toObject(message.gas[j], options); + } + if (message.memo != null && message.hasOwnProperty('memo')) + object.memo = message.memo; + return object; + }; + + /** + * Converts this Tx to JSON. + * @function toJSON + * @memberof common.Tx + * @instance + * @returns {Object.} JSON object + */ + Tx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tx; + })(); + + common.Fee = (function () { + /** + * Properties of a Fee. + * @memberof common + * @interface IFee + * @property {Array.|null} [coins] Fee coins + * @property {string|null} [poolDeduct] Fee poolDeduct + */ + + /** + * Constructs a new Fee. + * @memberof common + * @classdesc Represents a Fee. + * @implements IFee + * @constructor + * @param {common.IFee=} [properties] Properties to set + */ + function Fee(properties) { + this.coins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + + /** + * Fee coins. + * @member {Array.} coins + * @memberof common.Fee + * @instance + */ + Fee.prototype.coins = $util.emptyArray; + + /** + * Fee poolDeduct. + * @member {string} poolDeduct + * @memberof common.Fee + * @instance + */ + Fee.prototype.poolDeduct = ''; + + /** + * Creates a new Fee instance using the specified properties. + * @function create + * @memberof common.Fee + * @static + * @param {common.IFee=} [properties] Properties to set + * @returns {common.Fee} Fee instance + */ + Fee.create = function create(properties) { + return new Fee(properties); + }; + + /** + * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. + * @function encode + * @memberof common.Fee + * @static + * @param {common.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.common.Coin.encode( + message.coins[i], + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim(); + if ( + message.poolDeduct != null && + Object.hasOwnProperty.call(message, 'poolDeduct') + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.poolDeduct); + return writer; + }; + + /** + * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. + * @function encodeDelimited + * @memberof common.Fee + * @static + * @param {common.IFee} message Fee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fee message from the specified reader or buffer. + * @function decode + * @memberof common.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.common.Fee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.coins && message.coins.length)) message.coins = []; + message.coins.push( + $root.common.Coin.decode(reader, reader.uint32()) + ); + break; + case 2: + message.poolDeduct = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Fee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.Fee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.Fee} Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fee message. + * @function verify + * @memberof common.Fee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fee.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.coins != null && message.hasOwnProperty('coins')) { + if (!Array.isArray(message.coins)) return 'coins: array expected'; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.common.Coin.verify(message.coins[i]); + if (error) return 'coins.' + error; + } + } + if (message.poolDeduct != null && message.hasOwnProperty('poolDeduct')) + if (!$util.isString(message.poolDeduct)) + return 'poolDeduct: string expected'; + return null; + }; + + /** + * Creates a Fee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.Fee + * @static + * @param {Object.} object Plain object + * @returns {common.Fee} Fee + */ + Fee.fromObject = function fromObject(object) { + if (object instanceof $root.common.Fee) return object; + var message = new $root.common.Fee(); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError('.common.Fee.coins: array expected'); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== 'object') + throw TypeError('.common.Fee.coins: object expected'); + message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + } + } + if (object.poolDeduct != null) + message.poolDeduct = String(object.poolDeduct); + return message; + }; + + /** + * Creates a plain object from a Fee message. Also converts values to other types if specified. + * @function toObject + * @memberof common.Fee + * @static + * @param {common.Fee} message Fee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fee.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.arrays || options.defaults) object.coins = []; + if (options.defaults) object.poolDeduct = ''; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.common.Coin.toObject( + message.coins[j], + options + ); + } + if (message.poolDeduct != null && message.hasOwnProperty('poolDeduct')) + object.poolDeduct = message.poolDeduct; + return object; + }; + + /** + * Converts this Fee to JSON. + * @function toJSON + * @memberof common.Fee + * @instance + * @returns {Object.} JSON object + */ + Fee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Fee; + })(); + + return common; +})(); + +$root.types = (function () { + /** + * Namespace types. + * @exports types + * @namespace + */ + var types = {}; + + types.MsgDeposit = (function () { + /** + * Properties of a MsgDeposit. + * @memberof types + * @interface IMsgDeposit + * @property {Array.|null} [coins] MsgDeposit coins + * @property {string|null} [memo] MsgDeposit memo + * @property {Uint8Array|null} [signer] MsgDeposit signer + */ + + /** + * Constructs a new MsgDeposit. + * @memberof types + * @classdesc Represents a MsgDeposit. + * @implements IMsgDeposit + * @constructor + * @param {types.IMsgDeposit=} [properties] Properties to set + */ + function MsgDeposit(properties) { + this.coins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgDeposit coins. + * @member {Array.} coins + * @memberof types.MsgDeposit + * @instance + */ + MsgDeposit.prototype.coins = $util.emptyArray; + + /** + * MsgDeposit memo. + * @member {string} memo + * @memberof types.MsgDeposit + * @instance + */ + MsgDeposit.prototype.memo = ''; + + /** + * MsgDeposit signer. + * @member {Uint8Array} signer + * @memberof types.MsgDeposit + * @instance + */ + MsgDeposit.prototype.signer = $util.newBuffer([]); + + /** + * Creates a new MsgDeposit instance using the specified properties. + * @function create + * @memberof types.MsgDeposit + * @static + * @param {types.IMsgDeposit=} [properties] Properties to set + * @returns {types.MsgDeposit} MsgDeposit instance + */ + MsgDeposit.create = function create(properties) { + return new MsgDeposit(properties); + }; + + /** + * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @function encode + * @memberof types.MsgDeposit + * @static + * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.common.Coin.encode( + message.coins[i], + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim(); + if (message.memo != null && Object.hasOwnProperty.call(message, 'memo')) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.memo); + if ( + message.signer != null && + Object.hasOwnProperty.call(message, 'signer') + ) + writer.uint32(/* id 3, wireType 2 =*/ 26).bytes(message.signer); + return writer; + }; + + /** + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @function encodeDelimited + * @memberof types.MsgDeposit + * @static + * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer. + * @function decode + * @memberof types.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.types.MsgDeposit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.coins && message.coins.length)) message.coins = []; + message.coins.push( + $root.common.Coin.decode(reader, reader.uint32()) + ); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.signer = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.MsgDeposit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.MsgDeposit} MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgDeposit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgDeposit message. + * @function verify + * @memberof types.MsgDeposit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgDeposit.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.coins != null && message.hasOwnProperty('coins')) { + if (!Array.isArray(message.coins)) return 'coins: array expected'; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.common.Coin.verify(message.coins[i]); + if (error) return 'coins.' + error; + } + } + if (message.memo != null && message.hasOwnProperty('memo')) + if (!$util.isString(message.memo)) return 'memo: string expected'; + if (message.signer != null && message.hasOwnProperty('signer')) + if ( + !( + (message.signer && typeof message.signer.length === 'number') || + $util.isString(message.signer) + ) + ) + return 'signer: buffer expected'; + return null; + }; + + /** + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.MsgDeposit + * @static + * @param {Object.} object Plain object + * @returns {types.MsgDeposit} MsgDeposit + */ + MsgDeposit.fromObject = function fromObject(object) { + if (object instanceof $root.types.MsgDeposit) return object; + var message = new $root.types.MsgDeposit(); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError('.types.MsgDeposit.coins: array expected'); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== 'object') + throw TypeError('.types.MsgDeposit.coins: object expected'); + message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + } + } + if (object.memo != null) message.memo = String(object.memo); + if (object.signer != null) + if (typeof object.signer === 'string') + $util.base64.decode( + object.signer, + (message.signer = $util.newBuffer( + $util.base64.length(object.signer) + )), + 0 + ); + else if (object.signer.length) message.signer = object.signer; + return message; + }; + + /** + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. + * @function toObject + * @memberof types.MsgDeposit + * @static + * @param {types.MsgDeposit} message MsgDeposit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgDeposit.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.arrays || options.defaults) object.coins = []; + if (options.defaults) { + object.memo = ''; + if (options.bytes === String) object.signer = ''; + else { + object.signer = []; + if (options.bytes !== Array) + object.signer = $util.newBuffer(object.signer); + } + } + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.common.Coin.toObject( + message.coins[j], + options + ); + } + if (message.memo != null && message.hasOwnProperty('memo')) + object.memo = message.memo; + if (message.signer != null && message.hasOwnProperty('signer')) + object.signer = + options.bytes === String + ? $util.base64.encode(message.signer, 0, message.signer.length) + : options.bytes === Array + ? Array.prototype.slice.call(message.signer) + : message.signer; + return object; + }; + + /** + * Converts this MsgDeposit to JSON. + * @function toJSON + * @memberof types.MsgDeposit + * @instance + * @returns {Object.} JSON object + */ + MsgDeposit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgDeposit; + })(); + + types.MsgSend = (function () { + /** + * Properties of a MsgSend. + * @memberof types + * @interface IMsgSend + * @property {Uint8Array|null} [fromAddress] MsgSend fromAddress + * @property {Uint8Array|null} [toAddress] MsgSend toAddress + * @property {Array.|null} [amount] MsgSend amount + */ + + /** + * Constructs a new MsgSend. + * @memberof types + * @classdesc Represents a MsgSend. + * @implements IMsgSend + * @constructor + * @param {types.IMsgSend=} [properties] Properties to set + */ + function MsgSend(properties) { + this.amount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + + /** + * MsgSend fromAddress. + * @member {Uint8Array} fromAddress + * @memberof types.MsgSend + * @instance + */ + MsgSend.prototype.fromAddress = $util.newBuffer([]); + + /** + * MsgSend toAddress. + * @member {Uint8Array} toAddress + * @memberof types.MsgSend + * @instance + */ + MsgSend.prototype.toAddress = $util.newBuffer([]); + + /** + * MsgSend amount. + * @member {Array.} amount + * @memberof types.MsgSend + * @instance + */ + MsgSend.prototype.amount = $util.emptyArray; + + /** + * Creates a new MsgSend instance using the specified properties. + * @function create + * @memberof types.MsgSend + * @static + * @param {types.IMsgSend=} [properties] Properties to set + * @returns {types.MsgSend} MsgSend instance + */ + MsgSend.create = function create(properties) { + return new MsgSend(properties); + }; + + /** + * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @function encode + * @memberof types.MsgSend + * @static + * @param {types.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if ( + message.fromAddress != null && + Object.hasOwnProperty.call(message, 'fromAddress') + ) + writer.uint32(/* id 1, wireType 2 =*/ 10).bytes(message.fromAddress); + if ( + message.toAddress != null && + Object.hasOwnProperty.call(message, 'toAddress') + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.toAddress); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode( + message.amount[i], + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim(); + return writer; + }; + + /** + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @function encodeDelimited + * @memberof types.MsgSend + * @static + * @param {types.IMsgSend} message MsgSend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MsgSend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer. + * @function decode + * @memberof types.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.types.MsgSend(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.bytes(); + break; + case 2: + message.toAddress = reader.bytes(); + break; + case 3: + if (!(message.amount && message.amount.length)) message.amount = []; + message.amount.push( + $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MsgSend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.MsgSend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.MsgSend} MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MsgSend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MsgSend message. + * @function verify + * @memberof types.MsgSend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MsgSend.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.fromAddress != null && message.hasOwnProperty('fromAddress')) + if ( + !( + (message.fromAddress && + typeof message.fromAddress.length === 'number') || + $util.isString(message.fromAddress) + ) + ) + return 'fromAddress: buffer expected'; + if (message.toAddress != null && message.hasOwnProperty('toAddress')) + if ( + !( + (message.toAddress && + typeof message.toAddress.length === 'number') || + $util.isString(message.toAddress) + ) + ) + return 'toAddress: buffer expected'; + if (message.amount != null && message.hasOwnProperty('amount')) { + if (!Array.isArray(message.amount)) return 'amount: array expected'; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); + if (error) return 'amount.' + error; + } + } + return null; + }; + + /** + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.MsgSend + * @static + * @param {Object.} object Plain object + * @returns {types.MsgSend} MsgSend + */ + MsgSend.fromObject = function fromObject(object) { + if (object instanceof $root.types.MsgSend) return object; + var message = new $root.types.MsgSend(); + if (object.fromAddress != null) + if (typeof object.fromAddress === 'string') + $util.base64.decode( + object.fromAddress, + (message.fromAddress = $util.newBuffer( + $util.base64.length(object.fromAddress) + )), + 0 + ); + else if (object.fromAddress.length) + message.fromAddress = object.fromAddress; + if (object.toAddress != null) + if (typeof object.toAddress === 'string') + $util.base64.decode( + object.toAddress, + (message.toAddress = $util.newBuffer( + $util.base64.length(object.toAddress) + )), + 0 + ); + else if (object.toAddress.length) message.toAddress = object.toAddress; + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError('.types.MsgSend.amount: array expected'); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== 'object') + throw TypeError('.types.MsgSend.amount: object expected'); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject( + object.amount[i] + ); + } + } + return message; + }; + + /** + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. + * @function toObject + * @memberof types.MsgSend + * @static + * @param {types.MsgSend} message MsgSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSend.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.arrays || options.defaults) object.amount = []; + if (options.defaults) { + if (options.bytes === String) object.fromAddress = ''; + else { + object.fromAddress = []; + if (options.bytes !== Array) + object.fromAddress = $util.newBuffer(object.fromAddress); + } + if (options.bytes === String) object.toAddress = ''; + else { + object.toAddress = []; + if (options.bytes !== Array) + object.toAddress = $util.newBuffer(object.toAddress); + } + } + if (message.fromAddress != null && message.hasOwnProperty('fromAddress')) + object.fromAddress = + options.bytes === String + ? $util.base64.encode( + message.fromAddress, + 0, + message.fromAddress.length + ) + : options.bytes === Array + ? Array.prototype.slice.call(message.fromAddress) + : message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty('toAddress')) + object.toAddress = + options.bytes === String + ? $util.base64.encode( + message.toAddress, + 0, + message.toAddress.length + ) + : options.bytes === Array + ? Array.prototype.slice.call(message.toAddress) + : message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject( + message.amount[j], + options + ); + } + return object; + }; + + /** + * Converts this MsgSend to JSON. + * @function toJSON + * @memberof types.MsgSend + * @instance + * @returns {Object.} JSON object + */ + MsgSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MsgSend; + })(); + + return types; +})(); + +$root.cosmos = (function () { + /** + * Namespace cosmos. + * @exports cosmos + * @namespace + */ + var cosmos = {}; + + cosmos.base = (function () { + /** + * Namespace base. + * @memberof cosmos + * @namespace + */ + var base = {}; + + base.v1beta1 = (function () { + /** + * Namespace v1beta1. + * @memberof cosmos.base + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Coin = (function () { + /** + * Properties of a Coin. + * @memberof cosmos.base.v1beta1 + * @interface ICoin + * @property {string|null} [denom] Coin denom + * @property {string|null} [amount] Coin amount + */ + + /** + * Constructs a new Coin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a Coin. + * @implements ICoin + * @constructor + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + */ + function Coin(properties) { + if (properties) + for ( + var keys = Object.keys(properties), i = 0; + i < keys.length; + ++i + ) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Coin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.denom = ''; + + /** + * Coin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.amount = ''; + + /** + * Creates a new Coin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.Coin} Coin instance + */ + Coin.create = function create(properties) { + return new Coin(properties); + }; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if ( + message.denom != null && + Object.hasOwnProperty.call(message, 'denom') + ) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.denom); + if ( + message.amount != null && + Object.hasOwnProperty.call(message, 'amount') + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Coin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.cosmos.base.v1beta1.Coin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.Coin} Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Coin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Coin message. + * @function verify + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Coin.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.denom != null && message.hasOwnProperty('denom')) + if (!$util.isString(message.denom)) return 'denom: string expected'; + if (message.amount != null && message.hasOwnProperty('amount')) + if (!$util.isString(message.amount)) + return 'amount: string expected'; + return null; + }; + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.Coin} Coin + */ + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.Coin) return object; + var message = new $root.cosmos.base.v1beta1.Coin(); + if (object.denom != null) message.denom = String(object.denom); + if (object.amount != null) message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.Coin + * @static + * @param {cosmos.base.v1beta1.Coin} message Coin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Coin.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.defaults) { + object.denom = ''; + object.amount = ''; + } + if (message.denom != null && message.hasOwnProperty('denom')) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty('amount')) + object.amount = message.amount; + return object; + }; + + /** + * Converts this Coin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.Coin + * @instance + * @returns {Object.} JSON object + */ + Coin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Coin; + })(); + + v1beta1.DecCoin = (function () { + /** + * Properties of a DecCoin. + * @memberof cosmos.base.v1beta1 + * @interface IDecCoin + * @property {string|null} [denom] DecCoin denom + * @property {string|null} [amount] DecCoin amount + */ + + /** + * Constructs a new DecCoin. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecCoin. + * @implements IDecCoin + * @constructor + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + */ + function DecCoin(properties) { + if (properties) + for ( + var keys = Object.keys(properties), i = 0; + i < keys.length; + ++i + ) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecCoin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.denom = ''; + + /** + * DecCoin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + */ + DecCoin.prototype.amount = ''; + + /** + * Creates a new DecCoin instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance + */ + DecCoin.create = function create(properties) { + return new DecCoin(properties); + }; + + /** + * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if ( + message.denom != null && + Object.hasOwnProperty.call(message, 'denom') + ) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.denom); + if ( + message.amount != null && + Object.hasOwnProperty.call(message, 'amount') + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount); + return writer; + }; + + /** + * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecCoin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.cosmos.base.v1beta1.DecCoin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecCoin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecCoin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecCoin message. + * @function verify + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecCoin.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.denom != null && message.hasOwnProperty('denom')) + if (!$util.isString(message.denom)) return 'denom: string expected'; + if (message.amount != null && message.hasOwnProperty('amount')) + if (!$util.isString(message.amount)) + return 'amount: string expected'; + return null; + }; + + /** + * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecCoin} DecCoin + */ + DecCoin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecCoin) + return object; + var message = new $root.cosmos.base.v1beta1.DecCoin(); + if (object.denom != null) message.denom = String(object.denom); + if (object.amount != null) message.amount = String(object.amount); + return message; + }; + + /** + * Creates a plain object from a DecCoin message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecCoin + * @static + * @param {cosmos.base.v1beta1.DecCoin} message DecCoin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecCoin.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.defaults) { + object.denom = ''; + object.amount = ''; + } + if (message.denom != null && message.hasOwnProperty('denom')) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty('amount')) + object.amount = message.amount; + return object; + }; + + /** + * Converts this DecCoin to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecCoin + * @instance + * @returns {Object.} JSON object + */ + DecCoin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecCoin; + })(); + + v1beta1.IntProto = (function () { + /** + * Properties of an IntProto. + * @memberof cosmos.base.v1beta1 + * @interface IIntProto + * @property {string|null} [int] IntProto int + */ + + /** + * Constructs a new IntProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents an IntProto. + * @implements IIntProto + * @constructor + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + */ + function IntProto(properties) { + if (properties) + for ( + var keys = Object.keys(properties), i = 0; + i < keys.length; + ++i + ) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntProto int. + * @member {string} int + * @memberof cosmos.base.v1beta1.IntProto + * @instance + */ + IntProto.prototype.int = ''; + + /** + * Creates a new IntProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.IntProto} IntProto instance + */ + IntProto.create = function create(properties) { + return new IntProto(properties); + }; + + /** + * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.int != null && Object.hasOwnProperty.call(message, 'int')) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.int); + return writer; + }; + + /** + * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.cosmos.base.v1beta1.IntProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.IntProto} IntProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntProto message. + * @function verify + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntProto.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.int != null && message.hasOwnProperty('int')) + if (!$util.isString(message.int)) return 'int: string expected'; + return null; + }; + + /** + * Creates an IntProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.IntProto} IntProto + */ + IntProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.IntProto) + return object; + var message = new $root.cosmos.base.v1beta1.IntProto(); + if (object.int != null) message.int = String(object.int); + return message; + }; + + /** + * Creates a plain object from an IntProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.IntProto + * @static + * @param {cosmos.base.v1beta1.IntProto} message IntProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntProto.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.defaults) object.int = ''; + if (message.int != null && message.hasOwnProperty('int')) + object.int = message.int; + return object; + }; + + /** + * Converts this IntProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.IntProto + * @instance + * @returns {Object.} JSON object + */ + IntProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IntProto; + })(); + + v1beta1.DecProto = (function () { + /** + * Properties of a DecProto. + * @memberof cosmos.base.v1beta1 + * @interface IDecProto + * @property {string|null} [dec] DecProto dec + */ + + /** + * Constructs a new DecProto. + * @memberof cosmos.base.v1beta1 + * @classdesc Represents a DecProto. + * @implements IDecProto + * @constructor + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + */ + function DecProto(properties) { + if (properties) + for ( + var keys = Object.keys(properties), i = 0; + i < keys.length; + ++i + ) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecProto dec. + * @member {string} dec + * @memberof cosmos.base.v1beta1.DecProto + * @instance + */ + DecProto.prototype.dec = ''; + + /** + * Creates a new DecProto instance using the specified properties. + * @function create + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.DecProto} DecProto instance + */ + DecProto.create = function create(properties) { + return new DecProto(properties); + }; + + /** + * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.dec != null && Object.hasOwnProperty.call(message, 'dec')) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.dec); + return writer; + }; + + /** + * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * @function encodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecProto message from the specified reader or buffer. + * @function decode + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, + message = new $root.cosmos.base.v1beta1.DecProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecProto message. + * @function verify + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecProto.verify = function verify(message) { + if (typeof message !== 'object' || message === null) + return 'object expected'; + if (message.dec != null && message.hasOwnProperty('dec')) + if (!$util.isString(message.dec)) return 'dec: string expected'; + return null; + }; + + /** + * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {Object.} object Plain object + * @returns {cosmos.base.v1beta1.DecProto} DecProto + */ + DecProto.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.DecProto) + return object; + var message = new $root.cosmos.base.v1beta1.DecProto(); + if (object.dec != null) message.dec = String(object.dec); + return message; + }; + + /** + * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * @function toObject + * @memberof cosmos.base.v1beta1.DecProto + * @static + * @param {cosmos.base.v1beta1.DecProto} message DecProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecProto.toObject = function toObject(message, options) { + if (!options) options = {}; + var object = {}; + if (options.defaults) object.dec = ''; + if (message.dec != null && message.hasOwnProperty('dec')) + object.dec = message.dec; + return object; + }; + + /** + * Converts this DecProto to JSON. + * @function toJSON + * @memberof cosmos.base.v1beta1.DecProto + * @instance + * @returns {Object.} JSON object + */ + DecProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DecProto; + })(); + + return v1beta1; + })(); + + return base; + })(); + + return cosmos; +})(); + +module.exports = $root; diff --git a/packages/thor/src/signers/private-key.signer.spec.ts b/packages/thor/src/signers/private-key.signer.spec.ts index d6fae6dd..c6e74f67 100644 --- a/packages/thor/src/signers/private-key.signer.spec.ts +++ b/packages/thor/src/signers/private-key.signer.spec.ts @@ -72,7 +72,7 @@ describe('private-key.signer', () => { await signer.sign(messages.thorchain as ChainMsg); expect(messages.thorchain.signedTransaction).toEqual( - 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJhClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABINCgkKBHJ1bmUSATAQABpA01Hb6deAASNC/X3n9FPZYP3J/Dd3rAqSxkUv/OXgtHE1dYq6nmu5kOMSPdaGiAAyrVxzLT/Ihav3LN4CLEQT/g==' + 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJYClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIEEMCaDBpARKIPDEXsG3U3PH+TtNqy3/qEC/a71PoAsvuAl1vZcigQBcWXF85nWL4gluaTGFJRhJQroBDWwlB4ftwB2LlKEA==' ); }); @@ -80,7 +80,7 @@ describe('private-key.signer', () => { await signer.sign(messages.mayachain as ChainMsg); expect(messages.mayachain.signedTransaction).toEqual( - 'ClAKTgoOL3R5cGVzLk1zZ1NlbmQSPAoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGg4KBWNhY2FvEgUxMDAwMBJiClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIOCgoKBWNhY2FvEgEwEAAaQCz7DsyqQcbgDK9007gTSz++N38eLd+ghHCBEyzm9bJtKSWnHwiKLBNHFMLc42GfBv8VSqHwxu/6bKthgrgE+m8=' + 'Ck4KTAoOL3R5cGVzLk1zZ1NlbmQSOgoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgwKBWNhY2FvEgMxMDASWApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA/C5ZHhO0v4GaeGiMT6ZF1tF/C6v15Jwjjjwq/Au6v1HEgQKAggBGAASBBDAmgwaQBbam0ygnZSKGaEHYRkpIAo/J+tK2YqCOQNJzoJonwA7bUvjj+8GX/o3dxba15QOc4o0PYKj3pRXwFzYfrf1q30=' ); }); }); diff --git a/packages/thor/src/signers/private-key.signer.ts b/packages/thor/src/signers/private-key.signer.ts index b529f642..6d87bc25 100644 --- a/packages/thor/src/signers/private-key.signer.ts +++ b/packages/thor/src/signers/private-key.signer.ts @@ -52,12 +52,7 @@ export class PrivateKeySigner extends Signer.Provider { }, ], fee: { - amount: [ - { - denom: msg.provider.manifest.denom, - amount: gasPrice, - }, - ], + amount: [], gas_limit: new Long(parseInt(gasLimit)), }, }); diff --git a/packages/thor/src/signers/seed-phrase.signer.spec.ts b/packages/thor/src/signers/seed-phrase.signer.spec.ts index 6445beaf..ecbae2ce 100644 --- a/packages/thor/src/signers/seed-phrase.signer.spec.ts +++ b/packages/thor/src/signers/seed-phrase.signer.spec.ts @@ -63,7 +63,7 @@ describe('seed-phrase.signer', () => { await signer.sign(messages.thorchain as ChainMsg, derivation); expect(messages.thorchain.signedTransaction).toEqual( - 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJhClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABINCgkKBHJ1bmUSATAQABpA01Hb6deAASNC/X3n9FPZYP3J/Dd3rAqSxkUv/OXgtHE1dYq6nmu5kOMSPdaGiAAyrVxzLT/Ihav3LN4CLEQT/g==' + 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJjClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIPCgkKBHJ1bmUSATAQwJoMGkCcsjR8tN2XlDJIN6WBlTtcvoqP3wNNEX5icxtynFY+hReK41XbLWqDiihvzBkpyikDBz6jyvCoWXdCY9A07hYx' ); }); @@ -71,7 +71,7 @@ describe('seed-phrase.signer', () => { await signer.sign(messages.mayachain as ChainMsg, derivation); expect(messages.mayachain.signedTransaction).toEqual( - 'ClAKTgoOL3R5cGVzLk1zZ1NlbmQSPAoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGg4KBWNhY2FvEgUxMDAwMBJiClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIOCgoKBWNhY2FvEgEwEAAaQCz7DsyqQcbgDK9007gTSz++N38eLd+ghHCBEyzm9bJtKSWnHwiKLBNHFMLc42GfBv8VSqHwxu/6bKthgrgE+m8=' + 'Ck4KTAoOL3R5cGVzLk1zZ1NlbmQSOgoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgwKBWNhY2FvEgMxMDASZApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA/C5ZHhO0v4GaeGiMT6ZF1tF/C6v15Jwjjjwq/Au6v1HEgQKAggBGAASEAoKCgVjYWNhbxIBMBDAmgwaQMLpXq11jlObzM8FMtor3iIXP5aOy3uavo6+8QDlBK9LTolUuiA7JACOAd9c+QlS0ML5lETTFpKH63nTmO8cxSQ=' ); }); diff --git a/packages/thor/src/utils.ts b/packages/thor/src/utils.ts new file mode 100644 index 00000000..ab503ac3 --- /dev/null +++ b/packages/thor/src/utils.ts @@ -0,0 +1,28 @@ +import { common } from './proto'; + +export const SYNTH_DELIMITER = '/'; +export const NON_SYNTH_DELIMITER = '.'; + +export const assetFromString = (s: string): common.IAsset | null => { + const isSynth = s.includes(SYNTH_DELIMITER); + const delimiter = isSynth ? SYNTH_DELIMITER : NON_SYNTH_DELIMITER; + const data = s.split(delimiter); + if (data.length <= 1 || data[1]?.length < 1) { + return null; + } + + let chain = data[0]; + // filter out not supported string of chains + if (!chain) return null; + + let symbol = data[1]; + const ticker = data[data.length - 1]; + + if (!symbol) return null; + if (isSynth) { + chain = symbol; + symbol = data[data.length - 1]; + } + + return { chain, symbol, ticker, synth: isSynth }; +}; diff --git a/packages/thor/tsconfig.json b/packages/thor/tsconfig.json index fbdcc4ab..0218c9ff 100644 --- a/packages/thor/tsconfig.json +++ b/packages/thor/tsconfig.json @@ -16,5 +16,5 @@ } }, "allowJs": true, - "include": ["!./src/custom.d.ts", "./src/**/*.ts", "!src/**/*.spec.*"] + "include": ["!./src/custom.d.ts", "./src/**/*.ts", "!src/**/*.spec.*", "./src/proto"] } diff --git a/utility-packages/graphql/src/gql/graphql.ts b/utility-packages/graphql/src/gql/graphql.ts index 71ed2370..47661b33 100644 --- a/utility-packages/graphql/src/gql/graphql.ts +++ b/utility-packages/graphql/src/gql/graphql.ts @@ -18,6 +18,7 @@ export type Scalars = { Boolean: boolean; Int: number; Float: number; + AssetV0Args: any; /** * A datetime with timezone offset. * @@ -29,6 +30,7 @@ export type Scalars = { DateTime: any; /** Decimal (fixed-point) */ Decimal: any; + IntegerString: any; /** A scalar that can represent any JSON value. */ JSON: any; /** @@ -76,10 +78,12 @@ export enum AddressChain { BitcoinCashTestnet = 'BitcoinCashTestnet', BitcoinTestnet = 'BitcoinTestnet', Bitsong = 'Bitsong', + Blast = 'Blast', /** Legacy, use "Cosmos" instead */ COSMOS = 'COSMOS', Canto = 'Canto', CantoEVM = 'CantoEVM', + Celestia = 'Celestia', Celo = 'Celo', Cerberus = 'Cerberus', Chihuahua = 'Chihuahua', @@ -94,6 +98,7 @@ export enum AddressChain { Desmos = 'Desmos', Dogecoin = 'Dogecoin', DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', /** Legacy, use "Ethereum" instead */ ETH = 'ETH', Emoney = 'Emoney', @@ -119,10 +124,13 @@ export enum AddressChain { /** Legacy, use "Litecoin" instead */ LTC = 'LTC', LikeCoin = 'LikeCoin', + Linea = 'Linea', Litecoin = 'Litecoin', LitecoinTestnet = 'LitecoinTestnet', Lum = 'Lum', MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', MarsProtocol = 'MarsProtocol', Medibloc = 'Medibloc', Mumbai = 'Mumbai', @@ -170,6 +178,7 @@ export enum AddressChain { TomoChain = 'TomoChain', Tron = 'Tron', Umee = 'Umee', + opBNB = 'opBNB', xDAI = 'xDAI', zkSync = 'zkSync', } @@ -222,12 +231,15 @@ export type AddressType = { chain: ChainType; }; +/** Address on given chain */ export type AddressV0 = { __typename?: 'AddressV0'; /** Crypto currency address */ address?: Maybe; /** Chain name */ chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; }; export type AddressV0Args = { @@ -276,6 +288,8 @@ export type AmountType = { export type Arbitrum = { __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -284,10 +298,17 @@ export type Arbitrum = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type ArbitrumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -315,6 +336,8 @@ export type ArbitrumTransactionsArgs = { export type AssetAllAssetsType = AssetBaseType & { __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; /** Only for "CRYPTOCURRENCY" type */ chain?: Maybe; /** For "TOKEN" and "LP_TOKEN" types */ @@ -395,6 +418,12 @@ export type AssetAmountType = { yearPriceChange?: Maybe; }; +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + export type AssetBaseType = { /** Icon URL */ icon?: Maybe; @@ -451,6 +480,8 @@ export type AssetCompositeTokenTypePageInfo = { export type AssetCryptoCurrencyType = AssetBaseType & { __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; chain: Scalars['String']; /** Additional info about asset: description, social and tech links, etc. */ externalData: Scalars['JSON']; @@ -541,6 +572,12 @@ export type AssetFiatCurrencyTypePageInfo = { startCursor?: Maybe; }; +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + export enum AssetInternalType { CRYPTOCURRENCY = 'CRYPTOCURRENCY', LP_TOKEN = 'LP_TOKEN', @@ -566,6 +603,8 @@ export type AssetTokenContractType = { export type AssetTokenType = AssetBaseType & { __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; /** Assets contracts */ contracts?: Maybe>; /** Additional info about asset: description, social and tech links, etc. */ @@ -582,6 +621,8 @@ export type AssetTokenType = AssetBaseType & { priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; type: AssetInternalType; }; @@ -631,6 +672,7 @@ export type AssetType = { cryptoAssets?: Maybe>; /** Scaling factor for market cap */ cryptoCurrencies?: Maybe; + dapps?: Maybe; /** Scaling factor for market cap */ fiatCurrencies?: Maybe; /** Trending gainers (by day price change) */ @@ -683,6 +725,11 @@ export type AssetTypeCryptoCurrenciesArgs = { page: ConnectionArgs; }; +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + export type AssetTypeFiatCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -717,6 +764,18 @@ export type AssetTypeTokensV0Args = { input: Array; }; +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + export type AssetV3 = { __typename?: 'AssetV3'; address?: Maybe; @@ -740,6 +799,8 @@ export type AssetWithAmount = { export type Aurora = { __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -748,10 +809,17 @@ export type Aurora = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type AuroraBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -779,6 +847,8 @@ export type AuroraTransactionsArgs = { export type Avalanche = { __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -787,10 +857,17 @@ export type Avalanche = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type AvalancheBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -823,6 +900,17 @@ export type Balance = { asset: CryptoAsset; }; +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + export type Base = { __typename?: 'Base'; average24hFee?: Maybe; @@ -830,6 +918,9 @@ export type Base = { name: Scalars['String']; }; +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + export type Beam = { __typename?: 'Beam'; average24hFee?: Maybe; @@ -860,6 +951,8 @@ export type BinanceTransactionsArgs = { export type BinanceSmartChain = { __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -868,10 +961,17 @@ export type BinanceSmartChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BinanceSmartChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1163,6 +1263,8 @@ export enum CacheControlScope { export type CantoEvm = { __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -1171,10 +1273,17 @@ export type CantoEvm = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CantoEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1386,6 +1495,8 @@ export type CreateReferrer = { export type CronosEvm = { __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -1394,10 +1505,17 @@ export type CronosEvm = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CronosEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1425,6 +1543,8 @@ export type CronosEvmTransactionsArgs = { export type CryptoAsset = { __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; /** supported list of chain are in [`crate::chain::Chain`] enum */ chain?: Maybe; /** ID of token (contract address in most chain) */ @@ -1520,6 +1640,16 @@ export type DAppReputationInput = { url: Scalars['String']; }; +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + /** Fiat amount at specific point of time (similar to `DatedAmount`) */ export type DatedAmountFiat = { __typename?: 'DatedAmountFiat'; @@ -1550,6 +1680,16 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + export type DogeChain = { __typename?: 'DogeChain'; average24hFee?: Maybe; @@ -1691,6 +1831,8 @@ export type EvmTransactionV2Edge = { export type Ethereum = { __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -1699,10 +1841,17 @@ export type Ethereum = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type EthereumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1728,6 +1877,26 @@ export type EthereumTransactionsArgs = { first?: InputMaybe; }; +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + export type ExplainedTransactionV3 = { __typename?: 'ExplainedTransactionV3'; args: Array; @@ -1767,6 +1936,8 @@ export type ExplainedTxWithRiskAnalysisV1 = { export type Fantom = { __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -1775,10 +1946,17 @@ export type Fantom = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type FantomBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1810,6 +1988,12 @@ export type Fee = { payer: Scalars['String']; }; +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + export type FeeInputType = { feeRateTransaction: Scalars['Float']; inboundFeeAsset: Scalars['Float']; @@ -1825,6 +2009,25 @@ export type FeeType = { value?: Maybe; }; +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + /** Unable to fetch some or all tokens information */ export type FetchingError = { __typename?: 'FetchingError'; @@ -1872,6 +2075,24 @@ export type FloorPrice = { valueUsdCents?: Maybe; }; +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + export type GetTokensArgs = { address?: InputMaybe>; ids?: InputMaybe>; @@ -2073,15 +2294,23 @@ export type Marketplace = { export type MayaChain = { __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: ThorchainTransactionConnection; version: Array; }; +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type MayaChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; @@ -2220,6 +2449,7 @@ export type NftLastSaleV2 = { quantity: Amount; }; +/** NFT for a given chain, contract and token_id */ export type NfTv0 = { __typename?: 'NFTv0'; attributes?: Maybe>; @@ -2366,6 +2596,34 @@ export enum NftChainType { Solana = 'Solana', } +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + export type OpBnb = { __typename?: 'OpBNB'; average24hFee?: Maybe; @@ -2401,6 +2659,8 @@ export type OptDateSelector = { export type Optimism = { __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2409,10 +2669,17 @@ export type Optimism = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type OptimismBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2484,6 +2751,8 @@ export type PickObjectType = { export type Polygon = { __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2492,10 +2761,17 @@ export type Polygon = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type PolygonBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2548,6 +2824,15 @@ export type PoolType = { totalSupply: Scalars['String']; }; +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + export enum PortfolioChainVariant { Akash = 'Akash', Arbitrum = 'Arbitrum', @@ -2828,6 +3113,20 @@ export type QueryWalletInfoArgs = { address: Scalars['String']; }; +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + export type ReferralBonus = { __typename?: 'ReferralBonus'; bonus?: Maybe; @@ -3475,6 +3774,8 @@ export type SearchResponse = { export type SearchType = AssetBaseType & { __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; /** Only for "CRYPTOCURRENCY" type */ chain?: Maybe; /** For "TOKEN" and "LP_TOKEN" types */ @@ -3518,8 +3819,33 @@ export type SearchTypePageInfo = { startCursor?: Maybe; }; +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + export type SolanaChain = { __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3533,6 +3859,18 @@ export type SolanaChain = { version: Array; }; +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + export type SolanaChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3626,6 +3964,19 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + /** Transaction object with necessary fields for simulation and classification using tenderly */ export type TenderlyMinimalSimulateInput = { blockNumber?: InputMaybe; @@ -3660,15 +4011,23 @@ export type TerraChainLegacyNfTsArgs = { export type ThorChain = { __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: ThorchainTransactionConnection; version: Array; }; +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type ThorChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; @@ -3680,6 +4039,14 @@ export type ThorChainTransactionsArgs = { first?: Scalars['Int']; }; +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + /** Transactions fee management for THORChain. */ export type ThorChainFee = { __typename?: 'ThorChainFee'; @@ -3695,6 +4062,15 @@ export type ThorChainFee = { tnsRegisterFee?: Maybe; }; +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + export type ThorchainFee = { __typename?: 'ThorchainFee'; amount: Amount; @@ -3757,6 +4133,23 @@ export enum TimePeriod { YEAR = 'YEAR', } +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + export type TokenContractType = { __typename?: 'TokenContractType'; address: AddressType; @@ -3778,6 +4171,13 @@ export type TokenResponse = { pageData?: Maybe; }; +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + export type TokenType = { __typename?: 'TokenType'; contract: Scalars['String']; @@ -3791,11 +4191,14 @@ export type TokenType = { symbol: Scalars['String']; }; +/** (experimental) Represent Token for a given chain, contract and token_id */ export type TokenV0 = { __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; /** Chain name */ chain?: Maybe; - /** Chain name and crypto currency address */ + /** Contract for EVM/Cosmos and program_id for Solana */ contract?: Maybe; /** Number of decimals for current asset */ decimals?: Maybe; @@ -3806,7 +4209,7 @@ export type TokenV0 = { price?: Maybe; /** The symbol that identifies token */ symbol?: Maybe; - /** Token id for solana mint */ + /** Null for EVM/Cosmos and mint for Solana */ tokenId?: Maybe; }; @@ -3839,6 +4242,22 @@ export type TransactionCallArg = { value: Scalars['String']; }; +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + export enum TransactionType { CLAIM = 'CLAIM', DEPOSIT = 'DEPOSIT', @@ -3852,6 +4271,8 @@ export enum TransactionType { export type TrendingCoingeckoType = { __typename?: 'TrendingCoingeckoType'; assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; chains: Array; icon?: Maybe; name: Scalars['String']; @@ -3863,6 +4284,8 @@ export type TrendingCoingeckoType = { export type TrendingTokensType = { __typename?: 'TrendingTokensType'; assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; chains: Array; icon?: Maybe; name: Scalars['String']; @@ -3873,6 +4296,8 @@ export type TrendingTokensType = { export type Tron = { __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3880,10 +4305,17 @@ export type Tron = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ transactions: EvmTransactionV2Connection; version: Array; }; +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type TronBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3904,6 +4336,22 @@ export type TronTransactionsArgs = { first?: InputMaybe; }; +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + export type TxAnalysisV1 = { __typename?: 'TxAnalysisV1'; securityIssues: Array; @@ -4014,10 +4462,16 @@ export enum TxClassifierChains { Dummychain = 'Dummychain', arbitrum = 'arbitrum', avalanche = 'avalanche', + base = 'base', + blast = 'blast', bsc = 'bsc', ethereum = 'ethereum', fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', polygon = 'polygon', + solana = 'solana', } export enum TxClassifierTxType { @@ -4204,6 +4658,44 @@ export type Wallet = { name: Scalars['String']; }; +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + export type WalletInfo = { __typename?: 'WalletInfo'; /** EVM address of the wallet. */ From a37c2b22b8e9c765ba8a8e8839fc6dd88ae93d93 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 27 Jun 2024 16:35:35 +0000 Subject: [PATCH 022/176] Version packages --- .changeset/empty-pots-cheer.md | 5 ----- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/empty-pots-cheer.md diff --git a/.changeset/empty-pots-cheer.md b/.changeset/empty-pots-cheer.md deleted file mode 100644 index 234d973d..00000000 --- a/.changeset/empty-pots-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch ---- - -chore: added msgDeposit to thor diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index ef73c1e6..6bd4e5f9 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.0.19 + +### Patch Changes + +- 1f0b3cec: chore: added msgDeposit to thor + ## 2.0.18 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index e5039927..2685d171 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.18", + "version": "2.0.19", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From c8af2ed85f2d4200d8a3dce0803f1c2413f4ee47 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:00:11 +0700 Subject: [PATCH 023/176] Chore/install size limit package (#252) * chore: install size limit package to develop * chore: install size limit package to develop * chore: add size limit config --- package.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package.json b/package.json index 1ba21cc2..a4232388 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,13 @@ "chain:generate": "HYGEN_TMPLS=templates hygen basic new", "publish-packages": "turbo run build lint && changeset version && changeset publish" }, + "size-limit": [ + { + "path": "packages/*/dist/index.js", + "webpack": false, + "limit": "50000 ms" + } + ], "devDependencies": { "@babel/core": "7.21.8", "@babel/plugin-proposal-class-properties": "7.18.6", From 89c09e8fa3ee41631a0a1fde81f40f7441c823f8 Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Fri, 28 Jun 2024 16:33:19 +0700 Subject: [PATCH 024/176] feat: Split Chains Lib GQL package into binance lib (#230) * feat: Split Chains Lib GQL package into binance lib * feat: XDEFI-4566: Split Chains Lib GQL package for binance * feat: XDEFI-4566 Split Chains Lib GQL package into each chain * feat: XDEFI-4566 split getCryptoAssets func to core * feat: update code generate * chore: add changeset --- .changeset/tiny-fans-tease.md | 15 + packages/binance/codegen.yml | 25 + packages/binance/package.json | 15 +- .../datasource/indexer/indexer.data-source.ts | 2 +- .../indexer/queries/balances.query.ts | 3 +- .../datasource/indexer/queries/fees.query.ts | 3 +- .../indexer/queries/status.query.ts | 3 +- .../indexer/queries/transactions.query.ts | 5 +- packages/binance/src/gql/fragment-masking.ts | 54 + packages/binance/src/gql/gql.ts | 46 + packages/binance/src/gql/graphql.ts | 5363 ++++++ packages/binance/src/gql/index.ts | 3 + packages/bitcoin/codegen.yml | 25 + packages/bitcoin/package.json | 15 +- .../indexer/queries/balances.query.ts | 3 +- .../indexer/queries/broadcast.query.ts | 3 +- .../datasource/indexer/queries/fees.query.ts | 3 +- .../queries/getTransactionByHash.query.ts | 3 +- .../indexer/queries/scanUTXOs.query.ts | 3 +- .../indexer/queries/transactions.query.ts | 5 +- packages/bitcoin/src/gql/fragment-masking.ts | 54 + packages/bitcoin/src/gql/gql.ts | 46 + packages/bitcoin/src/gql/graphql.ts | 5515 ++++++ packages/bitcoin/src/gql/index.ts | 3 + packages/bitcoincash/codegen.yml | 25 + packages/bitcoincash/package.json | 15 +- .../indexer/queries/balances.query.ts | 6 +- .../indexer/queries/broadcast.query.ts | 3 +- .../datasource/indexer/queries/fees.query.ts | 3 +- .../queries/getTransactionByHash.query.ts | 3 +- .../indexer/queries/scanUTXOs.query.ts | 3 +- .../indexer/queries/transactions.query.ts | 5 +- .../bitcoincash/src/gql/fragment-masking.ts | 54 + packages/bitcoincash/src/gql/gql.ts | 46 + packages/bitcoincash/src/gql/graphql.ts | 5524 ++++++ packages/bitcoincash/src/gql/index.ts | 3 + packages/core/codegen.yml | 24 + packages/core/package.json | 13 +- packages/core/src/common/client/index.ts | 1 + .../common/client/queries/getCryptoAssets.ts | 11 + .../core/src/common/client/queries/index.ts | 1 + packages/core/src/common/fragment-masking.ts | 50 + packages/core/src/common/gql.ts | 50 + packages/core/src/common/graphql.ts | 4809 ++++++ packages/core/src/operations.graphql | 17 + packages/cosmos/codegen.yml | 25 + packages/cosmos/package.json | 15 +- .../src/datasource/chain/chain.data-source.ts | 7 +- .../datasource/chain/queries/assets-query.ts | 3 +- .../indexer/queries/balances.query.ts | 4 +- .../datasource/indexer/queries/fees.query.ts | 4 +- .../indexer/queries/transactions.query.ts | 6 +- packages/cosmos/src/gql/fragment-masking.ts | 54 + packages/cosmos/src/gql/gql.ts | 62 + packages/cosmos/src/gql/graphql.ts | 14237 ++++++++++++++++ packages/cosmos/src/gql/index.ts | 3 + packages/dogecoin/codegen.yml | 25 + packages/dogecoin/package.json | 15 +- .../indexer/queries/balances.query.ts | 3 +- .../indexer/queries/broadcast.query.ts | 3 +- .../datasource/indexer/queries/fees.query.ts | 3 +- .../queries/getTransactionByHash.query.ts | 3 +- .../indexer/queries/scanUTXOs.query.ts | 3 +- .../indexer/queries/transactions.query.ts | 5 +- packages/dogecoin/src/gql/fragment-masking.ts | 54 + packages/dogecoin/src/gql/gql.ts | 46 + packages/dogecoin/src/gql/graphql.ts | 5521 ++++++ packages/dogecoin/src/gql/index.ts | 3 + packages/evm/codegen.yml | 25 + packages/evm/package.json | 15 +- .../src/datasource/chain/chain.data-source.ts | 3 +- packages/evm/src/gql/fragment-masking.ts | 54 + packages/evm/src/gql/gql.ts | 118 + packages/evm/src/gql/graphql.ts | 11529 +++++++++++++ packages/evm/src/gql/index.ts | 3 + packages/litecoin/codegen.yml | 25 + packages/litecoin/package.json | 15 +- .../indexer/queries/balances.query.ts | 3 +- .../indexer/queries/broadcast.query.ts | 3 +- .../datasource/indexer/queries/fees.query.ts | 3 +- .../queries/getTransactionByHash.query.ts | 3 +- .../indexer/queries/scanUTXOs.query.ts | 3 +- .../indexer/queries/transactions.query.ts | 5 +- packages/litecoin/src/gql/fragment-masking.ts | 54 + packages/litecoin/src/gql/gql.ts | 46 + packages/litecoin/src/gql/graphql.ts | 5521 ++++++ packages/litecoin/src/gql/index.ts | 3 + packages/solana/codegen.yml | 25 + packages/solana/package.json | 13 +- .../indexer/queries/balances.query.ts | 3 +- .../datasource/indexer/queries/fees.query.ts | 3 +- .../indexer/queries/transactions.query.ts | 6 +- packages/solana/src/gql/fragment-masking.ts | 54 + packages/solana/src/gql/gql.ts | 46 + packages/solana/src/gql/graphql.ts | 5356 ++++++ packages/solana/src/gql/index.ts | 3 + packages/thor/codegen.yml | 25 + packages/thor/package.json | 15 +- .../src/datasource/chain/chain.data-source.ts | 7 +- .../indexer/queries/balances.query.ts | 4 +- .../datasource/indexer/queries/fees.query.ts | 4 +- .../indexer/queries/transactions.query.ts | 6 +- packages/thor/src/gql/fragment-masking.ts | 54 + packages/thor/src/gql/gql.ts | 62 + packages/thor/src/gql/graphql.ts | 6351 +++++++ packages/thor/src/gql/index.ts | 3 + packages/thor/src/operations.graphql | 17 + packages/tron/codegen.yml | 25 + packages/tron/package.json | 15 +- .../datasource/indexer/indexer.data-source.ts | 2 +- .../indexer/queries/balances.query.ts | 3 +- .../indexer/queries/transactions.query.ts | 3 +- packages/tron/src/gql/fragment-masking.ts | 54 + packages/tron/src/gql/gql.ts | 46 + packages/tron/src/gql/graphql.ts | 5255 ++++++ packages/tron/src/gql/index.ts | 3 + packages/tron/src/gql/operations.graphql | 17 + utility-packages/graphql/package.json | 5 +- 118 files changed, 76794 insertions(+), 107 deletions(-) create mode 100644 .changeset/tiny-fans-tease.md create mode 100644 packages/binance/codegen.yml create mode 100644 packages/binance/src/gql/fragment-masking.ts create mode 100644 packages/binance/src/gql/gql.ts create mode 100644 packages/binance/src/gql/graphql.ts create mode 100644 packages/binance/src/gql/index.ts create mode 100644 packages/bitcoin/codegen.yml create mode 100644 packages/bitcoin/src/gql/fragment-masking.ts create mode 100644 packages/bitcoin/src/gql/gql.ts create mode 100644 packages/bitcoin/src/gql/graphql.ts create mode 100644 packages/bitcoin/src/gql/index.ts create mode 100644 packages/bitcoincash/codegen.yml create mode 100644 packages/bitcoincash/src/gql/fragment-masking.ts create mode 100644 packages/bitcoincash/src/gql/gql.ts create mode 100644 packages/bitcoincash/src/gql/graphql.ts create mode 100644 packages/bitcoincash/src/gql/index.ts create mode 100644 packages/core/codegen.yml create mode 100644 packages/core/src/common/client/queries/getCryptoAssets.ts create mode 100644 packages/core/src/common/client/queries/index.ts create mode 100644 packages/core/src/common/fragment-masking.ts create mode 100644 packages/core/src/common/gql.ts create mode 100644 packages/core/src/common/graphql.ts create mode 100644 packages/core/src/operations.graphql create mode 100644 packages/cosmos/codegen.yml create mode 100644 packages/cosmos/src/gql/fragment-masking.ts create mode 100644 packages/cosmos/src/gql/gql.ts create mode 100644 packages/cosmos/src/gql/graphql.ts create mode 100644 packages/cosmos/src/gql/index.ts create mode 100644 packages/dogecoin/codegen.yml create mode 100644 packages/dogecoin/src/gql/fragment-masking.ts create mode 100644 packages/dogecoin/src/gql/gql.ts create mode 100644 packages/dogecoin/src/gql/graphql.ts create mode 100644 packages/dogecoin/src/gql/index.ts create mode 100644 packages/evm/codegen.yml create mode 100644 packages/evm/src/gql/fragment-masking.ts create mode 100644 packages/evm/src/gql/gql.ts create mode 100644 packages/evm/src/gql/graphql.ts create mode 100644 packages/evm/src/gql/index.ts create mode 100644 packages/litecoin/codegen.yml create mode 100644 packages/litecoin/src/gql/fragment-masking.ts create mode 100644 packages/litecoin/src/gql/gql.ts create mode 100644 packages/litecoin/src/gql/graphql.ts create mode 100644 packages/litecoin/src/gql/index.ts create mode 100644 packages/solana/codegen.yml create mode 100644 packages/solana/src/gql/fragment-masking.ts create mode 100644 packages/solana/src/gql/gql.ts create mode 100644 packages/solana/src/gql/graphql.ts create mode 100644 packages/solana/src/gql/index.ts create mode 100644 packages/thor/codegen.yml create mode 100644 packages/thor/src/gql/fragment-masking.ts create mode 100644 packages/thor/src/gql/gql.ts create mode 100644 packages/thor/src/gql/graphql.ts create mode 100644 packages/thor/src/gql/index.ts create mode 100644 packages/thor/src/operations.graphql create mode 100644 packages/tron/codegen.yml create mode 100644 packages/tron/src/gql/fragment-masking.ts create mode 100644 packages/tron/src/gql/gql.ts create mode 100644 packages/tron/src/gql/graphql.ts create mode 100644 packages/tron/src/gql/index.ts create mode 100644 packages/tron/src/gql/operations.graphql diff --git a/.changeset/tiny-fans-tease.md b/.changeset/tiny-fans-tease.md new file mode 100644 index 00000000..0dffb064 --- /dev/null +++ b/.changeset/tiny-fans-tease.md @@ -0,0 +1,15 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-evm': patch +--- + +Split Chains Lib GQL package for each chains diff --git a/packages/binance/codegen.yml b/packages/binance/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/binance/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/binance/package.json b/packages/binance/package.json index 7b8084f7..15b8c0da 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -17,14 +17,19 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@binance-chain/javascript-sdk": "4.2.2", "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "axios": "1.4.0", "bignumber.js": "9.1.2", "reflect-metadata": "0.1.13", @@ -41,7 +46,11 @@ "test:watch": "jest --watch", "lint": "eslint .", "lint:fix": "eslint . --fix", - "clean": "rimraf dist .turbo node_modules" + "clean": "rimraf dist .turbo node_modules", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/binance/src/datasource/indexer/indexer.data-source.ts b/packages/binance/src/datasource/indexer/indexer.data-source.ts index ee25783e..5b3109b8 100644 --- a/packages/binance/src/datasource/indexer/indexer.data-source.ts +++ b/packages/binance/src/datasource/indexer/indexer.data-source.ts @@ -14,8 +14,8 @@ import { } from '@xdefi-tech/chains-core'; import { Observable } from 'rxjs'; import BigNumber from 'bignumber.js'; -import { OptBlockRange } from '@xdefi-tech/chains-graphql'; +import { OptBlockRange } from '../../gql/graphql'; import { ChainMsg } from '../../msg'; import { getBalance, getFees, getStatus, getTransaction } from './queries'; diff --git a/packages/binance/src/datasource/indexer/queries/balances.query.ts b/packages/binance/src/datasource/indexer/queries/balances.query.ts index badf5bba..084621b0 100644 --- a/packages/binance/src/datasource/indexer/queries/balances.query.ts +++ b/packages/binance/src/datasource/indexer/queries/balances.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { GetBinanceBalancesDocument } from '@xdefi-tech/chains-graphql'; + +import { GetBinanceBalancesDocument } from '../../../gql/graphql'; export const getBalance = (address: string) => { return gqlClient.query({ diff --git a/packages/binance/src/datasource/indexer/queries/fees.query.ts b/packages/binance/src/datasource/indexer/queries/fees.query.ts index bede103e..cbaa12c3 100644 --- a/packages/binance/src/datasource/indexer/queries/fees.query.ts +++ b/packages/binance/src/datasource/indexer/queries/fees.query.ts @@ -1,6 +1,7 @@ -import { GetBinanceFeeDocument } from '@xdefi-tech/chains-graphql'; import { gqlClient } from '@xdefi-tech/chains-core'; +import { GetBinanceFeeDocument } from '../../../gql/graphql'; + export const getFees = () => { return gqlClient.query({ query: GetBinanceFeeDocument, diff --git a/packages/binance/src/datasource/indexer/queries/status.query.ts b/packages/binance/src/datasource/indexer/queries/status.query.ts index 217d076a..0682535e 100644 --- a/packages/binance/src/datasource/indexer/queries/status.query.ts +++ b/packages/binance/src/datasource/indexer/queries/status.query.ts @@ -1,6 +1,7 @@ -import { GetBinanceStatusDocument } from '@xdefi-tech/chains-graphql'; import { gqlClient } from '@xdefi-tech/chains-core'; +import { GetBinanceStatusDocument } from '../../../gql/graphql'; + export const getStatus = () => { return gqlClient.query({ query: GetBinanceStatusDocument, diff --git a/packages/binance/src/datasource/indexer/queries/transactions.query.ts b/packages/binance/src/datasource/indexer/queries/transactions.query.ts index 3454f0ca..a04b6cb7 100644 --- a/packages/binance/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/binance/src/datasource/indexer/queries/transactions.query.ts @@ -1,9 +1,10 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetBinanceTransactionsDocument, Scalars, OptBlockRange, -} from '@xdefi-tech/chains-graphql'; -import { gqlClient } from '@xdefi-tech/chains-core'; +} from '../../../gql/graphql'; export const getTransaction = ( address: Scalars['String'], diff --git a/packages/binance/src/gql/fragment-masking.ts b/packages/binance/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/binance/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/binance/src/gql/gql.ts b/packages/binance/src/gql/gql.ts new file mode 100644 index 00000000..57b669b3 --- /dev/null +++ b/packages/binance/src/gql/gql.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}': + types.GetBinanceBalancesDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}' +): typeof documents['query GetBinanceBalances($address: String!) {\n binance {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n }\n }\n}\n\nquery GetBinanceTransactions($address: String!, $first: Int, $after: String, $blockRange: OptBlockSelector) {\n binance {\n transactions(\n address: $address\n first: $first\n after: $after\n blockRange: $blockRange\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n type\n }\n blockHeight\n data\n fee {\n value\n }\n fromAddress\n hash\n status\n time\n toAddress\n type\n }\n }\n }\n }\n}\n\nquery GetBinanceFee {\n binance {\n fee\n }\n}\n\nquery GetBinanceStatus {\n binance {\n status {\n lastBlock {\n hash\n height\n time\n txCount\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/binance/src/gql/graphql.ts b/packages/binance/src/gql/graphql.ts new file mode 100644 index 00000000..6b181bc6 --- /dev/null +++ b/packages/binance/src/gql/graphql.ts @@ -0,0 +1,5363 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type GetBinanceBalancesQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetBinanceBalancesQuery = { + __typename?: 'Query'; + binance: { + __typename?: 'Binance'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetBinanceTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; + after?: InputMaybe; + blockRange?: InputMaybe; +}>; + +export type GetBinanceTransactionsQuery = { + __typename?: 'Query'; + binance: { + __typename?: 'Binance'; + transactions: { + __typename?: 'BinanceTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'BinanceTransactionEdge'; + node: { + __typename?: 'BinanceTransaction'; + blockHeight: number; + data?: any | null; + fromAddress: string; + hash: string; + status: string; + time: any; + toAddress?: string | null; + type: string; + amount?: { __typename?: 'Amount'; value: string } | null; + asset?: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } | null; + fee: { __typename?: 'Amount'; value: string }; + }; + }>; + }; + }; +}; + +export type GetBinanceFeeQueryVariables = Exact<{ [key: string]: never }>; + +export type GetBinanceFeeQuery = { + __typename?: 'Query'; + binance: { __typename?: 'Binance'; fee?: any | null }; +}; + +export type GetBinanceStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetBinanceStatusQuery = { + __typename?: 'Query'; + binance: { + __typename?: 'Binance'; + status: { + __typename?: 'BinanceStatus'; + lastBlock?: { + __typename?: 'LastBlock'; + hash: string; + height: number; + time: any; + txCount: number; + } | null; + }; + }; +}; + +export const GetBinanceBalancesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBinanceBalances' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binance' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBinanceBalancesQuery, + GetBinanceBalancesQueryVariables +>; +export const GetBinanceTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBinanceTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockSelector' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binance' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'type' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'data' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'time' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'toAddress' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'type' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBinanceTransactionsQuery, + GetBinanceTransactionsQueryVariables +>; +export const GetBinanceFeeDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBinanceFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binance' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'fee' } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetBinanceStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBinanceStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binance' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'height' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'time' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'txCount' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBinanceStatusQuery, + GetBinanceStatusQueryVariables +>; diff --git a/packages/binance/src/gql/index.ts b/packages/binance/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/binance/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/bitcoin/codegen.yml b/packages/bitcoin/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/bitcoin/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 02ceff31..5454a49b 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -16,7 +16,13 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -28,7 +34,6 @@ "@scure/btc-signer": "1.2.1", "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bignumber.js": "9.1.2", @@ -52,7 +57,11 @@ "test:watch": "jest --watch", "lint": "eslint .", "lint:fix": "eslint . --fix", - "clean": "rimraf dist .turbo node_modules" + "clean": "rimraf dist .turbo node_modules", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/bitcoin/src/datasource/indexer/queries/balances.query.ts b/packages/bitcoin/src/datasource/indexer/queries/balances.query.ts index 1c25d18a..c8b4a08d 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/balances.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/balances.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { BitcoinBalanceDocument, Balance } from '@xdefi-tech/chains-graphql'; + +import { Balance, BitcoinBalanceDocument } from '../../../gql/graphql'; export const getBalance = async (address: string): Promise> => { const response = await gqlClient.query({ diff --git a/packages/bitcoin/src/datasource/indexer/queries/broadcast.query.ts b/packages/bitcoin/src/datasource/indexer/queries/broadcast.query.ts index a0ac6724..cfb15b2f 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/broadcast.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/broadcast.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { BitcoinBroadcastTransactionDocument } from '@xdefi-tech/chains-graphql'; + +import { BitcoinBroadcastTransactionDocument } from '../../../gql/graphql'; export const broadcast = async (rawHex: string): Promise => { const response = await gqlClient.query({ diff --git a/packages/bitcoin/src/datasource/indexer/queries/fees.query.ts b/packages/bitcoin/src/datasource/indexer/queries/fees.query.ts index a5339c18..8d1011c2 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/fees.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/fees.query.ts @@ -1,6 +1,7 @@ -import { GetBitcoinFeesDocument } from '@xdefi-tech/chains-graphql'; import { DefaultFeeOptions, gqlClient } from '@xdefi-tech/chains-core'; +import { GetBitcoinFeesDocument } from '../../../gql/graphql'; + export const getFees = async (): Promise => { const response = await gqlClient.query({ query: GetBitcoinFeesDocument, diff --git a/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts b/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts index 4d7a9c08..7714f927 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { BitcoinGetTransactionByHashDocument } from '@xdefi-tech/chains-graphql'; + +import { BitcoinGetTransactionByHashDocument } from '../../../gql/graphql'; export const getTransactionByHash = async (txHash: string) => { try { diff --git a/packages/bitcoin/src/datasource/indexer/queries/scanUTXOs.query.ts b/packages/bitcoin/src/datasource/indexer/queries/scanUTXOs.query.ts index 64cf4fdb..5ebf9974 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/scanUTXOs.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/scanUTXOs.query.ts @@ -1,8 +1,9 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { BitcoinScanUtxOsDocument, UnspentTransactionOutputV5, -} from '@xdefi-tech/chains-graphql'; +} from '../../../gql/graphql'; export const scanUTXOs = async ( address: string diff --git a/packages/bitcoin/src/datasource/indexer/queries/transactions.query.ts b/packages/bitcoin/src/datasource/indexer/queries/transactions.query.ts index a74a6be0..57764290 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/transactions.query.ts @@ -1,9 +1,10 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetBitcoinTransactionsDocument, Scalars, UtxoTransactionV2, -} from '@xdefi-tech/chains-graphql'; -import { gqlClient } from '@xdefi-tech/chains-core'; +} from '../../../gql/graphql'; export const getTransactions = async ( chain: string, diff --git a/packages/bitcoin/src/gql/fragment-masking.ts b/packages/bitcoin/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/bitcoin/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/bitcoin/src/gql/gql.ts b/packages/bitcoin/src/gql/gql.ts new file mode 100644 index 00000000..fc28fa7e --- /dev/null +++ b/packages/bitcoin/src/gql/gql.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}': + types.BitcoinBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' +): typeof documents['query BitcoinBalance($address: String!) {\n bitcoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinFees {\n bitcoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinBroadcastTransaction($rawHex: String!) {\n bitcoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinScanUTXOs($address: String!, $page: Int!) {\n bitcoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinGetTransactionByHash($txHash: String!) {\n bitcoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/bitcoin/src/gql/graphql.ts b/packages/bitcoin/src/gql/graphql.ts new file mode 100644 index 00000000..40def958 --- /dev/null +++ b/packages/bitcoin/src/gql/graphql.ts @@ -0,0 +1,5515 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type BitcoinBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type BitcoinBalanceQuery = { + __typename?: 'Query'; + bitcoin: { + __typename?: 'BitcoinChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetBitcoinFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetBitcoinFeesQuery = { + __typename?: 'Query'; + bitcoin: { + __typename?: 'BitcoinChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetBitcoinTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + pageSize: Scalars['Int']; + pageNumber: Scalars['Int']; +}>; + +export type GetBitcoinTransactionsQuery = { + __typename?: 'Query'; + bitcoin: { + __typename?: 'BitcoinChain'; + transactionsV2: Array<{ + __typename?: 'UTXOTransactionV2'; + blockNumber?: number | null; + hash: string; + timestamp?: any | null; + status?: string | null; + balanceChange?: { __typename?: 'Amount'; value: string } | null; + fee?: { __typename?: 'Amount'; value: string } | null; + inputs?: Array<{ + __typename?: 'Input'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + outputs?: Array<{ + __typename?: 'Output'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + }>; + }; +}; + +export type BitcoinBroadcastTransactionQueryVariables = Exact<{ + rawHex: Scalars['String']; +}>; + +export type BitcoinBroadcastTransactionQuery = { + __typename?: 'Query'; + bitcoin: { __typename?: 'BitcoinChain'; broadcastTransaction: string }; +}; + +export type BitcoinScanUtxOsQueryVariables = Exact<{ + address: Scalars['String']; + page: Scalars['Int']; +}>; + +export type BitcoinScanUtxOsQuery = { + __typename?: 'Query'; + bitcoin: { + __typename?: 'BitcoinChain'; + unspentTxOutputsV5: Array<{ + __typename?: 'UnspentTransactionOutputV5'; + oTxHash: string; + oIndex: number; + oTxHex?: string | null; + address?: string | null; + isCoinbase?: boolean | null; + scriptHex?: string | null; + value: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type BitcoinGetTransactionByHashQueryVariables = Exact<{ + txHash: Scalars['String']; +}>; + +export type BitcoinGetTransactionByHashQuery = { + __typename?: 'Query'; + bitcoin: { + __typename?: 'BitcoinChain'; + getTransactionByHashV5: { + __typename?: 'UtxotransactionByHashV5'; + hex?: string | null; + txid?: string | null; + hash: string; + size: number; + version: number; + locktime?: number | null; + confirmations?: number | null; + blocktime?: number | null; + time?: number | null; + blockhash?: string | null; + blockNumber?: number | null; + sourceOfData: string; + inputs: Array<{ __typename?: 'Input'; address: string }>; + outputs: Array<{ __typename?: 'Output'; address: string }>; + }; + }; +}; + +export const BitcoinBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetBitcoinFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBitcoinFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetBitcoinTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBitcoinTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactionsV2' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageSize' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageNumber' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balanceChange' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBitcoinTransactionsQuery, + GetBitcoinTransactionsQueryVariables +>; +export const BitcoinBroadcastTransactionDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinBroadcastTransaction' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'broadcastTransaction' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'rawHex' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + }, + ], + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinBroadcastTransactionQuery, + BitcoinBroadcastTransactionQueryVariables +>; +export const BitcoinScanUtxOsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinScanUTXOs' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'unspentTxOutputsV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'page' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'page' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'isCoinbase' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scriptHex' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinScanUtxOsQuery, + BitcoinScanUtxOsQueryVariables +>; +export const BitcoinGetTransactionByHashDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinGetTransactionByHash' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'getTransactionByHashV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'txHash' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'hex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'txid' } }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { kind: 'Field', name: { kind: 'Name', value: 'size' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'version' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'locktime' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'confirmations' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blocktime' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'time' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockhash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'sourceOfData' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinGetTransactionByHashQuery, + BitcoinGetTransactionByHashQueryVariables +>; diff --git a/packages/bitcoin/src/gql/index.ts b/packages/bitcoin/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/bitcoin/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/bitcoincash/codegen.yml b/packages/bitcoincash/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/bitcoincash/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 0433629d..79b2674c 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -16,7 +16,13 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -27,7 +33,6 @@ "@psf/bitcoincashjs-lib": "4.0.3", "@scure/btc-signer": "1.2.1", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bchaddrjs": "0.5.2", @@ -55,7 +60,11 @@ "test:watch": "jest --watch", "lint": "eslint .", "lint:fix": "eslint . --fix", - "clean": "rimraf dist .turbo node_modules" + "clean": "rimraf dist .turbo node_modules", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/bitcoincash/src/datasource/indexer/queries/balances.query.ts b/packages/bitcoincash/src/datasource/indexer/queries/balances.query.ts index bd845412..09bace98 100644 --- a/packages/bitcoincash/src/datasource/indexer/queries/balances.query.ts +++ b/packages/bitcoincash/src/datasource/indexer/queries/balances.query.ts @@ -1,8 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { - BitcoinCashBalanceDocument, - Balance, -} from '@xdefi-tech/chains-graphql'; + +import { BitcoinCashBalanceDocument, Balance } from '../../../gql/graphql'; export const getBalance = async (address: string): Promise> => { const response = await gqlClient.query({ diff --git a/packages/bitcoincash/src/datasource/indexer/queries/broadcast.query.ts b/packages/bitcoincash/src/datasource/indexer/queries/broadcast.query.ts index f58bd4f3..5b5fee85 100644 --- a/packages/bitcoincash/src/datasource/indexer/queries/broadcast.query.ts +++ b/packages/bitcoincash/src/datasource/indexer/queries/broadcast.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { BitcoinCashBroadcastTransactionDocument } from '@xdefi-tech/chains-graphql'; + +import { BitcoinCashBroadcastTransactionDocument } from '../../../gql/graphql'; export const broadcast = async (rawHex: string): Promise => { const response = await gqlClient.query({ diff --git a/packages/bitcoincash/src/datasource/indexer/queries/fees.query.ts b/packages/bitcoincash/src/datasource/indexer/queries/fees.query.ts index 5d457db6..03230e2d 100644 --- a/packages/bitcoincash/src/datasource/indexer/queries/fees.query.ts +++ b/packages/bitcoincash/src/datasource/indexer/queries/fees.query.ts @@ -1,6 +1,7 @@ -import { GetBitcoinCashFeesDocument } from '@xdefi-tech/chains-graphql'; import { DefaultFeeOptions, gqlClient } from '@xdefi-tech/chains-core'; +import { GetBitcoinCashFeesDocument } from '../../../gql/graphql'; + export const getFees = async (): Promise => { const response = await gqlClient.query({ query: GetBitcoinCashFeesDocument, diff --git a/packages/bitcoincash/src/datasource/indexer/queries/getTransactionByHash.query.ts b/packages/bitcoincash/src/datasource/indexer/queries/getTransactionByHash.query.ts index 7aaacefc..0600f262 100644 --- a/packages/bitcoincash/src/datasource/indexer/queries/getTransactionByHash.query.ts +++ b/packages/bitcoincash/src/datasource/indexer/queries/getTransactionByHash.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { BitcoinCashGetTransactionByHashDocument } from '@xdefi-tech/chains-graphql'; + +import { BitcoinCashGetTransactionByHashDocument } from '../../../gql/graphql'; export const getTransactionByHash = async (txHash: string) => { try { diff --git a/packages/bitcoincash/src/datasource/indexer/queries/scanUTXOs.query.ts b/packages/bitcoincash/src/datasource/indexer/queries/scanUTXOs.query.ts index d3f3a865..27270c8d 100644 --- a/packages/bitcoincash/src/datasource/indexer/queries/scanUTXOs.query.ts +++ b/packages/bitcoincash/src/datasource/indexer/queries/scanUTXOs.query.ts @@ -1,8 +1,9 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { BitcoinCashScanUtxOsDocument, UnspentTransactionOutputV5, -} from '@xdefi-tech/chains-graphql'; +} from '../../../gql/graphql'; export const scanUTXOs = async ( address: string diff --git a/packages/bitcoincash/src/datasource/indexer/queries/transactions.query.ts b/packages/bitcoincash/src/datasource/indexer/queries/transactions.query.ts index d1542673..74925003 100644 --- a/packages/bitcoincash/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/bitcoincash/src/datasource/indexer/queries/transactions.query.ts @@ -1,9 +1,10 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetBitcoinCashTransactionsDocument, Scalars, UtxoTransactionV2, -} from '@xdefi-tech/chains-graphql'; -import { gqlClient } from '@xdefi-tech/chains-core'; +} from '../../../gql/graphql'; export const getTransactions = async ( chain: string, diff --git a/packages/bitcoincash/src/gql/fragment-masking.ts b/packages/bitcoincash/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/bitcoincash/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/bitcoincash/src/gql/gql.ts b/packages/bitcoincash/src/gql/gql.ts new file mode 100644 index 00000000..c843cfab --- /dev/null +++ b/packages/bitcoincash/src/gql/gql.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}': + types.BitcoinCashBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' +): typeof documents['query BitcoinCashBalance($address: String!) {\n bitcoincash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetBitcoinCashFees {\n bitcoincash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetBitcoinCashTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n bitcoincash {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery BitcoinCashBroadcastTransaction($rawHex: String!) {\n bitcoincash {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery BitcoinCashScanUTXOs($address: String!, $page: Int!) {\n bitcoincash {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery BitcoinCashGetTransactionByHash($txHash: String!) {\n bitcoincash {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/bitcoincash/src/gql/graphql.ts b/packages/bitcoincash/src/gql/graphql.ts new file mode 100644 index 00000000..586ccf69 --- /dev/null +++ b/packages/bitcoincash/src/gql/graphql.ts @@ -0,0 +1,5524 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type BitcoinCashBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type BitcoinCashBalanceQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetBitcoinCashFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetBitcoinCashFeesQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetBitcoinCashTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + pageSize: Scalars['Int']; + pageNumber: Scalars['Int']; +}>; + +export type GetBitcoinCashTransactionsQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + transactionsV2: Array<{ + __typename?: 'UTXOTransactionV2'; + blockNumber?: number | null; + hash: string; + timestamp?: any | null; + status?: string | null; + balanceChange?: { __typename?: 'Amount'; value: string } | null; + fee?: { __typename?: 'Amount'; value: string } | null; + inputs?: Array<{ + __typename?: 'Input'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + outputs?: Array<{ + __typename?: 'Output'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + }>; + }; +}; + +export type BitcoinCashBroadcastTransactionQueryVariables = Exact<{ + rawHex: Scalars['String']; +}>; + +export type BitcoinCashBroadcastTransactionQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + broadcastTransaction: string; + }; +}; + +export type BitcoinCashScanUtxOsQueryVariables = Exact<{ + address: Scalars['String']; + page: Scalars['Int']; +}>; + +export type BitcoinCashScanUtxOsQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + unspentTxOutputsV5: Array<{ + __typename?: 'UnspentTransactionOutputV5'; + oTxHash: string; + oIndex: number; + oTxHex?: string | null; + address?: string | null; + isCoinbase?: boolean | null; + scriptHex?: string | null; + value: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type BitcoinCashGetTransactionByHashQueryVariables = Exact<{ + txHash: Scalars['String']; +}>; + +export type BitcoinCashGetTransactionByHashQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + getTransactionByHashV5: { + __typename?: 'UtxotransactionByHashV5'; + hex?: string | null; + txid?: string | null; + hash: string; + size: number; + version: number; + locktime?: number | null; + confirmations?: number | null; + blocktime?: number | null; + time?: number | null; + blockhash?: string | null; + blockNumber?: number | null; + sourceOfData: string; + inputs: Array<{ __typename?: 'Input'; address: string }>; + outputs: Array<{ __typename?: 'Output'; address: string }>; + }; + }; +}; + +export const BitcoinCashBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashBalanceQuery, + BitcoinCashBalanceQueryVariables +>; +export const GetBitcoinCashFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBitcoinCashFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBitcoinCashFeesQuery, + GetBitcoinCashFeesQueryVariables +>; +export const GetBitcoinCashTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBitcoinCashTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactionsV2' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageSize' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageNumber' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balanceChange' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBitcoinCashTransactionsQuery, + GetBitcoinCashTransactionsQueryVariables +>; +export const BitcoinCashBroadcastTransactionDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashBroadcastTransaction' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'broadcastTransaction' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'rawHex' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + }, + ], + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashBroadcastTransactionQuery, + BitcoinCashBroadcastTransactionQueryVariables +>; +export const BitcoinCashScanUtxOsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashScanUTXOs' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'unspentTxOutputsV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'page' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'page' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'isCoinbase' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scriptHex' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashScanUtxOsQuery, + BitcoinCashScanUtxOsQueryVariables +>; +export const BitcoinCashGetTransactionByHashDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashGetTransactionByHash' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'getTransactionByHashV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'txHash' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'hex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'txid' } }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { kind: 'Field', name: { kind: 'Name', value: 'size' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'version' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'locktime' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'confirmations' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blocktime' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'time' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockhash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'sourceOfData' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashGetTransactionByHashQuery, + BitcoinCashGetTransactionByHashQueryVariables +>; diff --git a/packages/bitcoincash/src/gql/index.ts b/packages/bitcoincash/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/bitcoincash/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/core/codegen.yml b/packages/core/codegen.yml new file mode 100644 index 00000000..9acfcdaf --- /dev/null +++ b/packages/core/codegen.yml @@ -0,0 +1,24 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - './**/*.graphql' +generates: + src/common/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: false + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/common/index.ts: + plugins: + - add: + content: export * from './config'; + export * from './di'; + export * from './client'; diff --git a/packages/core/package.json b/packages/core/package.json index 7c413441..1133b8e4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -29,7 +29,12 @@ "prettier": "2.6.2", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typedoc": "0.22.15" + "typedoc": "0.22.15", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2" }, "dependencies": { "@apollo/client": "3.6.9", @@ -58,7 +63,11 @@ "test:watch": "jest --watch", "lint": "eslint .", "lint:fix": "eslint . --fix", - "typedoc": "typedoc src/index.ts" + "typedoc": "typedoc src/index.ts", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/core/src/common/client/index.ts b/packages/core/src/common/client/index.ts index 980a60f0..a01e8178 100644 --- a/packages/core/src/common/client/index.ts +++ b/packages/core/src/common/client/index.ts @@ -1,2 +1,3 @@ export * from './gql.client'; export * from './fragments'; +export * from './queries'; diff --git a/packages/core/src/common/client/queries/getCryptoAssets.ts b/packages/core/src/common/client/queries/getCryptoAssets.ts new file mode 100644 index 00000000..8f8aa71e --- /dev/null +++ b/packages/core/src/common/client/queries/getCryptoAssets.ts @@ -0,0 +1,11 @@ +import { CryptoAssetArgs, GetCryptoAssetsDocument } from '../../graphql'; +import { gqlClient } from '../gql.client'; + +export const getCryptoAssets = (input: Array | CryptoAssetArgs) => { + return gqlClient.query({ + query: GetCryptoAssetsDocument, + variables: { + input: input, + }, + }); +}; diff --git a/packages/core/src/common/client/queries/index.ts b/packages/core/src/common/client/queries/index.ts new file mode 100644 index 00000000..0795a05c --- /dev/null +++ b/packages/core/src/common/client/queries/index.ts @@ -0,0 +1 @@ +export * from './getCryptoAssets'; diff --git a/packages/core/src/common/fragment-masking.ts b/packages/core/src/common/fragment-masking.ts new file mode 100644 index 00000000..195a11eb --- /dev/null +++ b/packages/core/src/common/fragment-masking.ts @@ -0,0 +1,50 @@ +import { ResultOf, TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +export type FragmentType> = TDocumentType extends DocumentNode< + infer TType, + any +> + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> | null | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData>( + data: FT, + _fragment: F +): FragmentType { + return data as FragmentType; +} diff --git a/packages/core/src/common/gql.ts b/packages/core/src/common/gql.ts new file mode 100644 index 00000000..cbf7ce1e --- /dev/null +++ b/packages/core/src/common/gql.ts @@ -0,0 +1,50 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}': + types.GetCryptoAssetsDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}' +): typeof documents['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = TDocumentNode extends DocumentNode< + infer TType, + any +> + ? TType + : never; diff --git a/packages/core/src/common/graphql.ts b/packages/core/src/common/graphql.ts new file mode 100644 index 00000000..97fbb771 --- /dev/null +++ b/packages/core/src/common/graphql.ts @@ -0,0 +1,4809 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = EvmFeeDetailsV0 | ThorChainFeeDetailsV0 | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type GetCryptoAssetsQueryVariables = Exact<{ + input: Array | CryptoAssetArgs; +}>; + +export type GetCryptoAssetsQuery = { + __typename?: 'Query'; + assets: { + __typename?: 'AssetType'; + cryptoAssets?: Array<{ + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + price?: { __typename?: 'AssetAmountType'; amount: string; scalingFactor: number } | null; + }> | null; + }; +}; + +export const GetCryptoAssetsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCryptoAssets' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } }, + type: { + kind: 'NonNullType', + type: { + kind: 'ListType', + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'CryptoAssetArgs' } }, + }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'assets' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cryptoAssets' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'input' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'chain' } }, + { kind: 'Field', name: { kind: 'Name', value: 'contract' } }, + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'symbol' } }, + { kind: 'Field', name: { kind: 'Name', value: 'image' } }, + { kind: 'Field', name: { kind: 'Name', value: 'decimals' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'amount' } }, + { kind: 'Field', name: { kind: 'Name', value: 'scalingFactor' } }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; diff --git a/packages/core/src/operations.graphql b/packages/core/src/operations.graphql new file mode 100644 index 00000000..0b108163 --- /dev/null +++ b/packages/core/src/operations.graphql @@ -0,0 +1,17 @@ +query GetCryptoAssets($input: [CryptoAssetArgs!]!) { + assets { + cryptoAssets(input: $input) { + chain + contract + id + name + symbol + image + decimals + price { + amount + scalingFactor + } + } + } +} \ No newline at end of file diff --git a/packages/cosmos/codegen.yml b/packages/cosmos/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/cosmos/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 3e95b6f3..8cd68c9f 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -18,7 +18,13 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@cosmjs/amino": "0.32.3", @@ -36,7 +42,6 @@ "@terra-money/feather.js": "2.1.0-beta.3", "@terra-money/terra.proto": "5.3.0-beta.0", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "axios": "1.4.0", "bech32": "2.0.0", "bech32-buffer": "0.2.1", @@ -61,7 +66,11 @@ "lint:fix": "eslint . --fix", "coverage": "jest --coverageReporters='json-summary' --coverage", "test": "jest", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "jest": { "setupFiles": [], diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 2a9ba100..71126227 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -10,6 +10,7 @@ import { Balance, FeeOptions, FeeData, + getCryptoAssets, } from '@xdefi-tech/chains-core'; import { Observable } from 'rxjs'; import BigNumber from 'bignumber.js'; @@ -18,11 +19,6 @@ import { LcdClient, setupBankExtension, } from '@cosmjs/launchpad'; -import { - AddressChain, - getCryptoAssets, - CryptoAssetArgs, -} from '@xdefi-tech/chains-graphql'; import cosmosclient from '@cosmos-client/core'; import { uniqBy, capitalize } from 'lodash'; import { Account } from '@cosmjs/stargate'; @@ -37,6 +33,7 @@ import { import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'; import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; +import { AddressChain, CryptoAssetArgs } from '../../gql/graphql'; import * as manifests from '../../manifests'; import { ChainMsg } from '../../msg'; diff --git a/packages/cosmos/src/datasource/chain/queries/assets-query.ts b/packages/cosmos/src/datasource/chain/queries/assets-query.ts index cc52bf32..c10ceff6 100644 --- a/packages/cosmos/src/datasource/chain/queries/assets-query.ts +++ b/packages/cosmos/src/datasource/chain/queries/assets-query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { GetAssetsWithFilterDocument } from '@xdefi-tech/chains-graphql'; + +import { GetAssetsWithFilterDocument } from '../../../gql/graphql'; export const getAssets = (contractAddress: string[]) => { return gqlClient.query({ diff --git a/packages/cosmos/src/datasource/indexer/queries/balances.query.ts b/packages/cosmos/src/datasource/indexer/queries/balances.query.ts index 754d2d77..820fc7d7 100644 --- a/packages/cosmos/src/datasource/indexer/queries/balances.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/balances.query.ts @@ -1,4 +1,5 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { CosmosBalanceDocument, OsmosisBalanceDocument, @@ -14,8 +15,7 @@ import { MarsBalanceDocument, TerraBalanceDocument, Balance, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { CosmosHubChains } from '../../../manifests'; type CosmosChainParams = { diff --git a/packages/cosmos/src/datasource/indexer/queries/fees.query.ts b/packages/cosmos/src/datasource/indexer/queries/fees.query.ts index 18dc776c..6343f4a2 100644 --- a/packages/cosmos/src/datasource/indexer/queries/fees.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/fees.query.ts @@ -1,4 +1,5 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetCosmosFeesDocument, GetOsmosisFeesDocument, @@ -14,8 +15,7 @@ import { GetMarsFeesDocument, GetTerraFeesDocument, DefaultGasFee, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { CosmosHubChains } from '../../../manifests'; type CosmosChainParams = { diff --git a/packages/cosmos/src/datasource/indexer/queries/transactions.query.ts b/packages/cosmos/src/datasource/indexer/queries/transactions.query.ts index 9de4b1e2..75ccdf72 100644 --- a/packages/cosmos/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/transactions.query.ts @@ -1,4 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; +import { map } from 'lodash'; + import { GetCosmosTransactionsDocument, GetOsmosisTransactionsDocument, @@ -14,9 +16,7 @@ import { GetMarsTransactionsDocument, Scalars, CosmosLikeTransaction, -} from '@xdefi-tech/chains-graphql'; -import { map } from 'lodash'; - +} from '../../../gql/graphql'; import { CosmosHubChains } from '../../../manifests'; type CosmosChainParams = { diff --git a/packages/cosmos/src/gql/fragment-masking.ts b/packages/cosmos/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/cosmos/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/cosmos/src/gql/gql.ts b/packages/cosmos/src/gql/gql.ts new file mode 100644 index 00000000..41ae1e5f --- /dev/null +++ b/packages/cosmos/src/gql/gql.ts @@ -0,0 +1,62 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}': + types.GetAssetsWithFilterDocument, + 'query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}': + types.CosmosBalanceDocument, + 'query TerraBalance($address: String!) {\n terra {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetTerraFees {\n terra {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetTerraStatus {\n terra {\n status {\n lastBlock\n }\n }\n}': + types.TerraBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}' +): typeof documents['query GetAssetsWithFilter($page: ConnectionArgs!, $filter: TokenFilter) {\n assets {\n tokens(page: $page, filter: $filter) {\n page {\n edges {\n node {\n contracts {\n address\n symbol\n chain\n scalingFactor\n }\n id\n price {\n amount\n scalingFactor\n }\n symbol\n name\n icon\n }\n }\n }\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query TerraBalance($address: String!) {\n terra {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetTerraFees {\n terra {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetTerraStatus {\n terra {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query TerraBalance($address: String!) {\n terra {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetTerraFees {\n terra {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetTerraStatus {\n terra {\n status {\n lastBlock\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/cosmos/src/gql/graphql.ts b/packages/cosmos/src/gql/graphql.ts new file mode 100644 index 00000000..07bed7af --- /dev/null +++ b/packages/cosmos/src/gql/graphql.ts @@ -0,0 +1,14237 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type GetAssetsWithFilterQueryVariables = Exact<{ + page: ConnectionArgs; + filter?: InputMaybe; +}>; + +export type GetAssetsWithFilterQuery = { + __typename?: 'Query'; + assets: { + __typename?: 'AssetType'; + tokens?: { + __typename?: 'TokenResponse'; + page: { + __typename?: 'AssetTokenTypeConnection'; + edges?: Array<{ + __typename?: 'AssetTokenTypeEdge'; + node?: { + __typename?: 'AssetTokenType'; + id: string; + symbol: string; + name?: string | null; + icon?: string | null; + contracts?: Array<{ + __typename?: 'AssetTokenContractType'; + address: string; + symbol: string; + chain: string; + scalingFactor: number; + }> | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } | null; + }> | null; + }; + } | null; + }; +}; + +export type CosmosBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type CosmosBalanceQuery = { + __typename?: 'Query'; + cosmos: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetCosmosTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetCosmosTransactionsQuery = { + __typename?: 'Query'; + cosmos: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetCosmosFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCosmosFeesQuery = { + __typename?: 'Query'; + cosmos: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetCosmosStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCosmosStatusQuery = { + __typename?: 'Query'; + cosmos: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type OsmosisBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type OsmosisBalanceQuery = { + __typename?: 'Query'; + osmosis: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetOsmosisTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetOsmosisTransactionsQuery = { + __typename?: 'Query'; + osmosis: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetOsmosisFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetOsmosisFeesQuery = { + __typename?: 'Query'; + osmosis: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetOsmosisStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetOsmosisStatusQuery = { + __typename?: 'Query'; + osmosis: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type AxelarBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type AxelarBalanceQuery = { + __typename?: 'Query'; + axelar: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetAxelarTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetAxelarTransactionsQuery = { + __typename?: 'Query'; + axelar: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetAxelarFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetAxelarFeesQuery = { + __typename?: 'Query'; + axelar: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetAxelarStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetAxelarStatusQuery = { + __typename?: 'Query'; + axelar: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type CrescentBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type CrescentBalanceQuery = { + __typename?: 'Query'; + crescent: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetCrescentTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetCrescentTransactionsQuery = { + __typename?: 'Query'; + crescent: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetCrescentFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCrescentFeesQuery = { + __typename?: 'Query'; + crescent: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetCrescentStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCrescentStatusQuery = { + __typename?: 'Query'; + crescent: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type KavaBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type KavaBalanceQuery = { + __typename?: 'Query'; + kava: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetKavaTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetKavaTransactionsQuery = { + __typename?: 'Query'; + kava: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetKavaFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetKavaFeesQuery = { + __typename?: 'Query'; + kava: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetKavaStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetKavaStatusQuery = { + __typename?: 'Query'; + kava: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type AkashBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type AkashBalanceQuery = { + __typename?: 'Query'; + akash: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetAkashTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetAkashTransactionsQuery = { + __typename?: 'Query'; + akash: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetAkashFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetAkashFeesQuery = { + __typename?: 'Query'; + akash: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetAkashStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetAkashStatusQuery = { + __typename?: 'Query'; + akash: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type CronosBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type CronosBalanceQuery = { + __typename?: 'Query'; + cronos: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetCronosTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetCronosTransactionsQuery = { + __typename?: 'Query'; + cronos: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetCronosFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCronosFeesQuery = { + __typename?: 'Query'; + cronos: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetCronosStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCronosStatusQuery = { + __typename?: 'Query'; + cronos: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type KujiraBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type KujiraBalanceQuery = { + __typename?: 'Query'; + kujira: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetKujiraTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetKujiraTransactionsQuery = { + __typename?: 'Query'; + kujira: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetKujiraFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetKujiraFeesQuery = { + __typename?: 'Query'; + kujira: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetKujiraStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetKujiraStatusQuery = { + __typename?: 'Query'; + kujira: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type StrideBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type StrideBalanceQuery = { + __typename?: 'Query'; + stride: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetStrideTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetStrideTransactionsQuery = { + __typename?: 'Query'; + stride: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetStrideFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetStrideFeesQuery = { + __typename?: 'Query'; + stride: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetStrideStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetStrideStatusQuery = { + __typename?: 'Query'; + stride: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type MarsBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type MarsBalanceQuery = { + __typename?: 'Query'; + mars: { + __typename?: 'CosmosBasedChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetMarsTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetMarsTransactionsQuery = { + __typename?: 'Query'; + mars: { + __typename?: 'CosmosBasedChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetMarsFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetMarsFeesQuery = { + __typename?: 'Query'; + mars: { + __typename?: 'CosmosBasedChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetMarsStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetMarsStatusQuery = { + __typename?: 'Query'; + mars: { + __typename?: 'CosmosBasedChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type JunoBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type JunoBalanceQuery = { + __typename?: 'Query'; + juno: { + __typename?: 'JunoChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetJunoTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetJunoTransactionsQuery = { + __typename?: 'Query'; + juno: { + __typename?: 'JunoChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetJunoFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetJunoFeesQuery = { + __typename?: 'Query'; + juno: { + __typename?: 'JunoChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetJunoStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetJunoStatusQuery = { + __typename?: 'Query'; + juno: { + __typename?: 'JunoChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type StargazeBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type StargazeBalanceQuery = { + __typename?: 'Query'; + stargaze: { + __typename?: 'StargazeChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetStargazeTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + blockRange: OptBlockRange; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetStargazeTransactionsQuery = { + __typename?: 'Query'; + stargaze: { + __typename?: 'StargazeChain'; + transactions: { + __typename?: 'CosmosLikeTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'CosmosLikeTransactionEdge'; + node: { + __typename?: 'CosmosLikeTransaction'; + blockHeight: number; + blockIndex?: number | null; + hash: string; + status: string; + timestamp: any; + signers: Array; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + }; + }>; + fee?: { + __typename?: 'CosmosFee'; + payer?: string | null; + amount: Array<{ + __typename?: 'AssetWithAmount'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + }; + }>; + } | null; + }; + }>; + }; + }; +}; + +export type GetStargazeFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetStargazeFeesQuery = { + __typename?: 'Query'; + stargaze: { + __typename?: 'StargazeChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetStargazeStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetStargazeStatusQuery = { + __typename?: 'Query'; + stargaze: { + __typename?: 'StargazeChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type TerraBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type TerraBalanceQuery = { + __typename?: 'Query'; + terra: { + __typename?: 'TerraChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetTerraFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetTerraFeesQuery = { + __typename?: 'Query'; + terra: { + __typename?: 'TerraChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetTerraStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetTerraStatusQuery = { + __typename?: 'Query'; + terra: { + __typename?: 'TerraChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export const GetAssetsWithFilterDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAssetsWithFilter' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'ConnectionArgs' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'filter' }, + }, + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'TokenFilter' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'assets' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'tokens' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'page' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'page' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'filter' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'filter' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'page' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contracts', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'address', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'icon' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAssetsWithFilterQuery, + GetAssetsWithFilterQueryVariables +>; +export const CosmosBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CosmosBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cosmos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetCosmosTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCosmosTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cosmos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCosmosTransactionsQuery, + GetCosmosTransactionsQueryVariables +>; +export const GetCosmosFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCosmosFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cosmos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetCosmosStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCosmosStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cosmos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCosmosStatusQuery, + GetCosmosStatusQueryVariables +>; +export const OsmosisBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'OsmosisBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'osmosis' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetOsmosisTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetOsmosisTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'osmosis' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetOsmosisTransactionsQuery, + GetOsmosisTransactionsQueryVariables +>; +export const GetOsmosisFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetOsmosisFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'osmosis' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetOsmosisStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetOsmosisStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'osmosis' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetOsmosisStatusQuery, + GetOsmosisStatusQueryVariables +>; +export const AxelarBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'AxelarBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'axelar' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetAxelarTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAxelarTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'axelar' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAxelarTransactionsQuery, + GetAxelarTransactionsQueryVariables +>; +export const GetAxelarFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAxelarFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'axelar' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetAxelarStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAxelarStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'axelar' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAxelarStatusQuery, + GetAxelarStatusQueryVariables +>; +export const CrescentBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CrescentBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'crescent' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CrescentBalanceQuery, + CrescentBalanceQueryVariables +>; +export const GetCrescentTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCrescentTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'crescent' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCrescentTransactionsQuery, + GetCrescentTransactionsQueryVariables +>; +export const GetCrescentFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCrescentFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'crescent' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCrescentFeesQuery, + GetCrescentFeesQueryVariables +>; +export const GetCrescentStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCrescentStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'crescent' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCrescentStatusQuery, + GetCrescentStatusQueryVariables +>; +export const KavaBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'KavaBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kava' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetKavaTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetKavaTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kava' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetKavaTransactionsQuery, + GetKavaTransactionsQueryVariables +>; +export const GetKavaFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetKavaFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kava' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetKavaStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetKavaStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kava' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const AkashBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'AkashBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'akash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetAkashTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAkashTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'akash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAkashTransactionsQuery, + GetAkashTransactionsQueryVariables +>; +export const GetAkashFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAkashFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'akash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetAkashStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAkashStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'akash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const CronosBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CronosBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetCronosTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCronosTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCronosTransactionsQuery, + GetCronosTransactionsQueryVariables +>; +export const GetCronosFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCronosFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetCronosStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCronosStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronos' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCronosStatusQuery, + GetCronosStatusQueryVariables +>; +export const KujiraBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'KujiraBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kujira' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetKujiraTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetKujiraTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kujira' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetKujiraTransactionsQuery, + GetKujiraTransactionsQueryVariables +>; +export const GetKujiraFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetKujiraFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kujira' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetKujiraStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetKujiraStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'kujira' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetKujiraStatusQuery, + GetKujiraStatusQueryVariables +>; +export const StrideBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'StrideBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stride' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetStrideTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetStrideTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stride' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetStrideTransactionsQuery, + GetStrideTransactionsQueryVariables +>; +export const GetStrideFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetStrideFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stride' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetStrideStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetStrideStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stride' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetStrideStatusQuery, + GetStrideStatusQueryVariables +>; +export const MarsBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'MarsBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mars' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetMarsTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMarsTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mars' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMarsTransactionsQuery, + GetMarsTransactionsQueryVariables +>; +export const GetMarsFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMarsFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mars' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetMarsStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMarsStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mars' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const JunoBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'JunoBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'juno' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetJunoTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetJunoTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'juno' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetJunoTransactionsQuery, + GetJunoTransactionsQueryVariables +>; +export const GetJunoFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetJunoFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'juno' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetJunoStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetJunoStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'juno' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const StargazeBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'StargazeBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stargaze' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + StargazeBalanceQuery, + StargazeBalanceQueryVariables +>; +export const GetStargazeTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetStargazeTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'OptBlockRange' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stargaze' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'blockRange' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'blockRange' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockHeight', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetStargazeTransactionsQuery, + GetStargazeTransactionsQueryVariables +>; +export const GetStargazeFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetStargazeFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stargaze' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetStargazeFeesQuery, + GetStargazeFeesQueryVariables +>; +export const GetStargazeStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetStargazeStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stargaze' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetStargazeStatusQuery, + GetStargazeStatusQueryVariables +>; +export const TerraBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'TerraBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'terra' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetTerraFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetTerraFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'terra' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetTerraStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetTerraStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'terra' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; diff --git a/packages/cosmos/src/gql/index.ts b/packages/cosmos/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/cosmos/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/dogecoin/codegen.yml b/packages/dogecoin/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/dogecoin/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index c5219ef9..df57d04c 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -16,7 +16,13 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -26,7 +32,6 @@ "@noble/curves": "1.3.0", "@scure/btc-signer": "1.2.1", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bignumber.js": "9.1.2", @@ -51,7 +56,11 @@ "test:watch": "jest --watch", "lint": "eslint .", "lint:fix": "eslint . --fix", - "clean": "rimraf dist .turbo node_modules" + "clean": "rimraf dist .turbo node_modules", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/dogecoin/src/datasource/indexer/queries/balances.query.ts b/packages/dogecoin/src/datasource/indexer/queries/balances.query.ts index 7f927379..46048907 100644 --- a/packages/dogecoin/src/datasource/indexer/queries/balances.query.ts +++ b/packages/dogecoin/src/datasource/indexer/queries/balances.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { DogecoinBalanceDocument, Balance } from '@xdefi-tech/chains-graphql'; + +import { DogecoinBalanceDocument, Balance } from '../../../gql/graphql'; export const getBalance = async (address: string): Promise> => { const response = await gqlClient.query({ diff --git a/packages/dogecoin/src/datasource/indexer/queries/broadcast.query.ts b/packages/dogecoin/src/datasource/indexer/queries/broadcast.query.ts index 2049fe7b..e7d9bb5b 100644 --- a/packages/dogecoin/src/datasource/indexer/queries/broadcast.query.ts +++ b/packages/dogecoin/src/datasource/indexer/queries/broadcast.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { DogecoinBroadcastTransactionDocument } from '@xdefi-tech/chains-graphql'; + +import { DogecoinBroadcastTransactionDocument } from '../../../gql/graphql'; export const broadcast = async (rawHex: string): Promise => { const response = await gqlClient.query({ diff --git a/packages/dogecoin/src/datasource/indexer/queries/fees.query.ts b/packages/dogecoin/src/datasource/indexer/queries/fees.query.ts index 38050b4d..99018e8f 100644 --- a/packages/dogecoin/src/datasource/indexer/queries/fees.query.ts +++ b/packages/dogecoin/src/datasource/indexer/queries/fees.query.ts @@ -1,6 +1,7 @@ -import { GetDogecoinFeesDocument } from '@xdefi-tech/chains-graphql'; import { DefaultFeeOptions, gqlClient } from '@xdefi-tech/chains-core'; +import { GetDogecoinFeesDocument } from '../../../gql/graphql'; + export const getFees = async (): Promise => { const response = await gqlClient.query({ query: GetDogecoinFeesDocument, diff --git a/packages/dogecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts b/packages/dogecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts index 8a7a63fc..426fdb4e 100644 --- a/packages/dogecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts +++ b/packages/dogecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { DogecoinGetTransactionByHashDocument } from '@xdefi-tech/chains-graphql'; + +import { DogecoinGetTransactionByHashDocument } from '../../../gql/graphql'; export const getTransactionByHash = async (txHash: string) => { try { diff --git a/packages/dogecoin/src/datasource/indexer/queries/scanUTXOs.query.ts b/packages/dogecoin/src/datasource/indexer/queries/scanUTXOs.query.ts index ad3c5497..b4677a1e 100644 --- a/packages/dogecoin/src/datasource/indexer/queries/scanUTXOs.query.ts +++ b/packages/dogecoin/src/datasource/indexer/queries/scanUTXOs.query.ts @@ -1,8 +1,9 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { DogecoinScanUtxOsDocument, UnspentTransactionOutputV5, -} from '@xdefi-tech/chains-graphql'; +} from '../../../gql/graphql'; export const scanUTXOs = async ( address: string diff --git a/packages/dogecoin/src/datasource/indexer/queries/transactions.query.ts b/packages/dogecoin/src/datasource/indexer/queries/transactions.query.ts index 68ec7cc4..b5d4fc14 100644 --- a/packages/dogecoin/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/dogecoin/src/datasource/indexer/queries/transactions.query.ts @@ -1,9 +1,10 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetDogecoinTransactionsDocument, Scalars, UtxoTransactionV2, -} from '@xdefi-tech/chains-graphql'; -import { gqlClient } from '@xdefi-tech/chains-core'; +} from '../../../gql/graphql'; export const getTransactions = async ( chain: string, diff --git a/packages/dogecoin/src/gql/fragment-masking.ts b/packages/dogecoin/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/dogecoin/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/dogecoin/src/gql/gql.ts b/packages/dogecoin/src/gql/gql.ts new file mode 100644 index 00000000..e209f880 --- /dev/null +++ b/packages/dogecoin/src/gql/gql.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}': + types.DogecoinBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' +): typeof documents['query DogecoinBalance($address: String!) {\n dogecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetDogecoinFees {\n dogecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetDogecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n dogecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery DogecoinBroadcastTransaction($rawHex: String!) {\n dogecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery DogecoinScanUTXOs($address: String!, $page: Int!) {\n dogecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery DogecoinGetTransactionByHash($txHash: String!) {\n dogecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/dogecoin/src/gql/graphql.ts b/packages/dogecoin/src/gql/graphql.ts new file mode 100644 index 00000000..c3199141 --- /dev/null +++ b/packages/dogecoin/src/gql/graphql.ts @@ -0,0 +1,5521 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type DogecoinBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type DogecoinBalanceQuery = { + __typename?: 'Query'; + dogecoin: { + __typename?: 'DogeChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetDogecoinFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetDogecoinFeesQuery = { + __typename?: 'Query'; + dogecoin: { + __typename?: 'DogeChain'; + fee: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + }; + }; +}; + +export type GetDogecoinTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + pageSize: Scalars['Int']; + pageNumber: Scalars['Int']; +}>; + +export type GetDogecoinTransactionsQuery = { + __typename?: 'Query'; + dogecoin: { + __typename?: 'DogeChain'; + transactionsV2: Array<{ + __typename?: 'UTXOTransactionV2'; + blockNumber?: number | null; + hash: string; + timestamp?: any | null; + status?: string | null; + balanceChange?: { __typename?: 'Amount'; value: string } | null; + fee?: { __typename?: 'Amount'; value: string } | null; + inputs?: Array<{ + __typename?: 'Input'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + outputs?: Array<{ + __typename?: 'Output'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + }>; + }; +}; + +export type DogecoinBroadcastTransactionQueryVariables = Exact<{ + rawHex: Scalars['String']; +}>; + +export type DogecoinBroadcastTransactionQuery = { + __typename?: 'Query'; + dogecoin: { __typename?: 'DogeChain'; broadcastTransaction: string }; +}; + +export type DogecoinScanUtxOsQueryVariables = Exact<{ + address: Scalars['String']; + page: Scalars['Int']; +}>; + +export type DogecoinScanUtxOsQuery = { + __typename?: 'Query'; + dogecoin: { + __typename?: 'DogeChain'; + unspentTxOutputsV5: Array<{ + __typename?: 'UnspentTransactionOutputV5'; + oTxHash: string; + oIndex: number; + oTxHex?: string | null; + address?: string | null; + isCoinbase?: boolean | null; + scriptHex?: string | null; + value: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type DogecoinGetTransactionByHashQueryVariables = Exact<{ + txHash: Scalars['String']; +}>; + +export type DogecoinGetTransactionByHashQuery = { + __typename?: 'Query'; + dogecoin: { + __typename?: 'DogeChain'; + getTransactionByHashV5: { + __typename?: 'UtxotransactionByHashV5'; + hex?: string | null; + txid?: string | null; + hash: string; + size: number; + version: number; + locktime?: number | null; + confirmations?: number | null; + blocktime?: number | null; + time?: number | null; + blockhash?: string | null; + blockNumber?: number | null; + sourceOfData: string; + inputs: Array<{ __typename?: 'Input'; address: string }>; + outputs: Array<{ __typename?: 'Output'; address: string }>; + }; + }; +}; + +export const DogecoinBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'DogecoinBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'dogecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + DogecoinBalanceQuery, + DogecoinBalanceQueryVariables +>; +export const GetDogecoinFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetDogecoinFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'dogecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetDogecoinFeesQuery, + GetDogecoinFeesQueryVariables +>; +export const GetDogecoinTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetDogecoinTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'dogecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactionsV2' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageSize' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageNumber' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balanceChange' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetDogecoinTransactionsQuery, + GetDogecoinTransactionsQueryVariables +>; +export const DogecoinBroadcastTransactionDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'DogecoinBroadcastTransaction' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'dogecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'broadcastTransaction' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'rawHex' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + }, + ], + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + DogecoinBroadcastTransactionQuery, + DogecoinBroadcastTransactionQueryVariables +>; +export const DogecoinScanUtxOsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'DogecoinScanUTXOs' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'dogecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'unspentTxOutputsV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'page' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'page' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'isCoinbase' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scriptHex' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + DogecoinScanUtxOsQuery, + DogecoinScanUtxOsQueryVariables +>; +export const DogecoinGetTransactionByHashDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'DogecoinGetTransactionByHash' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'dogecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'getTransactionByHashV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'txHash' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'hex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'txid' } }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { kind: 'Field', name: { kind: 'Name', value: 'size' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'version' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'locktime' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'confirmations' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blocktime' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'time' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockhash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'sourceOfData' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + DogecoinGetTransactionByHashQuery, + DogecoinGetTransactionByHashQueryVariables +>; diff --git a/packages/dogecoin/src/gql/index.ts b/packages/dogecoin/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/dogecoin/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/evm/codegen.yml b/packages/evm/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/evm/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/evm/package.json b/packages/evm/package.json index 5fbafd23..a8c2fa73 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -20,7 +20,13 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@ledgerhq/cryptoassets": "13.0.0", @@ -29,7 +35,6 @@ "@ledgerhq/hw-transport-webhid": "6.28.6", "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "bignumber.js": "9.1.2", "eth-crypto": "2.6.0", "ethers": "5.6.4", @@ -48,7 +53,11 @@ "lint:fix": "eslint . --fix", "coverage": "jest --coverageReporters='json-summary' --coverage", "test": "jest", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/evm/src/datasource/chain/chain.data-source.ts b/packages/evm/src/datasource/chain/chain.data-source.ts index 7cbdc760..e4ed7c01 100644 --- a/packages/evm/src/datasource/chain/chain.data-source.ts +++ b/packages/evm/src/datasource/chain/chain.data-source.ts @@ -12,16 +12,17 @@ import { Injectable, Transaction, TransactionsFilter, + getCryptoAssets, } from '@xdefi-tech/chains-core'; import { Observable } from 'rxjs'; import BigNumber from 'bignumber.js'; import * as ethers from 'ethers'; import { providers } from 'ethers'; import { capitalize, filter as lodashFilter, uniqBy } from 'lodash'; -import { AddressChain, getCryptoAssets } from '@xdefi-tech/chains-graphql'; import { formatFixed } from '@ethersproject/bignumber'; import axios, { Axios } from 'axios'; +import { AddressChain } from '../../gql/graphql'; import { RestEstimateGasRequest } from '../../types'; import { EVMChains } from '../../manifests'; import { ChainMsg, TokenType } from '../../msg'; diff --git a/packages/evm/src/gql/fragment-masking.ts b/packages/evm/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/evm/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/evm/src/gql/gql.ts b/packages/evm/src/gql/gql.ts new file mode 100644 index 00000000..a8ff77ec --- /dev/null +++ b/packages/evm/src/gql/gql.ts @@ -0,0 +1,118 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}': + types.GetArbitrumBalanceDocument, + 'query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}': + types.GetAuroraBalanceDocument, + 'query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}': + types.GetAvalancheBalanceDocument, + 'query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}': + types.GetCantoEvmBalanceDocument, + 'query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}': + types.GetCronosEvmBalanceDocument, + 'query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}': + types.GetEthereumBalanceDocument, + 'query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}': + types.GetFantomBalanceDocument, + 'query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}': + types.GetOptimismBalanceDocument, + 'query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}': + types.GetPolygonBalanceDocument, + 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}': + types.GetSmartChainBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetArbitrumBalance($address: String!) {\n arbitrum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery ArbitrumDefaultGasFees {\n arbitrum {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetArbitrumTransactions($address: String!, $first: Int) {\n arbitrum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetArbitrumStatus {\n arbitrum {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetAuroraBalance($address: String!) {\n aurora {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AuroraDefaultGasFees {\n aurora {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAuroraTransactions($address: String!, $first: Int) {\n aurora {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAuroraStatus {\n aurora {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetAvalancheBalance($address: String!) {\n avalanche {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery AvalancheEIP1559GasFees {\n avalanche {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetAvalancheTransactions($address: String!, $first: Int) {\n avalanche {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetAvalancheStatus {\n avalanche {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetCantoEVMBalance($address: String!) {\n cantoEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CantoEVMEIP1559GasFees {\n cantoEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCantoEVMTransactions($address: String!, $first: Int) {\n cantoEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCantoEVMStatus {\n cantoEVM {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetCronosEVMBalance($address: String!) {\n cronosEVM {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery CronosEVMEIP1559GasFees {\n cronosEVM {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetCronosEVMTransactions($address: String!, $first: Int) {\n cronosEVM {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetCronosEVMStatus {\n cronosEVM {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetEthereumBalance($address: String!) {\n ethereum {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery EthereumEIP1559GasFees {\n ethereum {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetEthereumTransactions($address: String!, $first: Int) {\n ethereum {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetEthereumStatus {\n ethereum {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/evm/src/gql/graphql.ts b/packages/evm/src/gql/graphql.ts new file mode 100644 index 00000000..17fe2c04 --- /dev/null +++ b/packages/evm/src/gql/graphql.ts @@ -0,0 +1,11529 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type GetArbitrumBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetArbitrumBalanceQuery = { + __typename?: 'Query'; + arbitrum: { + __typename?: 'Arbitrum'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type ArbitrumDefaultGasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type ArbitrumDefaultGasFeesQuery = { + __typename?: 'Query'; + arbitrum: { + __typename?: 'Arbitrum'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetArbitrumTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetArbitrumTransactionsQuery = { + __typename?: 'Query'; + arbitrum: { + __typename?: 'Arbitrum'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetArbitrumStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetArbitrumStatusQuery = { + __typename?: 'Query'; + arbitrum: { + __typename?: 'Arbitrum'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetAuroraBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetAuroraBalanceQuery = { + __typename?: 'Query'; + aurora: { + __typename?: 'Aurora'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type AuroraDefaultGasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type AuroraDefaultGasFeesQuery = { + __typename?: 'Query'; + aurora: { + __typename?: 'Aurora'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetAuroraTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetAuroraTransactionsQuery = { + __typename?: 'Query'; + aurora: { + __typename?: 'Aurora'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetAuroraStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetAuroraStatusQuery = { + __typename?: 'Query'; + aurora: { + __typename?: 'Aurora'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetAvalancheBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetAvalancheBalanceQuery = { + __typename?: 'Query'; + avalanche: { + __typename?: 'Avalanche'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type AvalancheEip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type AvalancheEip1559GasFeesQuery = { + __typename?: 'Query'; + avalanche: { + __typename?: 'Avalanche'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetAvalancheTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetAvalancheTransactionsQuery = { + __typename?: 'Query'; + avalanche: { + __typename?: 'Avalanche'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetAvalancheStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetAvalancheStatusQuery = { + __typename?: 'Query'; + avalanche: { + __typename?: 'Avalanche'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetCantoEvmBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetCantoEvmBalanceQuery = { + __typename?: 'Query'; + cantoEVM: { + __typename?: 'CantoEVM'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type CantoEvmeip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type CantoEvmeip1559GasFeesQuery = { + __typename?: 'Query'; + cantoEVM: { + __typename?: 'CantoEVM'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetCantoEvmTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetCantoEvmTransactionsQuery = { + __typename?: 'Query'; + cantoEVM: { + __typename?: 'CantoEVM'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetCantoEvmStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCantoEvmStatusQuery = { + __typename?: 'Query'; + cantoEVM: { + __typename?: 'CantoEVM'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetCronosEvmBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetCronosEvmBalanceQuery = { + __typename?: 'Query'; + cronosEVM: { + __typename?: 'CronosEVM'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type CronosEvmeip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type CronosEvmeip1559GasFeesQuery = { + __typename?: 'Query'; + cronosEVM: { + __typename?: 'CronosEVM'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetCronosEvmTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetCronosEvmTransactionsQuery = { + __typename?: 'Query'; + cronosEVM: { + __typename?: 'CronosEVM'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetCronosEvmStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetCronosEvmStatusQuery = { + __typename?: 'Query'; + cronosEVM: { + __typename?: 'CronosEVM'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetEthereumBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetEthereumBalanceQuery = { + __typename?: 'Query'; + ethereum: { + __typename?: 'Ethereum'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type EthereumEip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type EthereumEip1559GasFeesQuery = { + __typename?: 'Query'; + ethereum: { + __typename?: 'Ethereum'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetEthereumTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetEthereumTransactionsQuery = { + __typename?: 'Query'; + ethereum: { + __typename?: 'Ethereum'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetEthereumStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetEthereumStatusQuery = { + __typename?: 'Query'; + ethereum: { + __typename?: 'Ethereum'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetFantomBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetFantomBalanceQuery = { + __typename?: 'Query'; + fantom: { + __typename?: 'Fantom'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type FantomEip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type FantomEip1559GasFeesQuery = { + __typename?: 'Query'; + fantom: { + __typename?: 'Fantom'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetFantomTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetFantomTransactionsQuery = { + __typename?: 'Query'; + fantom: { + __typename?: 'Fantom'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetFantomStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetFantomStatusQuery = { + __typename?: 'Query'; + fantom: { + __typename?: 'Fantom'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetOptimismBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetOptimismBalanceQuery = { + __typename?: 'Query'; + optimism: { + __typename?: 'Optimism'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type OptimismEip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type OptimismEip1559GasFeesQuery = { + __typename?: 'Query'; + optimism: { + __typename?: 'Optimism'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetOptimismTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetOptimismTransactionsQuery = { + __typename?: 'Query'; + optimism: { + __typename?: 'Optimism'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetOptimismStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetOptimismStatusQuery = { + __typename?: 'Query'; + optimism: { + __typename?: 'Optimism'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetPolygonBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetPolygonBalanceQuery = { + __typename?: 'Query'; + polygon: { + __typename?: 'Polygon'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type PolygonEip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type PolygonEip1559GasFeesQuery = { + __typename?: 'Query'; + polygon: { + __typename?: 'Polygon'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetPolygonTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetPolygonTransactionsQuery = { + __typename?: 'Query'; + polygon: { + __typename?: 'Polygon'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetPolygonStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetPolygonStatusQuery = { + __typename?: 'Query'; + polygon: { + __typename?: 'Polygon'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetSmartChainBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetSmartChainBalanceQuery = { + __typename?: 'Query'; + binanceSmartChain: { + __typename?: 'BinanceSmartChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type SmartChainDefaultGasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type SmartChainDefaultGasFeesQuery = { + __typename?: 'Query'; + binanceSmartChain: { + __typename?: 'BinanceSmartChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetSmartChainTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetSmartChainTransactionsQuery = { + __typename?: 'Query'; + binanceSmartChain: { + __typename?: 'BinanceSmartChain'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetSmartChainStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetSmartChainStatusQuery = { + __typename?: 'Query'; + binanceSmartChain: { + __typename?: 'BinanceSmartChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export const GetArbitrumBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetArbitrumBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'arbitrum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetArbitrumBalanceQuery, + GetArbitrumBalanceQueryVariables +>; +export const ArbitrumDefaultGasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'ArbitrumDefaultGasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'arbitrum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + ArbitrumDefaultGasFeesQuery, + ArbitrumDefaultGasFeesQueryVariables +>; +export const GetArbitrumTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetArbitrumTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'arbitrum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetArbitrumTransactionsQuery, + GetArbitrumTransactionsQueryVariables +>; +export const GetArbitrumStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetArbitrumStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'arbitrum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetArbitrumStatusQuery, + GetArbitrumStatusQueryVariables +>; +export const GetAuroraBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAuroraBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'aurora' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAuroraBalanceQuery, + GetAuroraBalanceQueryVariables +>; +export const AuroraDefaultGasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'AuroraDefaultGasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'aurora' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + AuroraDefaultGasFeesQuery, + AuroraDefaultGasFeesQueryVariables +>; +export const GetAuroraTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAuroraTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'aurora' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAuroraTransactionsQuery, + GetAuroraTransactionsQueryVariables +>; +export const GetAuroraStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAuroraStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'aurora' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAuroraStatusQuery, + GetAuroraStatusQueryVariables +>; +export const GetAvalancheBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAvalancheBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAvalancheBalanceQuery, + GetAvalancheBalanceQueryVariables +>; +export const AvalancheEip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'AvalancheEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + AvalancheEip1559GasFeesQuery, + AvalancheEip1559GasFeesQueryVariables +>; +export const GetAvalancheTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAvalancheTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAvalancheTransactionsQuery, + GetAvalancheTransactionsQueryVariables +>; +export const GetAvalancheStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAvalancheStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAvalancheStatusQuery, + GetAvalancheStatusQueryVariables +>; +export const GetCantoEvmBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCantoEVMBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cantoEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCantoEvmBalanceQuery, + GetCantoEvmBalanceQueryVariables +>; +export const CantoEvmeip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CantoEVMEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cantoEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CantoEvmeip1559GasFeesQuery, + CantoEvmeip1559GasFeesQueryVariables +>; +export const GetCantoEvmTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCantoEVMTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cantoEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCantoEvmTransactionsQuery, + GetCantoEvmTransactionsQueryVariables +>; +export const GetCantoEvmStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCantoEVMStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cantoEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCantoEvmStatusQuery, + GetCantoEvmStatusQueryVariables +>; +export const GetCronosEvmBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCronosEVMBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronosEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCronosEvmBalanceQuery, + GetCronosEvmBalanceQueryVariables +>; +export const CronosEvmeip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CronosEVMEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronosEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CronosEvmeip1559GasFeesQuery, + CronosEvmeip1559GasFeesQueryVariables +>; +export const GetCronosEvmTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCronosEVMTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronosEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCronosEvmTransactionsQuery, + GetCronosEvmTransactionsQueryVariables +>; +export const GetCronosEvmStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCronosEVMStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cronosEVM' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCronosEvmStatusQuery, + GetCronosEvmStatusQueryVariables +>; +export const GetEthereumBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetEthereumBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'ethereum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetEthereumBalanceQuery, + GetEthereumBalanceQueryVariables +>; +export const EthereumEip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'EthereumEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'ethereum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + EthereumEip1559GasFeesQuery, + EthereumEip1559GasFeesQueryVariables +>; +export const GetEthereumTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetEthereumTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'ethereum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetEthereumTransactionsQuery, + GetEthereumTransactionsQueryVariables +>; +export const GetEthereumStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetEthereumStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'ethereum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetEthereumStatusQuery, + GetEthereumStatusQueryVariables +>; +export const GetFantomBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetFantomBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fantom' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetFantomBalanceQuery, + GetFantomBalanceQueryVariables +>; +export const FantomEip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'FantomEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fantom' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + FantomEip1559GasFeesQuery, + FantomEip1559GasFeesQueryVariables +>; +export const GetFantomTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetFantomTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fantom' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetFantomTransactionsQuery, + GetFantomTransactionsQueryVariables +>; +export const GetFantomStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetFantomStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fantom' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetFantomStatusQuery, + GetFantomStatusQueryVariables +>; +export const GetOptimismBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetOptimismBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'optimism' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetOptimismBalanceQuery, + GetOptimismBalanceQueryVariables +>; +export const OptimismEip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'OptimismEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'optimism' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + OptimismEip1559GasFeesQuery, + OptimismEip1559GasFeesQueryVariables +>; +export const GetOptimismTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetOptimismTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'optimism' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetOptimismTransactionsQuery, + GetOptimismTransactionsQueryVariables +>; +export const GetOptimismStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetOptimismStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'optimism' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetOptimismStatusQuery, + GetOptimismStatusQueryVariables +>; +export const GetPolygonBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetPolygonBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'polygon' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetPolygonBalanceQuery, + GetPolygonBalanceQueryVariables +>; +export const PolygonEip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'PolygonEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'polygon' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + PolygonEip1559GasFeesQuery, + PolygonEip1559GasFeesQueryVariables +>; +export const GetPolygonTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetPolygonTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'polygon' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetPolygonTransactionsQuery, + GetPolygonTransactionsQueryVariables +>; +export const GetPolygonStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetPolygonStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'polygon' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetPolygonStatusQuery, + GetPolygonStatusQueryVariables +>; +export const GetSmartChainBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSmartChainBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binanceSmartChain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSmartChainBalanceQuery, + GetSmartChainBalanceQueryVariables +>; +export const SmartChainDefaultGasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'SmartChainDefaultGasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binanceSmartChain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + SmartChainDefaultGasFeesQuery, + SmartChainDefaultGasFeesQueryVariables +>; +export const GetSmartChainTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSmartChainTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binanceSmartChain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSmartChainTransactionsQuery, + GetSmartChainTransactionsQueryVariables +>; +export const GetSmartChainStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSmartChainStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'binanceSmartChain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSmartChainStatusQuery, + GetSmartChainStatusQueryVariables +>; diff --git a/packages/evm/src/gql/index.ts b/packages/evm/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/evm/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/litecoin/codegen.yml b/packages/litecoin/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/litecoin/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 9222f1dd..12c1ac7f 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -16,7 +16,13 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -24,7 +30,6 @@ "@ledgerhq/hw-transport-webhid": "6.28.3", "@ledgerhq/hw-transport-mocker": "6.28.3", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "@xdefi-tech/chains-utxo": "*", "@noble/curves": "1.3.0", "@scure/btc-signer": "1.2.1", @@ -52,7 +57,11 @@ "test:watch": "jest --watch", "lint": "eslint .", "lint:fix": "eslint . --fix", - "clean": "rimraf dist .turbo node_modules" + "clean": "rimraf dist .turbo node_modules", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/litecoin/src/datasource/indexer/queries/balances.query.ts b/packages/litecoin/src/datasource/indexer/queries/balances.query.ts index ac0d5a6d..8fc06123 100644 --- a/packages/litecoin/src/datasource/indexer/queries/balances.query.ts +++ b/packages/litecoin/src/datasource/indexer/queries/balances.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { LitecoinBalanceDocument, Balance } from '@xdefi-tech/chains-graphql'; + +import { LitecoinBalanceDocument, Balance } from '../../../gql/graphql'; export const getBalance = async (address: string): Promise> => { const response = await gqlClient.query({ diff --git a/packages/litecoin/src/datasource/indexer/queries/broadcast.query.ts b/packages/litecoin/src/datasource/indexer/queries/broadcast.query.ts index 6921459c..2bf8e040 100644 --- a/packages/litecoin/src/datasource/indexer/queries/broadcast.query.ts +++ b/packages/litecoin/src/datasource/indexer/queries/broadcast.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { LitecoinBroadcastTransactionDocument } from '@xdefi-tech/chains-graphql'; + +import { LitecoinBroadcastTransactionDocument } from '../../../gql/graphql'; export const broadcast = async (rawHex: string): Promise => { const response = await gqlClient.query({ diff --git a/packages/litecoin/src/datasource/indexer/queries/fees.query.ts b/packages/litecoin/src/datasource/indexer/queries/fees.query.ts index 0e9c6a73..8f252dd4 100644 --- a/packages/litecoin/src/datasource/indexer/queries/fees.query.ts +++ b/packages/litecoin/src/datasource/indexer/queries/fees.query.ts @@ -1,6 +1,7 @@ -import { GetLitecoinFeesDocument } from '@xdefi-tech/chains-graphql'; import { DefaultFeeOptions, gqlClient } from '@xdefi-tech/chains-core'; +import { GetLitecoinFeesDocument } from '../../../gql/graphql'; + export const getFees = async (): Promise => { const response = await gqlClient.query({ query: GetLitecoinFeesDocument, diff --git a/packages/litecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts b/packages/litecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts index eb9131ee..35b4faf3 100644 --- a/packages/litecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts +++ b/packages/litecoin/src/datasource/indexer/queries/getTransactionByHash.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { LitecoinGetTransactionByHashDocument } from '@xdefi-tech/chains-graphql'; + +import { LitecoinGetTransactionByHashDocument } from '../../../gql/graphql'; export const getTransactionByHash = async (txHash: string) => { try { diff --git a/packages/litecoin/src/datasource/indexer/queries/scanUTXOs.query.ts b/packages/litecoin/src/datasource/indexer/queries/scanUTXOs.query.ts index 5a32d26c..75b2ae42 100644 --- a/packages/litecoin/src/datasource/indexer/queries/scanUTXOs.query.ts +++ b/packages/litecoin/src/datasource/indexer/queries/scanUTXOs.query.ts @@ -1,8 +1,9 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { LitecoinScanUtxOsDocument, UnspentTransactionOutputV5, -} from '@xdefi-tech/chains-graphql'; +} from '../../../gql/graphql'; export const scanUTXOs = async ( address: string diff --git a/packages/litecoin/src/datasource/indexer/queries/transactions.query.ts b/packages/litecoin/src/datasource/indexer/queries/transactions.query.ts index 96c0ffba..5665fda5 100644 --- a/packages/litecoin/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/litecoin/src/datasource/indexer/queries/transactions.query.ts @@ -1,9 +1,10 @@ +import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetLitecoinTransactionsDocument, Scalars, UtxoTransactionV2, -} from '@xdefi-tech/chains-graphql'; -import { gqlClient } from '@xdefi-tech/chains-core'; +} from '../../../gql/graphql'; export const getTransactions = async ( chain: string, diff --git a/packages/litecoin/src/gql/fragment-masking.ts b/packages/litecoin/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/litecoin/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/litecoin/src/gql/gql.ts b/packages/litecoin/src/gql/gql.ts new file mode 100644 index 00000000..3f7984d4 --- /dev/null +++ b/packages/litecoin/src/gql/gql.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}': + types.LitecoinBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}' +): typeof documents['query LitecoinBalance($address: String!) {\n litecoin {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetLitecoinFees {\n litecoin {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetLitecoinTransactions($address: String!, $pageSize: Int!, $pageNumber: Int!) {\n litecoin {\n transactionsV2(address: $address, pageSize: $pageSize, pageNumber: $pageNumber) {\n balanceChange {\n value\n }\n blockNumber\n fee {\n value\n }\n hash\n inputs {\n address\n amount {\n value\n }\n }\n outputs {\n amount {\n value\n }\n address\n }\n timestamp\n status\n }\n }\n}\n\nquery LitecoinBroadcastTransaction($rawHex: String!) {\n litecoin {\n broadcastTransaction(rawHex: $rawHex)\n }\n}\n\nquery LitecoinScanUTXOs($address: String!, $page: Int!) {\n litecoin {\n unspentTxOutputsV5(address: $address, page: $page) {\n oTxHash\n oIndex\n value {\n value\n }\n oTxHex\n address\n isCoinbase\n scriptHex\n }\n }\n}\n\nquery LitecoinGetTransactionByHash($txHash: String!) {\n litecoin {\n getTransactionByHashV5(txHash: $txHash) {\n hex\n txid\n hash\n size\n version\n locktime\n confirmations\n blocktime\n time\n blockhash\n blockNumber\n sourceOfData\n inputs {\n address\n }\n outputs {\n address\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/litecoin/src/gql/graphql.ts b/packages/litecoin/src/gql/graphql.ts new file mode 100644 index 00000000..3364ea48 --- /dev/null +++ b/packages/litecoin/src/gql/graphql.ts @@ -0,0 +1,5521 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type LitecoinBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type LitecoinBalanceQuery = { + __typename?: 'Query'; + litecoin: { + __typename?: 'LitecoinChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetLitecoinFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetLitecoinFeesQuery = { + __typename?: 'Query'; + litecoin: { + __typename?: 'LitecoinChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetLitecoinTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + pageSize: Scalars['Int']; + pageNumber: Scalars['Int']; +}>; + +export type GetLitecoinTransactionsQuery = { + __typename?: 'Query'; + litecoin: { + __typename?: 'LitecoinChain'; + transactionsV2: Array<{ + __typename?: 'UTXOTransactionV2'; + blockNumber?: number | null; + hash: string; + timestamp?: any | null; + status?: string | null; + balanceChange?: { __typename?: 'Amount'; value: string } | null; + fee?: { __typename?: 'Amount'; value: string } | null; + inputs?: Array<{ + __typename?: 'Input'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + outputs?: Array<{ + __typename?: 'Output'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + }>; + }; +}; + +export type LitecoinBroadcastTransactionQueryVariables = Exact<{ + rawHex: Scalars['String']; +}>; + +export type LitecoinBroadcastTransactionQuery = { + __typename?: 'Query'; + litecoin: { __typename?: 'LitecoinChain'; broadcastTransaction: string }; +}; + +export type LitecoinScanUtxOsQueryVariables = Exact<{ + address: Scalars['String']; + page: Scalars['Int']; +}>; + +export type LitecoinScanUtxOsQuery = { + __typename?: 'Query'; + litecoin: { + __typename?: 'LitecoinChain'; + unspentTxOutputsV5: Array<{ + __typename?: 'UnspentTransactionOutputV5'; + oTxHash: string; + oIndex: number; + oTxHex?: string | null; + address?: string | null; + isCoinbase?: boolean | null; + scriptHex?: string | null; + value: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type LitecoinGetTransactionByHashQueryVariables = Exact<{ + txHash: Scalars['String']; +}>; + +export type LitecoinGetTransactionByHashQuery = { + __typename?: 'Query'; + litecoin: { + __typename?: 'LitecoinChain'; + getTransactionByHashV5: { + __typename?: 'UtxotransactionByHashV5'; + hex?: string | null; + txid?: string | null; + hash: string; + size: number; + version: number; + locktime?: number | null; + confirmations?: number | null; + blocktime?: number | null; + time?: number | null; + blockhash?: string | null; + blockNumber?: number | null; + sourceOfData: string; + inputs: Array<{ __typename?: 'Input'; address: string }>; + outputs: Array<{ __typename?: 'Output'; address: string }>; + }; + }; +}; + +export const LitecoinBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'LitecoinBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'litecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + LitecoinBalanceQuery, + LitecoinBalanceQueryVariables +>; +export const GetLitecoinFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetLitecoinFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'litecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetLitecoinFeesQuery, + GetLitecoinFeesQueryVariables +>; +export const GetLitecoinTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetLitecoinTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'litecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactionsV2' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageSize' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageNumber' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balanceChange' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetLitecoinTransactionsQuery, + GetLitecoinTransactionsQueryVariables +>; +export const LitecoinBroadcastTransactionDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'LitecoinBroadcastTransaction' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'litecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'broadcastTransaction' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'rawHex' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + }, + ], + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + LitecoinBroadcastTransactionQuery, + LitecoinBroadcastTransactionQueryVariables +>; +export const LitecoinScanUtxOsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'LitecoinScanUTXOs' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'litecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'unspentTxOutputsV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'page' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'page' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'isCoinbase' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scriptHex' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + LitecoinScanUtxOsQuery, + LitecoinScanUtxOsQueryVariables +>; +export const LitecoinGetTransactionByHashDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'LitecoinGetTransactionByHash' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'litecoin' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'getTransactionByHashV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'txHash' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'hex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'txid' } }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { kind: 'Field', name: { kind: 'Name', value: 'size' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'version' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'locktime' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'confirmations' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blocktime' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'time' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockhash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'sourceOfData' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + LitecoinGetTransactionByHashQuery, + LitecoinGetTransactionByHashQueryVariables +>; diff --git a/packages/litecoin/src/gql/index.ts b/packages/litecoin/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/litecoin/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/solana/codegen.yml b/packages/solana/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/solana/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/solana/package.json b/packages/solana/package.json index ddb21cdf..87736e5c 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -18,6 +18,12 @@ "ts-jest": "27.1.4", "tsup": "6.6.3", "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0", "xhr2": "0.2.1" }, "dependencies": { @@ -28,7 +34,6 @@ "@solana/spl-token": "0.4.6", "@solana/web3.js": "1.91.8", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "bignumber.js": "9.1.2", "bip39": "3.1.0", "bs58": "5.0.0", @@ -50,7 +55,11 @@ "coverage": "jest --coverageReporters='json-summary' --coverage", "test": "jest", "lint:fix": "eslint . --fix", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/solana/src/datasource/indexer/queries/balances.query.ts b/packages/solana/src/datasource/indexer/queries/balances.query.ts index dc398522..badc8619 100644 --- a/packages/solana/src/datasource/indexer/queries/balances.query.ts +++ b/packages/solana/src/datasource/indexer/queries/balances.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { GetSolanaBalanceDocument } from '@xdefi-tech/chains-graphql'; + +import { GetSolanaBalanceDocument } from '../../../gql/graphql'; export const getBalance = (address: string) => { return gqlClient.query({ diff --git a/packages/solana/src/datasource/indexer/queries/fees.query.ts b/packages/solana/src/datasource/indexer/queries/fees.query.ts index 5009d706..5d58c855 100644 --- a/packages/solana/src/datasource/indexer/queries/fees.query.ts +++ b/packages/solana/src/datasource/indexer/queries/fees.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { GetSolanaFeeDocument } from '@xdefi-tech/chains-graphql'; + +import { GetSolanaFeeDocument } from '../../../gql/graphql'; export const getFees = () => { return gqlClient.query({ diff --git a/packages/solana/src/datasource/indexer/queries/transactions.query.ts b/packages/solana/src/datasource/indexer/queries/transactions.query.ts index ab858a8f..a25bf4a0 100644 --- a/packages/solana/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/solana/src/datasource/indexer/queries/transactions.query.ts @@ -1,10 +1,8 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { - GetSolanaTransactionsDocument, - Scalars, -} from '@xdefi-tech/chains-graphql'; import map from 'lodash/map'; +import { GetSolanaTransactionsDocument, Scalars } from '../../../gql/graphql'; + export const getTransactions = async (address: Scalars['String']) => { const response = await gqlClient.query({ query: GetSolanaTransactionsDocument, diff --git a/packages/solana/src/gql/fragment-masking.ts b/packages/solana/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/solana/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/solana/src/gql/gql.ts b/packages/solana/src/gql/gql.ts new file mode 100644 index 00000000..e3dfc0ab --- /dev/null +++ b/packages/solana/src/gql/gql.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}': + types.GetSolanaBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}' +): typeof documents['query GetSolanaBalance($address: String!) {\n solana {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSolanaTransactions($address: String!, $first: Int!, $after: String) {\n solana {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n payer\n }\n hash\n slot\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n }\n fromAddress\n toAddress\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetSolanaStatus {\n solana {\n status {\n lastBlock\n }\n }\n}\n\nquery GetSolanaFee {\n solana {\n fee {\n high\n low\n medium\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/solana/src/gql/graphql.ts b/packages/solana/src/gql/graphql.ts new file mode 100644 index 00000000..18d996c3 --- /dev/null +++ b/packages/solana/src/gql/graphql.ts @@ -0,0 +1,5356 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type GetSolanaBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetSolanaBalanceQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + name?: string | null; + image?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetSolanaTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetSolanaTransactionsQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + transactions: { + __typename?: 'SolanaTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'SolanaTransactionEdge'; + node: { + __typename?: 'SolanaTransaction'; + hash: string; + slot: number; + status: string; + timestamp?: any | null; + signers: Array; + fee: { + __typename?: 'Fee'; + payer: string; + amount: { __typename?: 'Amount'; value: string }; + }; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }>; + }; + }>; + }; + }; +}; + +export type GetSolanaStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetSolanaStatusQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + status: { __typename?: 'SolanaStatus'; lastBlock: number }; + }; +}; + +export type GetSolanaFeeQueryVariables = Exact<{ [key: string]: never }>; + +export type GetSolanaFeeQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export const GetSolanaBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSolanaBalanceQuery, + GetSolanaBalanceQueryVariables +>; +export const GetSolanaTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'slot' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSolanaTransactionsQuery, + GetSolanaTransactionsQueryVariables +>; +export const GetSolanaStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSolanaStatusQuery, + GetSolanaStatusQueryVariables +>; +export const GetSolanaFeeDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; diff --git a/packages/solana/src/gql/index.ts b/packages/solana/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/solana/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/thor/codegen.yml b/packages/thor/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/thor/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/thor/package.json b/packages/thor/package.json index 2685d171..94d616f8 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -18,7 +18,13 @@ "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3" + "typescript": "4.8.3", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@cosmjs/launchpad": "0.27.1", @@ -27,7 +33,6 @@ "@ledgerhq/hw-transport-webhid": "6.28.3", "@thorchain/ledger-thorchain": "0.1.0-alpha.2", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "axios": "1.4.0", "bech32": "2.0.0", "bech32-buffer": "0.2.1", @@ -52,7 +57,11 @@ "test:watch": "jest --watch", "lint": "eslint .", "lint:fix": "eslint . --fix", - "clean": "rimraf dist .turbo node_modules" + "clean": "rimraf dist .turbo node_modules", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "jest": { "setupFiles": [], diff --git a/packages/thor/src/datasource/chain/chain.data-source.ts b/packages/thor/src/datasource/chain/chain.data-source.ts index 2c301170..919630dd 100644 --- a/packages/thor/src/datasource/chain/chain.data-source.ts +++ b/packages/thor/src/datasource/chain/chain.data-source.ts @@ -10,19 +10,16 @@ import { Injectable, Transaction, TransactionsFilter, + getCryptoAssets, } from '@xdefi-tech/chains-core'; import { Observable } from 'rxjs'; import cosmosclient from '@cosmos-client/core'; import axios, { Axios } from 'axios'; import BigNumber from 'bignumber.js'; import { uniqBy } from 'lodash'; -import { - AddressChain, - CryptoAssetArgs, - getCryptoAssets, -} from '@xdefi-tech/chains-graphql'; import Long from 'long'; +import { AddressChain, CryptoAssetArgs } from '../../gql/graphql'; import { ChainMsg } from '../../msg'; import * as manifests from '../../manifests'; import { AccountInfo } from '../../types'; diff --git a/packages/thor/src/datasource/indexer/queries/balances.query.ts b/packages/thor/src/datasource/indexer/queries/balances.query.ts index 566fb197..0aeae5a3 100644 --- a/packages/thor/src/datasource/indexer/queries/balances.query.ts +++ b/packages/thor/src/datasource/indexer/queries/balances.query.ts @@ -1,9 +1,9 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetMayachainBalancesDocument, GetThorchainBalancesDocument, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { ThorChains } from '../../../manifests'; type ThorchainParams = { diff --git a/packages/thor/src/datasource/indexer/queries/fees.query.ts b/packages/thor/src/datasource/indexer/queries/fees.query.ts index 2aae249f..0781ed31 100644 --- a/packages/thor/src/datasource/indexer/queries/fees.query.ts +++ b/packages/thor/src/datasource/indexer/queries/fees.query.ts @@ -1,9 +1,9 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetMayachainFeeDocument, GetThorchainFeeDocument, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { ThorChains } from '../../../manifests'; type ThorchainParams = { diff --git a/packages/thor/src/datasource/indexer/queries/transactions.query.ts b/packages/thor/src/datasource/indexer/queries/transactions.query.ts index be5b342c..c705f34c 100644 --- a/packages/thor/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/thor/src/datasource/indexer/queries/transactions.query.ts @@ -1,11 +1,11 @@ import { gqlClient } from '@xdefi-tech/chains-core'; +import map from 'lodash/map'; + import { GetMayachainTransactionsDocument, GetThorchainTransactionsDocument, Scalars, -} from '@xdefi-tech/chains-graphql'; -import map from 'lodash/map'; - +} from '../../../gql/graphql'; import { ThorChains } from '../../../manifests'; type ThorchainParams = { diff --git a/packages/thor/src/gql/fragment-masking.ts b/packages/thor/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/thor/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/thor/src/gql/gql.ts b/packages/thor/src/gql/gql.ts new file mode 100644 index 00000000..2fc5533e --- /dev/null +++ b/packages/thor/src/gql/gql.ts @@ -0,0 +1,62 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': + types.GetMayachainBalancesDocument, + 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': + types.GetThorchainBalancesDocument, + 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}': + types.GetCryptoAssetsDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' +): typeof documents['query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' +): typeof documents['query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}' +): typeof documents['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/thor/src/gql/graphql.ts b/packages/thor/src/gql/graphql.ts new file mode 100644 index 00000000..7e2c85b6 --- /dev/null +++ b/packages/thor/src/gql/graphql.ts @@ -0,0 +1,6351 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type GetMayachainBalancesQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetMayachainBalancesQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + name?: string | null; + image?: string | null; + symbol?: string | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }>; + }; +}; + +export type GetMayachainTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetMayachainTransactionsQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + transactions: { + __typename?: 'ThorchainTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'ThorchainTransactionEdge'; + node: { + __typename?: 'ThorchainTransaction'; + hash: string; + status: string; + timestamp?: any | null; + fee?: Array<{ + __typename?: 'ThorchainFee'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + id?: string | null; + decimals?: number | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }> | null; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetMayachainStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetMayachainStatusQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetMayachainFeeQueryVariables = Exact<{ [key: string]: never }>; + +export type GetMayachainFeeQuery = { + __typename?: 'Query'; + mayachain: { + __typename?: 'MayaChain'; + fee?: { + __typename?: 'MayaChainFee'; + outboundTransactionFee?: number | null; + nativeTransactionFee?: number | null; + tnsRegisterFee?: number | null; + tnsFeeOnSale?: number | null; + tnsFeePerBlock?: number | null; + } | null; + }; +}; + +export type GetThorchainBalancesQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetThorchainBalancesQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + name?: string | null; + image?: string | null; + symbol?: string | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }>; + }; +}; + +export type GetThorchainTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first: Scalars['Int']; + after?: InputMaybe; +}>; + +export type GetThorchainTransactionsQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + transactions: { + __typename?: 'ThorchainTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'ThorchainTransactionEdge'; + node: { + __typename?: 'ThorchainTransaction'; + hash: string; + status: string; + timestamp?: any | null; + fee?: Array<{ + __typename?: 'ThorchainFee'; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + id?: string | null; + decimals?: number | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }> | null; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + type?: AssetInternalType | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetThorchainStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetThorchainStatusQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetThorchainFeeQueryVariables = Exact<{ [key: string]: never }>; + +export type GetThorchainFeeQuery = { + __typename?: 'Query'; + thorchain: { + __typename?: 'ThorChain'; + fee?: { + __typename?: 'ThorChainFee'; + outboundTransactionFee?: number | null; + nativeTransactionFee?: number | null; + tnsRegisterFee?: number | null; + tnsFeeOnSale?: number | null; + tnsFeePerBlock?: number | null; + } | null; + }; +}; + +export type GetCryptoAssetsQueryVariables = Exact<{ + input: Array | CryptoAssetArgs; +}>; + +export type GetCryptoAssetsQuery = { + __typename?: 'Query'; + assets: { + __typename?: 'AssetType'; + cryptoAssets?: Array<{ + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + }> | null; + }; +}; + +export const GetMayachainBalancesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainBalances' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainBalancesQuery, + GetMayachainBalancesQueryVariables +>; +export const GetMayachainTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainTransactionsQuery, + GetMayachainTransactionsQueryVariables +>; +export const GetMayachainStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainStatusQuery, + GetMayachainStatusQueryVariables +>; +export const GetMayachainFeeDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMayachainFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'mayachain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'outboundTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'nativeTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsRegisterFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeeOnSale' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeePerBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetMayachainFeeQuery, + GetMayachainFeeQueryVariables +>; +export const GetThorchainBalancesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainBalances' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainBalancesQuery, + GetThorchainBalancesQueryVariables +>; +export const GetThorchainTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'type', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainTransactionsQuery, + GetThorchainTransactionsQueryVariables +>; +export const GetThorchainStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainStatusQuery, + GetThorchainStatusQueryVariables +>; +export const GetThorchainFeeDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetThorchainFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'thorchain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'outboundTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'nativeTransactionFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsRegisterFee' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeeOnSale' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'tnsFeePerBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetThorchainFeeQuery, + GetThorchainFeeQueryVariables +>; +export const GetCryptoAssetsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCryptoAssets' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'input' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'ListType', + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CryptoAssetArgs' }, + }, + }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'assets' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cryptoAssets' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'input' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'input' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'chain' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'image' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scalingFactor' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCryptoAssetsQuery, + GetCryptoAssetsQueryVariables +>; diff --git a/packages/thor/src/gql/index.ts b/packages/thor/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/thor/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/thor/src/operations.graphql b/packages/thor/src/operations.graphql new file mode 100644 index 00000000..0b108163 --- /dev/null +++ b/packages/thor/src/operations.graphql @@ -0,0 +1,17 @@ +query GetCryptoAssets($input: [CryptoAssetArgs!]!) { + assets { + cryptoAssets(input: $input) { + chain + contract + id + name + symbol + image + decimals + price { + amount + scalingFactor + } + } + } +} \ No newline at end of file diff --git a/packages/tron/codegen.yml b/packages/tron/codegen.yml new file mode 100644 index 00000000..9017a190 --- /dev/null +++ b/packages/tron/codegen.yml @@ -0,0 +1,25 @@ +overwrite: true +schema: https://gql-router.xdefi.services/graphql +documents: + - ./**/*.graphql +generates: + src/gql/: + preset: client + presetConfig: + gqlTagName: gql + addOperationExport: true + namingConvention: + enumValues: 'keep' + documentMode: string + flattenGeneratedTypes: true + config: + flattenGeneratedTypes: true + namingConvention: + enumValues: 'keep' + src/gql/index.ts: + plugins: + - add: + content: | + export * from "./fragment-masking"; + export * from "./gql"; + export * from "./graphql"; diff --git a/packages/tron/package.json b/packages/tron/package.json index 3e65e42f..683ae57e 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -17,7 +17,13 @@ "ts-jest": "27.1.4", "tsup": "6.6.3", "typescript": "4.8.3", - "xhr2": "0.2.1" + "xhr2": "0.2.1", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", + "graphql": "16.6.0" }, "dependencies": { "@agrozyme/types-tronweb": "5.3.2", @@ -25,7 +31,6 @@ "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-graphql": "*", "axios": "1.6.1", "bignumber.js": "9.1.2", "eslint-config-custom": "*", @@ -46,7 +51,11 @@ "test:disabled": "jest", "lint:fix": "eslint . --fix", "test:watch": "jest --watch", - "coverage": "jest --coverageReporters='json-summary' --coverage" + "coverage": "jest --coverageReporters='json-summary' --coverage", + "compile": "graphql-codegen --config codegen.yml && yarn format", + "compile:build": "yarn compile && yarn build", + "compile:watch": "graphql-codegen -w", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", "tsup": { diff --git a/packages/tron/src/datasource/indexer/indexer.data-source.ts b/packages/tron/src/datasource/indexer/indexer.data-source.ts index 2e3f60b5..ce3bc53a 100644 --- a/packages/tron/src/datasource/indexer/indexer.data-source.ts +++ b/packages/tron/src/datasource/indexer/indexer.data-source.ts @@ -18,8 +18,8 @@ import { AbiCoder, formatUnits } from 'ethers'; import { Observable } from 'rxjs'; import TronWeb from 'tronweb'; import axios, { AxiosInstance } from 'axios'; -import { CryptoAsset } from '@xdefi-tech/chains-graphql'; +import { CryptoAsset } from '../../gql/graphql'; import type { TronManifest } from '../../manifests'; import { TronEnergyEstimate } from '../../msg'; diff --git a/packages/tron/src/datasource/indexer/queries/balances.query.ts b/packages/tron/src/datasource/indexer/queries/balances.query.ts index 70404f71..c9edfb05 100644 --- a/packages/tron/src/datasource/indexer/queries/balances.query.ts +++ b/packages/tron/src/datasource/indexer/queries/balances.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { GetTronBalanceDocument } from '@xdefi-tech/chains-graphql'; + +import { GetTronBalanceDocument } from '../../../gql/graphql'; export const getBalance = async (address: string) => { const response = await gqlClient.query({ diff --git a/packages/tron/src/datasource/indexer/queries/transactions.query.ts b/packages/tron/src/datasource/indexer/queries/transactions.query.ts index b809be51..774df644 100644 --- a/packages/tron/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/tron/src/datasource/indexer/queries/transactions.query.ts @@ -1,7 +1,8 @@ import { gqlClient } from '@xdefi-tech/chains-core'; -import { GetTronTransactionsDocument } from '@xdefi-tech/chains-graphql'; import map from 'lodash/map'; +import { GetTronTransactionsDocument } from '../../../gql/graphql'; + export interface BlockRange { from: number; to: number; diff --git a/packages/tron/src/gql/fragment-masking.ts b/packages/tron/src/gql/fragment-masking.ts new file mode 100644 index 00000000..0a9ad73d --- /dev/null +++ b/packages/tron/src/gql/fragment-masking.ts @@ -0,0 +1,54 @@ +import { + ResultOf, + TypedDocumentNode as DocumentNode, +} from '@graphql-typed-document-node/core'; + +export type FragmentType> = + TDocumentType extends DocumentNode + ? TType extends { ' $fragmentName'?: infer TKey } + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } + : never + : never + : never; + +// return non-nullable if `fragmentType` is non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> +): TType; +// return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: FragmentType> | null | undefined +): TType | null | undefined; +// return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: ReadonlyArray>> +): ReadonlyArray; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | ReadonlyArray>> + | null + | undefined +): ReadonlyArray | null | undefined; +export function useFragment( + _documentNode: DocumentNode, + fragmentType: + | FragmentType> + | ReadonlyArray>> + | null + | undefined +): TType | ReadonlyArray | null | undefined { + return fragmentType as any; +} + +export function makeFragmentData< + F extends DocumentNode, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { + return data as FragmentType; +} diff --git a/packages/tron/src/gql/gql.ts b/packages/tron/src/gql/gql.ts new file mode 100644 index 00000000..1ac31152 --- /dev/null +++ b/packages/tron/src/gql/gql.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + 'query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}': + types.GetTronBalanceDocument, +}; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function gql(source: string): unknown; + +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}' +): typeof documents['query GetTronBalance($address: String!) {\n tron {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n }\n amount {\n value\n scalingFactor\n }\n }\n }\n}\n\nquery GetTronTransactions($address: String!, $first: Int) {\n tron {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n toAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}']; + +export function gql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/packages/tron/src/gql/graphql.ts b/packages/tron/src/gql/graphql.ts new file mode 100644 index 00000000..0426be8e --- /dev/null +++ b/packages/tron/src/gql/graphql.ts @@ -0,0 +1,5255 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + AssetV0Args: any; + /** + * A datetime with timezone offset. + * + * The input is a string in RFC3339 format, e.g. "2022-01-12T04:00:19.12345Z" + * or "2022-01-12T04:00:19+03:00". The output is also a string in RFC3339 + * format, but it is always normalized to the UTC (Z) offset, e.g. + * "2022-01-12T04:00:19.12345Z". + */ + DateTime: any; + /** Decimal (fixed-point) */ + Decimal: any; + IntegerString: any; + /** A scalar that can represent any JSON value. */ + JSON: any; + /** + * A local datetime without timezone offset. + * + * The input/output is a string in ISO 8601 format without timezone, including + * subseconds. E.g. "2022-01-12T07:30:19.12345". + */ + LocalDateTime: any; +}; + +export enum AddressChain { + /** Legacy, use "Arbitrum" instead */ + ARBITRUM = 'ARBITRUM', + /** Legacy, use "Aurora" instead */ + AURORA = 'AURORA', + /** Legacy, use "Avalanche" instead */ + AVAX = 'AVAX', + Akash = 'Akash', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + /** Legacy, use "BitcoinCash" instead */ + BCH = 'BCH', + /** Legacy, use "BinanceChain" instead */ + BNB = 'BNB', + /** Legacy, use "BinanceSmartChain" instead */ + BSC = 'BSC', + /** Legacy, use "Bitcoin" instead */ + BTC = 'BTC', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Blast = 'Blast', + /** Legacy, use "Cosmos" instead */ + COSMOS = 'COSMOS', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celestia = 'Celestia', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + /** Legacy, use "Dogecoin" instead */ + DOGE = 'DOGE', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + Dymension = 'Dymension', + /** Legacy, use "Ethereum" instead */ + ETH = 'ETH', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + /** Legacy, use "Fantom" instead */ + FTM = 'FTM', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + HuobiECOChain = 'HuobiECOChain', + Injective = 'Injective', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + /** Legacy, use "Litecoin" instead */ + LTC = 'LTC', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MantaPacific = 'MantaPacific', + Mantle = 'Mantle', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mumbai = 'Mumbai', + /** Legacy, use "Near" instead */ + NEAR = 'NEAR', + Near = 'Near', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + /** Legacy, use "Osmosis" instead */ + OSMOSIS = 'OSMOSIS', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + /** Legacy, use "Polygon" instead */ + POLYGON = 'POLYGON', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Regen = 'Regen', + Rizon = 'Rizon', + Ropsten = 'Ropsten', + /** Legacy, use "Solana" instead */ + SOL = 'SOL', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + /** Legacy, use "TerraClassic" instead */ + TERRA = 'TERRA', + /** Legacy, use "THORChain" instead */ + THOR = 'THOR', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +/** Portfolio by wallet address */ +export type AddressPortfolioFiat = { + __typename?: 'AddressPortfolioFiat'; + /** wallet address */ + address: Scalars['String']; + /** errors if there was some issue with fetching data */ + errors: Array; + /** granularity of data (NOTE: experimental, can be removed) */ + granularity?: Maybe; + /** historical balances USD at specific datetime */ + historicalBalanceSum: Array; +}; + +export type AddressRouteCheckTypeV2 = { + __typename?: 'AddressRouteCheckTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; + isValid: Scalars['Boolean']; +}; + +export type AddressRouteInputType = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteInputTypeV2 = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteType = { + __typename?: 'AddressRouteType'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressRouteTypeV2 = { + __typename?: 'AddressRouteTypeV2'; + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AddressType = { + __typename?: 'AddressType'; + address?: Maybe; + chain: ChainType; +}; + +/** Address on given chain */ +export type AddressV0 = { + __typename?: 'AddressV0'; + /** Crypto currency address */ + address?: Maybe; + /** Chain name */ + chain?: Maybe; + /** Indicating the dapp corresponding to the provided chain and address */ + dAppDetails?: Maybe; +}; + +export type AddressV0Args = { + /** Crypto currency address */ + address?: InputMaybe; + /** Chain name */ + chain?: InputMaybe; +}; + +export type AllAssetsFilter = { + assetTypes?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type AllAssetsResponse = { + __typename?: 'AllAssetsResponse'; + page: AssetAllAssetsTypeConnection; + pageData?: Maybe; +}; + +export type Amount = { + __typename?: 'Amount'; + /** @deprecated use `decimals` from CryptoAsset */ + scalingFactor?: Maybe; + value: Scalars['String']; +}; + +/** Represent fiat amount in USD */ +export type AmountFiat = { + __typename?: 'AmountFiat'; + amount: Scalars['String']; + scalingFactor: Scalars['Int']; +}; + +export type AmountInputType = { + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type AmountType = { + __typename?: 'AmountType'; + amount: Scalars['String']; + scalingFactor: Scalars['Float']; +}; + +export type Arbitrum = { + __typename?: 'Arbitrum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ArbitrumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ArbitrumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ArbitrumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ArbitrumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ArbitrumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type AssetAllAssetsType = AssetBaseType & { + __typename?: 'AssetAllAssetsType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetAllAssetsTypeConnection = { + __typename?: 'AssetAllAssetsTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetAllAssetsTypeEdge = { + __typename?: 'AssetAllAssetsTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetAllAssetsTypePageInfo = { + __typename?: 'AssetAllAssetsTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Currency price */ +export type AssetAmountType = { + __typename?: 'AssetAmountType'; + /** Currency allTimeHigh */ + allTimeHigh?: Maybe; + /** Currency allTimeLow */ + allTimeLow?: Maybe; + /** Currency price amount */ + amount: Scalars['String']; + /** Currency dailyHigh */ + dailyHigh?: Maybe; + /** Currency dailyLow */ + dailyLow?: Maybe; + /** 24 Hour Trading Volume */ + dailyTradingVolume?: Maybe; + /** Currency dayPriceChange */ + dayPriceChange?: Maybe; + /** Currency fdv */ + fdv?: Maybe; + /** Currency marketCapRank */ + marketCapRank?: Maybe; + /** Currency monthPriceChange */ + monthPriceChange?: Maybe; + /** The scaling factor is needed to convert the amount of payment to the currency */ + scalingFactor: Scalars['Float']; + /** Current sparkline */ + sparkline: Array; + /** Current sparkline image url */ + sparklineImageUrl?: Maybe; + /** Updated on */ + updatedOn: Scalars['Float']; + /** Currency weekPriceChange */ + weekPriceChange?: Maybe; + /** Currency yearPriceChange */ + yearPriceChange?: Maybe; +}; + +export type AssetAmountV0 = { + __typename?: 'AssetAmountV0'; + amount: Scalars['IntegerString']; + asset: AssetV0; +}; + +export type AssetBaseType = { + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenType = AssetBaseType & { + __typename?: 'AssetCompositeTokenType'; + address?: Maybe; + chain?: Maybe; + contract?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + protocol?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCompositeTokenTypeConnection = { + __typename?: 'AssetCompositeTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCompositeTokenTypeEdge = { + __typename?: 'AssetCompositeTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCompositeTokenTypePageInfo = { + __typename?: 'AssetCompositeTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetCryptoCurrencyType = AssetBaseType & { + __typename?: 'AssetCryptoCurrencyType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chain: Scalars['String']; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + fee?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type AssetCryptoCurrencyTypeConnection = { + __typename?: 'AssetCryptoCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetCryptoCurrencyTypeEdge = { + __typename?: 'AssetCryptoCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetCryptoCurrencyTypePageInfo = { + __typename?: 'AssetCryptoCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetDefiProtocolType = { + __typename?: 'AssetDefiProtocolType'; + /** Address chain name */ + chain: Scalars['String']; + icon?: Maybe; + name: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fee that is charged to users when performing crypto transactions */ +export type AssetFeeType = { + __typename?: 'AssetFeeType'; + /** The scaling factor is needed to convert the amount of payment (value field) to the currency */ + scalingFactor?: Maybe; + /** Payment amount */ + value?: Maybe; +}; + +export type AssetFiatCurrencyType = PickObjectType & { + __typename?: 'AssetFiatCurrencyType'; + character?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetFiatCurrencyTypeConnection = { + __typename?: 'AssetFiatCurrencyTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetFiatCurrencyTypeEdge = { + __typename?: 'AssetFiatCurrencyTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetFiatCurrencyTypePageInfo = { + __typename?: 'AssetFiatCurrencyTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetHistory = { + __typename?: 'AssetHistory'; + asset: AssetV0; + balancesHistory: Array; +}; + +export enum AssetInternalType { + CRYPTOCURRENCY = 'CRYPTOCURRENCY', + LP_TOKEN = 'LP_TOKEN', + TOKEN = 'TOKEN', +} + +export type AssetTokenContractType = { + __typename?: 'AssetTokenContractType'; + address: Scalars['String']; + /** Address chain name */ + chain: Scalars['String']; + /** DefiProtocol */ + defiProtocol?: Maybe; + /** Chain fee */ + fee: AssetFeeType; + /** Unique identifier in the database */ + id: Scalars['Float']; + /** The scaling factor is needed to convert contract to token price */ + scalingFactor: Scalars['Float']; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type AssetTokenType = AssetBaseType & { + __typename?: 'AssetTokenType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Assets contracts */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData: Scalars['JSON']; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** The symbol that identifies token */ + symbol: Scalars['String']; + /** This filed contains detailed information about underlying tokens if assets type is LP token */ + tokens?: Maybe>>; + type: AssetInternalType; +}; + +export type AssetTokenTypeConnection = { + __typename?: 'AssetTokenTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type AssetTokenTypeEdge = { + __typename?: 'AssetTokenTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type AssetTokenTypePageInfo = { + __typename?: 'AssetTokenTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +export type AssetTransfer = { + __typename?: 'AssetTransfer'; + amount: Amount; + asset: CryptoAsset; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetTransferV2 = { + __typename?: 'AssetTransferV2'; + amount: Amount; + asset: AssetVariant; + fromAddress?: Maybe; + toAddress?: Maybe; +}; + +export type AssetType = { + __typename?: 'AssetType'; + /** All assets including tokens, lpTokens and cryptoCurrencies */ + allAssets?: Maybe; + /** Scaling factor for market cap */ + compositeTokens?: Maybe; + /** Crypto assets */ + cryptoAssets?: Maybe>; + /** Scaling factor for market cap */ + cryptoCurrencies?: Maybe; + dapps?: Maybe; + /** Scaling factor for market cap */ + fiatCurrencies?: Maybe; + /** Trending gainers (by day price change) */ + gainers?: Maybe>; + /** Trending losers (by day price change) */ + losers?: Maybe>; + /** Scaling factor for market cap */ + lpTokens?: Maybe; + /** NFTs by chain, contract and token_id. */ + nftsV0?: Maybe>; + /** + * Trending popular (by market cap) + * @deprecated Use topMarketCap query instead + */ + popular?: Maybe>; + search?: Maybe; + supportedChains: Array; + /** Scaling factor for market cap */ + tokens?: Maybe; + /** Experimental tokenV0 assets */ + tokensV0?: Maybe>; + /** Trending popular (by market cap) */ + topMarketCap?: Maybe>; + /** Trending coingecko tokens */ + trending?: Maybe>; +}; + +export type AssetTypeAllAssetsArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCompositeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeCryptoAssetsArgs = { + input: Array; +}; + +export type AssetTypeCryptoCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeDappsArgs = { + address: Scalars['String']; + chain: Scalars['String']; +}; + +export type AssetTypeFiatCurrenciesArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeLpTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeNftsV0Args = { + keys: Array; +}; + +export type AssetTypeSearchArgs = { + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensArgs = { + after?: InputMaybe; + afterPrice?: InputMaybe; + filter?: InputMaybe; + page: ConnectionArgs; +}; + +export type AssetTypeTokensV0Args = { + input: Array; +}; + +/** Unified asset representation for different chains */ +export type AssetV0 = { + __typename?: 'AssetV0'; + /** json encoded input arguments for payload resolver */ + args?: Maybe; + chain: Scalars['String']; + payload?: Maybe; +}; + +/** Union type that represent any asset (currently nft or token) */ +export type AssetV0Payload = NfTv0 | TokenV0; + +export type AssetV3 = { + __typename?: 'AssetV3'; + address?: Maybe; + assetId: Scalars['String']; + decimals?: Maybe; + icon?: Maybe; + id?: Maybe; + isERC721?: Maybe; + name?: Maybe; + symbol?: Maybe; + value?: Maybe; +}; + +export type AssetVariant = CryptoAsset | NftAsset; + +export type AssetWithAmount = { + __typename?: 'AssetWithAmount'; + amount: Amount; + asset: CryptoAsset; +}; + +export type Aurora = { + __typename?: 'Aurora'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AuroraActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AuroraBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AuroraLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AuroraNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AuroraTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Avalanche = { + __typename?: 'Avalanche'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type AvalancheActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type AvalancheBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type AvalancheLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type AvalancheNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type AvalancheTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Balance = { + __typename?: 'Balance'; + address: Scalars['String']; + amount: Amount; + asset: CryptoAsset; +}; + +/** Balance at specific chain block height for specific asset */ +export type BalanceAtHeight = { + __typename?: 'BalanceAtHeight'; + /** Value of asset at specific block height */ + amount: Scalars['String']; + /** Block height */ + blockHeight: Scalars['Int']; + /** Date and time (UTC) related to block height */ + dateTime?: Maybe; +}; + +export type Base = { + __typename?: 'Base'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Base onchain activity */ +export type BasicActivityV0 = ReceiveAssetActivityV0 | SendAssetActivityV0; + +export type Beam = { + __typename?: 'Beam'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Binance = { + __typename?: 'Binance'; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: BinanceStatus; + transactions: BinanceTransactionConnection; +}; + +export type BinanceBalancesArgs = { + address: Scalars['String']; +}; + +export type BinanceTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceSmartChain = { + __typename?: 'BinanceSmartChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BinanceSmartChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BinanceSmartChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BinanceSmartChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BinanceSmartChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BinanceSmartChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type BinanceStatus = { + __typename?: 'BinanceStatus'; + lastBlock?: Maybe; +}; + +export type BinanceTransaction = { + __typename?: 'BinanceTransaction'; + amount?: Maybe; + asset?: Maybe; + blockHeight: Scalars['Int']; + data?: Maybe; + fee: Amount; + fromAddress: Scalars['String']; + hash: Scalars['String']; + status: Scalars['String']; + time: Scalars['DateTime']; + toAddress?: Maybe; + type: Scalars['String']; +}; + +export type BinanceTransactionConnection = { + __typename?: 'BinanceTransactionConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type BinanceTransactionEdge = { + __typename?: 'BinanceTransactionEdge'; + cursor: Scalars['String']; + node: BinanceTransaction; +}; + +export type BitcoinChain = { + __typename?: 'BitcoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + legacyNFTs: Array; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type BitcoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNet = { + __typename?: 'BitcoinChainTestNet'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoinChainTestNetBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoinChainTestNetBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoinChainTestNetGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoinChainTestNetTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoinChainTestNetTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoinChainTestNetUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChain = { + __typename?: 'BitcoincashChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type BitcoincashChainBalancesArgs = { + address: Scalars['String']; +}; + +export type BitcoincashChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type BitcoincashChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type BitcoincashChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type BitcoincashChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type BitcoincashChainTestNet = { + __typename?: 'BitcoincashChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Blast = { + __typename?: 'Blast'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** Transaction object with necessary fields for risk analysis by Blowfish. */ +export type BlowfishEvmTxPayload = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + dappDomain?: InputMaybe; + data?: InputMaybe; + fromAddress: Scalars['String']; + gas?: InputMaybe; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Solana Transaction Input object for risk analysis by Blowfish. */ +export type BlowfishSolanaTxPayload = { + dappDomain?: InputMaybe; + decodeInstructions?: InputMaybe; + simulateExpired?: InputMaybe; + simulationTimeoutMs?: InputMaybe; + transactions: Array; + userAccount: Scalars['String']; +}; + +export type BridgeTokenInput = { + address: Scalars['String']; + name: Scalars['String']; +}; + +export enum CacheControlScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', +} + +export type CantoEvm = { + __typename?: 'CantoEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CantoEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CantoEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CantoEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CantoEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CantoEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Celo = { + __typename?: 'Celo'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export enum Chain { + ARBITRUM = 'ARBITRUM', + AVALANCHE = 'AVALANCHE', + BINANCE_SMART_CHAIN = 'BINANCE_SMART_CHAIN', + ETHEREUM = 'ETHEREUM', + FANTOM = 'FANTOM', + HARMONY = 'HARMONY', + OPTIMISM = 'OPTIMISM', + POLYGON = 'POLYGON', +} + +export type ChainPortfolio = { + __typename?: 'ChainPortfolio'; + chain: PortfolioChainVariant; + portfolioByAddr: Array; +}; + +export type ChainType = { + __typename?: 'ChainType'; + fee: FeeType; + name: Scalars['String']; +}; + +export type ChainedAddresses = { + addresses: Array; + chain: PortfolioChainVariant; +}; + +export type ClaimStatus = { + __typename?: 'ClaimStatus'; + amountUsd: Scalars['Float']; + bonus: Scalars['Float']; + claimId: Scalars['String']; + dateModification?: Maybe; + status: Scalars['String']; +}; + +export type CompositeTokenFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; +}; + +export type CompositeTokenResponse = { + __typename?: 'CompositeTokenResponse'; + page: AssetCompositeTokenTypeConnection; + pageData?: Maybe; +}; + +export type CompositeTokenType = { + __typename?: 'CompositeTokenType'; + address?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + protocol: DefiProtocolType; + symbol: Scalars['String']; + token?: Maybe; +}; + +/** Pagination options. Requires first or last */ +export type ConnectionArgs = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Contract = { + __typename?: 'Contract'; + info: CryptoAsset; + name: Scalars['String']; +}; + +export type CosmosBalanceChain = { + __typename?: 'CosmosBalanceChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type CosmosBalanceChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChain = { + __typename?: 'CosmosBasedChain'; + average24hFee: DefaultGasFee; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type CosmosBasedChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type CosmosBasedChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CosmosBasedChainV2 = { + __typename?: 'CosmosBasedChainV2'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosBasedChainWithNft = { + __typename?: 'CosmosBasedChainWithNft'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type CosmosFee = { + __typename?: 'CosmosFee'; + amount: Array; + payer?: Maybe; +}; + +export type CosmosLikeTransaction = { + __typename?: 'CosmosLikeTransaction'; + blockHeight: Scalars['Int']; + blockIndex?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + signers: Array; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + transfers: Array; +}; + +export type CosmosLikeTransactionConnection = { + __typename?: 'CosmosLikeTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type CosmosLikeTransactionEdge = { + __typename?: 'CosmosLikeTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: CosmosLikeTransaction; +}; + +export type CreateReferrer = { + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Unique name of the Referrer */ + name: Scalars['String']; + /** Signed by the address to verify ownership. Must be {address}:{name} and signed by the address */ + signedMessage: Scalars['String']; +}; + +export type CronosEvm = { + __typename?: 'CronosEVM'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CronosEvmActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CronosEvmBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CronosEvmLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type CronosEvmNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CronosEvmTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type CryptoAsset = { + __typename?: 'CryptoAsset'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of token (contract address in most chain) */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Unique asset identifier */ + id?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + type?: Maybe; +}; + +export type CryptoAssetArgs = { + chain: AddressChain; + contract?: InputMaybe; +}; + +export type CryptoAssetInput = { + /** Chain name */ + chain?: InputMaybe; + /** Crypto currency address */ + contract?: InputMaybe; + /** Unique asset identifier */ + id?: InputMaybe; + /** Asset image */ + image?: InputMaybe; + /** Known name that identifies token */ + name?: InputMaybe; + price?: InputMaybe; + /** The symbol that identifies token */ + symbol?: InputMaybe; +}; + +export type CryptoAssetInputV2 = { + chain?: InputMaybe; + contract?: InputMaybe; + decimals?: InputMaybe; + id?: InputMaybe; + image?: InputMaybe; + name?: InputMaybe; + price?: InputMaybe; + symbol?: InputMaybe; +}; + +export type CryptoCurrencyFilter = { + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type CryptoCurrencyResponse = { + __typename?: 'CryptoCurrencyResponse'; + page: AssetCryptoCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type CryptoCurrencyType = { + __typename?: 'CryptoCurrencyType'; + chain?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type CursorPagination = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + +export type DAppReputation = { + __typename?: 'DAppReputation'; + chains?: Maybe>; + logo?: Maybe; + name?: Maybe; + status: Scalars['String']; + url: Scalars['String']; +}; + +export type DAppReputationInput = { + url: Scalars['String']; +}; + +export type DappsType = { + __typename?: 'DappsType'; + /** icon url contract */ + iconUrl?: Maybe; + /** Address dapp name */ + name?: Maybe; + /** status (Processing/Success) - To indicate the process of fetching data or successfully retrieving data from a dapp */ + status?: Maybe; +}; + +/** Fiat amount at specific point of time (similar to `DatedAmount`) */ +export type DatedAmountFiat = { + __typename?: 'DatedAmountFiat'; + amount: AmountFiat; + date: Scalars['DateTime']; +}; + +export type DecodedTransaction = { + __typename?: 'DecodedTransaction'; + args: Array; + contract: Contract; + fname: Scalars['String']; + type: Scalars['String']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type DefaultGasFee = { + __typename?: 'DefaultGasFee'; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type DefiProtocolType = { + __typename?: 'DefiProtocolType'; + icon: ImageType; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +/** Detailed activity represent more details about transaction */ +export type DetailedActivityV0 = + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0; + +export type DogeChain = { + __typename?: 'DogeChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee: DefaultGasFee; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type DogeChainBalancesArgs = { + address: Scalars['String']; +}; + +export type DogeChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type DogeChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type DogeChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type DogeChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type DogeChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type Eip1559Fee = { + __typename?: 'EIP1559Fee'; + baseFeePerGas: Scalars['Float']; + maxFeePerGas: Scalars['Float']; + priorityFeePerGas: Scalars['Float']; +}; + +/** Fee is a cryptocurrency transaction fees that is charged to users when performing crypto transactions */ +export type Eip1559GasFee = { + __typename?: 'EIP1559GasFee'; + /** Default gasPrice field for legacy transactions */ + defaultGasPrice?: Maybe; + high?: Maybe; + low?: Maybe; + medium?: Maybe; +}; + +export type EvmTransactionLog = { + __typename?: 'EVMTransactionLog'; + data?: Maybe; + topic0?: Maybe; + topic1?: Maybe; + topic2?: Maybe; + topic3?: Maybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayload = { + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +/** Transaction object with necessary fields for simulation and classification. */ +export type EvmTransactionPayloadV2 = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type EvmTransactionV2 = { + __typename?: 'EVMTransactionV2'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee: Scalars['JSON']; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData: Scalars['String']; + logs: Array; + rawData: Scalars['String']; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + value: Scalars['String']; +}; + +export type EvmTransactionV2Connection = { + __typename?: 'EVMTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type EvmTransactionV2Edge = { + __typename?: 'EVMTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: EvmTransactionV2; +}; + +export type Ethereum = { + __typename?: 'Ethereum'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type EthereumActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type EthereumBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type EthereumLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type EthereumNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type EthereumTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type EvmFeeDetailsV0 = { + __typename?: 'EvmFeeDetailsV0'; + /** null means no information */ + gas?: Maybe; +}; + +export type EvmGasV0 = { + __typename?: 'EvmGasV0'; + /** value of base fee (only for EIP-1559; null means no data) */ + base?: Maybe; + /** max gas that could be used in the transaction before it is failed */ + limit: Scalars['IntegerString']; + /** gas price for the transaction (represented with asset unit from [`FeeV0`] struct) */ + price: Scalars['IntegerString']; + /** If there was some priority fee (only for EIP-1559; null means no data. 0 means no priority). */ + priority?: Maybe; + /** all gas used in the transaction (base + priority) */ + used: Scalars['IntegerString']; +}; + +export type ExplainedTransactionV3 = { + __typename?: 'ExplainedTransactionV3'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TransactionType; +}; + +export type ExplainedTransactionV4 = { + __typename?: 'ExplainedTransactionV4'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: TxClassifierTxType; +}; + +export type ExplainedTransactionV5 = { + __typename?: 'ExplainedTransactionV5'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + type: Scalars['String']; +}; + +export type ExplainedTxWithRiskAnalysisV1 = { + __typename?: 'ExplainedTxWithRiskAnalysisV1'; + args: Array; + confidence: Scalars['Float']; + inputAssets: Array; + outputAssets: Array; + riskAnalysis?: Maybe; + type: Scalars['String']; +}; + +export type Fantom = { + __typename?: 'Fantom'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type FantomActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type FantomBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type FantomLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type FantomNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type FantomTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Fee = { + __typename?: 'Fee'; + amount: Amount; + payer: Scalars['String']; +}; + +/** Represent possible fee details specific to chain */ +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; + +export type FeeInputType = { + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type FeeType = { + __typename?: 'FeeType'; + scalingFactor?: Maybe; + value?: Maybe; +}; + +/** Unified fee structure */ +export type FeeV0 = { + __typename?: 'FeeV0'; + /** The sum of amount paid by payers */ + amount?: Maybe; + /** The asset that was used to pay the fee */ + asset?: Maybe; + /** Additional details about fee specific per (group of) chain(s) */ + details?: Maybe; + /** Who paid the fee */ + payer?: Maybe>; +}; + +/** Group all fees for a given transaction */ +export type FeesV0 = { + __typename?: 'FeesV0'; + fees: Array; +}; + +/** Unable to fetch some or all tokens information */ +export type FetchingError = { + __typename?: 'FetchingError'; + /** General error without with hidden details (for user) */ + error: Scalars['String']; +}; + +export type FiatCurrencyFilter = { + ids?: InputMaybe>; +}; + +export type FiatCurrencyResponse = { + __typename?: 'FiatCurrencyResponse'; + page: AssetFiatCurrencyTypeConnection; + pageData?: Maybe; +}; + +export type FiatCurrencyType = { + __typename?: 'FiatCurrencyType'; + icon?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + price?: Maybe; + /** @deprecated Use scalingFactor of price field */ + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export enum FiatGranularity { + DAY = 'DAY', + FIVE_MINUTE = 'FIVE_MINUTE', + HOUR = 'HOUR', +} + +export type FilterArgs = { + chain?: InputMaybe; + pool?: InputMaybe; +}; + +export type FloorPrice = { + __typename?: 'FloorPrice'; + marketplaceId: Scalars['String']; + paymentToken: PaymentToken; + value?: Maybe; + valueUsdCents?: Maybe; +}; + +/** Represents funds deposit action from user to gas tank with specified amount and asset */ +export type GasTankDepositActivityV0 = { + __typename?: 'GasTankDepositActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +/** Represents funds withdrawal action from gas tank to user with specified amount and asset */ +export type GasTankWithdrawActivityV0 = { + __typename?: 'GasTankWithdrawActivityV0'; + /** amount of asset used in gas tank action */ + amount: Scalars['IntegerString']; + /** asset used in gas tank action */ + asset: AssetV0; +}; + +export type GetTokensArgs = { + address?: InputMaybe>; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type Gnosis = { + __typename?: 'Gnosis'; + average24hFee?: Maybe; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; +}; + +export type GnosisLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ImageType = { + __typename?: 'ImageType'; + data: Scalars['String']; + format: Scalars['String']; +}; + +export type Input = { + __typename?: 'Input'; + address: Scalars['String']; + amount: Amount; +}; + +export type InvestingType = { + __typename?: 'InvestingType'; + pools: Array; +}; + +export type InvestingTypePoolsArgs = { + filter?: InputMaybe; +}; + +export type JunoChain = { + __typename?: 'JunoChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type JunoChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type JunoChainNftsArgs = { + address: Scalars['String']; +}; + +export type JunoChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Klaytn = { + __typename?: 'Klaytn'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LastBlock = { + __typename?: 'LastBlock'; + hash: Scalars['String']; + height: Scalars['Int']; + nodeName: Scalars['String']; + prevHash: Scalars['String']; + time: Scalars['DateTime']; + txCount: Scalars['Int']; +}; + +export type Leaderboard = { + __typename?: 'Leaderboard'; + /** CCTP leaderboard details */ + cctp?: Maybe>; +}; + +export type LeaderboardEntry = { + __typename?: 'LeaderboardEntry'; + /** EVM address of the user */ + evmAddress: Scalars['String']; + /** Volume that was swapped by the address */ + volumeUsd: Scalars['Decimal']; +}; + +export type Linea = { + __typename?: 'Linea'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type LitecoinChain = { + __typename?: 'LitecoinChain'; + average24hFee?: Maybe; + balances: Array; + broadcastTransaction: Scalars['String']; + fee?: Maybe; + getTransactionByHashV5: UtxotransactionByHashV5; + name: Scalars['String']; + status: Statusv2; + /** @deprecated Use `transactions_v2` instead. */ + transactions: Array; + transactionsV2: Array; + transactionsV3: UtxoTransactionV2Connection; + /** @deprecated Use `unspent_tx_outputs_v5` instead. This endpoint will be removed after 31.12.2023 */ + unspentTxOutputs: Array; + unspentTxOutputsV5: Array; +}; + +export type LitecoinChainBalancesArgs = { + address: Scalars['String']; +}; + +export type LitecoinChainBroadcastTransactionArgs = { + rawHex: Scalars['String']; +}; + +export type LitecoinChainGetTransactionByHashV5Args = { + txHash: Scalars['String']; +}; + +export type LitecoinChainTransactionsArgs = { + address: Scalars['String']; + blockRange?: OptBlockRange; + dateRange?: OptDateRange; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV2Args = { + address: Scalars['String']; + pageNumber: Scalars['Int']; + pageSize: Scalars['Int']; +}; + +export type LitecoinChainTransactionsV3Args = { + address: Scalars['String']; + after?: InputMaybe; + first: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsArgs = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainUnspentTxOutputsV5Args = { + address: Scalars['String']; + page: Scalars['Int']; +}; + +export type LitecoinChainTestNet = { + __typename?: 'LitecoinChainTestNet'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Manta = { + __typename?: 'Manta'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Mantle = { + __typename?: 'Mantle'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type Marketplace = { + __typename?: 'Marketplace'; + collectionUrl: Scalars['String']; + logoUrl?: Maybe; + marketplaceCollectionId: Scalars['String']; + marketplaceId: Scalars['String']; + marketplaceName: Scalars['String']; + nftUrl: Scalars['String']; + verified?: Maybe; +}; + +export type MayaChain = { + __typename?: 'MayaChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type MayaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MayaChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type MayaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +/** Transactions fee management for MAYA chain. */ +export type MayaChainFee = { + __typename?: 'MayaChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of cacao to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in cacao */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new MAYAName, in cacao */ + tnsRegisterFee?: Maybe; +}; + +export type MediaV2 = { + __typename?: 'MediaV2'; + /** contains blurhash value of the media (if media type supports it) */ + blurHash?: Maybe; + /** + * represents actual content type by peeking into content referenced by media URL + * format as described in: + * i.e. image/png if url points to PNG image + */ + contentType?: Maybe; + /** + * "type" field describes "source" of media URL from metadata.json + * if URL is taken from "image" or "image_url" fields - type will have image value + * if URL is taken from "animated_url" field - type will be animated + */ + type: Scalars['String']; + url: Scalars['String']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; +}; + +export type MutationCreateReferrerArgs = { + referrer: CreateReferrer; +}; + +export type MutationTransactionHashV2Args = { + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + +export type MutationTransactionsArgs = { + routeData: RouteTransactionInputType; +}; + +export type MutationTransactionsV2Args = { + routeData: RouteInputTypeV2; +}; + +export type MutationTransactonHashArgs = { + routeId: Scalars['String']; + signedHash: Scalars['String']; + tradeId: Scalars['Float']; +}; + +export type MutationUpsertReferrerArgs = { + address: Scalars['String']; + feeTier: Scalars['String']; + id?: InputMaybe; + name: Scalars['String']; +}; + +/** attributes data from opensea spec */ +export type NftAttribute = { + __typename?: 'NFTAttribute'; + displayType?: Maybe; + traitType: Scalars['String']; + value: Scalars['JSON']; +}; + +export type NftCollectionV2 = { + __typename?: 'NFTCollectionV2'; + address: Scalars['String']; + media?: Maybe; + name: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NftCollectionV3 = { + __typename?: 'NFTCollectionV3'; + address: Scalars['String']; + collectionItemsAmount?: Maybe; + collectionItemsOwnersAmount?: Maybe; + floorPrices?: Maybe>; + marketplaces?: Maybe>; + media?: Maybe; + name?: Maybe; + symbol: Scalars['String']; +}; + +export type NftLastSale = { + __typename?: 'NFTLastSale'; + cryptoPrice: Amount; + fiatPrice: Amount; + quantity: Amount; +}; + +export type NftLastSaleV2 = { + __typename?: 'NFTLastSaleV2'; + cryptoPrice?: Maybe; + fiatPrice?: Maybe; + quantity: Amount; +}; + +/** NFT for a given chain, contract and token_id */ +export type NfTv0 = { + __typename?: 'NFTv0'; + attributes?: Maybe>; + chain?: Maybe; + collection?: Maybe; + /** Crypto currency address on specific chain */ + contract?: Maybe; + contractType?: Maybe; + description?: Maybe; + isNftSpam?: Maybe; + lastSale?: Maybe; + location?: Maybe; + media?: Maybe>; + name?: Maybe; + spamScore?: Maybe; + symbol?: Maybe; + tokenId?: Maybe; +}; + +export type NfTv0Args = { + chain?: InputMaybe; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type NfTv2 = { + __typename?: 'NFTv2'; + attributes: Array; + balance: Amount; + collection?: Maybe; + description?: Maybe; + id: Scalars['ID']; + lastSale?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + symbol: Scalars['String']; +}; + +export type NfTv3 = { + __typename?: 'NFTv3'; + attributes: Array; + balance: Amount; + /** @deprecated NFTCollectionV2 is deprecated. Please move to the NFTCollectionV3 */ + collection?: Maybe; + collectionV3?: Maybe; + contractType?: Maybe; + description?: Maybe; + id: Scalars['ID']; + isNftSpam: Scalars['Boolean']; + lastSale?: Maybe; + location?: Maybe; + media: Array; + name: Scalars['String']; + owner: Scalars['String']; + spamScore?: Maybe; + symbol: Scalars['String']; +}; + +export type NearChain = { + __typename?: 'NearChain'; + average24hFee?: Maybe; + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: NearTransactionConnection; + version: Array; +}; + +export type NearChainBalancesArgs = { + address: Scalars['String']; +}; + +export type NearChainNftsArgs = { + address: Scalars['String']; +}; + +export type NearChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type NearTransaction = { + __typename?: 'NearTransaction'; + blockIndex: Scalars['Int']; + blockNumber: Scalars['Int']; + fee?: Maybe; + fromAddress: Scalars['String']; + hash: Scalars['String']; + inputData?: Maybe; + logs?: Maybe; + raw?: Maybe; + status: Scalars['String']; + timestamp: Scalars['DateTime']; + toAddress: Scalars['String']; + transfers: Array; + type: Scalars['String']; +}; + +export type NearTransactionConnection = { + __typename?: 'NearTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type NearTransactionEdge = { + __typename?: 'NearTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: NearTransaction; +}; + +export type NftAsset = { + __typename?: 'NftAsset'; + /** supported list of chain are in [`crate::chain::Chain`] enum */ + chain?: Maybe; + /** ID of contract (contract address in most chain) */ + contract?: Maybe; + /** Details of the NFT */ + nft?: Maybe; + /** ID of the token. */ + tokenId: Scalars['String']; +}; + +export enum NftChainType { + Arbitrum = 'Arbitrum', + Avalanche = 'Avalanche', + Base = 'Base', + BinanceSmartChain = 'BinanceSmartChain', + Bitcoin = 'Bitcoin', + Ethereum = 'Ethereum', + Gnosis = 'Gnosis', + Optimism = 'Optimism', + Polygon = 'Polygon', + Solana = 'Solana', +} + +/** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ +export type OffchainReceiveAssetActivityV0 = { + __typename?: 'OffchainReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +/** Send off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle proof) */ +export type OffchainSendAssetActivityV0 = { + __typename?: 'OffchainSendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +export type OpBnb = { + __typename?: 'OpBNB'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +/** A both end inclusive range selector for block */ +export type OptBlockRange = { + /** The lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptBlockSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +/** A both end inclusive range selector for date */ +export type OptDateRange = { + /** The optional lower bound of the range (inclusive). */ + from?: InputMaybe; + /** The optional upper bound of the range (inclusive). */ + to?: InputMaybe; +}; + +export type OptDateSelector = { + from?: InputMaybe; + to?: InputMaybe; +}; + +export type Optimism = { + __typename?: 'Optimism'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OptimismActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OptimismBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OptimismLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type OptimismNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OptimismTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Output = { + __typename?: 'Output'; + address: Scalars['String']; + amount: Amount; +}; + +export type PageDataType = { + __typename?: 'PageDataType'; + count: Scalars['Float']; + limit: Scalars['Float']; + offset: Scalars['Float']; +}; + +/** Information about pagination in a connection */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export type PaymentToken = { + __typename?: 'PaymentToken'; + address?: Maybe; + decimals?: Maybe; + name?: Maybe; + paymentTokenId: Scalars['String']; + symbol?: Maybe; +}; + +export type PickObjectType = { + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Known name that identifies token */ + name?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +export type Polygon = { + __typename?: 'Polygon'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type PolygonActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type PolygonBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type PolygonLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type PolygonNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type PolygonTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export enum Pool { + Aave = 'Aave', + Benqi = 'Benqi', + Bitswap = 'Bitswap', + IronBank = 'IronBank', +} + +export type PoolType = { + __typename?: 'PoolType'; + address: Scalars['String']; + borrowApr: Scalars['String']; + borrowApy: Scalars['String']; + borrowCap: Scalars['String']; + borrowRate: Scalars['String']; + chain: Chain; + exchangeRate: Scalars['String']; + name: Scalars['String']; + pool: Pool; + reserves: Scalars['String']; + supplyApr: Scalars['String']; + supplyApy: Scalars['String']; + supplyCap: Scalars['String']; + supplyRate: Scalars['String']; + totalBorrows: Scalars['String']; + totalSupply: Scalars['String']; +}; + +/** (experimental) Represent Pool */ +export type PoolV0 = { + __typename?: 'PoolV0'; + /** Pool ID */ + id?: Maybe; + /** Pool type for example "GAMM" */ + type?: Maybe; +}; + +export enum PortfolioChainVariant { + Akash = 'Akash', + Arbitrum = 'Arbitrum', + AssetMantle = 'AssetMantle', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + BinanceChain = 'BinanceChain', + BinanceSmartChain = 'BinanceSmartChain', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + Cudos = 'Cudos', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + Emoney = 'Emoney', + Ethereum = 'Ethereum', + Evmos = 'Evmos', + Fantom = 'Fantom', + Gnosis = 'Gnosis', + Harmony = 'Harmony', + Injective = 'Injective', + Iris = 'Iris', + JUNO = 'JUNO', + Kava = 'Kava', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Litecoin = 'Litecoin', + Lum = 'Lum', + MarsProtocol = 'MarsProtocol', + Near = 'Near', + Neutron = 'Neutron', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Persistence = 'Persistence', + Polygon = 'Polygon', + Provenance = 'Provenance', + Regen = 'Regen', + Rizon = 'Rizon', + Secret = 'Secret', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Sifchain = 'Sifchain', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stargaze = 'Stargaze', + Starname = 'Starname', + Stride = 'Stride', + THORChain = 'THORChain', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', +} + +export type PostRouteTypeV2 = { + __typename?: 'PostRouteTypeV2'; + routeId: Scalars['String']; +}; + +/** Price history interval */ +export enum PriceHistoryInterval { + day = 'day', + month = 'month', + week = 'week', + year = 'year', +} + +/** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ +export type PriceHistoryType = { + __typename?: 'PriceHistoryType'; + /** History metrics of asset for last day */ + day?: Maybe; + /** History metrics of asset for last month */ + month?: Maybe; + /** History metrics of asset for last week */ + week?: Maybe; + /** History metrics of asset for last year */ + year?: Maybe; +}; + +export type PriceInputV2 = { + amount?: Scalars['String']; + scalingFactor?: Scalars['Int']; +}; + +export type ProviderHealth = { + __typename?: 'ProviderHealth'; + error?: Maybe; + isFine: Scalars['Boolean']; +}; + +export type ProviderInputType = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderInputTypeV2 = { + icon?: InputMaybe; + id: Scalars['String']; + name?: InputMaybe; + time?: InputMaybe; +}; + +export type ProviderType = { + __typename?: 'ProviderType'; + icon?: Maybe; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type ProviderTypeV2 = { + __typename?: 'ProviderTypeV2'; + icon: Scalars['String']; + id: Scalars['String']; + name: Scalars['String']; + time: Scalars['String']; +}; + +export type Query = { + __typename?: 'Query'; + akash: CosmosBasedChain; + arbitrum: Arbitrum; + assets: AssetType; + aurora: Aurora; + avalanche: Avalanche; + axelar: CosmosBasedChain; + base: Base; + beam: Beam; + binance: Binance; + binanceSmartChain: BinanceSmartChain; + bitcoin: BitcoinChain; + bitcoinTestnet: BitcoinChainTestNet; + bitcoincash: BitcoincashChain; + bitcoincashTestnet: BitcoincashChainTestNet; + blast: Blast; + cantoEVM: CantoEvm; + celo: Celo; + chains: Array; + /** Fetch composite tokens */ + compositeTokens: Array; + cosmos: CosmosBasedChain; + cosmoshub: CosmosBasedChain; + crescent: CosmosBasedChain; + /** @deprecated Use cronos_pos instead */ + cronos: CosmosBasedChain; + cronosEVM: CronosEvm; + /** Cronos POS */ + cronosPos: CosmosBasedChain; + /** Fetch list of all available tokens */ + cryptoCurrencies: Array; + dapp: DAppReputation; + dogecoin: DogeChain; + ethereum: Ethereum; + fantom: Fantom; + /** Fetch list of fiat currencies */ + fiatCurrencies: Array; + gnosis: Gnosis; + injective: CosmosBasedChain; + investing: InvestingType; + juno: JunoChain; + kava: CosmosBasedChain; + klaytn: Klaytn; + kujira: CosmosBasedChain; + linea: Linea; + litecoin: LitecoinChain; + litecoinTestnet: LitecoinChainTestNet; + manta: Manta; + mantle: Mantle; + mars: CosmosBasedChain; + mayachain: MayaChain; + near: NearChain; + opBNB: OpBnb; + optimism: Optimism; + osmosis: CosmosBasedChain; + polygon: Polygon; + portfolio: Array; + quasar: CosmosBasedChain; + reputation: Reputation; + reputationV2: ReputationV2; + routing: RoutingType; + routingV2?: Maybe; + sei: CosmosBalanceChain; + solana: SolanaChain; + stargaze: StargazeChain; + stride: CosmosBasedChain; + /** Terra2 */ + terra: TerraChain; + /** Terra1 */ + terraClassic: TerraChain; + thorchain: ThorChain; + /** Fetch list of all available tokens */ + tokens: Array; + trackWalletConnect?: Maybe; + tron: Tron; + txClassifier: TxClassifier; + /** Fetch wallet information */ + walletInfo: WalletInfo; + zetachain: ZetaChain; + zkSync: ZkSync; +}; + +export type QueryChainsArgs = { + filter?: InputMaybe; +}; + +export type QueryCompositeTokensArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryCryptoCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; + symbols?: InputMaybe>; +}; + +export type QueryDappArgs = { + app: DAppReputationInput; +}; + +export type QueryFiatCurrenciesArgs = { + after?: InputMaybe; + ids?: InputMaybe>; +}; + +export type QueryPortfolioArgs = { + timePeriod: TimePeriod; + wallets: Array; +}; + +export type QueryReputationArgs = { + address: Scalars['String']; + approved?: InputMaybe; + first?: Scalars['Int']; + offest?: Scalars['Int']; +}; + +export type QueryReputationV2Args = { + address: Scalars['String']; + approved?: InputMaybe; + chain: ReputationChains; + cursor?: InputMaybe; + first?: Scalars['Int']; +}; + +export type QueryTokensArgs = { + after?: InputMaybe; + filter?: InputMaybe; +}; + +export type QueryTrackWalletConnectArgs = { + walletAddress: Scalars['String']; + walletProvider: Scalars['String']; +}; + +export type QueryWalletInfoArgs = { + address: Scalars['String']; +}; + +/** Receive asset activity with mint detection, valid with wallet context */ +export type ReceiveAssetActivityV0 = { + __typename?: 'ReceiveAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** + * Represent wallet address that send the asset + * If empty then this is mint activity (NOTE: if `from` contains address this still can be mint activity) + */ + from?: Maybe>; + /** If true then this Receive was mint activity (if `from` is present then address is mint address) */ + mint?: Maybe; +}; + +export type ReferralBonus = { + __typename?: 'ReferralBonus'; + bonus?: Maybe; +}; + +export type ReferralFeeSummary = { + __typename?: 'ReferralFeeSummary'; + bonusArbEarned: Scalars['Decimal']; + claimHistory: Array; + claimableFees: Scalars['Decimal']; + feeTier: Scalars['Decimal']; + last7dFees: Scalars['Decimal']; + last30dFees: Scalars['Decimal']; + lifetimeFees: Scalars['Decimal']; + referrerId: Scalars['String']; + totalAssociatedAddresses: Scalars['Int']; + totalReferralVolume: Scalars['Decimal']; + url: Scalars['String']; + userType: Scalars['String']; +}; + +export type ReferralInputType = { + link?: InputMaybe; + medium?: InputMaybe; +}; + +export type ReferralType = { + __typename?: 'ReferralType'; + link?: Maybe; + medium?: Maybe; +}; + +export type Referrer = { + __typename?: 'Referrer'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type ReferrerWithFees = { + __typename?: 'ReferrerWithFees'; + /** On chain wallet address of the referrer. Must be unique */ + address: Scalars['String']; + /** Fees that the referrer already claimed from XDEFI */ + collectedFees?: Maybe; + /** Fee tier of the referrer. Must be between [0, 1] */ + feeTier: Scalars['String']; + /** Total fees generated by the referrer for XDEFI */ + generatedFees?: Maybe; + id: Scalars['String']; + link?: Maybe; + /** Name of the Referrer. Must be unique */ + name: Scalars['String']; +}; + +export type RefuelInfoType = { + __typename?: 'RefuelInfoType'; + destChain: Scalars['String']; + maxAmount: Scalars['Decimal']; + minAmount: Scalars['Decimal']; + srcChain: Scalars['String']; +}; + +export type Reputation = { + __typename?: 'Reputation'; + comments: Array; + commentsLimit: Scalars['Int']; + commentsOffset: Scalars['Int']; + commentsTotal: Scalars['Int']; + location: Scalars['String']; +}; + +export enum ReputationChains { + Akash = 'Akash', + Algorand = 'Algorand', + Arbitrum = 'Arbitrum', + Archway = 'Archway', + ArchwayTestnet = 'ArchwayTestnet', + AssetMantle = 'AssetMantle', + Astar = 'Astar', + Aurora = 'Aurora', + Avalanche = 'Avalanche', + Axelar = 'Axelar', + Band = 'Band', + Base = 'Base', + BerachainTestnet = 'BerachainTestnet', + BinanceChain = 'BinanceChain', + BinanceChainTestnet = 'BinanceChainTestnet', + BinanceSmartChain = 'BinanceSmartChain', + BinanceSmartChainTestnet = 'BinanceSmartChainTestnet', + Bitcanna = 'Bitcanna', + Bitcoin = 'Bitcoin', + BitcoinCash = 'BitcoinCash', + BitcoinCashTestnet = 'BitcoinCashTestnet', + BitcoinTestnet = 'BitcoinTestnet', + Bitsong = 'Bitsong', + Canto = 'Canto', + CantoEVM = 'CantoEVM', + Cardano = 'Cardano', + Celo = 'Celo', + Cerberus = 'Cerberus', + Chihuahua = 'Chihuahua', + Comdex = 'Comdex', + Cosmos = 'Cosmos', + Crescent = 'Crescent', + Cronos = 'Cronos', + CronosEVM = 'CronosEVM', + CronosPOS = 'CronosPOS', + Cudos = 'Cudos', + Defikingdoms = 'Defikingdoms', + Dep = 'Dep', + Desmos = 'Desmos', + Dogecoin = 'Dogecoin', + DogecoinTestnet = 'DogecoinTestnet', + ETHW = 'ETHW', + Emoney = 'Emoney', + Eos = 'Eos', + Ethereum = 'Ethereum', + Everscale = 'Everscale', + Evmos = 'Evmos', + FONSmartChain = 'FONSmartChain', + Fantom = 'Fantom', + FetchAI = 'FetchAI', + Flow = 'Flow', + Fuse = 'Fuse', + Gnosis = 'Gnosis', + GravityBridge = 'GravityBridge', + Harmony = 'Harmony', + Heco = 'Heco', + Hedera = 'Hedera', + Hive = 'Hive', + HuobiECOChain = 'HuobiECOChain', + Immutablex = 'Immutablex', + Injective = 'Injective', + Iotex = 'Iotex', + Iris = 'Iris', + Ixo = 'Ixo', + JUNO = 'JUNO', + Kardiachain = 'Kardiachain', + Kava = 'Kava', + Kcc = 'Kcc', + KiChain = 'KiChain', + Klaytn = 'Klaytn', + Konstellation = 'Konstellation', + Kujira = 'Kujira', + LikeCoin = 'LikeCoin', + Linea = 'Linea', + Litecoin = 'Litecoin', + LitecoinTestnet = 'LitecoinTestnet', + Lum = 'Lum', + MAYAChain = 'MAYAChain', + MarsProtocol = 'MarsProtocol', + Medibloc = 'Medibloc', + Mooi = 'Mooi', + Moonbeam = 'Moonbeam', + Moonriver = 'Moonriver', + Mumbai = 'Mumbai', + Near = 'Near', + Neo = 'Neo', + Neutron = 'Neutron', + Noble = 'Noble', + OKExChain = 'OKExChain', + Oasis = 'Oasis', + Oec = 'Oec', + Ontology = 'Ontology', + Optimism = 'Optimism', + Osmosis = 'Osmosis', + Other = 'Other', + Persistence = 'Persistence', + Platon = 'Platon', + Polygon = 'Polygon', + Provenance = 'Provenance', + Quasar = 'Quasar', + Rangers = 'Rangers', + Regen = 'Regen', + Rizon = 'Rizon', + Ronin = 'Ronin', + Ropsten = 'Ropsten', + Rsk = 'Rsk', + Scroll = 'Scroll', + Secret = 'Secret', + Sei = 'Sei', + SeiTestnet = 'SeiTestnet', + Sentinel = 'Sentinel', + Shentu = 'Shentu', + Shiden = 'Shiden', + Sifchain = 'Sifchain', + Skale = 'Skale', + Solana = 'Solana', + Sommelier = 'Sommelier', + Stacks = 'Stacks', + Stargaze = 'Stargaze', + Starname = 'Starname', + Steem = 'Steem', + Stride = 'Stride', + Sxnetwork = 'Sxnetwork', + THORChain = 'THORChain', + THORChainTestnet = 'THORChainTestnet', + Telos = 'Telos', + Telosevm = 'Telosevm', + Terra = 'Terra', + TerraClassic = 'TerraClassic', + Tezos = 'Tezos', + Theta = 'Theta', + Thundercore = 'Thundercore', + TomoChain = 'TomoChain', + Tron = 'Tron', + Umee = 'Umee', + Vechain = 'Vechain', + Vulcanforged = 'Vulcanforged', + Wax = 'Wax', + Zilliqa = 'Zilliqa', + opBNB = 'opBNB', + xDAI = 'xDAI', + zkSync = 'zkSync', +} + +export type ReputationComment = { + __typename?: 'ReputationComment'; + approved: Scalars['Boolean']; + commentId: Scalars['Int']; + date: Scalars['DateTime']; + source: Scalars['String']; + text: Scalars['String']; +}; + +export type ReputationCommentNode = { + __typename?: 'ReputationCommentNode'; + cursor: Scalars['String']; + node: ReputationComment; +}; + +export type ReputationV2 = { + __typename?: 'ReputationV2'; + address: Scalars['String']; + chain: ReputationChains; + comments: Array; + pageInfo: PageInfo; +}; + +export type RewardInputType = { + amount?: Scalars['Decimal']; + amountUsd?: Scalars['Decimal']; + asset: RoutingTokenInputTypeV2; +}; + +export type RewardType = { + __typename?: 'RewardType'; + amount: Scalars['Decimal']; + amountUsd: Scalars['Decimal']; + asset: RoutingTokenTypeV2; +}; + +export type RouteInputTypeV2 = { + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + feeTier?: InputMaybe; + gasPrices?: InputMaybe; + isOptIn?: InputMaybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RouteTradeInputType = { + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenInputType; + assetOut: RoutingTokenInputType; + fee: FeeInputType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderInputType; + tradeType: Scalars['String']; +}; + +export type RouteTradeType = { + __typename?: 'RouteTradeType'; + amountIn: Scalars['Float']; + amountOut: Scalars['Float']; + assetIn: RoutingTokenType; + assetOut: RoutingTokenType; + fee: RoutingFeeType; + minAmountReceived: Scalars['Float']; + priceRateUsdAssetIn: Scalars['Float']; + priceRateUsdAssetOut: Scalars['Float']; + provider: ProviderType; + tradeType: Scalars['String']; +}; + +export type RouteTradeTypeV2 = { + __typename?: 'RouteTradeTypeV2'; + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenTypeV2; + assetOut: RoutingTokenTypeV2; + fee: RoutingFeeTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderTypeV2; + referral?: Maybe; + reward?: Maybe; + tradeType: Scalars['String']; +}; + +export type RouteTransactionInputType = { + addresses: Array; + amountIn?: InputMaybe; + approvalInfiniteFlag?: InputMaybe; + destAddress: Scalars['String']; + errorBuildingRoute?: InputMaybe; + gasPrices?: InputMaybe; + priceImpact?: InputMaybe; + priceRate: Scalars['Float']; + priceRateText?: InputMaybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTransactionStatus = { + __typename?: 'RouteTransactionStatus'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionStatusV2 = { + __typename?: 'RouteTransactionStatusV2'; + status?: Maybe; + txHash?: Maybe; +}; + +export type RouteTransactionTradeType = { + __typename?: 'RouteTransactionTradeType'; + routeId: Scalars['String']; + status: RouteTransactionStatus; + tradeRoute: RouteTradeType; + transaction?: Maybe; +}; + +export type RouteTransactionTradeTypeV2 = { + __typename?: 'RouteTransactionTradeTypeV2'; + routeId: Scalars['String']; + status: RouteTransactionStatusV2; + tradeId: Scalars['String']; + tradeRoute: RouteTradeTypeV2; + transaction?: Maybe; +}; + +export type RouteTransactionType = { + __typename?: 'RouteTransactionType'; + amount?: Maybe; + chain?: Maybe; + data?: Maybe; + feeRate?: Maybe; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + tradeId?: Maybe; + txType?: Maybe; + unsignedStdTx?: Maybe; +}; + +export type RouteTransactionTypeV2 = { + __typename?: 'RouteTransactionTypeV2'; + actions?: Maybe; + amount: Scalars['Decimal']; + chain: Scalars['String']; + data?: Maybe; + feeRate: Scalars['String']; + gasLimit?: Maybe; + gasPrice?: Maybe; + memo?: Maybe; + receiverId?: Maybe; + recipient?: Maybe; + routeId?: Maybe; + signerId?: Maybe; + tradeId: Scalars['String']; + txType: Scalars['String']; + unsignedStdTx?: Maybe; +}; + +export type RouteType = { + __typename?: 'RouteType'; + addresses: Array; + amountIn?: Maybe; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + gasPrices?: Maybe; + priceImpact?: Maybe; + priceRate: Scalars['Float']; + priceRateText?: Maybe; + slippage: Scalars['Float']; + tradesRoute: Array; +}; + +export type RouteTypeV2 = { + __typename?: 'RouteTypeV2'; + addresses: Array; + amountIn: Scalars['Decimal']; + approvalInfiniteFlag?: Maybe; + destAddress: Scalars['String']; + errorBuildingRoute?: Maybe; + /** Fee tier that the wallet requesting the quote has. Fee tier are defined by the number XDEFI & vXDEFI tokens held by the wallet. The more tokens the wallet has, the lower the fee tier */ + feeTier: Scalars['Int']; + gasPrices?: Maybe; + /** + * On chain wallet address of the referrer. Must be unique + * @deprecated Not necessary anymore, now this data is stored in the Campaigns service + */ + isOptIn?: Maybe; + priceImpact: Scalars['String']; + priceRate: Scalars['Decimal']; + priceRateText: Scalars['String']; + slippage: Scalars['Decimal']; + tradesRoute: Array; +}; + +export type RoutingChainType = { + __typename?: 'RoutingChainType'; + name: Scalars['String']; + tokens: Array; +}; + +export type RoutingChainTypeTokensArgs = { + addresses?: InputMaybe>; + srcToken?: InputMaybe; +}; + +export type RoutingChainTypeV2 = { + __typename?: 'RoutingChainTypeV2'; + name: Scalars['String']; + tokens: Array>; +}; + +export type RoutingFeeInputTypeV2 = { + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Scalars['Decimal']; + xdefiSwapFeeDollar?: Scalars['Decimal']; +}; + +export type RoutingFeeType = { + __typename?: 'RoutingFeeType'; + feeRateTransaction: Scalars['Float']; + inboundFeeAsset: Scalars['Float']; + inboundFeeDollar: Scalars['Float']; + networkFeeAsset: Scalars['Float']; + networkFeeDollar: Scalars['Float']; + swapFee: Scalars['Float']; +}; + +export type RoutingFeeTypeV2 = { + __typename?: 'RoutingFeeTypeV2'; + feeRateTransaction: Scalars['Decimal']; + inboundFeeAsset: Scalars['Decimal']; + inboundFeeDollar: Scalars['Decimal']; + networkFeeAsset: Scalars['Decimal']; + networkFeeDollar: Scalars['Decimal']; + swapFee: Scalars['Decimal']; + xdefiSwapFee?: Maybe; + xdefiSwapFeeDollar?: Maybe; +}; + +export type RoutingTokenInputType = { + asset?: InputMaybe; + id: Scalars['ID']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenInputTypeV2 = { + asset?: InputMaybe; + id: Scalars['String']; + listProviders?: InputMaybe>; +}; + +export type RoutingTokenType = { + __typename?: 'RoutingTokenType'; + asset?: Maybe; + id: Scalars['ID']; + listProviders?: Maybe>; +}; + +export type RoutingTokenTypeV2 = { + __typename?: 'RoutingTokenTypeV2'; + asset: CryptoAsset; + id: Scalars['String']; + /** Cryptocurrencies that are newly added and volatile, pulled in from a fetcher that identifies new trending tokens from GeckoTerminal */ + isHotNewToken: Scalars['Boolean']; + listProviders: Array; +}; + +export type RoutingType = { + __typename?: 'RoutingType'; + chain?: Maybe; + chains: Array; + route?: Maybe; + token?: Maybe; + tokens?: Maybe>; + trades?: Maybe>; +}; + +export type RoutingTypeChainArgs = { + name: Scalars['String']; +}; + +export type RoutingTypeRouteArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeTokenArgs = { + id: Scalars['String']; +}; + +export type RoutingTypeTokensArgs = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeTradesArgs = { + routeId: Scalars['String']; +}; + +export type RoutingTypeV2 = { + __typename?: 'RoutingTypeV2'; + addressCheckV2: AddressRouteCheckTypeV2; + allReferrers?: Maybe>; + bridgeableTokens: Array; + chainV2: RoutingChainTypeV2; + chainsV2: Array; + dailyVolume?: Maybe>; + getArbGauge: ReferralBonus; + /** Checks if the Asset(chain=chain_name, address=address) is available for the routes. */ + isAssetSwappable: Scalars['Boolean']; + leaderboard: Leaderboard; + referrerSummary: ReferralFeeSummary; + refuel: RouteTypeV2; + refuelInfo: RefuelInfoType; + routeV2: RouteTypeV2; + tokenV2: RoutingTokenTypeV2; + tokensV2: Array; + tradeV2: RouteTransactionTradeTypeV2; + tradesV2: Array; +}; + +export type RoutingTypeV2AddressCheckV2Args = { + address: AddressRouteInputTypeV2; +}; + +export type RoutingTypeV2BridgeableTokensArgs = { + bridgeToken?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type RoutingTypeV2ChainV2Args = { + name: Scalars['String']; +}; + +export type RoutingTypeV2DailyVolumeArgs = { + startDate?: Scalars['String']; +}; + +export type RoutingTypeV2IsAssetSwappableArgs = { + address: Scalars['String']; + chainName: Scalars['String']; +}; + +export type RoutingTypeV2RefuelArgs = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + referral?: InputMaybe; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2RefuelInfoArgs = { + destChain: Scalars['String']; + srcChain: Scalars['String']; +}; + +export type RoutingTypeV2RouteV2Args = { + addresses: Array; + amountSource?: InputMaybe; + destAddress: Scalars['String']; + destToken: Scalars['String']; + infiniteApproval?: InputMaybe; + isLedgerLive?: InputMaybe; + isOptedIn?: InputMaybe; + referral?: InputMaybe; + slippage: Scalars['String']; + srcToken: Scalars['String']; +}; + +export type RoutingTypeV2TokenV2Args = { + id: Scalars['String']; +}; + +export type RoutingTypeV2TokensV2Args = { + names?: InputMaybe>; + tokenIds?: InputMaybe>; +}; + +export type RoutingTypeV2TradeV2Args = { + tradeId: Scalars['String']; +}; + +export type RoutingTypeV2TradesV2Args = { + routeId: Scalars['String']; +}; + +export type SearchFilter = { + name?: InputMaybe; + symbol?: InputMaybe; +}; + +export type SearchResponse = { + __typename?: 'SearchResponse'; + page: SearchTypeConnection; + pageData?: Maybe; +}; + +export type SearchType = AssetBaseType & { + __typename?: 'SearchType'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + /** Only for "CRYPTOCURRENCY" type */ + chain?: Maybe; + /** For "TOKEN" and "LP_TOKEN" types */ + contracts?: Maybe>; + /** Additional info about asset: description, social and tech links, etc. */ + externalData?: Maybe; + /** Icon URL */ + icon?: Maybe; + /** Unique identifier in the database */ + id: Scalars['ID']; + /** Market capitalization is total value of a publicly traded company's outstanding common shares owned by stockholders */ + marketCap?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + priceHistory: PriceHistoryType; + /** Only for "CRYPTOCURRENCY" type */ + scalingFactor?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type SearchTypeConnection = { + __typename?: 'SearchTypeConnection'; + edges?: Maybe>; + pageInfo?: Maybe; +}; + +export type SearchTypeEdge = { + __typename?: 'SearchTypeEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export type SearchTypePageInfo = { + __typename?: 'SearchTypePageInfo'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean']; + startCursor?: Maybe; +}; + +/** Send asset activity with burn detection, valid with wallet context */ +export type SendAssetActivityV0 = { + __typename?: 'SendAssetActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** If true then this Send was burn activity (if `to` is present then address is burn address) */ + burn?: Maybe; + /** + * Represent wallet address that receive the asset + * If empty then this is burn activity (NOTE: if `to` contains address this still can be burn activity for example eth burn by sending to 0x0 address) + */ + to?: Maybe>; +}; + +/** Keep information about smart contract/program */ +export type SmartContractV0 = { + __typename?: 'SmartContractV0'; + contract: AddressV0; + name?: Maybe; +}; + +export type SolanaChain = { + __typename?: 'SolanaChain'; + /** activity history for solana with forward pagination */ + activityHistoryV0?: Maybe; + /** return asset history balances for specific address. By default it returns at least 24h of history (if no activity for asset at least one balance is returned) */ + assetHistoryBalancesV0?: Maybe>; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + nfts: Array; + status: SolanaStatus; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: SolanaTransactionConnection; + version: Array; +}; + +export type SolanaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaChainAssetHistoryBalancesV0Args = { + address: Scalars['String']; + minUntil?: InputMaybe; + skipAssetServiceFiltering?: Scalars['Boolean']; +}; + +export type SolanaChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type SolanaChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type SolanaChainNftsArgs = { + address: Scalars['String']; +}; + +export type SolanaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type SolanaStatus = { + __typename?: 'SolanaStatus'; + lastBlock: Scalars['Int']; +}; + +export type SolanaTransaction = { + __typename?: 'SolanaTransaction'; + fee: Fee; + hash: Scalars['String']; + signers: Array; + slot: Scalars['Int']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type SolanaTransactionConnection = { + __typename?: 'SolanaTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type SolanaTransactionEdge = { + __typename?: 'SolanaTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: SolanaTransaction; +}; + +export type StargazeChain = { + __typename?: 'StargazeChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + transactions: CosmosLikeTransactionConnection; + version: Array; +}; + +export type StargazeChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type StargazeChainNftsArgs = { + address: Scalars['String']; +}; + +export type StargazeChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Status = { + __typename?: 'Status'; + lastBlock: Scalars['Int']; +}; + +export type Statusv2 = { + __typename?: 'Statusv2'; + blockbookHealth: ProviderHealth; + blockchairHealth: ProviderHealth; +}; + +export type SwapAssetActivityV0 = { + __typename?: 'SwapAssetActivityV0'; + /** Place where swap was executed */ + executor?: Maybe; + fromAssets?: Maybe>; + /** amount paid during swap execution to the protocol. Null doesn't mean "no fees" */ + swapFee?: Maybe>; + toAssets?: Maybe>; +}; + +/** (experimental) Place where input/output assets are swapped */ +export type SwapExecutorV0 = PoolV0 | SmartContractV0; + +/** Transaction object with necessary fields for simulation and classification using tenderly */ +export type TenderlyMinimalSimulateInput = { + blockNumber?: InputMaybe; + chain?: InputMaybe; + data: Scalars['String']; + fromAddress: Scalars['String']; + to: Scalars['String']; + value?: InputMaybe; +}; + +export type TerraChain = { + __typename?: 'TerraChain'; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + legacyNFTs: Array; + name: Scalars['String']; + status: Status; + version: Array; +}; + +export type TerraChainBalancesArgs = { + address: Scalars['String']; + tokenAddresses?: InputMaybe>; +}; + +export type TerraChainLegacyNfTsArgs = { + address: Scalars['String']; + tokenId?: InputMaybe; +}; + +export type ThorChain = { + __typename?: 'ThorChain'; + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ + transactions: ThorchainTransactionConnection; + version: Array; +}; + +export type ThorChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainBalancesArgs = { + address: Scalars['String']; + tokenAddress?: InputMaybe>; +}; + +export type ThorChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ThorChainAffiliate = { + __typename?: 'ThorChainAffiliate'; + /** address of affiliate which received the fee ($RUNE address) */ + address: AddressV0; + /** The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound swap amount from the user */ + fee: Scalars['IntegerString']; +}; + +/** Transactions fee management for THORChain. */ +export type ThorChainFee = { + __typename?: 'ThorChainFee'; + /** Cacao fee on all on chain txs */ + nativeTransactionFee?: Maybe; + /** Amount of rune to withhold on all outbound transactions (1e8 notation) */ + outboundTransactionFee?: Maybe; + /** Fee for TNS sale in basis points */ + tnsFeeOnSale?: Maybe; + /** Per block cost for TNS, in rune */ + tnsFeePerBlock?: Maybe; + /** Registration fee for new THORName, in rune */ + tnsRegisterFee?: Maybe; +}; + +/** Detailed fees of THORChain and similar chains (Maya) as described in */ +export type ThorChainFeeDetailsV0 = { + __typename?: 'ThorChainFeeDetailsV0'; + /** affiliate related fee */ + affiliate?: Maybe; + /** liquidity fee depends on swap slippage and swap amount - less liquidity - higher fee */ + liquidityFee?: Maybe; +}; + +export type ThorchainFee = { + __typename?: 'ThorchainFee'; + amount: Amount; + asset: CryptoAsset; +}; + +export type ThorchainTransaction = { + __typename?: 'ThorchainTransaction'; + blockHeight: Scalars['Int']; + fee?: Maybe>; + hash: Scalars['String']; + status: Scalars['String']; + timestamp?: Maybe; + transfers: Array; +}; + +export type ThorchainTransactionConnection = { + __typename?: 'ThorchainTransactionConnection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type ThorchainTransactionEdge = { + __typename?: 'ThorchainTransactionEdge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: ThorchainTransaction; +}; + +/** Contains data item for each metric field of each time frame */ +export type TimeFrameData = { + __typename?: 'TimeFrameData'; + /** Assets price */ + price: Scalars['Float']; + /** Timestamp for assets price */ + timestamp: Scalars['Float']; +}; + +/** Contains history metrcis of asset for one specific time frame */ +export type TimeFrameItem = { + __typename?: 'TimeFrameItem'; + /** Contains market caps of asset for one time frame */ + market_caps: Array; + /** Contains prices of asset for one time frame */ + prices: Array; + /** Contains total_volumes of asset for one time frame */ + total_volumes: Array; +}; + +/** Chronoscales */ +export enum TimePeriod { + ALL = 'ALL', + DAY = 'DAY', + MONTH = 'MONTH', + WEEK = 'WEEK', + YEAR = 'YEAR', +} + +/** Unlimited or specific amount of asset approved to spend for spender address */ +export type TokenApproveActivityV0 = { + __typename?: 'TokenApproveActivityV0'; + amount?: Maybe; + asset: AssetV0; + spender: AddressV0; + unlimited: Scalars['Boolean']; +}; + +export enum TokenCategory { + LP_TOKEN = 'LP_TOKEN', + LST_TOKEN = 'LST_TOKEN', + SHITCOIN = 'SHITCOIN', + STABLECOIN = 'STABLECOIN', + TRENDING_TOKEN = 'TRENDING_TOKEN', +} + +export type TokenContractType = { + __typename?: 'TokenContractType'; + address: AddressType; + scalingFactor: Scalars['Float']; + symbol: Scalars['String']; +}; + +export type TokenFilter = { + address?: InputMaybe>; + chains?: InputMaybe>; + ids?: InputMaybe>; + priceHistoryInterval?: InputMaybe; + symbols?: InputMaybe>; +}; + +export type TokenResponse = { + __typename?: 'TokenResponse'; + page: AssetTokenTypeConnection; + pageData?: Maybe; +}; + +/** Approval revocation of asset to use for spender address */ +export type TokenRevokeActivityV0 = { + __typename?: 'TokenRevokeActivityV0'; + asset: AssetV0; + spender: AddressV0; +}; + +export type TokenType = { + __typename?: 'TokenType'; + contract: Scalars['String']; + contracts: Array; + icon?: Maybe; + id: Scalars['ID']; + /** Known name that identifies token */ + name: Scalars['String']; + price?: Maybe; + /** The symbol that identifies token */ + symbol: Scalars['String']; +}; + +/** (experimental) Represent Token for a given chain, contract and token_id */ +export type TokenV0 = { + __typename?: 'TokenV0'; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories?: Maybe>; + /** Chain name */ + chain?: Maybe; + /** Contract for EVM/Cosmos and program_id for Solana */ + contract?: Maybe; + /** Number of decimals for current asset */ + decimals?: Maybe; + /** Asset image */ + image?: Maybe; + /** Known name that identifies token */ + name?: Maybe; + price?: Maybe; + /** The symbol that identifies token */ + symbol?: Maybe; + /** Null for EVM/Cosmos and mint for Solana */ + tokenId?: Maybe; +}; + +export type TokenV0Args = { + chain: AddressChain; + contract?: InputMaybe; + tokenId?: InputMaybe; +}; + +export type TradeRouteInputTypeV2 = { + amountIn: Scalars['Decimal']; + amountOut: Scalars['Decimal']; + assetIn: RoutingTokenInputTypeV2; + assetOut: RoutingTokenInputTypeV2; + fee: RoutingFeeInputTypeV2; + minAmountReceived: Scalars['Decimal']; + priceRateUsdAssetIn: Scalars['Decimal']; + priceRateUsdAssetOut: Scalars['Decimal']; + provider: ProviderInputTypeV2; + referral?: InputMaybe; + reward?: InputMaybe; + tradeType: Scalars['String']; +}; + +export type TransactionCallArg = { + __typename?: 'TransactionCallArg'; + name: Scalars['String']; + standardisedName: Scalars['String']; + type: Scalars['String']; + value: Scalars['String']; +}; + +/** Represents the status of a transaction */ +export enum TransactionStatus { + /** Transaction was included in a block but failed to execute */ + FAILED = 'FAILED', + /** Transaction was sent and is in the mempool (or equivalent for the chain) */ + PENDING = 'PENDING', + /** Transaction was included in a block and successfully executed */ + SUCCESS = 'SUCCESS', +} + +/** Represents the status of a transaction with optional details */ +export type TransactionStatusDetails = { + __typename?: 'TransactionStatusDetails'; + status: TransactionStatus; +}; + +export enum TransactionType { + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TrendingCoingeckoType = { + __typename?: 'TrendingCoingeckoType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price?: Maybe; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type TrendingTokensType = { + __typename?: 'TrendingTokensType'; + assetId: Scalars['String']; + /** Identify asset as a shitcoin, stablecoin, lp token, lst token or trending token. */ + categories: Array; + chains: Array; + icon?: Maybe; + name: Scalars['String']; + price: AssetAmountType; + symbol: Scalars['String']; + type: AssetInternalType; +}; + +export type Tron = { + __typename?: 'Tron'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type TronActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type TronBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type TronNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type TronTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +/** + * Tron chain specific fee details + * It usually consists of energy fee + bandwidth fee in TRX + */ +export type TronFeeDetailsV0 = { + __typename?: 'TronFeeDetailsV0'; + /** energy fee for interacting with smart contract (energy usage * energy price in TRX) */ + energyFee?: Maybe; + /** actual energy used for interacting with smart contract */ + energyUsage?: Maybe; + /** fee limit which is provided only for contract interactions */ + feeLimit?: Maybe; + /** bandwidth fee for each transaction */ + netFee?: Maybe; +}; + +export type TxAnalysisV1 = { + __typename?: 'TxAnalysisV1'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxAnalysisV2 = { + __typename?: 'TxAnalysisV2'; + issues: Array; + riskScore: Scalars['String']; +}; + +export type TxAnalysisV3 = { + __typename?: 'TxAnalysisV3'; + securityIssues: Array; + txRiskLevel: Scalars['String']; +}; + +export type TxClassifier = { + __typename?: 'TxClassifier'; + analyzeEVMTxBlowfish: TxAnalysisV3; + analyzeSolanaTxBlowfish: TxAnalysisV3; + /** @deprecated use analyzeEVMTxBlowfish for EVMs and analyzeSolanaTxBlowfish for Solana */ + analyzeTxBlowfish: TxAnalysisV3; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV1Hexagate: TxAnalysisV1; + /** @deprecated no api key is provided at the moment for this service use analyzeTxBlowfish instead */ + analyzeTxV2Hexagate: TxAnalysisV2; + decodeTransactionV2?: Maybe; + explainEVMTxWithRiskAnalysisV1?: Maybe; + /** @deprecated it is not reasonable to use static enum values for tx type use explainTransactionV5 instead */ + explainTransactionV3?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3DebugTraceCall?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3Tenderly?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV3TenderlyBundled?: Maybe; + /** @deprecated only for test, be sure not to use this endpoint */ + explainTransactionV4Tenderly?: Maybe; + /** @deprecated use explainEVMTxWithRiskAnalysisV1 since it also returns the risk analysis for EVM txs */ + explainTransactionV5?: Maybe; + /** @deprecated only for tests please do not use this endpoint at all */ + getBlockchairTxsByQuery: Scalars['String']; +}; + +export type TxClassifierAnalyzeEvmTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { + payload: BlowfishSolanaTxPayload; +}; + +export type TxClassifierAnalyzeTxBlowfishArgs = { + payload: BlowfishEvmTxPayload; +}; + +export type TxClassifierAnalyzeTxV1HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierAnalyzeTxV2HexagateArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierDecodeTransactionV2Args = { + payload: EvmTransactionPayload; +}; + +export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { + payload: Array; +}; + +export type TxClassifierExplainTransactionV4TenderlyArgs = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierExplainTransactionV5Args = { + payload: EvmTransactionPayloadV2; +}; + +export type TxClassifierGetBlockchairTxsByQueryArgs = { + chain: TxClassifierChains; + limit: Scalars['Int']; + offset: Scalars['Int']; + recipient: Scalars['String']; + useApiKey: Scalars['Boolean']; +}; + +export enum TxClassifierChains { + Dummychain = 'Dummychain', + arbitrum = 'arbitrum', + avalanche = 'avalanche', + base = 'base', + blast = 'blast', + bsc = 'bsc', + ethereum = 'ethereum', + fantom = 'fantom', + gnosis = 'gnosis', + linea = 'linea', + optimism = 'optimism', + polygon = 'polygon', + solana = 'solana', +} + +export enum TxClassifierTxType { + APPROVE = 'APPROVE', + CLAIM = 'CLAIM', + DEPOSIT = 'DEPOSIT', + MINT = 'MINT', + STAKE = 'STAKE', + SWAP = 'SWAP', + TRANSFER = 'TRANSFER', + UNCLASSIFIED = 'UNCLASSIFIED', + WITHDRAW = 'WITHDRAW', +} + +export type TxSecurityIssue = { + __typename?: 'TxSecurityIssue'; + categoryType: Scalars['String']; + riskScore: Scalars['String']; + type: Scalars['String']; +}; + +export type TxSecurityIssueV2 = { + __typename?: 'TxSecurityIssueV2'; + kind: Scalars['String']; + message: Scalars['String']; + riskScore: Scalars['String']; +}; + +export type UtxoTransaction = { + __typename?: 'UTXOTransaction'; + balanceChange?: Maybe; + /** @deprecated Not used in the txs, is to be removed in the next version */ + blockIndex?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2 = { + __typename?: 'UTXOTransactionV2'; + balanceChange?: Maybe; + blockNumber?: Maybe; + fee?: Maybe; + hash: Scalars['String']; + inputs?: Maybe>; + outputs?: Maybe>; + status?: Maybe; + timestamp?: Maybe; +}; + +export type UtxoTransactionV2Connection = { + __typename?: 'UTXOTransactionV2Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type UtxoTransactionV2Edge = { + __typename?: 'UTXOTransactionV2Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: UtxoTransactionV2; +}; + +export type UnspentTransactionOutputV4 = { + __typename?: 'UnspentTransactionOutputV4'; + address?: Maybe; + iTxHash?: Maybe; + iTxIndex?: Maybe; + isCoinbase?: Maybe; + isSpent: Scalars['Boolean']; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + oTxTime?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UnspentTransactionOutputV5 = { + __typename?: 'UnspentTransactionOutputV5'; + address?: Maybe; + isCoinbase?: Maybe; + oIndex: Scalars['Int']; + oTxHash: Scalars['String']; + oTxHex?: Maybe; + scriptHex?: Maybe; + value: Amount; +}; + +export type UtxotransactionByHashV5 = { + __typename?: 'UtxotransactionByHashV5'; + /** (numeric, optional) the block number in which this transaction is mined. */ + blockNumber?: Maybe; + /** (string, optional) the block hash */ + blockhash?: Maybe; + /** (numeric, optional) The block time expressed in UNIX epoch time */ + blocktime?: Maybe; + /** (numeric, optional) The confirmations */ + confirmations?: Maybe; + /** the amout of Satushi spent for this tx to be mined by a miner. */ + fee: Amount; + /** (string) The transaction hash (differs from txid for witness transactions) */ + hash: Scalars['String']; + /** (string) The serialized, hex-encoded data for 'txid' */ + hex?: Maybe; + /** Inputs from the privous outputs, as addresses and values */ + inputs: Array; + /** (numeric) The lock time */ + locktime?: Maybe; + /** outputs containing */ + outputs: Array; + /** (numeric) The serialized transaction size */ + size: Scalars['Int']; + /** ( either blockbook or blockchair ) */ + sourceOfData: Scalars['String']; + /** (numeric, optional) Same as "blocktime" */ + time?: Maybe; + /** (string) The transaction id (same as provided) */ + txid?: Maybe; + /** (numeric) The version */ + version: Scalars['Int']; + /** + * vin, input records directly from the node's response. + * contains the privious outputs data. + */ + vin?: Maybe>; + /** vout */ + vout?: Maybe>; +}; + +export type UtxovinV3 = { + __typename?: 'UtxovinV3'; + addresses?: Maybe>; + coinbase?: Maybe; + isAddress?: Maybe; + n?: Maybe; + sequence?: Maybe; + txid?: Maybe; + value?: Maybe; + vout?: Maybe; +}; + +export type UtxovoutV2 = { + __typename?: 'UtxovoutV2'; + addresses?: Maybe>; + hex: Scalars['String']; + isAddress?: Maybe; + isOwn?: Maybe; + n?: Maybe; + spent?: Maybe; + spentHeight?: Maybe; + spentTxId?: Maybe; + value: Scalars['String']; +}; + +export type Version = { + __typename?: 'Version'; + /** date of compilation */ + compilationDate?: Maybe; + /** unique hash that represent source code that was used to build */ + compilationHash?: Maybe; + /** aplication name */ + name: Scalars['String']; + /** schematic version (semver.org) */ + version: Scalars['String']; +}; + +export type VolumeHistory = { + __typename?: 'VolumeHistory'; + date: Scalars['String']; + volume: Scalars['String']; +}; + +export type Wallet = { + __typename?: 'Wallet'; + name: Scalars['String']; +}; + +/** Represent wallet activities for a single transaction related to specific address */ +export type WalletActivityV0 = { + __typename?: 'WalletActivityV0'; + /** Wallet address that activity is related to */ + address: AddressV0; + /** Assets movements (Sent and Received activities) */ + basic: Array; + /** Block height (null for pending txs) */ + blockHeight?: Maybe; + /** Time of the transaction as ISO 8601 string */ + datetime?: Maybe; + /** Complex activities (Swap, Withdraw, Stake, etc.); build on top of `basic` */ + detailed?: Maybe>; + /** Transaction fees */ + fees?: Maybe; + /** Transaction hash that was parsed to provide this activity */ + txHash: Scalars['String']; + /** Details of transaction status (pending, success, failed). null if status was not available */ + txStatus?: Maybe; +}; + +export type WalletActivityV0Connection = { + __typename?: 'WalletActivityV0Connection'; + /** A list of edges. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type WalletActivityV0Edge = { + __typename?: 'WalletActivityV0Edge'; + /** A cursor for use in pagination */ + cursor: Scalars['String']; + /** The item at the end of the edge */ + node: WalletActivityV0; +}; + +export type WalletInfo = { + __typename?: 'WalletInfo'; + /** EVM address of the wallet. */ + address: Scalars['String']; + /** If set to true, wallet is the boss */ + isAdmin: Scalars['Boolean']; + /** If set to true, wallet is part of the referral program */ + isReferrer: Scalars['Boolean']; +}; + +export type ZetaChain = { + __typename?: 'ZetaChain'; + average24hFee?: Maybe; + fee?: Maybe; + name: Scalars['String']; +}; + +export type ZkSync = { + __typename?: 'ZkSync'; + fee?: Maybe; + feeHistory: DefaultGasFee; + name: Scalars['String']; +}; + +export type GetTronBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetTronBalanceQuery = { + __typename?: 'Query'; + tron: { + __typename?: 'Tron'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + amount: { + __typename?: 'Amount'; + value: string; + scalingFactor?: number | null; + }; + }>; + }; +}; + +export type GetTronTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetTronTransactionsQuery = { + __typename?: 'Query'; + tron: { + __typename?: 'Tron'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + toAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export const GetTronBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetTronBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'tron' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scalingFactor' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetTronTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetTronTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'tron' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'toAddress' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetTronTransactionsQuery, + GetTronTransactionsQueryVariables +>; diff --git a/packages/tron/src/gql/index.ts b/packages/tron/src/gql/index.ts new file mode 100644 index 00000000..aa66c634 --- /dev/null +++ b/packages/tron/src/gql/index.ts @@ -0,0 +1,3 @@ +export * from './fragment-masking'; +export * from './gql'; +export * from './graphql'; diff --git a/packages/tron/src/gql/operations.graphql b/packages/tron/src/gql/operations.graphql new file mode 100644 index 00000000..768fa2a9 --- /dev/null +++ b/packages/tron/src/gql/operations.graphql @@ -0,0 +1,17 @@ +query GetCryptoAssets($input: [CryptoAssetArgs!]!) { + assets { + cryptoAssets(input: $input) { + chain + contract + id + name + symbol + image + decimals + price { + amount + scalingFactor + } + } + } +} diff --git a/utility-packages/graphql/package.json b/utility-packages/graphql/package.json index e1b9b6e3..c2ff81ff 100644 --- a/utility-packages/graphql/package.json +++ b/utility-packages/graphql/package.json @@ -17,9 +17,6 @@ "build": "tsup --minify --clean", "publish:packages": "npm publish --tag $GITHUB_REF", "watch": "tsup --watch", - "compile": "graphql-codegen --config codegen.yml && yarn format", - "compile:build": "yarn compile && yarn build", - "compile:watch": "graphql-codegen -w", "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "dependencies": { @@ -48,4 +45,4 @@ "platform": "browser", "target": "es2015" } -} \ No newline at end of file +} From a1137e9500fd128d7ed9a968c92215c4a0101fcb Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 28 Jun 2024 09:35:40 +0000 Subject: [PATCH 025/176] Version packages --- .changeset/tiny-fans-tease.md | 15 --------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 8 ++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 ++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 ++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 ++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- 23 files changed, 97 insertions(+), 26 deletions(-) delete mode 100644 .changeset/tiny-fans-tease.md diff --git a/.changeset/tiny-fans-tease.md b/.changeset/tiny-fans-tease.md deleted file mode 100644 index 0dffb064..00000000 --- a/.changeset/tiny-fans-tease.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-evm': patch ---- - -Split Chains Lib GQL package for each chains diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 92e48e3e..2a925278 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.15 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.14 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 15b8c0da..31e83fc1 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.14", + "version": "2.0.15", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 33255b86..854812d4 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.0.19 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.18 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 5454a49b..0b74db4a 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.18", + "version": "2.0.19", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index a7de70f1..3a0dd88a 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.19 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.18 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 79b2674c..f19a437b 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.18", + "version": "2.0.19", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index f5d317a5..90df91d1 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.19 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains + ## 2.0.18 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 1133b8e4..973da8da 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.18", + "version": "2.0.19", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 3322cc4a..e59daffc 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.22 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.21 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 8cd68c9f..eec93605 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.21", + "version": "2.0.22", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 7807502d..3d72d6d0 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.0.18 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.17 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index df57d04c..32f04ae3 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.17", + "version": "2.0.18", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 8d27519b..be71b048 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.30 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.29 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index a8c2fa73..5c86eb71 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.29", + "version": "2.0.30", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index a28548a8..4bd7824f 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.0.17 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.16 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 12c1ac7f..6d4ece87 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.16", + "version": "2.0.17", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index d2e9be85..dd23ac27 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.22 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.21 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 87736e5c..e3bbab9f 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.21", + "version": "2.0.22", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 6bd4e5f9..8c5983e2 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.0.20 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.19 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 94d616f8..1b30761f 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.19", + "version": "2.0.20", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 7bfae545..8928b971 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.20 + +### Patch Changes + +- 0a125235: Split Chains Lib GQL package for each chains +- Updated dependencies [0a125235] + - @xdefi-tech/chains-core@2.0.19 + ## 2.0.19 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 683ae57e..87b213b3 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.19", + "version": "2.0.20", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 985b16141745a50fb6f89b4e73ecca3b0bea8263 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:20:21 +0700 Subject: [PATCH 026/176] chore: configuration size-limit to many packages (#254) * chore: install size limit package to develop * chore: install size limit package to develop * chore: change limit size config --- package.json | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a4232388..b7e8ab49 100644 --- a/package.json +++ b/package.json @@ -30,9 +30,52 @@ }, "size-limit": [ { - "path": "packages/*/dist/index.js", - "webpack": false, - "limit": "50000 ms" + "path": "packages/binance/dist/index.js", + "webpack": false + }, + { + "path": "packages/bitcoin/dist/index.js", + "webpack": false + }, + { + "path": "packages/bitcoincash/dist/index.js", + "webpack": false + }, + { + "path": "packages/core/dist/index.js", + "webpack": false + }, + { + "path": "packages/cosmos/dist/index.js", + "webpack": false + }, + { + "path": "packages/dogecoin/dist/index.js", + "webpack": false + }, + { + "path": "packages/evm/dist/index.js", + "webpack": false + }, + { + "path": "packages/litecoin/dist/index.js", + "webpack": false + }, + { + "path": "packages/solana/dist/index.js", + "webpack": false + }, + { + "path": "packages/thor/dist/index.js", + "webpack": false + }, + { + "path": "packages/tron/dist/index.js", + "webpack": false + }, + { + "path": "packages/utxo/dist/index.js", + "webpack": false } ], "devDependencies": { From 77a91a73113d15b48680a72f0b4a2cbae8fd6f9b Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Mon, 1 Jul 2024 23:05:01 +0700 Subject: [PATCH 027/176] fix: calculate fee rate to use for bitcoin dusting algorithm (#256) * fix: calculate fee rate to use for bitcoin dusting algorthm * chore: update unit tests * feat: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 Co-authored-by: danilxdefi --- .changeset/fair-dingos-accept.md | 9 + packages/bitcoin/src/custom.d.ts | 1 + packages/bitcoin/src/msg.spec.ts | 170 +++++++++++++++++- packages/bitcoin/src/msg.ts | 5 +- .../bitcoin/src/signers/ledger.signer.spec.ts | 8 + .../src/signers/private-key.signer.spec.ts | 10 +- .../src/signers/seed-phrase.signer.spec.ts | 10 +- packages/bitcoincash/src/msg.ts | 6 +- .../src/signers/private-key.signer.spec.ts | 2 +- .../src/signers/seed-phrase.signer.spec.ts | 2 +- packages/dogecoin/src/msg.ts | 7 +- .../src/signers/private-key.signer.spec.ts | 2 +- .../src/signers/seed-phrase.signer.spec.ts | 2 +- packages/litecoin/src/msg.ts | 6 +- packages/utxo/src/msg.ts | 6 +- 15 files changed, 222 insertions(+), 24 deletions(-) create mode 100644 .changeset/fair-dingos-accept.md diff --git a/.changeset/fair-dingos-accept.md b/.changeset/fair-dingos-accept.md new file mode 100644 index 00000000..fd4dd64b --- /dev/null +++ b/.changeset/fair-dingos-accept.md @@ -0,0 +1,9 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-utxo': patch +--- + +Fix: calculate fee rate to use for bitcoin dusting algorithm diff --git a/packages/bitcoin/src/custom.d.ts b/packages/bitcoin/src/custom.d.ts index 4f1f5387..523722fa 100644 --- a/packages/bitcoin/src/custom.d.ts +++ b/packages/bitcoin/src/custom.d.ts @@ -1,5 +1,6 @@ declare module 'coinselect'; declare module 'coinselect/accumulative'; +declare module 'coinselect/utils'; declare module 'tiny-secp256k1/index.js'; declare module 'hdkey'; declare module 'coinkey'; diff --git a/packages/bitcoin/src/msg.spec.ts b/packages/bitcoin/src/msg.spec.ts index 0cd2665c..25ba9375 100644 --- a/packages/bitcoin/src/msg.spec.ts +++ b/packages/bitcoin/src/msg.spec.ts @@ -1,7 +1,42 @@ import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; +import * as bitcoin from 'bitcoinjs-lib'; +import utils from 'coinselect/utils'; import { ChainMsg } from './msg'; +import { BitcoinProvider } from './chain.provider'; +import { IndexerDataSource } from './datasource'; +import { BITCOIN_MANIFEST } from './manifests'; +import * as scanUtxosMoudle from './datasource/indexer/queries/scanUTXOs.query'; +import * as feeModule from './datasource/indexer/queries/fees.query'; + +jest.mock('./datasource/indexer/queries/scanUTXOs.query', () => { + const originalModule = jest.requireActual( + './datasource/indexer/queries/scanUTXOs.query' + ); + + return { + __esModule: true, + ...originalModule, + scanUTXOs: jest.fn(), + }; +}); + +jest.mock('./datasource/indexer/queries/fees.query', () => { + const originalModule = jest.requireActual( + './datasource/indexer/queries/fees.query' + ); + + return { + __esModule: true, + ...originalModule, + getFees: jest.fn().mockResolvedValue({ + high: 3000, + medium: 3000, // 3000 sat/kvB => 3 sat/vB + low: 3000, + }), + }; +}); describe('msg', () => { let mockProvider: any; @@ -12,10 +47,10 @@ describe('msg', () => { Promise.resolve([ { hash: 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d', - value: 546, + value: 1000, index: 0, witnessUtxo: { - value: 546, + value: 1000, script: Buffer.from( '5120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e4088', 'hex' @@ -26,10 +61,10 @@ describe('msg', () => { }, { hash: 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d', - value: 546, + value: 1000, index: 1, witnessUtxo: { - value: 546, + value: 1000, script: Buffer.from( '5120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e4088', 'hex' @@ -59,9 +94,9 @@ describe('msg', () => { ), gasFeeOptions: jest.fn(() => Promise.resolve({ - high: 1140000, - low: 114000, - medium: 228000, + high: 3000, + low: 3000, + medium: 3000, }) ), getBalance: jest.fn(() => @@ -270,3 +305,124 @@ describe('msg', () => { ); }); }); + +describe('msg: Bitcoin dust filter', () => { + const address = 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw'; + const mockFirstTx = new bitcoin.Transaction(); + mockFirstTx.addInput(Buffer.alloc(32, 0), 0); + mockFirstTx.addOutput(bitcoin.address.toOutputScript(address), 1000); + const mockSecondTx = new bitcoin.Transaction(); + mockSecondTx.addInput(Buffer.alloc(32, 0), 0); + mockSecondTx.addOutput(bitcoin.address.toOutputScript(address), 3000); + + (scanUtxosMoudle.scanUTXOs as any).mockResolvedValue([ + { + oTxHash: mockFirstTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockFirstTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockFirstTx.outs[0].script.toString('hex'), + value: { + value: '1000', + }, + }, + { + oTxHash: mockSecondTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockSecondTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockSecondTx.outs[0].script.toString('hex'), + value: { + value: '3000', + }, + }, + ]); + + let provider: BitcoinProvider; + + beforeEach(() => { + provider = new BitcoinProvider(new IndexerDataSource(BITCOIN_MANIFEST)); + }); + + it('should remove utxo with value 1000 sats', async () => { + const feeRate = 8; // 8 sat/vB + (feeModule.getFees as any).mockResolvedValue({ + high: 8000, + medium: 8000, // 8000 sat/kvB => 8 sat/vB + low: 8000, + }); + const msg = provider.createMsg({ + from: address, + to: address, + amount: 0.00000546, // 546 sat + }); + const utxos = await provider.scanUTXOs(address); + expect(utxos[0].value).toBeGreaterThan(546); // 1000 > 546 + const inputUtxosSize = utils.inputBytes(utxos[0]); + expect(inputUtxosSize * feeRate).toBeGreaterThan(utxos[0].value); // 1000 < utxo fees => bitcoin dust and shuld be removed + + const { inputs, outputs } = await msg.buildTx(); + expect(inputs.length).toBe(1); + expect(outputs.length).toBe(1); + expect(outputs[0].value).toEqual(546); + expect(inputs[0].value).toEqual(3000); + const inputSize = utils.inputBytes(inputs[0]); + const accumBytes = utils.transactionBytes([], outputs); + const fee = (inputSize + accumBytes) * feeRate; + const surplus = 3000 - 546 - fee; // 942 sat < 8 * 148 => bitcoin dust + expect(surplus).toBeLessThan(8 * inputSize); + }); + + it('Should not enough balances by fees', async () => { + (feeModule.getFees as any).mockResolvedValue({ + high: 3000, + medium: 3000, // 3000 sat/kvB => 3 sat/vB + low: 3000, + }); + const msg = provider.createMsg({ + from: address, + to: address, + amount: 0.00003, // 3000 sat + }); + + const utxos = await provider.scanUTXOs(address); + expect(utxos[0].value + utxos[1].value).toBeGreaterThan(3000); // 4000 sat > 3000 sat + const inputBytesSize = + utils.inputBytes(utxos[0]) + utils.inputBytes(utxos[1]); + const accumBytesSize = utils.transactionBytes( + [], + [{ address, value: 3000 }] + ); + const fee = (inputBytesSize + accumBytesSize) * 3; // 1032 + expect(utxos[0].value + utxos[1].value).toBeLessThan(3000 + fee); + await expect(msg.buildTx()).rejects.toThrowError( + 'Insufficient Balance for transaction' + ); + }); + + it('should contain utxo with value 1000 sats', async () => { + const feeRate = 3; + (feeModule.getFees as any).mockResolvedValue({ + high: 3000, + medium: 3000, // 3000 sat/kvB => 3 sat/vB + low: 3000, + }); + const msg = provider.createMsg({ + from: address, + to: address, + amount: 0.00000546, // 546 sat + }); + + const utxos = await provider.scanUTXOs(address); + const inputBytesSize = utils.inputBytes(utxos[0]); + expect(utxos[0].value).toBeGreaterThan(inputBytesSize * feeRate); + + const { inputs, outputs } = await msg.buildTx(); + expect(inputs.length).toBe(2); + expect(outputs.length).toBe(2); + expect(outputs[0].value).toEqual(546); + expect(inputs[0].value).toEqual(1000); + }); +}); diff --git a/packages/bitcoin/src/msg.ts b/packages/bitcoin/src/msg.ts index 6cbaacd5..aec24949 100644 --- a/packages/bitcoin/src/msg.ts +++ b/packages/bitcoin/src/msg.ts @@ -79,10 +79,11 @@ export class ChainMsg extends BaseMsg { ); } - const { fee } = await this.getFee(); + const { fee } = await this.getFee(); // unit is btc/kvB if (!fee) throw new Error('Fee estimation is required for building transaction'); - const feeRateWhole = parseInt(fee); + const feeRate = Number(fee) * 1e5; // sat/vB + const feeRateWhole = parseInt(feeRate.toString()); const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); const targetOutputs = []; diff --git a/packages/bitcoin/src/signers/ledger.signer.spec.ts b/packages/bitcoin/src/signers/ledger.signer.spec.ts index 5b6f3ab8..b1fa66ca 100644 --- a/packages/bitcoin/src/signers/ledger.signer.spec.ts +++ b/packages/bitcoin/src/signers/ledger.signer.spec.ts @@ -57,6 +57,14 @@ jest.mock('../datasource/indexer/queries/balances.query', () => ({ }, })); +jest.mock('../datasource/indexer/queries/fees.query', () => ({ + getFees: jest.fn().mockResolvedValue({ + low: 3000, + medium: 3000, + high: 3000, + }), +})); + describe('ledger.signer', () => { let signer: LedgerSigner; let derivationPath: string; diff --git a/packages/bitcoin/src/signers/private-key.signer.spec.ts b/packages/bitcoin/src/signers/private-key.signer.spec.ts index 66a60b74..ea284215 100644 --- a/packages/bitcoin/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoin/src/signers/private-key.signer.spec.ts @@ -54,6 +54,14 @@ jest.mock('../datasource/indexer/queries/scanUTXOs.query', () => ({ }, })); +jest.mock('../datasource/indexer/queries/fees.query', () => ({ + getFees: jest.fn().mockResolvedValue({ + low: 3000, + medium: 3000, + high: 3000, + }), +})); + describe('private-key.signer', () => { let privateKey: string; let signer: PrivateKeySigner; @@ -85,7 +93,7 @@ describe('private-key.signer', () => { await signer.sign(message as ChainMsg); expect(message.signedTransaction).toEqual( - '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a536c070000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302483045022100aebc0d5d7ae241077cb33e635ef36cf347674c0468051e5c4fab6d919d52ddf102203609428e2d61c4ab7208ab78801f45215d5a32b037be4257ca22fb85f585188f012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' + '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5399040000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022063256998af5b4eb17aab21bfe3db37fda7716561a2df0e58870c237a59a7abf10220407ad63ee39943fb5d1bfcd5808dcde4c72940202f6758f6420888b7975202a7012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' ); }); diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts index 6a470eb2..bbc05dbd 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts @@ -53,6 +53,14 @@ jest.mock('../datasource/indexer/queries/scanUTXOs.query', () => ({ }, })); +jest.mock('../datasource/indexer/queries/fees.query', () => ({ + getFees: jest.fn().mockResolvedValue({ + low: 3000, + medium: 3000, + high: 3000, + }), +})); + describe('seed-phrase.signer', () => { let privateKey: string; let derivation: string; @@ -89,7 +97,7 @@ describe('seed-phrase.signer', () => { await signer.sign(message as ChainMsg, derivation); expect(message.signedTransaction).toEqual( - '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a536c070000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302483045022100aebc0d5d7ae241077cb33e635ef36cf347674c0468051e5c4fab6d919d52ddf102203609428e2d61c4ab7208ab78801f45215d5a32b037be4257ca22fb85f585188f012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' + '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5399040000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022063256998af5b4eb17aab21bfe3db37fda7716561a2df0e58870c237a59a7abf10220407ad63ee39943fb5d1bfcd5808dcde4c72940202f6758f6420888b7975202a7012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' ); }); diff --git a/packages/bitcoincash/src/msg.ts b/packages/bitcoincash/src/msg.ts index 62bac247..760313e7 100644 --- a/packages/bitcoincash/src/msg.ts +++ b/packages/bitcoincash/src/msg.ts @@ -39,10 +39,12 @@ export class ChainMsg extends BaseMsg { async buildTx() { const msgData = this.toData(); const utxos = await this.provider.scanUTXOs(this.data.from); - const { fee } = await this.getFee(); + const { fee } = await this.getFee(); // unit is btc/kvB if (!fee) throw new Error('Fee estimation is required for building transaction'); - const feeRateWhole = parseInt(fee) < 1 ? 1 : parseInt(fee); + const feeRate = Number(fee) * 1e5; // sat/vB + const feeRateWhole = + parseInt(feeRate.toString()) < 1 ? 1 : parseInt(fee.toString()); const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); const targetOutputs = []; diff --git a/packages/bitcoincash/src/signers/private-key.signer.spec.ts b/packages/bitcoincash/src/signers/private-key.signer.spec.ts index 06d44d78..f936034e 100644 --- a/packages/bitcoincash/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoincash/src/signers/private-key.signer.spec.ts @@ -86,7 +86,7 @@ describe('private-key.signer', () => { await signer.sign(message as ChainMsg); expect(message.signedTransaction).toEqual( - '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006a47304402200419e6bc0222af2adff260c92c4330935804d7bafc6442afca3c5384723a5b0602207a383d7e8587481c12a4ad7152cc630aff62210374fe2b869234063f17c85d7041210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688acfa0b0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' + '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100c59aef47c478c523b6e4c42b6228867236747218a25bfdefa170867cb4312236022009ec8f22e33909b9b4806befd8d8a58d8faa367ec054bb8161b7a2205611a69441210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688acdc0c0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' ); }); diff --git a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts index b76c5400..70a0602d 100644 --- a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts @@ -92,7 +92,7 @@ describe('seed-phrase.signer', () => { await signer.sign(message as ChainMsg, derivation); expect(message.signedTransaction).toEqual( - '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006a47304402200419e6bc0222af2adff260c92c4330935804d7bafc6442afca3c5384723a5b0602207a383d7e8587481c12a4ad7152cc630aff62210374fe2b869234063f17c85d7041210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688acfa0b0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' + '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100c59aef47c478c523b6e4c42b6228867236747218a25bfdefa170867cb4312236022009ec8f22e33909b9b4806befd8d8a58d8faa367ec054bb8161b7a2205611a69441210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688acdc0c0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' ); }); diff --git a/packages/dogecoin/src/msg.ts b/packages/dogecoin/src/msg.ts index 6f60fe8a..fe129a74 100644 --- a/packages/dogecoin/src/msg.ts +++ b/packages/dogecoin/src/msg.ts @@ -41,13 +41,14 @@ export class ChainMsg extends BaseMsg { async buildTx() { const msgData = this.toData(); const utxos = await this.provider.scanUTXOs(this.data.from); - const { fee } = await this.getFee(); + const { fee } = await this.getFee(); // unit is btc/kvB if (!fee) throw new Error('Fee estimation is required for building transaction'); + const feeRate = Number(fee) * 1e5; // sat/vB const feeRateWhole = - parseInt(fee) < MINIMUM_DOGECOIN_FEE + parseInt(feeRate.toString()) < MINIMUM_DOGECOIN_FEE ? MINIMUM_DOGECOIN_FEE - : parseInt(fee); + : parseInt(fee.toString()); const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); const targetOutputs = []; diff --git a/packages/dogecoin/src/signers/private-key.signer.spec.ts b/packages/dogecoin/src/signers/private-key.signer.spec.ts index 6985c30c..083ff8a8 100644 --- a/packages/dogecoin/src/signers/private-key.signer.spec.ts +++ b/packages/dogecoin/src/signers/private-key.signer.spec.ts @@ -86,7 +86,7 @@ describe('private-key.signer', () => { await signer.sign(message as ChainMsg); expect(message.signedTransaction).toEqual( - '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a473044022068b491ee366b00d7ee0643111977b4f9d69d280446e4672c25f91e137f82ca5702205ce414f90daa6cb99f79ad80db6b2fb6cc700dcb74594e57b4f87b72d60260bf0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0164000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' + '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a47304402203693425d306d6c2b106e7b2afc7c7c43165dff38183652c00029b36beb19509302202cab0c2292ae9dc0f424122f460ff492894a58bc3766ab45b9f73262268aafff0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0264000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac1c969800000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' ); }); diff --git a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts index 0570030f..332a7f0f 100644 --- a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts @@ -88,7 +88,7 @@ describe('seed-phrase.signer', () => { await signer.sign(message as ChainMsg, derivation); expect(message.signedTransaction).toEqual( - '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a473044022068b491ee366b00d7ee0643111977b4f9d69d280446e4672c25f91e137f82ca5702205ce414f90daa6cb99f79ad80db6b2fb6cc700dcb74594e57b4f87b72d60260bf0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0164000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' + '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a47304402203693425d306d6c2b106e7b2afc7c7c43165dff38183652c00029b36beb19509302202cab0c2292ae9dc0f424122f460ff492894a58bc3766ab45b9f73262268aafff0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0264000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac1c969800000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' ); }); diff --git a/packages/litecoin/src/msg.ts b/packages/litecoin/src/msg.ts index 13d040fa..e7e6adc6 100644 --- a/packages/litecoin/src/msg.ts +++ b/packages/litecoin/src/msg.ts @@ -39,10 +39,12 @@ export class ChainMsg extends BaseMsg { async buildTx() { const msgData = this.toData(); const utxos = await this.provider.scanUTXOs(this.data.from); - const { fee } = await this.getFee(); + const { fee } = await this.getFee(); // unit is btc/kvB if (!fee) throw new Error('Fee estimation is required for building transaction'); - const feeRateWhole = parseInt(fee) < 1 ? 1 : parseInt(fee); + const feeRate = Number(fee) * 1e5; // sat/vB + const feeRateWhole = + parseInt(feeRate.toString()) < 1 ? 1 : parseInt(feeRate.toString()); const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); const targetOutputs = []; diff --git a/packages/utxo/src/msg.ts b/packages/utxo/src/msg.ts index 2528d02f..f9b1af9d 100644 --- a/packages/utxo/src/msg.ts +++ b/packages/utxo/src/msg.ts @@ -40,10 +40,12 @@ export class ChainMsg extends BaseMsg { async buildTx() { const msgData = this.toData(); const utxos = await this.provider.scanUTXOs(this.data.from); - const { fee } = await this.getFee(); + const { fee } = await this.getFee(); // unit is btc/kvB if (!fee) throw new Error('Fee estimation is required for building transaction'); - const feeRateWhole = parseInt(fee) < 1 ? 1 : parseInt(fee); + const feeRate = Number(fee) * 1e5; // sat/vB + const feeRateWhole = + parseInt(feeRate.toString()) < 1 ? 1 : parseInt(feeRate.toString()); const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); const targetOutputs = []; From 64a926651752c07a0f863e545d45800623a075a6 Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 1 Jul 2024 16:07:25 +0000 Subject: [PATCH 028/176] Version packages --- .changeset/fair-dingos-accept.md | 9 --------- packages/bitcoin/CHANGELOG.md | 8 ++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 ++++++++ packages/bitcoincash/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 ++++++++ packages/dogecoin/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 ++++++++ packages/litecoin/package.json | 2 +- packages/utxo/CHANGELOG.md | 6 ++++++ packages/utxo/package.json | 2 +- 11 files changed, 43 insertions(+), 14 deletions(-) delete mode 100644 .changeset/fair-dingos-accept.md diff --git a/.changeset/fair-dingos-accept.md b/.changeset/fair-dingos-accept.md deleted file mode 100644 index fd4dd64b..00000000 --- a/.changeset/fair-dingos-accept.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-utxo': patch ---- - -Fix: calculate fee rate to use for bitcoin dusting algorithm diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 854812d4..bdf501ab 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.0.20 + +### Patch Changes + +- fc541c1a: Fix: calculate fee rate to use for bitcoin dusting algorithm +- Updated dependencies [fc541c1a] + - @xdefi-tech/chains-utxo@2.0.10 + ## 2.0.19 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 0b74db4a..c963002c 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.19", + "version": "2.0.20", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 3a0dd88a..69aa8903 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.20 + +### Patch Changes + +- fc541c1a: Fix: calculate fee rate to use for bitcoin dusting algorithm +- Updated dependencies [fc541c1a] + - @xdefi-tech/chains-utxo@2.0.10 + ## 2.0.19 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index f19a437b..9b7b25ff 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.19", + "version": "2.0.20", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 3d72d6d0..9620956c 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.0.19 + +### Patch Changes + +- fc541c1a: Fix: calculate fee rate to use for bitcoin dusting algorithm +- Updated dependencies [fc541c1a] + - @xdefi-tech/chains-utxo@2.0.10 + ## 2.0.18 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 32f04ae3..3daf9a85 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.18", + "version": "2.0.19", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 4bd7824f..ae01aae2 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.0.18 + +### Patch Changes + +- fc541c1a: Fix: calculate fee rate to use for bitcoin dusting algorithm +- Updated dependencies [fc541c1a] + - @xdefi-tech/chains-utxo@2.0.10 + ## 2.0.17 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 6d4ece87..066a8003 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.17", + "version": "2.0.18", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index 07f61f89..2279478c 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-utxo +## 2.0.10 + +### Patch Changes + +- fc541c1a: Fix: calculate fee rate to use for bitcoin dusting algorithm + ## 2.0.9 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index b75da83b..d49b9fae 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.9", + "version": "2.0.10", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From e744b98e82756f09f1be8d8b1e355bd993d13e28 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:09:17 +0700 Subject: [PATCH 029/176] chore: change build turbo config (#257) * chore: change build turbo config * chore: change build turbo config --- turbo.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/turbo.json b/turbo.json index 295962ea..a5bdf3f6 100644 --- a/turbo.json +++ b/turbo.json @@ -5,6 +5,10 @@ "dependsOn": ["^build"], "outputs": ["dist/**"] }, + "@xdefi-tech/chains-evm#build": { + "dependsOn": ["@xdefi-tech/chains-graphql#build"], + "outputs": ["dist/**"] + }, "test": { "env": ["BLOCKCHAIR_API_KEY"] }, From 187d02ee5ee3037b7b89cde130fc984afef9624d Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 3 Jul 2024 14:17:22 +0700 Subject: [PATCH 030/176] chore: add build size report to pull request (#255) * chore: add build size report to pull request * chore: add yarn step * chore: debuging git action * chore: debuging git action * chore: revert test action file * chore: update action file * chore: revert fee file * chore: uninstall size limit package * Chore: Debug build issue * Chore: Disabled cache * Chore: Disabled cache * Chore: Debug build issue * chore: separate size limit config file * chore: separate size limit config file * chore: add dependence to chain evm * chore: remove @xdefi-tech/chains-graphql from evm dependence * chore: change build turbo config * chore: change build turbo config * chore: optimize git report size action * chore: revert packages/evm/src/datasource/indexer/queries/fees.query.ts * chore: change size-limit config --------- Co-authored-by: abhishekgotoadmin <87097447+abhishekgotoadmin@users.noreply.github.com> Co-authored-by: abhishek jha --- .github/workflows/size-report.yml | 22 + package.json | 34 +- yarn.lock | 757 ++++++++++++++++++++++++++++-- 3 files changed, 757 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/size-report.yml diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml new file mode 100644 index 00000000..5eb309fa --- /dev/null +++ b/.github/workflows/size-report.yml @@ -0,0 +1,22 @@ +name: 'size' + +on: + pull_request: + branches: + - develop +jobs: + size: + runs-on: ubuntu-latest + env: + CI_JOB_NUMBER: 1 + + steps: + - uses: actions/checkout@v3 + - name: Enable node + uses: actions/setup-node@v3 + with: + node-version: 20.12.0 + - uses: andresz1/size-limit-action@v1.8.0 + with: + github_token: ${{ secrets.GIT_TOKEN }} + build_script: size-build diff --git a/package.json b/package.json index b7e8ab49..6928f6a8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "scripts": { "prepare": "husky install", "build": "turbo run build", - "size-build": "yarn add --dev @size-limit/file@11.1.4 @size-limit/preset-big-lib@11.1.1 size-limit@11.1.4 --ignore-workspace-root-check && turbo run build", + "size-build": "yarn list | grep @size-limit/file || yarn add --dev @size-limit/file@11.1.4 @size-limit/preset-big-lib@11.1.4 size-limit@11.1.4 --ignore-workspace-root-check --frozen-lockfile && turbo run build", "dev": "turbo run dev", "publish:packages": "turbo run build && turbo run publish:packages", "coverage:per-package": "turbo run coverage", @@ -26,55 +26,56 @@ "clean": "turbo run clean && rimraf node_modules", "typedoc": "turbo run typedoc", "chain:generate": "HYGEN_TMPLS=templates hygen basic new", - "publish-packages": "turbo run build lint && changeset version && changeset publish" + "publish-packages": "turbo run build lint && changeset version && changeset publish", + "size": "yarn size-build && size-limit" }, "size-limit": [ { - "path": "packages/binance/dist/index.js", + "path": "packages/binance/dist", "webpack": false }, { - "path": "packages/bitcoin/dist/index.js", + "path": "packages/bitcoin/dist", "webpack": false }, { - "path": "packages/bitcoincash/dist/index.js", + "path": "packages/bitcoincash/dist", "webpack": false }, { - "path": "packages/core/dist/index.js", + "path": "packages/core/dist", "webpack": false }, { - "path": "packages/cosmos/dist/index.js", + "path": "packages/cosmos/dist", "webpack": false }, { - "path": "packages/dogecoin/dist/index.js", + "path": "packages/dogecoin/dist", "webpack": false }, { - "path": "packages/evm/dist/index.js", + "path": "packages/evm/dist", "webpack": false }, { - "path": "packages/litecoin/dist/index.js", + "path": "packages/litecoin/dist", "webpack": false }, { - "path": "packages/solana/dist/index.js", + "path": "packages/solana/dist", "webpack": false }, { - "path": "packages/thor/dist/index.js", + "path": "packages/thor/dist", "webpack": false }, { - "path": "packages/tron/dist/index.js", + "path": "packages/tron/dist", "webpack": false }, { - "path": "packages/utxo/dist/index.js", + "path": "packages/utxo/dist", "webpack": false } ], @@ -84,9 +85,12 @@ "@babel/plugin-proposal-decorators": "7.21.0", "@babel/preset-env": "7.21.5", "@babel/preset-typescript": "7.23.3", + "@size-limit/file": "11.1.4", + "@size-limit/preset-big-lib": "11.1.4", "babel-loader": "9.1.2", "husky": "8.0.3", "prettier": "2.5.1", + "size-limit": "11.1.4", "terser-webpack-plugin": "5.3.7", "ts-loader": "9.4.2", "turbo": "latest", @@ -96,7 +100,7 @@ }, "engines": { "npm": ">=7.0.0", - "node": ">=14.0.0" + "node": ">=18.0.0" }, "packageManager": "yarn@1.22.17", "dependencies": { diff --git a/yarn.lock b/yarn.lock index 5ff8acd1..2a748e60 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5315,6 +5315,34 @@ dependencies: "@psf/bitcoincash-ops" "^2.0.0" +"@puppeteer/browsers@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.2.2.tgz#c43b00a9808370fec3e548779d81d1e0b972e8bb" + integrity sha512-hZ/JhxPIceWaGSEzUZp83/8M49CoxlkuThfTR7t4AoCu5+ZvJ3vktLm60Otww2TXeROB5igiZ8D9oPQh6ckBVg== + dependencies: + debug "4.3.4" + extract-zip "2.0.1" + progress "2.0.3" + proxy-agent "6.4.0" + semver "7.6.0" + tar-fs "3.0.5" + unbzip2-stream "1.4.3" + yargs "17.7.2" + +"@puppeteer/browsers@^2.1.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.2.3.tgz#ad6b79129c50825e77ddaba082680f4dad0b674e" + integrity sha512-bJ0UBsk0ESOs6RFcLXOt99a3yTDcOKlzfjad+rhFwdaG1Lu/Wzq58GHYCDTlZ9z6mldf4g+NTb+TXEfe0PpnsQ== + dependencies: + debug "4.3.4" + extract-zip "2.0.1" + progress "2.0.3" + proxy-agent "6.4.0" + semver "7.6.0" + tar-fs "3.0.5" + unbzip2-stream "1.4.3" + yargs "17.7.2" + "@react-native-community/cli-clean@^10.1.1": version "10.1.1" resolved "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-10.1.1.tgz" @@ -5581,6 +5609,11 @@ resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== +"@sindresorhus/merge-streams@^2.1.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz#719df7fb41766bc143369eaa0dd56d8dc87c9958" + integrity sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg== + "@sinonjs/commons@^1.7.0": version "1.8.6" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" @@ -5609,6 +5642,43 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@sitespeed.io/tracium@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@sitespeed.io/tracium/-/tracium-0.3.3.tgz#b497a4a8d5837db1fd9e3053c99b78f6c0e1f53b" + integrity sha512-dNZafjM93Y+F+sfwTO5gTpsGXlnc/0Q+c2+62ViqP3gkMWvHEMSKkaEHgVJLcLg3i/g19GSIPziiKpgyne07Bw== + dependencies: + debug "^4.1.1" + +"@size-limit/file@11.1.4": + version "11.1.4" + resolved "https://registry.yarnpkg.com/@size-limit/file/-/file-11.1.4.tgz#b5bba86918123783b730879362e78c8cb737d149" + integrity sha512-QxnGj9cxhCEuqMAV01gqonXIKcc+caZqFHZpV51oL2ZJNGSPP9Q/yyf+7HbVe00faOFd1dZZwMwzZmX7HQ9LbA== + +"@size-limit/preset-big-lib@11.1.4": + version "11.1.4" + resolved "https://registry.yarnpkg.com/@size-limit/preset-big-lib/-/preset-big-lib-11.1.4.tgz#6af8ff2d6d74080b7a13d4df922ab4a428d0f2d9" + integrity sha512-bejHzQXW+RkWNmCRsny/MmmjshQsU0/vVKSYnZKiu8J2zWIpxZ2pFT79ud+pCQoXeH11rI/YObItcaPf+URAng== + dependencies: + "@size-limit/file" "11.1.4" + "@size-limit/time" "11.1.4" + "@size-limit/webpack" "11.1.4" + size-limit "11.1.4" + +"@size-limit/time@11.1.4": + version "11.1.4" + resolved "https://registry.yarnpkg.com/@size-limit/time/-/time-11.1.4.tgz#636f635eede75d05fb084de5c56dbd589e57d994" + integrity sha512-TxEeDZrNWQ1uwFjQT0d4NHUG7MGGrjnKSn9CwuF+Wb4AeZWy1nb93HjPCfe8LbQedV7xRY6dV/oSiARYvReuYg== + dependencies: + estimo "^3.0.3" + +"@size-limit/webpack@11.1.4": + version "11.1.4" + resolved "https://registry.yarnpkg.com/@size-limit/webpack/-/webpack-11.1.4.tgz#9eb65b921954608823daa366687b012b2af401f0" + integrity sha512-ikkvhPID8smxuBpO0VO2cgTutHcY3INPtVO4z9Qzb/ZdLV4zQ0MwtxWA9mZz92p+wLvTBKkMrewCdUYO2CIIaQ== + dependencies: + nanoid "^5.0.7" + webpack "^5.91.0" + "@solana/buffer-layout-utils@^0.2.0": version "0.2.0" resolved "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz" @@ -5987,6 +6057,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@tootallnate/quickjs-emscripten@^0.23.0": + version "0.23.0" + resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" + integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== + "@trezor/analytics@1.0.8": version "1.0.8" resolved "https://registry.npmjs.org/@trezor/analytics/-/analytics-1.0.8.tgz" @@ -6268,7 +6343,7 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^1.0.0": +"@types/estree@*", "@types/estree@^1.0.0", "@types/estree@^1.0.5": version "1.0.5" resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== @@ -6587,6 +6662,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yauzl@^2.9.1": + version "2.10.3" + resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.3.tgz#e9b2808b4f109504a03cda958259876f61017999" + integrity sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q== + dependencies: + "@types/node" "*" + "@typescript-eslint/eslint-plugin@5.54.1": version "5.54.1" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.54.1.tgz" @@ -6747,6 +6829,14 @@ "@webassemblyjs/helper-numbers" "1.11.6" "@webassemblyjs/helper-wasm-bytecode" "1.11.6" +"@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.12.1.tgz#bb16a0e8b1914f979f45864c23819cc3e3f0d4bb" + integrity sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/floating-point-hex-parser@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz" @@ -6762,6 +6852,11 @@ resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz" integrity sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA== +"@webassemblyjs/helper-buffer@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz#6df20d272ea5439bf20ab3492b7fb70e9bfcb3f6" + integrity sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw== + "@webassemblyjs/helper-numbers@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz" @@ -6786,6 +6881,16 @@ "@webassemblyjs/helper-wasm-bytecode" "1.11.6" "@webassemblyjs/wasm-gen" "1.11.6" +"@webassemblyjs/helper-wasm-section@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz#3da623233ae1a60409b509a52ade9bc22a37f7bf" + integrity sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/ieee754@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz" @@ -6819,6 +6924,20 @@ "@webassemblyjs/wasm-parser" "1.11.6" "@webassemblyjs/wast-printer" "1.11.6" +"@webassemblyjs/wasm-edit@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz#9f9f3ff52a14c980939be0ef9d5df9ebc678ae3b" + integrity sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-wasm-section" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-opt" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + "@webassemblyjs/wast-printer" "1.12.1" + "@webassemblyjs/wasm-gen@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz" @@ -6830,6 +6949,17 @@ "@webassemblyjs/leb128" "1.11.6" "@webassemblyjs/utf8" "1.11.6" +"@webassemblyjs/wasm-gen@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz#a6520601da1b5700448273666a71ad0a45d78547" + integrity sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + "@webassemblyjs/wasm-opt@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz" @@ -6840,6 +6970,16 @@ "@webassemblyjs/wasm-gen" "1.11.6" "@webassemblyjs/wasm-parser" "1.11.6" +"@webassemblyjs/wasm-opt@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz#9e6e81475dfcfb62dab574ac2dda38226c232bc5" + integrity sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + "@webassemblyjs/wasm-parser@1.11.6", "@webassemblyjs/wasm-parser@^1.11.5": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz" @@ -6852,6 +6992,18 @@ "@webassemblyjs/leb128" "1.11.6" "@webassemblyjs/utf8" "1.11.6" +"@webassemblyjs/wasm-parser@1.12.1", "@webassemblyjs/wasm-parser@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz#c47acb90e6f083391e3fa61d113650eea1e95937" + integrity sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + "@webassemblyjs/wast-printer@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz" @@ -6860,6 +7012,14 @@ "@webassemblyjs/ast" "1.11.6" "@xtuc/long" "4.2.2" +"@webassemblyjs/wast-printer@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz#bcecf661d7d1abdaf989d8341a4833e33e2b31ac" + integrity sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@xtuc/long" "4.2.2" + "@webpack-cli/configtest@^2.1.0": version "2.1.1" resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz" @@ -6996,6 +7156,11 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz" integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== +acorn-import-attributes@^1.9.5: + version "1.9.5" + resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" + integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" @@ -7050,6 +7215,13 @@ agent-base@^7.0.2, agent-base@^7.1.0: dependencies: debug "^4.3.4" +agent-base@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317" + integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA== + dependencies: + debug "^4.3.4" + agentkeepalive@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz" @@ -7411,6 +7583,13 @@ ast-types@0.15.2: dependencies: tslib "^2.0.1" +ast-types@^0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.4.tgz#ee0d77b343263965ecc3fb62da16e7222b2b6782" + integrity sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w== + dependencies: + tslib "^2.0.1" + astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz" @@ -7560,9 +7739,9 @@ axobject-query@^3.2.1: dependencies: dequal "^2.0.3" -b4a@^1.6.0: +b4a@^1.6.0, b4a@^1.6.4: version "1.6.6" - resolved "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz" + resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.6.tgz#a4cc349a3851987c3c4ac2d7785c18744f6da9ba" integrity sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg== babel-core@^7.0.0-bridge.0: @@ -7768,6 +7947,39 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +bare-events@^2.0.0, bare-events@^2.2.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/bare-events/-/bare-events-2.4.2.tgz#3140cca7a0e11d49b3edc5041ab560659fd8e1f8" + integrity sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q== + +bare-fs@^2.1.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/bare-fs/-/bare-fs-2.3.1.tgz#cdbd63dac7a552dfb2b87d18c822298d1efd213d" + integrity sha512-W/Hfxc/6VehXlsgFtbB5B4xFcsCl+pAh30cYhoFyXErf6oGrwjh8SwiPAdHgpmWonKuYpZgGywN0SXt7dgsADA== + dependencies: + bare-events "^2.0.0" + bare-path "^2.0.0" + bare-stream "^2.0.0" + +bare-os@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/bare-os/-/bare-os-2.4.0.tgz#5de5e3ba7704f459c9656629edca7cc736e06608" + integrity sha512-v8DTT08AS/G0F9xrhyLtepoo9EJBJ85FRSMbu1pQUlAf6A8T0tEEQGMVObWeqpjhSPXsE0VGlluFBJu2fdoTNg== + +bare-path@^2.0.0, bare-path@^2.1.0: + version "2.1.3" + resolved "https://registry.yarnpkg.com/bare-path/-/bare-path-2.1.3.tgz#594104c829ef660e43b5589ec8daef7df6cedb3e" + integrity sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA== + dependencies: + bare-os "^2.1.0" + +bare-stream@^2.0.0: + version "2.1.3" + resolved "https://registry.yarnpkg.com/bare-stream/-/bare-stream-2.1.3.tgz#070b69919963a437cc9e20554ede079ce0a129b2" + integrity sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ== + dependencies: + streamx "^2.18.0" + base-x@^3.0.2, base-x@^3.0.9: version "3.0.9" resolved "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz" @@ -7790,6 +8002,11 @@ base64-js@^1.1.2, base64-js@^1.2.3, base64-js@^1.3.0, base64-js@^1.3.1, base64-j resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +basic-ftp@^5.0.2: + version "5.0.5" + resolved "https://registry.yarnpkg.com/basic-ftp/-/basic-ftp-5.0.5.tgz#14a474f5fffecca1f4f406f1c26b18f800225ac0" + integrity sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg== + bchaddrjs@0.5.2, bchaddrjs@^0.5.2: version "0.5.2" resolved "https://registry.npmjs.org/bchaddrjs/-/bchaddrjs-0.5.2.tgz" @@ -8155,6 +8372,16 @@ browserslist@^4.14.5, browserslist@^4.22.2: node-releases "^2.0.14" update-browserslist-db "^1.0.13" +browserslist@^4.21.10: + version "4.23.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.1.tgz#ce4af0534b3d37db5c1a4ca98b9080f985041e96" + integrity sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw== + dependencies: + caniuse-lite "^1.0.30001629" + electron-to-chromium "^1.4.796" + node-releases "^2.0.14" + update-browserslist-db "^1.0.16" + bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -8218,6 +8445,11 @@ buffer-alloc@^1.1.0: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" +buffer-crc32@~0.2.3: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== + buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz" @@ -8241,9 +8473,9 @@ buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -buffer@^5.5.0: +buffer@^5.2.1, buffer@^5.5.0: version "5.7.1" - resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== dependencies: base64-js "^1.3.1" @@ -8282,6 +8514,11 @@ bytebuffer@^5.0.1: dependencies: long "~3" +bytes-iec@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/bytes-iec/-/bytes-iec-3.1.1.tgz#94cd36bf95c2c22a82002c247df8772d1d591083" + integrity sha512-fey6+4jDK7TFtFg/klGSvNKJctyU7n2aQdnM+CO0ruLPbqqMOM8Tio0Pc+deqUeVKX1tL5DQep1zQ7+37aTAsA== + bytes@3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz" @@ -8406,6 +8643,11 @@ caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001580: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz" integrity sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ== +caniuse-lite@^1.0.30001629: + version "1.0.30001639" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001639.tgz#972b3a6adeacdd8f46af5fc7f771e9639f6c1521" + integrity sha512-eFHflNTBIlFwP2AIKaYuBQN/apnUoKNhBdza8ZnW/h2di4LCZ4xFqYlxUxo+LQ76KFI1PGcC1QDxMbxTZpSCAg== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz" @@ -8546,7 +8788,7 @@ charenc@0.0.2, charenc@~0.0.1: resolved "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz" integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== -chokidar@^3.5.1: +chokidar@^3.5.1, chokidar@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== @@ -8576,6 +8818,15 @@ chrome-trace-event@^1.0.2: resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz" integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== +chromium-bidi@0.5.17: + version "0.5.17" + resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-0.5.17.tgz#04b66fa77f9ab80234b72206e71fc2af96fd08c4" + integrity sha512-BqOuIWUgTPj8ayuBFJUYCCuwIcwjBsb3/614P7tt1bEPJ4i1M0kCdIl0Wi9xhtswBXnfO2bTpTMkHD71H8rJMg== + dependencies: + mitt "3.0.1" + urlpattern-polyfill "10.0.0" + zod "3.22.4" + ci-info@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" @@ -9151,6 +9402,11 @@ damerau-levenshtein@^1.0.8: resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== +data-uri-to-buffer@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz#8a58bb67384b261a38ef18bea1810cb01badd28b" + integrity sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw== + data-urls@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" @@ -9209,7 +9465,7 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -9321,6 +9577,15 @@ define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +degenerator@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-5.0.1.tgz#9403bf297c6dad9a1ece409b37db27954f91f2f5" + integrity sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ== + dependencies: + ast-types "^0.13.4" + escodegen "^2.1.0" + esprima "^4.0.1" + degit@^2.8.4: version "2.8.4" resolved "https://registry.npmjs.org/degit/-/degit-2.8.4.tgz" @@ -9417,6 +9682,11 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== +devtools-protocol@0.0.1262051: + version "0.0.1262051" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1262051.tgz#670b1f8459b2a136e05bd9a8d54ec0212d543a38" + integrity sha512-YJe4CT5SA8on3Spa+UDtNhEqtuV6Epwz3OZ4HQVLhlRccpZ9/PAYk0/cy/oKxFKRrZPBUPyxympQci4yWNWZ9g== + diff-sequences@^25.2.6: version "25.2.6" resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz" @@ -9609,6 +9879,11 @@ electron-to-chromium@^1.4.648: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.657.tgz" integrity sha512-On2ymeleg6QbRuDk7wNgDdXtNqlJLM2w4Agx1D/RiTmItiL+a9oq5p7HUa2ZtkAtGBe/kil2dq/7rPfkbe0r5w== +electron-to-chromium@^1.4.796: + version "1.4.816" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.816.tgz#3624649d1e7fde5cdbadf59d31a524245d8ee85f" + integrity sha512-EKH5X5oqC6hLmiS7/vYtZHZFTNdhsYG5NVPRN6Yn0kQHNBlT59+xSM8HBy66P5fxWpKgZbPqb+diC64ng295Jw== + elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" @@ -9693,6 +9968,14 @@ enhanced-resolve@^5.12.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.17.0: + version "5.17.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz#d037603789dd9555b89aaec7eb78845c49089bc5" + integrity sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enquirer@^2.3.0, enquirer@^2.3.6: version "2.4.1" resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz" @@ -9953,7 +10236,7 @@ esbuild@^0.17.6: "@esbuild/win32-ia32" "0.17.19" "@esbuild/win32-x64" "0.17.19" -escalade@^3.1.1: +escalade@^3.1.1, escalade@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz" integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== @@ -9978,7 +10261,7 @@ escape-string-regexp@^4.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^2.0.0: +escodegen@^2.0.0, escodegen@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== @@ -10382,6 +10665,17 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" +estimo@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/estimo/-/estimo-3.0.3.tgz#848cfb6136cab3175a4ddb6b45c35b16f5301130" + integrity sha512-qSibrDHo82yvmgeOW7onGgeOzS/nnqa8r2exQ8LyTSH8rAma10VBJE+hPSdukV1nQrqFvEz7BVe5puUK2LZJXg== + dependencies: + "@sitespeed.io/tracium" "^0.3.3" + commander "^12.0.0" + find-chrome-bin "2.0.2" + nanoid "5.0.7" + puppeteer-core "22.6.5" + estraverse@^4.1.1: version "4.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" @@ -10777,6 +11071,17 @@ extract-files@^11.0.0: resolved "https://registry.npmjs.org/extract-files/-/extract-files-11.0.0.tgz" integrity sha512-FuoE1qtbJ4bBVvv94CC7s0oTnKUGvQs+Rjf1L2SJFfS+HTVVjhPFtehPdQ0JiGPqVNfSSZvL5yzHHQq2Z4WNhQ== +extract-zip@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" + integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== + dependencies: + debug "^4.1.1" + get-stream "^5.1.0" + yauzl "^2.10.0" + optionalDependencies: + "@types/yauzl" "^2.9.1" + eyes@^0.1.8: version "0.1.8" resolved "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz" @@ -10797,7 +11102,12 @@ fast-diff@^1.1.2: resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== -fast-glob@^3.2.5, fast-glob@^3.2.9, fast-glob@^3.3.0, fast-glob@^3.3.1: +fast-fifo@^1.2.0, fast-fifo@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" + integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== + +fast-glob@^3.2.5, fast-glob@^3.2.9, fast-glob@^3.3.0, fast-glob@^3.3.1, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -10888,6 +11198,13 @@ fbjs@^3.0.0, fbjs@^3.0.1: setimmediate "^1.0.5" ua-parser-js "^1.0.35" +fd-slicer@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== + dependencies: + pend "~1.2.0" + fetch-retry@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/fetch-retry/-/fetch-retry-4.1.1.tgz" @@ -10972,6 +11289,13 @@ find-cache-dir@^3.3.2: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-chrome-bin@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/find-chrome-bin/-/find-chrome-bin-2.0.2.tgz#75f3c998583c22dabd7af2557b62c44f21c0eadd" + integrity sha512-KlggCilbbvgETk/WEq9NG894U8yu4erIW0SjMm1sMPm2xihCHeNoybpzGoxEzHRthwF3XrKOgHYtfqgJzpCH2w== + dependencies: + "@puppeteer/browsers" "^2.1.0" + find-root@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz" @@ -11141,6 +11465,15 @@ fs-extra@^10.0.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" + integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz" @@ -11273,6 +11606,13 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" @@ -11309,6 +11649,16 @@ get-tsconfig@^4.5.0: dependencies: resolve-pkg-maps "^1.0.0" +get-uri@^6.0.1: + version "6.0.3" + resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-6.0.3.tgz#0d26697bc13cf91092e519aa63aa60ee5b6f385a" + integrity sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw== + dependencies: + basic-ftp "^5.0.2" + data-uri-to-buffer "^6.0.2" + debug "^4.3.4" + fs-extra "^11.2.0" + getenv@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/getenv/-/getenv-1.0.0.tgz" @@ -11448,6 +11798,18 @@ globby@^13.1.2: merge2 "^1.4.1" slash "^4.0.0" +globby@^14.0.1: + version "14.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-14.0.2.tgz#06554a54ccfe9264e5a9ff8eded46aa1e306482f" + integrity sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw== + dependencies: + "@sindresorhus/merge-streams" "^2.1.0" + fast-glob "^3.3.2" + ignore "^5.2.4" + path-type "^5.0.0" + slash "^5.1.0" + unicorn-magic "^0.1.0" + google-protobuf@^3.17.3: version "3.21.2" resolved "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz" @@ -11460,7 +11822,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -11739,6 +12101,14 @@ http-proxy-agent@^6.0.0: agent-base "^7.1.0" debug "^4.3.4" +http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1: + version "7.0.2" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e" + integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig== + dependencies: + agent-base "^7.1.0" + debug "^4.3.4" + https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" @@ -11755,6 +12125,14 @@ https-proxy-agent@^6.0.0: agent-base "^7.0.2" debug "4" +https-proxy-agent@^7.0.3, https-proxy-agent@^7.0.5: + version "7.0.5" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2" + integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw== + dependencies: + agent-base "^7.0.2" + debug "4" + human-id@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz" @@ -11970,6 +12348,14 @@ inversify@6.0.1: resolved "https://registry.npmjs.org/inversify/-/inversify-6.0.1.tgz" integrity sha512-B3ex30927698TJENHR++8FfEaJGqoWOgI6ZY5Ht/nLUsFCwHn6akbwtnUAPCgUepAnTpe2qHxhDNjoKLyz6rgQ== +ip-address@^9.0.5: + version "9.0.5" + resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" + integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g== + dependencies: + jsbn "1.1.0" + sprintf-js "^1.1.3" + ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz" @@ -13052,6 +13438,11 @@ jiti@^1.17.1: resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz" integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== +jiti@^1.21.0: + version "1.21.6" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.6.tgz#6c7f7398dd4b3142767f9a168af2f317a428d268" + integrity sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w== + joi@^17.2.1: version "17.12.1" resolved "https://registry.npmjs.org/joi/-/joi-17.12.1.tgz" @@ -13108,6 +13499,11 @@ js-yaml@^4.0.0, js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +jsbn@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" + integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== + jsc-android@^250231.0.0: version "250231.0.0" resolved "https://registry.npmjs.org/jsc-android/-/jsc-android-250231.0.0.tgz" @@ -13430,6 +13826,11 @@ lilconfig@^2.0.5: resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== +lilconfig@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.2.tgz#e4a7c3cb549e3a606c8dcc32e5ae1005e62c05cb" + integrity sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow== + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" @@ -13640,6 +14041,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lru-cache@^7.14.1: + version "7.18.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" + integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== + "lru-cache@^9.1.1 || ^10.0.0": version "10.2.0" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz" @@ -14363,6 +14769,11 @@ minizlib@^2.1.1: minipass "^3.0.0" yallist "^4.0.0" +mitt@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" + integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw== + mixme@^0.5.1: version "0.5.10" resolved "https://registry.npmjs.org/mixme/-/mixme-0.5.10.tgz" @@ -14448,11 +14859,23 @@ nan@^2.13.2, nan@^2.14.0: resolved "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz" integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== +nanoid@5.0.7, nanoid@^5.0.7: + version "5.0.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-5.0.7.tgz#6452e8c5a816861fd9d2b898399f7e5fd6944cc6" + integrity sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ== + nanoid@^3.3.4: version "3.3.7" resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== +nanospinner@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/nanospinner/-/nanospinner-1.1.0.tgz#d17ff621cb1784b0a206b400da88a0ef6db39b97" + integrity sha512-yFvNYMig4AthKYfHFl1sLj7B2nkHL4lzdig4osvl9/LdGbXwrdFRoqBS98gsEsOakr0yH+r5NZ/1Y9gdVB8trA== + dependencies: + picocolors "^1.0.0" + napi-build-utils@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz" @@ -14503,6 +14926,11 @@ nested-error-stacks@~2.0.1: resolved "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.0.1.tgz" integrity sha512-SrQrok4CATudVzBS7coSz26QRSmlK9TzzoFbeKfcPBUFPjcQM9Rqvr/DlJkOrwI/0KcgvMub1n1g5Jt9EgRn4A== +netmask@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" + integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== + next-compose-plugins@2.2.1: version "2.2.1" resolved "https://registry.npmjs.org/next-compose-plugins/-/next-compose-plugins-2.2.1.tgz" @@ -15034,6 +15462,28 @@ p-try@^2.0.0: resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +pac-proxy-agent@^7.0.1: + version "7.0.2" + resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz#0fb02496bd9fb8ae7eb11cfd98386daaac442f58" + integrity sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg== + dependencies: + "@tootallnate/quickjs-emscripten" "^0.23.0" + agent-base "^7.0.2" + debug "^4.3.4" + get-uri "^6.0.1" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.5" + pac-resolver "^7.0.1" + socks-proxy-agent "^8.0.4" + +pac-resolver@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-7.0.1.tgz#54675558ea368b64d210fd9c92a640b5f3b8abb6" + integrity sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg== + dependencies: + degenerator "^5.0.0" + netmask "^2.0.2" + pako@^2.0.2: version "2.1.0" resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" @@ -15215,6 +15665,11 @@ path-type@^4.0.0: resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +path-type@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-5.0.0.tgz#14b01ed7aea7ddf9c7c3f46181d4d04f9c785bb8" + integrity sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg== + pbkdf2@^3.0.17, pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" @@ -15226,11 +15681,21 @@ pbkdf2@^3.0.17, pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" + integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" @@ -15499,6 +15964,20 @@ protocol-buffers-encodings@^1.1.0: signed-varint "^2.0.1" varint "5.0.0" +proxy-agent@6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-6.4.0.tgz#b4e2dd51dee2b377748aef8d45604c2d7608652d" + integrity sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ== + dependencies: + agent-base "^7.0.2" + debug "^4.3.4" + http-proxy-agent "^7.0.1" + https-proxy-agent "^7.0.3" + lru-cache "^7.14.1" + pac-proxy-agent "^7.0.1" + proxy-from-env "^1.1.0" + socks-proxy-agent "^8.0.2" + proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" @@ -15553,6 +16032,17 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== +puppeteer-core@22.6.5: + version "22.6.5" + resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-22.6.5.tgz#320eb6ab51e479c6a04cbb831b414e1cd51a7220" + integrity sha512-s0/5XkAWe0/dWISiljdrybjwDCHhgN31Nu/wznOZPKeikgcJtZtbvPKBz0t802XWqfSQnQDt3L6xiAE5JLlfuw== + dependencies: + "@puppeteer/browsers" "2.2.2" + chromium-bidi "0.5.17" + debug "4.3.4" + devtools-protocol "0.0.1262051" + ws "8.16.0" + pure-color@^1.2.0: version "1.3.0" resolved "https://registry.npmjs.org/pure-color/-/pure-color-1.3.0.tgz" @@ -15611,6 +16101,11 @@ queue-microtask@^1.2.2: resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +queue-tick@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/queue-tick/-/queue-tick-1.0.1.tgz#f6f07ac82c1fd60f82e098b417a80e52f1f4c142" + integrity sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag== + quick-lru@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" @@ -16427,9 +16922,9 @@ scheduler@^0.23.0: dependencies: loose-envify "^1.1.0" -schema-utils@^3.1.1, schema-utils@^3.1.2: +schema-utils@^3.1.1, schema-utils@^3.1.2, schema-utils@^3.2.0: version "3.3.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== dependencies: "@types/json-schema" "^7.0.8" @@ -16517,6 +17012,13 @@ semver@7.3.2: resolved "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== +semver@7.6.0, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3: + version "7.6.0" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz" + integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== + dependencies: + lru-cache "^6.0.0" + semver@7.x, semver@^7.3.2: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" @@ -16527,13 +17029,6 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3: - version "7.6.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz" - integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== - dependencies: - lru-cache "^6.0.0" - send@0.18.0, send@^0.18.0: version "0.18.0" resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz" @@ -16804,6 +17299,19 @@ sisteransi@^1.0.5: resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== +size-limit@11.1.4: + version "11.1.4" + resolved "https://registry.yarnpkg.com/size-limit/-/size-limit-11.1.4.tgz#0fd9418c7cae0cc77b6cb9bbe4f08cb2b3b0e126" + integrity sha512-V2JAI/Z7h8sEuxU3V+Ig3XKA5FcYbI4CZ7sh6s7wvuy+TUwDZYqw7sAqrHhQ4cgcNfPKIAHAaH8VaqOdbcwJDA== + dependencies: + bytes-iec "^3.1.1" + chokidar "^3.6.0" + globby "^14.0.1" + jiti "^1.21.0" + lilconfig "^3.1.1" + nanospinner "^1.1.0" + picocolors "^1.0.1" + slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" @@ -16814,6 +17322,11 @@ slash@^4.0.0: resolved "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz" integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== +slash@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-5.1.0.tgz#be3adddcdf09ac38eebe8dcdc7b1a57a75b095ce" + integrity sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg== + slice-ansi@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz" @@ -16887,6 +17400,15 @@ socks-proxy-agent@6.1.1: debug "^4.3.1" socks "^2.6.1" +socks-proxy-agent@^8.0.2, socks-proxy-agent@^8.0.4: + version "8.0.4" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz#9071dca17af95f483300316f4b063578fa0db08c" + integrity sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw== + dependencies: + agent-base "^7.1.1" + debug "^4.3.4" + socks "^2.8.3" + socks@^2.6.1: version "2.7.1" resolved "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz" @@ -16895,6 +17417,14 @@ socks@^2.6.1: ip "^2.0.0" smart-buffer "^4.2.0" +socks@^2.8.3: + version "2.8.3" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.3.tgz#1ebd0f09c52ba95a09750afe3f3f9f724a800cb5" + integrity sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw== + dependencies: + ip-address "^9.0.5" + smart-buffer "^4.2.0" + source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" @@ -16990,6 +17520,11 @@ sponge-case@^1.0.1: dependencies: tslib "^2.0.3" +sprintf-js@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" + integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" @@ -17061,6 +17596,17 @@ streamsearch@^1.1.0: resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== +streamx@^2.15.0, streamx@^2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.18.0.tgz#5bc1a51eb412a667ebfdcd4e6cf6a6fc65721ac7" + integrity sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ== + dependencies: + fast-fifo "^1.3.2" + queue-tick "^1.0.1" + text-decoder "^1.1.0" + optionalDependencies: + bare-events "^2.2.0" + string-env-interpolation@1.0.1, string-env-interpolation@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/string-env-interpolation/-/string-env-interpolation-1.0.1.tgz" @@ -17082,7 +17628,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17100,6 +17646,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -17201,7 +17756,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17222,6 +17777,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -17401,6 +17963,17 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== +tar-fs@3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-3.0.5.tgz#f954d77767e4e6edf973384e1eb95f8f81d64ed9" + integrity sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg== + dependencies: + pump "^3.0.0" + tar-stream "^3.1.5" + optionalDependencies: + bare-fs "^2.1.1" + bare-path "^2.1.0" + tar-fs@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz" @@ -17422,6 +17995,15 @@ tar-stream@^2.1.4: inherits "^2.0.3" readable-stream "^3.1.1" +tar-stream@^3.1.5: + version "3.1.7" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-3.1.7.tgz#24b3fb5eabada19fe7338ed6d26e5f7c482e792b" + integrity sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ== + dependencies: + b4a "^1.6.4" + fast-fifo "^1.2.0" + streamx "^2.15.0" + tar@^6.0.2, tar@^6.0.5: version "6.2.0" resolved "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz" @@ -17503,9 +18085,9 @@ terser-webpack-plugin@5.3.7: serialize-javascript "^6.0.1" terser "^5.16.5" -terser-webpack-plugin@^5.3.7: +terser-webpack-plugin@^5.3.10, terser-webpack-plugin@^5.3.7: version "5.3.10" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== dependencies: "@jridgewell/trace-mapping" "^0.3.20" @@ -17533,6 +18115,13 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" +text-decoder@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/text-decoder/-/text-decoder-1.1.0.tgz#3379e728fcf4d3893ec1aea35e8c2cac215ef190" + integrity sha512-TmLJNj6UgX8xcUZo4UDStGQtDiTzF7BzWlzn9g7UWrjkpHr5uJTK1ld16wZ3LXb2vb6jH8qU89dW5whuMdXYdw== + dependencies: + b4a "^1.6.4" + text-encoding-utf-8@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz" @@ -18145,6 +18734,14 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +unbzip2-stream@1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" + integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== + dependencies: + buffer "^5.2.1" + through "^2.3.8" + unc-path-regex@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz" @@ -18178,6 +18775,11 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== +unicorn-magic@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz#1bb9a51c823aaf9d73a8bfcd3d1a23dde94b0ce4" + integrity sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ== + unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz" @@ -18246,6 +18848,14 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.0.16: + version "1.0.16" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz#f6d489ed90fb2f07d67784eb3f53d7891f736356" + integrity sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + upper-case-first@^1.1.0, upper-case-first@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/upper-case-first/-/upper-case-first-1.1.2.tgz" @@ -18300,6 +18910,11 @@ url@^0.11.0: punycode "^1.4.1" qs "^6.11.2" +urlpattern-polyfill@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz#f0a03a97bfb03cdf33553e5e79a2aadd22cac8ec" + integrity sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg== + urlpattern-polyfill@^8.0.0: version "8.0.2" resolved "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz" @@ -18512,6 +19127,14 @@ watchpack@^2.4.0: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" +watchpack@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.1.tgz#29308f2cac150fa8e4c92f90e0ec954a9fed7fff" + integrity sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" @@ -18641,6 +19264,36 @@ webpack@5.82.1: watchpack "^2.4.0" webpack-sources "^3.2.3" +webpack@^5.91.0: + version "5.92.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.92.1.tgz#eca5c1725b9e189cffbd86e8b6c3c7400efc5788" + integrity sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^1.0.5" + "@webassemblyjs/ast" "^1.12.1" + "@webassemblyjs/wasm-edit" "^1.12.1" + "@webassemblyjs/wasm-parser" "^1.12.1" + acorn "^8.7.1" + acorn-import-attributes "^1.9.5" + browserslist "^4.21.10" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.17.0" + es-module-lexer "^1.2.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.11" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.2.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" + webpack-sources "^3.2.3" + websocket-stream@^5.5.0: version "5.5.2" resolved "https://registry.npmjs.org/websocket-stream/-/websocket-stream-5.5.2.tgz" @@ -18813,7 +19466,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18831,6 +19484,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" @@ -18879,6 +19541,11 @@ ws@8.13.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== +ws@8.16.0, ws@^8.12.0, ws@^8.12.1, ws@^8.5.0: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" + integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== + ws@8.5.0: version "8.5.0" resolved "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz" @@ -18910,11 +19577,6 @@ ws@^7.5.10: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== -ws@^8.12.0, ws@^8.12.1, ws@^8.5.0: - version "8.16.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz" - integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== - xcode@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz" @@ -19027,6 +19689,19 @@ yargs-parser@^21.0.0, yargs-parser@^21.1.1: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== +yargs@17.7.2, yargs@^17.0.0, yargs@^17.5.1, yargs@^17.7.1: + version "17.7.2" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + yargs@^15.1.0, yargs@^15.3.1: version "15.4.1" resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" @@ -19057,18 +19732,13 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.0.0, yargs@^17.5.1, yargs@^17.7.1: - version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== +yauzl@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" + buffer-crc32 "~0.2.3" + fd-slicer "~1.1.0" yn@3.1.1: version "3.1.1" @@ -19091,3 +19761,8 @@ zen-observable@0.8.15: version "0.8.15" resolved "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz" integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== + +zod@3.22.4: + version "3.22.4" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" + integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== From 09658081fa480e86162a7a7be78d7a88590e79f5 Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:57:39 +0700 Subject: [PATCH 031/176] feat: Tron Signers - signMessage, signMessageV2, sign, signTransaction for all wallets types (#258) * feat: Tron Signers - signMessage, signMessageV2, sign, signTransaction for all wallets types * feat: throw Ledger wallet does not support signMessage * feat: unit test with real signature * chore: add changeset * chore: re-export Bytes type from ethers --- .changeset/slow-needles-buy.md | 5 ++ .../tron/src/signers/ledger.signer.spec.ts | 32 ++++++++- packages/tron/src/signers/ledger.signer.ts | 29 ++++++++ .../src/signers/private-key.signer.spec.ts | 56 ++++++++++++++++ .../tron/src/signers/private-key.signer.ts | 29 ++++++++ .../src/signers/seed-phrase.signer.spec.ts | 66 +++++++++++++++++++ .../tron/src/signers/seed-phrase.signer.ts | 50 ++++++++++++++ packages/tron/src/signers/types.ts | 7 ++ 8 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 .changeset/slow-needles-buy.md create mode 100644 packages/tron/src/signers/types.ts diff --git a/.changeset/slow-needles-buy.md b/.changeset/slow-needles-buy.md new file mode 100644 index 00000000..8ccfbdc4 --- /dev/null +++ b/.changeset/slow-needles-buy.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-tron': patch +--- + +Tron Signers - signMessage, signMessageV2, sign, signTransaction for all wallets types diff --git a/packages/tron/src/signers/ledger.signer.spec.ts b/packages/tron/src/signers/ledger.signer.spec.ts index 09285bea..e2eadfa5 100644 --- a/packages/tron/src/signers/ledger.signer.spec.ts +++ b/packages/tron/src/signers/ledger.signer.spec.ts @@ -18,7 +18,16 @@ jest.mock('@ledgerhq/hw-app-trx', () => { getAddress: jest.fn().mockResolvedValue({ address: 'TSDmgg8m3AfNniTzz4dyWN44fkGd7otZ4C', }), - signTransaction: jest.fn().mockResolvedValue('SIGNEDTX'), + signTransaction: jest + .fn() + .mockResolvedValue( + '0xb80601cba137745cfbb0e3507c3c22bb9465dc7d2963a51a6fcfdc5f4341b53d7faab96d26c080151e5877a8945ea9028bc0d529f11dffa79b8162c38d5bab821c' + ), + signPersonalMessage: jest + .fn() + .mockResolvedValue( + '0xb80601cba137745cfbb0e3507c3c22bb9465dc7d2963a51a6fcfdc5f4341b53d7faab96d26c080151e5877a8945ea9028bc0d529f11dffa79b8162c38d5bab821c' + ), })); }); @@ -63,4 +72,25 @@ describe('ledger.signer', () => { it('should fail if private key is requested', async () => { expect(signer.getPrivateKey(derivationPath)).rejects.toThrowError(); }); + + it('should signMessage a transaction using a ledger device', async () => { + const { raw_data_hex } = await (message as ChainMsg).buildTx(); + const signature = await signer.signMessageV2(raw_data_hex, derivationPath); + + expect(signature).toEqual( + '0xb80601cba137745cfbb0e3507c3c22bb9465dc7d2963a51a6fcfdc5f4341b53d7faab96d26c080151e5877a8945ea9028bc0d529f11dffa79b8162c38d5bab821c' + ); + }); + + it('should signTransaction a transaction using a ledger device', async () => { + const { raw_data_hex } = await (message as ChainMsg).buildTx(); + const signature = await signer.signTransaction( + derivationPath, + raw_data_hex + ); + + expect(signature).toEqual( + '0xb80601cba137745cfbb0e3507c3c22bb9465dc7d2963a51a6fcfdc5f4341b53d7faab96d26c080151e5877a8945ea9028bc0d529f11dffa79b8162c38d5bab821c' + ); + }); }); diff --git a/packages/tron/src/signers/ledger.signer.ts b/packages/tron/src/signers/ledger.signer.ts index 7da24ec9..ade25d4d 100644 --- a/packages/tron/src/signers/ledger.signer.ts +++ b/packages/tron/src/signers/ledger.signer.ts @@ -30,6 +30,35 @@ export class LedgerSigner extends Signer.Provider { msg.sign(tx); } + + async signMessage() { + throw new Error('Ledger wallet does not support signMessage'); + } + + async signMessageV2(message: string, derivation: string) { + const trx = new Trx(this.transport as Transport); + const signature = await trx.signPersonalMessage( + derivation, + Buffer.from(message).toString('hex') + ); + + return signature; + } + + async signTransaction( + derivation: string, + txHex: string, + tokenSignature = [] as string[] + ) { + const trx = new Trx(this.transport as Transport); + const signature = await trx.signTransaction( + derivation, + txHex, + tokenSignature + ); + + return signature; + } } export default LedgerSigner; diff --git a/packages/tron/src/signers/private-key.signer.spec.ts b/packages/tron/src/signers/private-key.signer.spec.ts index fe376579..7d0004ff 100644 --- a/packages/tron/src/signers/private-key.signer.spec.ts +++ b/packages/tron/src/signers/private-key.signer.spec.ts @@ -5,6 +5,15 @@ import { ChainMsg, MsgBody, TokenType } from '../msg'; import { PrivateKeySigner } from './private-key.signer'; +jest.mock('../msg.ts', () => { + const orignalModule = jest.requireActual('../msg.ts'); + + return { + __esModule: true, + ...orignalModule, + }; +}); + describe('tron private-key.signer', () => { let signer: PrivateKeySigner; let txInput: MsgBody; @@ -111,4 +120,51 @@ describe('tron private-key.signer', () => { 'TRC20 Contract Address not provided' ); }); + + it('should signMessage a TRC20 TX with the private key', async () => { + const msg = new ChainMsg({ + to: txInput.to, + from: txInput.from, + amount: 0.000001, + contractAddress: txInput.contractAddress, + decimals: txInput.decimals, + tokenType: TokenType.TRC20, + provider: provider, + }); + ChainMsg.prototype.buildTx = jest.fn().mockResolvedValue({ + raw_data_hex: + '0a0218c52208b2dcb6ece39c937140a886d9be87325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541b2431e51da71cf3fbe9a0daf59b2d716213dc8f2121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000000084987d218c5ae2027c419e52c95791e453493821000000000000000000000000000000000000000000000000000000e8d4a5100070cac0d5be8732900180a3c347', + }); + const { raw_data_hex } = await msg.buildTx(); + const signature = await signer.signMessage(raw_data_hex); + + expect(signature.length).toBe(132); + }); + + it('should signMessageV2 a TRC20 TX with the private key', async () => { + const message = 'Hello world!'; + const signature = await signer.signMessageV2(message); + + expect(signature.length).toBe(132); + }); + + it('should signTransaction a TRC20 TX with the private key', async () => { + const msg = new ChainMsg({ + to: txInput.to, + from: txInput.from, + amount: 0.000001, + contractAddress: txInput.contractAddress, + decimals: txInput.decimals, + tokenType: TokenType.TRC20, + provider: provider, + }); + ChainMsg.prototype.buildTx = jest.fn().mockResolvedValue({ + raw_data_hex: + '0a0218c52208b2dcb6ece39c937140a886d9be87325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541b2431e51da71cf3fbe9a0daf59b2d716213dc8f2121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000000084987d218c5ae2027c419e52c95791e453493821000000000000000000000000000000000000000000000000000000e8d4a5100070cac0d5be8732900180a3c347', + }); + const { raw_data_hex } = await msg.buildTx(); + const signature = await signer.signTransaction(raw_data_hex); + + expect(signature.length).toBe(132); + }); }); diff --git a/packages/tron/src/signers/private-key.signer.ts b/packages/tron/src/signers/private-key.signer.ts index 5910bc96..917c90c6 100644 --- a/packages/tron/src/signers/private-key.signer.ts +++ b/packages/tron/src/signers/private-key.signer.ts @@ -4,6 +4,8 @@ import type { TronManifest } from 'src/manifests'; import { ChainMsg } from '../msg'; +import { Bytes } from './types'; + @SignerDecorator(Signer.SignerType.PRIVATE_KEY) export class PrivateKeySigner extends Signer.Provider { public manifest: TronManifest; @@ -42,6 +44,33 @@ export class PrivateKeySigner extends Signer.Provider { const signature = await tronWeb.trx.sign(txData); msg.sign(signature); } + + async signMessage(txHex: string): Promise { + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey: this.key, + }); + const signature = await tronWeb.trx.signMessage(txHex, this.key); + return signature; + } + + async signMessageV2(message: Bytes | string): Promise { + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey: this.key, + }); + const signature = await tronWeb.trx.signMessageV2(message, this.key); + return signature; + } + + async signTransaction(txHex: string): Promise { + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey: this.key, + }); + const signature = await tronWeb.trx.signTransaction(txHex, this.key); + return signature; + } } export default PrivateKeySigner; diff --git a/packages/tron/src/signers/seed-phrase.signer.spec.ts b/packages/tron/src/signers/seed-phrase.signer.spec.ts index 98f42804..e9fca7f2 100644 --- a/packages/tron/src/signers/seed-phrase.signer.spec.ts +++ b/packages/tron/src/signers/seed-phrase.signer.spec.ts @@ -5,6 +5,15 @@ import { ChainMsg, MsgBody, TokenType } from '../msg'; import { SeedPhraseSigner } from './seed-phrase.signer'; +jest.mock('../msg.ts', () => { + const orignalModule = jest.requireActual('../msg.ts'); + + return { + __esModule: true, + ...orignalModule, + }; +}); + describe('tron seed-phrase.signer', () => { let signer: SeedPhraseSigner; let txInput: MsgBody; @@ -116,6 +125,63 @@ describe('tron seed-phrase.signer', () => { 'TRC20 Contract Address not provided' ); }); + + it('should signMessage a TRC20 TX with the seed phrase', async () => { + const msg = new ChainMsg({ + to: txInput.to, + from: txInput.from, + amount: 0.000001, + contractAddress: txInput.contractAddress, + decimals: txInput.decimals, + tokenType: TokenType.TRC20, + provider: provider, + }); + ChainMsg.prototype.buildTx = jest.fn().mockResolvedValue({ + raw_data_hex: + '0a0218c52208b2dcb6ece39c937140a886d9be87325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541b2431e51da71cf3fbe9a0daf59b2d716213dc8f2121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000000084987d218c5ae2027c419e52c95791e453493821000000000000000000000000000000000000000000000000000000e8d4a5100070cac0d5be8732900180a3c347', + }); + const { raw_data_hex } = await msg.buildTx(); + const signature = await signer.signMessage(raw_data_hex, deriviationPath); + + expect(signature).toEqual( + '0x7605f9a707b2bc6ca6c5fc6deaf192868ef70b2c196df784c849d8734413131f67ba100590ecb931548869e771329aea8d137c339570882f3c1314c031bf75cb1c' + ); + }); + + it('should signMessageV2 a TRC20 TX with the seed phrase', async () => { + const message = 'Hello, world!'; + const signature = await signer.signMessageV2(message, deriviationPath); + + expect(signature).toEqual( + '0xb80601cba137745cfbb0e3507c3c22bb9465dc7d2963a51a6fcfdc5f4341b53d7faab96d26c080151e5877a8945ea9028bc0d529f11dffa79b8162c38d5bab821c' + ); + }); + + it('should signTransaction a TRC20 TX with the seed phrase', async () => { + const msg = new ChainMsg({ + to: txInput.to, + from: txInput.from, + amount: 0.000001, + contractAddress: txInput.contractAddress, + decimals: txInput.decimals, + tokenType: TokenType.TRC20, + provider: provider, + }); + ChainMsg.prototype.buildTx = jest.fn().mockResolvedValue({ + raw_data_hex: + '0a0218c52208b2dcb6ece39c937140a886d9be87325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541b2431e51da71cf3fbe9a0daf59b2d716213dc8f2121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000000084987d218c5ae2027c419e52c95791e453493821000000000000000000000000000000000000000000000000000000e8d4a5100070cac0d5be8732900180a3c347', + }); + const { raw_data_hex } = await msg.buildTx(); + + const signature = await signer.signTransaction( + raw_data_hex, + deriviationPath + ); + + expect(signature).toEqual( + '0x7605f9a707b2bc6ca6c5fc6deaf192868ef70b2c196df784c849d8734413131f67ba100590ecb931548869e771329aea8d137c339570882f3c1314c031bf75cb1c' + ); + }); }); describe('seed-phase.addressGeneration', () => { diff --git a/packages/tron/src/signers/seed-phrase.signer.ts b/packages/tron/src/signers/seed-phrase.signer.ts index 4fd77634..e7c1311c 100644 --- a/packages/tron/src/signers/seed-phrase.signer.ts +++ b/packages/tron/src/signers/seed-phrase.signer.ts @@ -4,6 +4,8 @@ import type { TronManifest } from 'src/manifests'; import { ChainMsg } from '../msg'; +import { Bytes } from './types'; + @SignerDecorator(Signer.SignerType.SEED_PHRASE) export class SeedPhraseSigner extends Signer.Provider { public manifest: TronManifest; @@ -41,6 +43,54 @@ export class SeedPhraseSigner extends Signer.Provider { const signature = await tronWeb.trx.sign(txData); msg.sign(signature); } + + async signMessage(txHex: string, derivation: string): Promise { + const tronAccount = TronWeb.fromMnemonic(this.key, derivation); + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey: tronAccount.privateKey.replace('0x', ''), + }); + + const signature = await tronWeb.trx.signMessage( + txHex, + tronAccount.privateKey.replace('0x', '') + ); + + return signature; + } + + async signMessageV2( + message: Bytes | string, + derivation: string + ): Promise { + const tronAccount = TronWeb.fromMnemonic(this.key, derivation); + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey: tronAccount.privateKey.replace('0x', ''), + }); + + const signature = await tronWeb.trx.signMessageV2( + message, + tronAccount.privateKey.replace('0x', '') + ); + + return signature; + } + + async signTransaction(txHex: string, derivation: string): Promise { + const tronAccount = TronWeb.fromMnemonic(this.key, derivation); + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey: tronAccount.privateKey.replace('0x', ''), + }); + + const signature = await tronWeb.trx.signTransaction( + txHex, + tronAccount.privateKey.replace('0x', '') + ); + + return signature; + } } export default SeedPhraseSigner; diff --git a/packages/tron/src/signers/types.ts b/packages/tron/src/signers/types.ts new file mode 100644 index 00000000..9da8affc --- /dev/null +++ b/packages/tron/src/signers/types.ts @@ -0,0 +1,7 @@ +// re-export from ethers. +interface ArrayLike { + readonly length: number; + readonly [n: number]: T; +} + +export type Bytes = ArrayLike; From 61170783f34ce1a728609c5827624b5891c05efe Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 3 Jul 2024 12:00:02 +0000 Subject: [PATCH 032/176] Version packages --- .changeset/slow-needles-buy.md | 5 ----- packages/tron/CHANGELOG.md | 6 ++++++ packages/tron/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/slow-needles-buy.md diff --git a/.changeset/slow-needles-buy.md b/.changeset/slow-needles-buy.md deleted file mode 100644 index 8ccfbdc4..00000000 --- a/.changeset/slow-needles-buy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-tron': patch ---- - -Tron Signers - signMessage, signMessageV2, sign, signTransaction for all wallets types diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 8928b971..a2fa50e3 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-tron +## 2.0.21 + +### Patch Changes + +- e0dcc77d: Tron Signers - signMessage, signMessageV2, sign, signTransaction for all wallets types + ## 2.0.20 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 87b213b3..f0919329 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.20", + "version": "2.0.21", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 05e50b95f116fad59e3b462a3314d94a660ad90c Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Thu, 4 Jul 2024 15:39:48 +0700 Subject: [PATCH 033/176] fix: dogecoin fee rate (#259) * fix: dogecoin fee rate * fix: utxos fee rate when creating transaction --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/spotty-tips-judge.md | 6 ++++++ packages/bitcoincash/src/msg.ts | 2 +- packages/bitcoincash/src/signers/private-key.signer.spec.ts | 2 +- packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts | 2 +- packages/dogecoin/src/msg.ts | 2 +- packages/dogecoin/src/signers/private-key.signer.spec.ts | 2 +- packages/dogecoin/src/signers/seed-phrase.signer.spec.ts | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .changeset/spotty-tips-judge.md diff --git a/.changeset/spotty-tips-judge.md b/.changeset/spotty-tips-judge.md new file mode 100644 index 00000000..4ac58555 --- /dev/null +++ b/.changeset/spotty-tips-judge.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +--- + +fix: fee being 0 when creating a transaction diff --git a/packages/bitcoincash/src/msg.ts b/packages/bitcoincash/src/msg.ts index 760313e7..079c0750 100644 --- a/packages/bitcoincash/src/msg.ts +++ b/packages/bitcoincash/src/msg.ts @@ -44,7 +44,7 @@ export class ChainMsg extends BaseMsg { throw new Error('Fee estimation is required for building transaction'); const feeRate = Number(fee) * 1e5; // sat/vB const feeRateWhole = - parseInt(feeRate.toString()) < 1 ? 1 : parseInt(fee.toString()); + parseInt(feeRate.toString()) < 1 ? 1 : parseInt(feeRate.toString()); const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); const targetOutputs = []; diff --git a/packages/bitcoincash/src/signers/private-key.signer.spec.ts b/packages/bitcoincash/src/signers/private-key.signer.spec.ts index f936034e..e54dcd16 100644 --- a/packages/bitcoincash/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoincash/src/signers/private-key.signer.spec.ts @@ -86,7 +86,7 @@ describe('private-key.signer', () => { await signer.sign(message as ChainMsg); expect(message.signedTransaction).toEqual( - '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100c59aef47c478c523b6e4c42b6228867236747218a25bfdefa170867cb4312236022009ec8f22e33909b9b4806befd8d8a58d8faa367ec054bb8161b7a2205611a69441210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688acdc0c0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' + '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100d14a8a5e39396e6e12c696bf0ab72a6c366492f134427671e6802b44d5894c06022038eff7ab48600dbe7fe26baee098f0b5810f2a6d5738d471ba5984377823fadf41210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac180b0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' ); }); diff --git a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts index 70a0602d..f9629a5e 100644 --- a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts @@ -92,7 +92,7 @@ describe('seed-phrase.signer', () => { await signer.sign(message as ChainMsg, derivation); expect(message.signedTransaction).toEqual( - '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100c59aef47c478c523b6e4c42b6228867236747218a25bfdefa170867cb4312236022009ec8f22e33909b9b4806befd8d8a58d8faa367ec054bb8161b7a2205611a69441210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688acdc0c0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' + '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100d14a8a5e39396e6e12c696bf0ab72a6c366492f134427671e6802b44d5894c06022038eff7ab48600dbe7fe26baee098f0b5810f2a6d5738d471ba5984377823fadf41210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac180b0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' ); }); diff --git a/packages/dogecoin/src/msg.ts b/packages/dogecoin/src/msg.ts index fe129a74..e7cd8469 100644 --- a/packages/dogecoin/src/msg.ts +++ b/packages/dogecoin/src/msg.ts @@ -48,7 +48,7 @@ export class ChainMsg extends BaseMsg { const feeRateWhole = parseInt(feeRate.toString()) < MINIMUM_DOGECOIN_FEE ? MINIMUM_DOGECOIN_FEE - : parseInt(fee.toString()); + : parseInt(feeRate.toString()); const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); const targetOutputs = []; diff --git a/packages/dogecoin/src/signers/private-key.signer.spec.ts b/packages/dogecoin/src/signers/private-key.signer.spec.ts index 083ff8a8..6985c30c 100644 --- a/packages/dogecoin/src/signers/private-key.signer.spec.ts +++ b/packages/dogecoin/src/signers/private-key.signer.spec.ts @@ -86,7 +86,7 @@ describe('private-key.signer', () => { await signer.sign(message as ChainMsg); expect(message.signedTransaction).toEqual( - '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a47304402203693425d306d6c2b106e7b2afc7c7c43165dff38183652c00029b36beb19509302202cab0c2292ae9dc0f424122f460ff492894a58bc3766ab45b9f73262268aafff0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0264000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac1c969800000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' + '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a473044022068b491ee366b00d7ee0643111977b4f9d69d280446e4672c25f91e137f82ca5702205ce414f90daa6cb99f79ad80db6b2fb6cc700dcb74594e57b4f87b72d60260bf0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0164000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' ); }); diff --git a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts index 332a7f0f..0570030f 100644 --- a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts @@ -88,7 +88,7 @@ describe('seed-phrase.signer', () => { await signer.sign(message as ChainMsg, derivation); expect(message.signedTransaction).toEqual( - '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a47304402203693425d306d6c2b106e7b2afc7c7c43165dff38183652c00029b36beb19509302202cab0c2292ae9dc0f424122f460ff492894a58bc3766ab45b9f73262268aafff0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0264000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac1c969800000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' + '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a473044022068b491ee366b00d7ee0643111977b4f9d69d280446e4672c25f91e137f82ca5702205ce414f90daa6cb99f79ad80db6b2fb6cc700dcb74594e57b4f87b72d60260bf0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0164000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' ); }); From 289c4870b1684676f11661c091e23b6bc1ce95d8 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 4 Jul 2024 08:42:18 +0000 Subject: [PATCH 034/176] Version packages --- .changeset/spotty-tips-judge.md | 6 ------ packages/bitcoincash/CHANGELOG.md | 6 ++++++ packages/bitcoincash/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 6 ++++++ packages/dogecoin/package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 .changeset/spotty-tips-judge.md diff --git a/.changeset/spotty-tips-judge.md b/.changeset/spotty-tips-judge.md deleted file mode 100644 index 4ac58555..00000000 --- a/.changeset/spotty-tips-judge.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch ---- - -fix: fee being 0 when creating a transaction diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 69aa8903..c5017b21 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.21 + +### Patch Changes + +- d76c12c3: fix: fee being 0 when creating a transaction + ## 2.0.20 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 9b7b25ff..6d11f74c 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.20", + "version": "2.0.21", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 9620956c..7ad87b70 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-dogecoin +## 2.0.20 + +### Patch Changes + +- d76c12c3: fix: fee being 0 when creating a transaction + ## 2.0.19 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 3daf9a85..98d40dad 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.19", + "version": "2.0.20", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 4e60095a052c556a3b62fedb89ab954872b4dbd7 Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:18:11 +0700 Subject: [PATCH 035/176] feat: split graphql for evm chain lib (#261) * feat: split graphql for evm chain lib * chore: add changeset --- .changeset/eight-bags-travel.md | 5 + packages/evm/src/chain.provider.spec.ts | 2 +- .../indexer/queries/balances.query.ts | 4 +- .../datasource/indexer/queries/fees.query.ts | 4 +- .../indexer/queries/status.query.ts | 4 +- .../indexer/queries/transactions.query.ts | 8 +- packages/evm/src/gql/gql.ts | 8 + packages/evm/src/gql/graphql.ts | 194 ++++++++++++++++++ 8 files changed, 218 insertions(+), 11 deletions(-) create mode 100644 .changeset/eight-bags-travel.md diff --git a/.changeset/eight-bags-travel.md b/.changeset/eight-bags-travel.md new file mode 100644 index 00000000..7a59710f --- /dev/null +++ b/.changeset/eight-bags-travel.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +split graphql for evm chain lib diff --git a/packages/evm/src/chain.provider.spec.ts b/packages/evm/src/chain.provider.spec.ts index 279cdf22..75d798b0 100644 --- a/packages/evm/src/chain.provider.spec.ts +++ b/packages/evm/src/chain.provider.spec.ts @@ -1,6 +1,6 @@ import { BigNumber, providers } from 'ethers'; -import { Eip1559Fee } from '@xdefi-tech/chains-graphql'; +import { Eip1559Fee } from './gql/graphql'; import { ChainMsg } from './msg'; import { EvmProvider } from './chain.provider'; import { ChainDataSource, IndexerDataSource } from './datasource'; diff --git a/packages/evm/src/datasource/indexer/queries/balances.query.ts b/packages/evm/src/datasource/indexer/queries/balances.query.ts index 307c0fe0..80fe7284 100644 --- a/packages/evm/src/datasource/indexer/queries/balances.query.ts +++ b/packages/evm/src/datasource/indexer/queries/balances.query.ts @@ -1,5 +1,6 @@ import { gqlClient } from '@xdefi-tech/chains-core'; import filter from 'lodash/filter'; + import { GetArbitrumBalanceDocument, GetAuroraBalanceDocument, @@ -11,8 +12,7 @@ import { GetSmartChainBalanceDocument, GetCronosEvmBalanceDocument, GetCantoEvmBalanceDocument, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; export const getBalance = async (chain: EVMChains, address: string) => { diff --git a/packages/evm/src/datasource/indexer/queries/fees.query.ts b/packages/evm/src/datasource/indexer/queries/fees.query.ts index 1c57ce76..5cba64cb 100644 --- a/packages/evm/src/datasource/indexer/queries/fees.query.ts +++ b/packages/evm/src/datasource/indexer/queries/fees.query.ts @@ -1,4 +1,5 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { ArbitrumDefaultGasFeesDocument, AuroraDefaultGasFeesDocument, @@ -10,8 +11,7 @@ import { OptimismEip1559GasFeesDocument, PolygonEip1559GasFeesDocument, SmartChainDefaultGasFeesDocument, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; export const getFees = async (chain: string) => { diff --git a/packages/evm/src/datasource/indexer/queries/status.query.ts b/packages/evm/src/datasource/indexer/queries/status.query.ts index 41ba1b68..b899770e 100644 --- a/packages/evm/src/datasource/indexer/queries/status.query.ts +++ b/packages/evm/src/datasource/indexer/queries/status.query.ts @@ -1,4 +1,5 @@ import { gqlClient } from '@xdefi-tech/chains-core'; + import { GetArbitrumStatusDocument, GetAuroraStatusDocument, @@ -10,8 +11,7 @@ import { GetOptimismStatusDocument, GetPolygonStatusDocument, GetSmartChainStatusDocument, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; export const getStatus = async (chain: string) => { diff --git a/packages/evm/src/datasource/indexer/queries/transactions.query.ts b/packages/evm/src/datasource/indexer/queries/transactions.query.ts index 5c4e6ce4..7cb7db77 100644 --- a/packages/evm/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/evm/src/datasource/indexer/queries/transactions.query.ts @@ -1,18 +1,18 @@ import { gqlClient } from '@xdefi-tech/chains-core'; import map from 'lodash/map'; + import { GetArbitrumTransactionsDocument, GetAuroraTransactionsDocument, GetAvalancheTransactionsDocument, GetCantoEvmTransactionsDocument, - GetCronosTransactionsDocument, + GetCronosEvmTransactionsDocument, GetEthereumTransactionsDocument, GetFantomTransactionsDocument, GetOptimismTransactionsDocument, GetPolygonTransactionsDocument, GetSmartChainTransactionsDocument, -} from '@xdefi-tech/chains-graphql'; - +} from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; export const getTransactions = async ( @@ -55,7 +55,7 @@ export const getTransactions = async ( break; case EVMChains.cronos: indexerChain = 'cronosEVM'; - query = GetCronosTransactionsDocument; + query = GetCronosEvmTransactionsDocument; break; default: throw new Error( diff --git a/packages/evm/src/gql/gql.ts b/packages/evm/src/gql/gql.ts index a8ff77ec..0cb4a9c9 100644 --- a/packages/evm/src/gql/gql.ts +++ b/packages/evm/src/gql/gql.ts @@ -33,6 +33,8 @@ const documents = { types.GetPolygonBalanceDocument, 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}': types.GetSmartChainBalanceDocument, + 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}': + types.GetCryptoAssetsDocument, }; /** @@ -109,6 +111,12 @@ export function gql( export function gql( source: 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}' ): typeof documents['query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}' +): typeof documents['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; export function gql(source: string) { return (documents as any)[source] ?? {}; diff --git a/packages/evm/src/gql/graphql.ts b/packages/evm/src/gql/graphql.ts index 17fe2c04..c71f5bb8 100644 --- a/packages/evm/src/gql/graphql.ts +++ b/packages/evm/src/gql/graphql.ts @@ -1031,6 +1031,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1050,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1105,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1123,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1173,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1191,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1413,16 +1437,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1692,6 +1725,8 @@ export type DetailedActivityV0 = export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1743,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2135,6 +2176,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2185,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2202,6 +2252,8 @@ export type Linea = { export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2270,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -3926,6 +3984,8 @@ export type SolanaTransactionEdge = { export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +3993,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -5965,6 +6032,32 @@ export type GetSmartChainStatusQuery = { }; }; +export type GetCryptoAssetsQueryVariables = Exact<{ + input: Array | CryptoAssetArgs; +}>; + +export type GetCryptoAssetsQuery = { + __typename?: 'Query'; + assets: { + __typename?: 'AssetType'; + cryptoAssets?: Array<{ + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + symbol?: string | null; + image?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + }> | null; + }; +}; + export const GetArbitrumBalanceDocument = { kind: 'Document', definitions: [ @@ -11527,3 +11620,104 @@ export const GetSmartChainStatusDocument = { GetSmartChainStatusQuery, GetSmartChainStatusQueryVariables >; +export const GetCryptoAssetsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetCryptoAssets' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'input' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'ListType', + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CryptoAssetArgs' }, + }, + }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'assets' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'cryptoAssets' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'input' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'input' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'chain' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'image' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scalingFactor' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetCryptoAssetsQuery, + GetCryptoAssetsQueryVariables +>; From ea1164ab0c9d7f307b2fb9d68287e085a0fde47b Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 4 Jul 2024 09:20:37 +0000 Subject: [PATCH 036/176] Version packages --- .changeset/eight-bags-travel.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/eight-bags-travel.md diff --git a/.changeset/eight-bags-travel.md b/.changeset/eight-bags-travel.md deleted file mode 100644 index 7a59710f..00000000 --- a/.changeset/eight-bags-travel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -split graphql for evm chain lib diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index be71b048..3e812943 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.31 + +### Patch Changes + +- 2c6c2f59: split graphql for evm chain lib + ## 2.0.30 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 5c86eb71..ae0b491a 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.30", + "version": "2.0.31", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From d57e0f91f952434bc06ff6a1c33941e37ae3e17a Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:46:54 +0100 Subject: [PATCH 037/176] fix: if tx has data, threat as valid data and proceed (#262) * fix: if tx has data, threat as valid data and proceed * fix: patch --- .changeset/ten-eyes-grab.md | 5 +++ packages/evm/src/msg.ts | 63 +++++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 .changeset/ten-eyes-grab.md diff --git a/.changeset/ten-eyes-grab.md b/.changeset/ten-eyes-grab.md new file mode 100644 index 00000000..a4206271 --- /dev/null +++ b/.changeset/ten-eyes-grab.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +fix: use data if present and not assume transfer for ERC20 tokens diff --git a/packages/evm/src/msg.ts b/packages/evm/src/msg.ts index f7870902..db74b72a 100644 --- a/packages/evm/src/msg.ts +++ b/packages/evm/src/msg.ts @@ -138,16 +138,21 @@ export class ChainMsg extends BasMsg { erc20ABI, this.provider?.rpcProvider ); - populatedTx = await contract.populateTransaction.transfer( - msgData.to, - ethers.utils.parseUnits( - msgData.amount.toString(), - msgData.decimals && msgData.decimals.toString() - ) - ); - contractData.value = '0x0'; - contractData.data = populatedTx.data; - contractData.to = populatedTx.to; + if (msgData.data) { + contractData.data = msgData.data; + contractData.to = msgData.to; + } else { + populatedTx = await contract.populateTransaction.transfer( + msgData.to, + ethers.utils.parseUnits( + msgData.amount.toString(), + msgData.decimals && msgData.decimals.toString() + ) + ); + contractData.value = '0x0'; + contractData.data = populatedTx.data; + contractData.to = populatedTx.to; + } break; case TokenType.ERC721: contract = new ethers.Contract( @@ -155,14 +160,19 @@ export class ChainMsg extends BasMsg { erc721ABI, this.provider?.rpcProvider ); - populatedTx = await contract.populateTransaction[ - ERC721_SAFE_TRANSFER_METHOD - ](msgData.from, msgData.to, msgData.nftId, { - gasLimit: utils.toHex(msgData.gasLimit || 21000), - }); - contractData.value = populatedTx.value?.toHexString(); - contractData.data = populatedTx.data; - contractData.to = populatedTx.to; + if (msgData.data) { + contractData.data = msgData.data; + contractData.to = msgData.to; + } else { + populatedTx = await contract.populateTransaction[ + ERC721_SAFE_TRANSFER_METHOD + ](msgData.from, msgData.to, msgData.nftId, { + gasLimit: utils.toHex(msgData.gasLimit || 21000), + }); + contractData.value = populatedTx.value?.toHexString(); + contractData.data = populatedTx.data; + contractData.to = populatedTx.to; + } break; case TokenType.ERC1155: contract = new ethers.Contract( @@ -170,12 +180,17 @@ export class ChainMsg extends BasMsg { erc1155ABI, this.provider?.rpcProvider ); - populatedTx = await contract.populateTransaction[ - ERC1155_SAFE_TRANSFER_METHOD - ](msgData.from, msgData.to, msgData.nftId, 1, [], {}); - contractData.value = populatedTx.value?.toHexString(); - contractData.data = populatedTx.data; - contractData.to = populatedTx.to; + if (msgData.data) { + contractData.data = msgData.data; + contractData.to = msgData.to; + } else { + populatedTx = await contract.populateTransaction[ + ERC1155_SAFE_TRANSFER_METHOD + ](msgData.from, msgData.to, msgData.nftId, 1, [], {}); + contractData.value = populatedTx.value?.toHexString(); + contractData.data = populatedTx.data; + contractData.to = populatedTx.to; + } break; default: const decimals = From 1be5537b102859bc49a186ceef2bbf5c3a43ee98 Mon Sep 17 00:00:00 2001 From: Justin <102846781+HoangVD2@users.noreply.github.com> Date: Thu, 4 Jul 2024 17:50:44 +0700 Subject: [PATCH 038/176] feat: add tests for real Network (XDEFI-8307) x tests for createMsg (XDEFI-8399) (#237) * feat: add smoke tests for real Network Queries * base: update * base: update * chore: update typo * base: update * chore: revert gql.ts * chore: fix typo * base: update * base: update * chore: update * chore: update * chore: update * chore: update * feat: add test for basic transfer with createMsg() * base: add test buildTx * chore: update param * base: update test * base: update test case * base: fix comment * update: chore * chore: fix comment * chore: resolve conflict * chore: resolve conflict * chore: rebase merge develop * chore: add desc for Environment Setup * chore: update test case * test: add case transfer with non-native-token and remove case buildTx with insufficient balance should throw an error * chore: update test case * chore: update mock --------- Co-authored-by: sotatek-tyler-nguyen4 --- .gitignore | 1 + README.md | 4 + packages/binance/.env.example | 1 + packages/binance/package.json | 4 +- packages/binance/src/chain.provider.spec.ts | 152 +++++++-- packages/binance/src/msg.spec.ts | 93 ++++++ .../src/signers/seed-phrase.signer.spec.ts | 2 + packages/bitcoin/.env.example | 1 + packages/bitcoin/package.json | 3 +- packages/bitcoin/src/chain.provider.spec.ts | 135 +++++--- packages/bitcoin/src/msg.spec.ts | 10 +- .../bitcoin/src/signers/ledger.signer.spec.ts | 2 + .../src/signers/private-key.signer.spec.ts | 2 + .../src/signers/seed-phrase.signer.spec.ts | 2 + .../bitcoin/src/signers/trezor.signer.spec.ts | 2 + packages/bitcoincash/.env.example | 1 + packages/bitcoincash/package.json | 3 +- .../bitcoincash/src/chain.provider.spec.ts | 110 +++++-- packages/bitcoincash/src/msg.spec.ts | 70 ++++ .../src/signers/trezor.signer.spec.ts | 2 - packages/cosmos/.env.example | 1 + packages/cosmos/package.json | 4 +- packages/cosmos/src/chain.provider.spec.ts | 214 ++++++------ packages/cosmos/src/msg.spec.ts | 235 +++++++++++++- packages/dogecoin/.env.example | 1 + packages/dogecoin/package.json | 3 +- packages/dogecoin/src/chain.provider.spec.ts | 140 ++++++-- packages/dogecoin/src/msg.spec.ts | 14 + packages/evm/.env.example | 1 + packages/evm/package.json | 4 +- packages/evm/src/chain.provider.spec.ts | 304 ++++++++++-------- packages/evm/src/msg.spec.ts | 112 +++++++ packages/litecoin/.env.example | 1 + packages/litecoin/package.json | 9 +- packages/litecoin/src/chain.provider.spec.ts | 140 ++++++-- packages/litecoin/src/msg.spec.ts | 70 ++++ .../src/signers/trezor.signer.spec.ts | 2 - packages/solana/.env.example | 1 + packages/solana/package.json | 3 +- packages/solana/src/chain.provider.spec.ts | 187 ++++++++--- packages/solana/src/msg.spec.ts | 118 ++++++- packages/thor/.env.example | 1 + packages/thor/package.json | 4 +- packages/thor/src/chain.provider.spec.ts | 107 +++++- packages/thor/src/msg.spec.ts | 54 ++++ packages/tron/.env.example | 1 + packages/tron/package.json | 1 + packages/tron/src/chain.provider.spec.ts | 2 +- packages/tron/src/msg.spec.ts | 60 ++++ turbo.json | 4 +- 50 files changed, 1946 insertions(+), 452 deletions(-) create mode 100644 packages/binance/.env.example create mode 100644 packages/bitcoin/.env.example create mode 100644 packages/bitcoincash/.env.example create mode 100644 packages/cosmos/.env.example create mode 100644 packages/dogecoin/.env.example create mode 100644 packages/evm/.env.example create mode 100644 packages/litecoin/.env.example create mode 100644 packages/solana/.env.example create mode 100644 packages/thor/.env.example create mode 100644 packages/tron/.env.example diff --git a/.gitignore b/.gitignore index eb2737f7..97492bb8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ yarn-error.log* .pnpm-debug.log* # local env files +*.env .env.local .env.development.local .env.test.local diff --git a/README.md b/README.md index fdb722cd..a075b43c 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ npm install @xdefi-tech/chains yarn add @xdefi-tech/chains ``` +## Environment Setup + +The `NETWORKED_QUERIES` environment variable is used to control the behavior of network requests in tests. By default, `NETWORKED_QUERIES` is set to `0`, which means that all network requests are mocked, allowing tests to run without actual network dependencies. This ensures that tests are faster, more reliable, and not affected by external factors such as network latency or availability of external services. Setting `NETWORKED_QUERIES` to `1` enables real network requests, allowing tests to interact with actual external services. This can be useful for integration tests where end-to-end verification of network interactions is required. To configure this setting, simply add `NETWORKED_QUERIES=0` or `NETWORKED_QUERIES=1` to your `.env` file as needed. + ## Manifest Each provider may have different manifests, but they share common fields. For more details, please refer to the README of the respective provider. diff --git a/packages/binance/.env.example b/packages/binance/.env.example new file mode 100644 index 00000000..e886c5a7 --- /dev/null +++ b/packages/binance/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=1 \ No newline at end of file diff --git a/packages/binance/package.json b/packages/binance/package.json index 31e83fc1..a769b839 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -75,7 +75,9 @@ ] }, "jest": { - "setupFiles": [], + "setupFiles": [ + "dotenv/config" + ], "preset": "ts-jest/presets/js-with-ts", "transform": { ".+\\.(t|j)s$": "ts-jest" diff --git a/packages/binance/src/chain.provider.spec.ts b/packages/binance/src/chain.provider.spec.ts index 8a6db10a..0707f3a6 100644 --- a/packages/binance/src/chain.provider.spec.ts +++ b/packages/binance/src/chain.provider.spec.ts @@ -1,33 +1,139 @@ +import { + Response, + GasFeeSpeed, + TransactionStatus, +} from '@xdefi-tech/chains-core'; + +import { ChainMsg } from './msg'; import { BinanceProvider } from './chain.provider'; +import { IndexerDataSource } from './datasource'; +import { BINANCE_MANIFEST } from './manifests'; + +describe('chain.provider', () => { + const NETWORKED_QUERIES = + process.env.NETWORKED_QUERIES === '1' ? true : false; + + let provider: BinanceProvider; + + beforeEach(() => { + provider = new BinanceProvider(new IndexerDataSource(BINANCE_MANIFEST)); + }); + + it('createMsg() should create a ChainMsg instance for native token', () => { + const msg = provider.createMsg({ + from: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + to: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + amount: 0.000001, + denom: 'bnb', + }); + + expect(msg).toBeInstanceOf(ChainMsg); + }); + + it('getBalance() should return balance data', async () => { + if (!NETWORKED_QUERIES) { + jest.spyOn(BinanceProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'Binance-Chain-Tigris', + name: 'Andy', + symbol: 'ANDY', + icon: null, + native: false, + address: '0x1b0e27D4733b5e6499354085114F2A5D21A00C60', + decimals: 8, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'Binance-Chain-Tigris', + name: 'Andy', + symbol: 'ANDY', + icon: null, + native: false, + address: '0x1b0e27D4733b5e6499354085114F2A5D21A00C60', + decimals: 8, + }, + amount: '1000', + }, + ]) + ) + ); -describe('binance/chain.provider', () => { - it('should return false when verifying an invalid address', () => { - expect(BinanceProvider.verifyAddress('0xDEADBEEF')).toBe(false); + const balance = await provider.getBalance( + '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(1); + expect(balanceData[0].amount).toEqual('1000'); + expect(balanceData[0].asset.symbol).toEqual('ANDY'); + } else { + const balance = await provider.getBalance( + '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(0); + } }); - it('should return true when verifying a valid address', () => { - expect( - BinanceProvider.verifyAddress( - 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k' - ) - ).toBe(true); + it('estimateFee() should return fee estimation', async () => { + jest.spyOn(BinanceProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); + + const msg = provider.createMsg({ + from: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + to: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + amount: 0.000001, + denom: 'bnb', + }); + + const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.medium); + + expect(estimateFee.length).toEqual(1); + expect(estimateFee[0].gasLimit).toBeTruthy(); }); - it('should return true when verifying a valid testnet address', () => { - expect( - BinanceProvider.verifyAddress( - 'tbnb1q82g2h9q0kfe7sysnj5w7nlak92csfjztymp39', - 'tbnb' - ) - ).toBe(true); + jest.setTimeout(15000); + + it('gasFeeOptions() should get fee options', async () => { + const feeOptions = await provider.gasFeeOptions(); + + expect(feeOptions?.low).toBeTruthy(); + expect(feeOptions?.medium).toBeTruthy(); + expect(feeOptions?.high).toBeTruthy(); }); - it('should return false when verifying valid address for testnet', () => { - expect( - BinanceProvider.verifyAddress( - 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', - 'tbnb' - ) - ).toBe(false); + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(BinanceProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); + + const txData = await provider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); + + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); }); diff --git a/packages/binance/src/msg.spec.ts b/packages/binance/src/msg.spec.ts index 083bde31..43043783 100644 --- a/packages/binance/src/msg.spec.ts +++ b/packages/binance/src/msg.spec.ts @@ -8,6 +8,20 @@ describe('msg', () => { beforeEach(() => { mockProvider = { + getAccount: jest.fn(() => + Promise.resolve({ + account_number: 7668046, + address: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + balances: [], + flags: 0, + public_key: [ + 3, 116, 108, 26, 123, 130, 31, 62, 52, 209, 147, 107, 81, 93, 233, + 182, 217, 106, 1, 172, 134, 143, 1, 89, 22, 50, 117, 0, 95, 120, + 114, 217, 127, + ], + sequence: 2, + }) + ), getBalance: jest.fn(() => Promise.resolve({ getData: jest.fn(() => @@ -37,6 +51,18 @@ describe('msg', () => { }, amount: '1000', }, + { + asset: { + chainId: 'Binance-Chain-Tigris', + name: 'Andy', + symbol: 'ANDY', + icon: null, + native: false, + address: 'ibc/ANDYTOKEN', + decimals: 8, + }, + amount: '1000', + }, ]) ), }) @@ -67,6 +93,73 @@ describe('msg', () => { }; }); + it('buildTx with insufficient balance should throw an error', async () => { + const chainMsg = new ChainMsg( + { + from: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + to: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + amount: 100000, + denom: 'bnb', + }, + mockProvider, + MsgEncoding.object + ); + + try { + await chainMsg.buildTx(); + } catch (error) { + expect(error).toMatchObject( + new Error('Insufficient Balance for transaction') + ); + } + }); + + it('buildTx with native token x valid amount', async () => { + const chainMsg = new ChainMsg( + { + from: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + to: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + amount: 0.0001, + denom: 'bnb', + memo: 'test', + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual('bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k'); + expect(response.to).toEqual('bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k'); + expect(response).toHaveProperty('chainId'); + expect(response.value).toEqual(10000); // 0.0001 * 10^8 (manifests decimals) + expect(response.memo).toEqual('test'); + expect(response.denom).toEqual('bnb'); + }); + + it('buildTx with non-native token', async () => { + const chainMsg = new ChainMsg( + { + from: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + to: 'bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k', + amount: 0.0001, + denom: 'andy', + memo: 'test', + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual('bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k'); + expect(response.to).toEqual('bnb1ac5cd7esh6wx78dxwwpkk6wn3g4a42578q3r8k'); + expect(response).toHaveProperty('chainId'); + expect(response.value).toEqual(10000); // 0.0001 * 10^8 (manifests decimals) + expect(response.memo).toEqual('test'); + expect(response.denom).toEqual('andy'); + }); + it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { diff --git a/packages/binance/src/signers/seed-phrase.signer.spec.ts b/packages/binance/src/signers/seed-phrase.signer.spec.ts index 8bc843dc..de2b011f 100644 --- a/packages/binance/src/signers/seed-phrase.signer.spec.ts +++ b/packages/binance/src/signers/seed-phrase.signer.spec.ts @@ -7,6 +7,8 @@ import { ChainMsg, MsgBody } from '../msg'; import SeedPhraseSigner from './seed-phrase.signer'; +jest.setTimeout(15000); + describe('seed-phrase.signer', () => { let mnemonic: string; let signer: SeedPhraseSigner; diff --git a/packages/bitcoin/.env.example b/packages/bitcoin/.env.example new file mode 100644 index 00000000..e886c5a7 --- /dev/null +++ b/packages/bitcoin/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=1 \ No newline at end of file diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index c963002c..e085411b 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -84,7 +84,8 @@ }, "jest": { "setupFiles": [ - "./jest-setup-file.ts" + "./jest-setup-file.ts", + "dotenv/config" ], "preset": "ts-jest/presets/js-with-ts", "transform": { diff --git a/packages/bitcoin/src/chain.provider.spec.ts b/packages/bitcoin/src/chain.provider.spec.ts index a6347300..9f2da5d1 100644 --- a/packages/bitcoin/src/chain.provider.spec.ts +++ b/packages/bitcoin/src/chain.provider.spec.ts @@ -1,45 +1,21 @@ -import { Coin } from '@xdefi-tech/chains-core'; +import { Coin, Response, TransactionStatus } from '@xdefi-tech/chains-core'; import { ChainMsg } from './msg'; import { BitcoinProvider } from './chain.provider'; import { IndexerDataSource } from './datasource'; import { BITCOIN_MANIFEST } from './manifests'; -jest.mock('./datasource/indexer/queries/balances.query', () => ({ - getBalance: () => { - return [ - { - address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', - amount: { - value: '0', - }, - asset: { - chain: 'Bitcoin', - contract: null, - id: 'bcafa2bf-d442-483a-96a4-0199f4371678', - name: 'Bitcoin', - symbol: 'BTC', - image: - 'https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579', - decimals: 8, - price: { - amount: '67310', - }, - type: 'CRYPTOCURRENCY', - }, - }, - ]; - }, -})); - describe('chain.provider', () => { + const NETWORKED_QUERIES = + process.env.NETWORKED_QUERIES === '1' ? true : false; + let provider: BitcoinProvider; beforeEach(() => { provider = new BitcoinProvider(new IndexerDataSource(BITCOIN_MANIFEST)); }); - it('createMsg(): should create message with data', () => { + it('createMsg() should create a ChainMsg instance for native token', () => { const msg = provider.createMsg({ to: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', from: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', @@ -49,7 +25,7 @@ describe('chain.provider', () => { expect(msg).toBeInstanceOf(ChainMsg); }); - it('should throw an error when broadcasting an unsigned tx', async () => { + it('createMsg() should throw an error when broadcasting an unsigned tx', async () => { const msg = provider.createMsg({ to: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', from: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', @@ -59,16 +35,71 @@ describe('chain.provider', () => { expect(provider.broadcast([msg])).rejects.toThrow(); }); - it('should get a transaction from the blockchain', async () => { - const txData = await provider.getTransaction( - 'e8c12eae2a7f9a2421f991fab4a617c16fd261d0c67b497260a97895a811b81b' - ); - expect(txData?.hash).toEqual( - 'e8c12eae2a7f9a2421f991fab4a617c16fd261d0c67b497260a97895a811b81b' - ); + jest.setTimeout(15000); + + it('getBalance() should return balance data', async () => { + if (!NETWORKED_QUERIES) { + jest.spyOn(BitcoinProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'bitcoin', + name: 'Bitcoin', + symbol: 'BTC', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoin/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '65000.00', + decimals: 8, + }, + amount: '100', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'bitcoin', + name: 'Bitcoin', + symbol: 'BTC', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoin/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '65000.00', + decimals: 8, + }, + amount: '100', + }, + ]) + ) + ); + + const balance = await provider.getBalance( + 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(1); + expect(balanceData[0].amount).toEqual('100'); + expect(balanceData[0].asset.symbol).toEqual('BTC'); + } else { + const balance = await provider.getBalance( + 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toBeGreaterThanOrEqual(0); + expect(balanceData[0]).toBeInstanceOf(Coin); + expect(balanceData[0].amount).toBeTruthy(); + expect(balanceData[0].asset.symbol).toEqual('BTC'); + } }); - it('should get fee options', async () => { + jest.setTimeout(20000); + + it('gasFeeOptions() should get fee options', async () => { const feeOptions = await provider.gasFeeOptions(); expect(feeOptions?.low).toBeTruthy(); @@ -76,22 +107,22 @@ describe('chain.provider', () => { expect(feeOptions?.high).toBeTruthy(); }); - it('should get a balance', async () => { - const balance = await provider.getBalance( - 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw' - ); + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(BitcoinProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(1); - expect(balanceData[0]).toBeInstanceOf(Coin); - }); + const txData = await provider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); - it('should throw for a non-existant transaction on the blockchain', async () => { - expect( - provider.getTransaction( - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' - ) - ).rejects.toThrow(); + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); it('should create message with memo as string', async () => { diff --git a/packages/bitcoin/src/msg.spec.ts b/packages/bitcoin/src/msg.spec.ts index 25ba9375..bee53581 100644 --- a/packages/bitcoin/src/msg.spec.ts +++ b/packages/bitcoin/src/msg.spec.ts @@ -161,7 +161,7 @@ describe('msg', () => { expect(response.maxFee).toBeNull(); }); - it('builds transaction with sufficient funds and no NFT', async () => { + it('buildTx with sufficient funds and no NFT', async () => { const chainMsg = new ChainMsg( { from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', @@ -182,7 +182,7 @@ describe('msg', () => { expect(outputs[0].value).toEqual(100); // 0.000001 * 10 ** 8 }); - it('builds transaction with insufficient funds and no NFT', async () => { + it('buildTx with insufficient funds and no NFT', async () => { const chainMsg = new ChainMsg( { from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', @@ -201,7 +201,7 @@ describe('msg', () => { } }); - it('builds a transaction with nft and sufficient balance for paying the fee', async () => { + it('buildTx with nft and sufficient balance for paying the fee', async () => { const chainMsg = new ChainMsg( { from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', @@ -223,7 +223,7 @@ describe('msg', () => { expect(outputs[0].value).toEqual(inputs[0].value); }); - it('builds a transaction with nft and insufficient balance for paying the fee', async () => { + it('buildTx with nft and insufficient balance for paying the fee', async () => { const chainMsg = new ChainMsg( { from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', @@ -245,7 +245,7 @@ describe('msg', () => { } }); - it('builds a transaction with non-owned nft ', async () => { + it('buildTx with non-owned nft ', async () => { const chainMsg = new ChainMsg( { from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', diff --git a/packages/bitcoin/src/signers/ledger.signer.spec.ts b/packages/bitcoin/src/signers/ledger.signer.spec.ts index b1fa66ca..30bfa995 100644 --- a/packages/bitcoin/src/signers/ledger.signer.spec.ts +++ b/packages/bitcoin/src/signers/ledger.signer.spec.ts @@ -98,6 +98,8 @@ describe('ledger.signer', () => { expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); + jest.setTimeout(15000); + it('should sign a transaction using a ledger device', async () => { await signer.sign(message as ChainMsg, derivationPath); diff --git a/packages/bitcoin/src/signers/private-key.signer.spec.ts b/packages/bitcoin/src/signers/private-key.signer.spec.ts index ea284215..71602c10 100644 --- a/packages/bitcoin/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoin/src/signers/private-key.signer.spec.ts @@ -89,6 +89,8 @@ describe('private-key.signer', () => { expect(await signer.getAddress('')).toBe(txInput.from); }); + jest.setTimeout(15000); + it('should sign a transaction using a private key', async () => { await signer.sign(message as ChainMsg); diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts index bbc05dbd..ca8b0deb 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts @@ -93,6 +93,8 @@ describe('seed-phrase.signer', () => { expect(await signer.getAddress(derivation)).toBe(txInput.from); }); + jest.setTimeout(15000); + it('should sign a transaction using the seed phrase', async () => { await signer.sign(message as ChainMsg, derivation); diff --git a/packages/bitcoin/src/signers/trezor.signer.spec.ts b/packages/bitcoin/src/signers/trezor.signer.spec.ts index ebbd47d4..5dcf6d4d 100644 --- a/packages/bitcoin/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoin/src/signers/trezor.signer.spec.ts @@ -85,6 +85,8 @@ describe('trezor.signer', () => { expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); + jest.setTimeout(15000); + it('should sign a transaction using a trezor device', async () => { await signer.sign(message as ChainMsg, derivationPath); diff --git a/packages/bitcoincash/.env.example b/packages/bitcoincash/.env.example new file mode 100644 index 00000000..69089005 --- /dev/null +++ b/packages/bitcoincash/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=0 \ No newline at end of file diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 6d11f74c..12fef7e4 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -87,7 +87,8 @@ }, "jest": { "setupFiles": [ - "./jest-setup-file.ts" + "./jest-setup-file.ts", + "dotenv/config" ], "preset": "ts-jest/presets/js-with-ts", "transform": { diff --git a/packages/bitcoincash/src/chain.provider.spec.ts b/packages/bitcoincash/src/chain.provider.spec.ts index dd1b75a1..94acd858 100644 --- a/packages/bitcoincash/src/chain.provider.spec.ts +++ b/packages/bitcoincash/src/chain.provider.spec.ts @@ -1,15 +1,14 @@ +import { Response, Coin, TransactionStatus } from '@xdefi-tech/chains-core'; + import { BitcoinCashProvider } from './chain.provider'; import { IndexerDataSource } from './datasource'; import { BITCOINCASH_MANIFEST } from './manifests'; import { ChainMsg } from './msg'; -jest.mock('./datasource/indexer/queries/balances.query', () => ({ - getBalance: () => { - return []; - }, -})); - describe('chain.provider', () => { + const NETWORKED_QUERIES = + process.env.NETWORKED_QUERIES === '1' ? true : false; + let provider: BitcoinCashProvider; beforeEach(() => { @@ -18,7 +17,7 @@ describe('chain.provider', () => { ); }); - it('createMsg(): should create message with data', () => { + it('createMsg() should create a ChainMsg instance for native token', () => { const msg = provider.createMsg({ to: 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu', from: 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu', @@ -28,7 +27,7 @@ describe('chain.provider', () => { expect(msg).toBeInstanceOf(ChainMsg); }); - it('should throw an error when broadcasting an unsigned tx', async () => { + it('createMsg() should throw an error when broadcasting an unsigned tx', async () => { const msg = provider.createMsg({ to: 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu', from: 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu', @@ -47,7 +46,7 @@ describe('chain.provider', () => { ); }); - it('should get fee options', async () => { + it('gasFeeOptions() should get fee options', async () => { const feeOptions = await provider.gasFeeOptions(); expect(feeOptions?.low).toBeTruthy(); @@ -55,21 +54,88 @@ describe('chain.provider', () => { expect(feeOptions?.high).toBeTruthy(); }); - it('should get a balance', async () => { - const balance = await provider.getBalance( - 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu' - ); - - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); + jest.setTimeout(20000); + + it('getBalance() should return balance data', async () => { + if (!NETWORKED_QUERIES) { + jest.spyOn(BitcoinCashProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'bitcoincash', + name: 'Bitcoin Cash', + symbol: 'BCH', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 8, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'bitcoincash', + name: 'Bitcoin Cash', + symbol: 'BCH', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 8, + }, + amount: '1000', + }, + ]) + ) + ); + + const balance = await provider.getBalance( + 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(1); + expect(balanceData[0].amount).toEqual('1000'); + expect(balanceData[0].asset.symbol).toEqual('BCH'); + } else { + const balance = await provider.getBalance( + 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toBeGreaterThanOrEqual(0); + if (balanceData.length > 0) { + expect(balanceData[0]).toBeInstanceOf(Coin); + expect(balanceData[0].amount).toBeTruthy(); + expect(balanceData[0].asset.symbol).toEqual('BCH'); + } + } }); - it('should throw for a non-existant transaction on the blockchain', async () => { - expect( - provider.getTransaction( - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' - ) - ).rejects.toThrow(); + it('getTransaction() should return data transaction on the blockchain', async () => { + jest + .spyOn(BitcoinCashProvider.prototype, 'getTransaction') + .mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); + + const txData = await provider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); + + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); it('should create message with memo as string', async () => { diff --git a/packages/bitcoincash/src/msg.spec.ts b/packages/bitcoincash/src/msg.spec.ts index 3fd59bf9..613ce54b 100644 --- a/packages/bitcoincash/src/msg.spec.ts +++ b/packages/bitcoincash/src/msg.spec.ts @@ -8,6 +8,41 @@ describe('msg', () => { beforeEach(() => { mockProvider = { + scanUTXOs: jest.fn(() => + Promise.resolve([ + { + hash: 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d', + value: 546, + index: 0, + witnessUtxo: { + value: 546, + script: Buffer.from( + '5120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e4088', + 'hex' + ), + }, + txHex: + '0200000000010173c12c3f6f99438c02abb77a8d782f651a80b7dac30dac74dbd9ea988e2c966b000000000005000000032202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40882202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40880000000000000000296a5d26020704948db1feb59ec9a6d302010003a40205a9e90706f4f3ccc8010a84f60d08aedf01160103406cb75a669728ffa3529936bd3c37aa8b606442f8a8a5c8cd8c0f2b7774bbffebbc7a770e8789aeb55e0c59540929ba5e837a0ce0b4a7f9bdb3adf61eda2d128bfde62420c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c8248ac0063036f72645d099446cc5ff3244d530101010a696d6167652f6a706567004d0802ffd8ffe000104a46494600010100000100010000ffe201d84943435f50524f46494c45000101000001c800000000043000006d6e74725247422058595a2007e00001000100000000000061637370000000000000000000000000000000000000000000000000000000010000f6d6000100000000d32d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000964657363000000f0000000247258595a00000114000000146758595a00000128000000146258595a0000013c00000014777470740000015000000014725452430000016400000028675452430000016400000028625452430000016400000028637072740000018c0000003c6d6c756300000000000000010000000c656e5553000000080000001c007300520047004258595a200000000000006fa2000038f50000039058595a2000000000000062990000b785000018da58595a2000000000000024a000000f840000b6cf58595a20000000000000f6d6000100000000d32d706172610000000000040000000266660000f2a700000d59000013d000000a5b00000000000000006d6c756300000000000000010000000c656e5553000000200000001c0047006f006f0067006c006500200049006e0063002e00200032003000310036ffdb004300191113161310191614161c1b191e253e29252222254d08024c373a2d3e5a505f5e595057566470907a646a886c56577daa7e889499a1a2a16178b0bdaf9cbb909ea19affdb0043011b1c1c252125492929499a6757679a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9affc00011080190019003012200021101031101ffc4001a000002030101000000000000000000000001020003040506ffc40031100002020104010304020201040301000000010203110412213141051351223261711442238133152452a1436291b1ffc4001801010101010100000000000000000000000001020304ffc4001d110101010101000203000000000000000000011102032131121351ffda000c03010002110311003f00f4ec082c08a88064032800279030030308ac2125da232488c0460616294062c7c8cc58f9003030b158400308000bef2322fbc8fb0000200a842100847d108fa00f84144f08888190c844320a643088641523f79615c7ef1c8190401401080801210840b67432e90b3e865d20080200210800200200a0fa129fec3cbed6253f6cbf611d16041022a201858aca0790327923085030b03012406190180ac563314a031579198abb61018ac662b000020002fbc8fb22fbc8c000090281024c0108fa0e08d70407c220d8e82a127d2602850ded4d7f560c35e02a2185414018fde3891fb87228a1854301028014404840804d0802b2185978180012100042100040802927f6b055ff001ffb0d9f6b257ff1a08de04117c9a44606162b081e40c3e40c00c56160602488c92e88c0562b0b032851576c662aed84462b0b000001000abef41605f7a0bec0042070151070443c20e4f0910051c97d5a594fbe11a68d3a8accbb3425826ae29869a11ed65966211f84194e315cbc1cfd5d8fdc8a4f8c915bac4dc7e9c18a745edf48d3fc8ae1149cb90c2edef88bc7c8197d8718e6512bdadfdb1674da4fb2b9cabfb1b49b039e961f2326596685c9e63302d2db1e9a6501048ebb62b9c15bb2517871cfe80b421846528a963046b1d904210202bed0ec47f721d80081200001030214db7c6b59657a8d46de11835176e8bcbe41ae94e6a55e53e19643fe3472347a9ffe393e3c1d78fd8bf406e17c858be4d322c56160602bec0c2fb0300315840c059740f049744f050ac0c2c561018abb633117dcc08c0162b00300401417dc82fb02fbd0584421064829a11727847474f4a8472fb2ad253c6e66c336ac4200119a9671e08acf753dce5997e0c3aa8d925ba4b62f075c4b2a8598dcb2064d0550954a4e3997cb345f29421fe38e59625182c2c2466d5ea556b6c7993032bd6d95a7bfb1689c5d9ee5cf327d234e9f48a5fe4b965bf05b1d1d519ee480ba324e29ae8c7a8d67b77c611e72cbf516a84308e42b211d439cf9c7488aee71249b40db0f847356a355a878aa1b63f2cd7a7d3c4d0802e1f5593729145f34dc71178316a29b13fa1ca4d9ba5251596f063b7d42b83c47ea7f80055a7b92cca48364955f7c9029f518d9628358c974f49558f32cb0332d4425258792f5252e8b614575ac46290fb52f080a085b29417782895d580459bc45915907d305affc6f00726d9393975d98ef928fecdb2508272f2ce5ea64f73fc8642166db33f0cf49a6b1594c5fe0f2a9ee9a47a1f4e97f8b0163b62f9185f2699415858180afb2323ec0c00c56160602cba0780cba17c140606162b080c55f73198abee023158581801802c01417de8205f720804b74f5ef9a4548e9692bdb0dcfb64a2f8c76a490c0c8bbd61fe0cb44d4d9b2b6cc9e9f395964dff5336bf512b6c5543cbc1d1d252a9a6315df903401b1673508e5986cd44ac6d478463bee72d4e75aedb2b6b0e466aeba55bbe52cbf1928785db0271974ce3fbaff001bfc1d54d35c312fb5555b9330d774aa977946e5b6d826d651db9ee7518b31cb957a8d6cf8cc21f26ca3d3a9ab96b74be59ad612e086d012515c2c155fa885316e4c7b149c711786736dd15b65f194a5ba39e500d8bb58f2decabffe86c5469eb6a2937f26f514a1b71c60e73d0bb752d4dbf6d1064d356efd545d69ed4f2d9de5c212aaa15476c22921db51596046d259664bf5497112ad4ea5b784f831b6db28b2774a4f96239314810ca4d16c2dcac3e8ce14c04d6edaea6d238575bba47a1b2b57d4e0ce46a3d3674d080216dc7c15319b4cb36fe8efe87889c5d3552849ee5c9dad27da88b1dc15f622ba2fc87726fb34c998ac3903015f6464976060062b198ac057d03c05f42ae8a2315858184062afb82c55f701181858a00606100505f721855f721bc816d10df624751709230e863f5391b4cd6a24e5b60d9ce7aac426bcb3a125ba2d7c9c2d5c6dd3d92cc5b8f820b7410f7754e72ea2755dcb7a845e59c1a6ed44deda6b6b3e4ec68f4ee986e9bccdf6c109aab374b622b4b0816bff0033c897592ae1951c9e2eeef4efccf867d53df6a845e1f9123374dca2dee40a655bdd2b1fd4cae9fab55c728cbb63a2f0d1ab433dd5b8fc332786d9a3d3d62b949f9676f170edb720534db4998f55abf6e2d47b0e9a5b34dee4df2f967a1c95eaf54e9bb09f7e0d1a6b27647328e0c9a6ad6a2e95f62e17da6eaac536d2f0516900420262d5ea3faa65da9b7643f2ce5592727928129658320204120320c941c9322b960aa76a441a2166d91add944e2d719c1c6f79e4917276396780345d5c37fd25fa6e383049bddde4d14db89e00e8670156c90ad8ad9b61a23a9f92e8db1979303065ae981d06f216608dd28f65d1d4a7d855ec56056465d30b640ac0ba0be80ba280c56331584017fb045fec01628581801808c01517dc86f222fb90ebb03a1a458af3f25f92aabe9aa286c986e1b22ca3197dc93036619eb97f2e3545f606f8c231fb6290d911481296136065d641c64d08027bd74fb2adca50c32fa7511be5283f057768e49b954ffd1c3d3cb6ec6f9eb142d356db720c615d5d6113dbd42e360d0d15b63cd92dabe1189e5d5fb6afa1773ba4abad7ed9be58a28c2f0834d30a6388aff61b62a75b8bf277e799ccc62dd72945ea6fdbbb08bb572db1869eb79c981d93d2ea5a5e0346a947512b6ce5f8352336eba52be3455ed2e1a41f4b939c2527e59cabb532d4db8ae2db7f076b454fb34462fbf248b71ab246f0b22e4ab5366c81463d5dbba6666194b2c52b2806f0430ebb56ab4d45f205d76aa30e114ad665f839129d96cb2d8d084d72993e475ddfb97057df666a9cd782dcbf2ca2d585fa1a6d61246795bc3427b9f909ad1bb816163f73250e5263c7828efb606c2d342b34c8303234236d00722b264990229ca3d32c8eaa4bb2a62b036475319164649aece630ab651f2074db1598e1abf92f8df197902c62ff006265307f600b1585818500108005f721e1ccd7ecad7dc8b2bff917ec0e9671140dc2cd9cff0051b6d843307c7932d0fa8fa82aa2e15be7c9cad1fb93d6466d3c67b134f5bd46a3eb7c1d0d4b8d1186de30565d68be017cb14c9fe0a68b5595c64bc83552ff0004bf465a7234dabf675dcbe1bc33d14649a4d1e4e153b2c9c9768edfa66a5cead927f544b52574721c95e4a6dbfda9addf6b32d35364c95a9a92ca7c072071bd6310b94be515687d3e7aa7bec6e3037ebb4af51a8aff00f15d9bab4d08028a845462b090094696aa12508acfc9a322648df2032661d6599960d9396d83672ed96e9365080211bc22a33eaee5554df93816d8ecb1b9335fa9dee766d4f846022569834916c2493e4c6a4d054a4351b9dc93e1892b72ccf5c5ce49367568d15718a6d65856385765afe94f068fe2b843749e59be3151584b055a97f41462dbd0e911f482823d0ca257289a1a1251348ccd31597ca25528815311b2c684920132d11cc8d08c02e42b680c56c02d032d790360c816475138f92faf549c96e31b140eb2b232e98727254e51e996c35525d81d0014435319765aa69f4c28ff0064595736afd957f643c5e26981bad78667b529c5c5f92eb1e5265126655c696ed36a963ac9b75aa365196f9c075747b8e325e195eaeb94aa4d3e8a83e95737175bf06bd54bfc3239de9916a5293375ff0055524be08ae4c6f74a9a5db068f532ab50a4f84d829a95ba9db3e8dbaed2c7da52ad7da5475e162945497933ebf9a73f065f4abe53a5c65fd4d1ab79a244699b49acf6a4a329662ceac66a4b299e56726ac3a1a1d63862327f48c495dcc872530b14e29a791f2468f9027c8ad922c817552c57839edf269d5cf32c194b12a14eaa7b296cb4c1ea93db560a38d6cb7cdb148432c8a19010c88b17e9966c476e2b114727430cda8ec1795a067d53e123418f532cd98f8348adf80a03ed05151e9da15a26e264046238a2d62328a6502a944d2d0928a60657124d0802b944d52acaa5008ccc565f281538fc008c51dfe50aff0000281b0b15811832460026468db28f4c4201aaad572b71aa17c64f8672c89b4f8607a48b53a13453207a6665a56db1a688d13224929269f449bc26cc5fcb71b1a97411aa3055f11e876f2858cd4e394c2073b55074dcac8f593a1558ada93ed342db5ab20e2ccda572a6c754baf006caeb8d49a82c6497bcd32264aef962a64572e9829ea5a7d0d7552a67ff00d41a67ff0074d9aefb6bdae326544d1eabdb6a2dfd2ceac66a4b299e6e3349bc7fa37e8354e2d5737df44ab2baf919329521f77046996f966c65434de64c52a21c9f5697291d5393ea9f7128e6910d80a46530121e288a2595c32d222b7fa7d7fd8de53a686cad171d27d25093c26609bccdb35dd2c4198fc952a3ec281e4207a4c0ad8ed0ad00bb8192342b282d8ac8c1900362319a1580ad265728a1d8ac0a6512a957f0687111a682333525d8bc334b4995cab4c0a8563ca0d74267e40001b0068001402ca20a76c62de32c0ee7a7476e917e46b3b2eaab55d2a2bc22ab08d289ae0e3df0ff00b8dbf2ced35c1ccd7476dd097e422bae73d359b65f6b3a316a4b28cfaaad59467ce05d058e55ed7dc40d45538c6525cfd48b59ced64e55dca4981bfc156a64954c6a6c56d6a48328a92c340719b719371ec318b9bcce783a1668e12e57052f40fc480a272aa10c43bf92aabdcb2d5b3e7b35c7d3d67ea91aaaa6152c4d08024501aaa6d4127d96eefa599e2c772fa591a54df200900073bd4619e4e899f555ee8e45238db02a25f2af0c8a073554a26cd2519965a169a5ca5d1d1ae0a11c235214dd2004593c47269967d44b2f051e469bdd26c0bb2a07f608176103d2e40492c742eec011a11a1f22b0118ac768460462b23606ca00ad07206c05680d058ac047115c4b00c0a5a12514cbda12480ceeb6ba11e5768d0c56979028e18f571647f6175af01a6b94ad8c719e423bd559f425f803e64595d2a314bf03ed8a32d2971e0e7fa957fe3ddf0ce94e5f066d457ee552451447ead3afd18f41c5d62f06e8c5c74f87f067d1d4d39c9aed846939bea189347466f645c9f8306a946d82b23f3c809a79bd3d8a32fb65d1d1ed64cfecc2eae0fe0bd2c2480842331eab52e0f117c81ac055a7bd5b0cf92d00a0c9fd2281be0299744645d108001acac0400669e9f2f80474cf3c9a88322e961050584824204428be7c6116ce5b6393249ee7965429104010176102182bd33457288d92640a649a177fc97b49954eb026531588e328be08a7f204944469a2dca60682a8602d947256e2d042e40c2d31594462e4206006c56168802342b896030056d1abd3d62dddf05383a3a2ae2aacf9641ad58db239678028e3a0a87964695bc08dc53c6792bd4ea614f09e647396a25fc88c9bf254751c73c0bb141705d0e629a16688acf38ee4d3395a98ca8dd15f6c8ec48a3514ab60d7924d0802a551a38eda23c9795e9a2e356d7e0b1a08ab51271adb47266e53cc9f475ec9c57d32f264d6462a95b5700acb56fa36d8bed7d9d3aac8d914d328a20a7a64a4369ea8d59519640bd8af81857ca01a0f231545e196f614084210021080403692cb03692cb33d966ee174540b67b9fe0ac20020020f0044102e8207a462b43315b0064391583214cd26552afe0b33920199a7122b3e4d0d26553ab3d00bb93232b94651029fc80cd0ad0d94c0d015b88ad16b42b40540658e223400158c4c00b93a7a04dd7ca30575ef9a47629828414578018cdafd47b34bc76cd671fd4db95d187e48566af4d65d177d8de3c14c9e64d25d1d9bd2ab478fc18b4f4674b658d77d031b3416ab34ebf1c16dd2d9072660f4697d5387e4e8ea239aa4bf015ca77ceed4c229e164dfb70b2ce66997fdec51d69c5b612284b2c9b4a5ddb355b1f4cd897007375953972bb461729c96c933b16637f261d751b56f82eca9544b50aaa9422f9268bdc94dcdfdac5d3e91cdeeb3af837a4a2b096101059cb6c5b7e066caece60d7e00aa1a9ae4fbc33442c4fc9c39adb37fb0c2e9c3a9309aefe7203955eba71ecbe3ae52c05d6e2b9d8a250edddd315b069a737210200200800211f4403e802ba080807a7922b68b58ad0554c563b030a40e43815ac10364991724c805a4fb299d39e8b721c818dc1c58548d4d27d95ce8cf405592342ca1288373403342b59194930e32052e4d080220c60b9a028e59516e8229d9ba5d23a4a51f08a74ba751865f6cd2a2978228672ba39b2d2cb51abdef88c59d5c70578c74073bd433270aa3e4b2e8c68d1ed5f05ea85ef3b25cbf063f54def6d70fec066f478376d93f075e714ab6d89a1d32a288c7cf92cb16e963c203894f1af5fb3ab6bdb16ce5db886bd3fc9a75baa5186c8733611ce9b94f5694565e4ed3fa2b4dfc1468748a987bb6733916d8f772f88a030d92f71c9478687a26adab9ed760d4c7daba16c7ed7c32b9c9696f73fe935902d924bf02b8e4aa2e7a99ee7f4d6bff0066b5158e0a3334556bdb06d9ae5030fa84e30a9c73cb0572a6d3931700264303864ce019200f1b651e9974354ffb1948074637465e47c9cb4dae996c2f947c85d6e219e1a94fb2e538be9853019324f2802420023d53158729803449213058c52291a17234858813b26084c900c0484c8540809900b8a7da2a9d3f05a9840c528342a6d1bdc14bb4553a3e02288cf3d9a74f5ef967c22baf4d29cb18e0e9554aae292283143f5d852c1cef51d54ab7b60c0dd2b12f226f8fca38b0b751645c926e3f22a76dd62ae326b230d776328cba6981d3194d4dacb42e974d1d3c3196df96cb9c92e88a1d26571e7233cb5d020b00707d41ecd53f2fc1afd3f45272f7aeedf499b25a2ae7a8f764b2d78352492e0a98a650c955d56ea6515f0689760c115c37a84a995324dcd3e0cee2e75395b2c38f499a7599d34d08026b1b8c5373e83fc7d91f7751f549f5145649a68d9a94b9db05e0e8a82492326854d4e4f6ed83e91b58228be71aab729748f37a9b5db6ca59e33c1e83d431fc7793813ad3e844aa41819c1a172564081e18180039010024010023464d74c52017c2f6bb2e85d16d18c280df94c2628ce4bc96c6ff0090af5f28e3a1777c9632b920d0f62b0731fd054932283592bc619601ac9023401bf62b414039200020c81b2240326326563440b132cae0e4c5aab737c1b210dab080918a8f43a0602f091424e584d9c4d4e6fd4ed8f6d9d0d6ea125b73839f5dce36b95507297c84ae9c288d5a6d98f07213f67591978c9a6766baceabc154745a9bad4ec585908eca7ba29ae8997e10610db051f8433c4511a235260e1719e4ab53ab8d4b19e4cbe9f39df74ec93e17411bc8df01c2c825c20acf3b36e5bf0535eba1396de983d46ab275e6acfe51cb8ca507b651daff0025474f5347bf64271e70cd0ea8c92dcb3839f45ceb5972e0d3a7d6abdb8a5ca20b5c527842343b030397ead638c631f9397d9d0f5479b52f839ee3f06a334ad0928263f28994c233cab6ba13aecd4d092826114107957f0234d010842600898720200c9845200e402201ee642b19b1701b2b42389630322abdcd764c85a11ac7403000a5f212283401b04c0084636dc964689cbc01528b7d1a2ad3b7ccb82faa8505cf65a9002294561218980b692e4a214ea5c956da195f5b96d54d08022cbfc0ed26b0c838b450f577bdf9dabb3ad5d35d4928c520d74c2aced58c8de42606321c2416d4518afd66d6e3545ca5f80ad739a8acc9e0c3a8d6c79507929746ab54f364b647e0c7abaa3a77b62db654d259beedf672d23abe995fb7a64fcb0e874915a4519ae65cb35c62a11515d204888136a2b2f84577ea214ae797e118adf72ffaad96c87c106c85b1b73b1a7812ed2d76a7be2b261a6f7a5b36ec7b24f8674d4b74535e40e45de9962962a9fd2fe4d9a7d3474f5e177e59a642f20c56d15df6c69adca45ed7c9c4f51d43b2c705f6a2c2b2ea2d76d8e4ca9858ad958462b8a091808d340c8ec0d00b8c8ae2361ae899f902a956238b468038e40a3211e55a623835d0406884cb5d87298002898f807441eeda14715a2ba15802d6004018af91b90a837d202a71156e4fac97fb72ce305d553b565f6419e309359c32c85327df0694864155c298c79c64b17e021e8a06191c94565b16c9ed59671f5baa9cbe983c111d1b75908a7b5e59ccb355a9d4cdc60b0be4d157a6eea549cdee6b253669eea33c657ca28be8b74fa387d73dd63ecb3fea2ec96da6b726fc9874fec2966c8e5fe4ead16d18fa3080babddb16fec62bb7515d6b2da31ffd495967b75472c8adf28a92c302ae11ea2835eedab7761602b59470e71f7fd4943c27c9dd7d1929d2ecd54ed7e7a095a63c24bc11f4335c093e23c85732c78d62c45cfe5fc0daf59846717d3e4d080286babb2c4f1f444cf0c5b54a119622bb6ca8d32846fd227e522686d7656e2fb8f0668dbedd5ecd199c9f9346834f3a54a537cc88366d5e43c0867d66a3d9abf2fa0a4d76b6342db15991c1b1ee9397c96db395927293c94b34c52303c0cc46101832162b604c90010211a2100571f827ec626005234468996bb015c532b957f05fc32600cdca0e4b9c531255fc01ee18065063a8608daa717f018d2e5df05c90c022ae2ba4324904204e119eed5420f1db06aed75c784ccba49d6ecff22cc98127adb3394b0890d7cd3fad706f95709470e28e6eaaa554b8e883a14ea6bb57d3dfc1764e251292d44147cb3b4e4a2b2d814eae129d2f67670ec4f389a69a3d146c84ba6812a6b9fdd14c0e2d7ea16d71518c5c8d354f5ba8feaa11fc9bfd9aa0b2a0bffc33df75dd555b0127a084a3f5cbebf9462b23fc56f36292f05ae9d75af97b51755e951ceeba4e4ca39896a35b628c13dbf276b45a186963f33f2cd15d50aa388452409dd1876c18b1f08495905dc91ced5fa8c62b6c5e5fe0c75d3abd53dcb318fe41aed7bd5ffe488adadbe248e5bf4abf1ff2bc95bd35f43fade57c90771493e98b2e4e3e8f5535aaf6a4f299d60a1626eb925de0e651e9d3949bba6d473f6a3aa408a6ba2ba96211487612632148da4b2ce2fa85deedb85d237ebf50a11708be4e44b9658cd56c4658d15cb82a118ac66c46c00c56303010a40e018020024021004c804d0802c4064214ad132d0c00889a64c130898680f7606d2ec2ce76b2738cb12ca5f246db5dd05dc903f915ff00e48e3ef7f23e9e89ea1bfaf007595f5ffe48656c1ff64731fa7d8bff0090aaca2dafab1303aedd72586d3114298bca514ce4a94d773ffd93dc94b88ee93fc10752dd4c20bbcbf84736fbfdd965f0be07ab477db872fa62742ad1d55afb537f2c0e4d76284d4d768d73d74671c49726e7a6a9f7045362d253f728a031e97ddb3529c13505db3b067d35f5dbc54b8f92e95918f6d20198089a6b2881493ba10fba4914d9afaa0bbc8da8d342e8f3dfc9c8d568ada5b78dd002cbbd5a7649c698b7fa161a4d66af99bf6e3ffb269357553c3ad67f46a9fab5504545ba6f4ba69faa599cbe59b7e98af091c897ace78841b2b7abd55fc42b7c81d4b7555d69b72472355ea2ef93855172fd16c3d3aebda7a89617c237d1a4a74eb108acfc81ccf4dd1ddfc8f7ae8ed5e0ece0242001c7c8322cde136c2a4e7082cc9e0c96fa85714d439655a8dd73c748a1e8fca65466b66e72727db2a66c5461fd45b1a61f03531cdd927e09ec4df83a9edc7e01b57c0d5c733f8ad93f8874f6a15c5134c737f8d815d183a4e057280d31ce748aeb37cab2b95634c617011c59b65588eb2ea632601834bac57584c5180e0b3603683084c0db49801704e82403dcf0c16571b23892c9c9af573aa6b2f397d1d783dd14fe434e4ea348ea93c7dbe0a6bba34bdd4d0802b9e7e11d9d4d1ef57b738fc9569fd3e9a796b74be581cf52d66a9ff8e0e31f965f5fa6592e6eb5fe91d3584b826418c95fa7d10ed67f65f1aab87db148cfaefe425ba8e7f072e7ea37d7c5b09203bce515db48a6dd5d14accec4709eb15ef129b8861ecc732c6f7f909adf77a94eefa74d5c9fe7064fe3fd5ee6b2d4bffae46adea2f588b8d50fc05c74da7799b76cc06fe5dae1b34956d8afeccc754adb75295d6f09f3c9aa76df7c76d55ec88b57a7d517bb516fd4fc2606f9fa9e9a88a8464e6d7845ba4d5bd4e5fb728af962d3a2d3d6938c17ed8f6df1ae3f4e08ad00693586b263d1eafdeb6507e3a370573b57e990b732afe991c8ba89d3625756f8f3e0f4e2d90858b128a61183453d3591588c6323a30504be9c7fa31bd0539ca58fd1755546a5c37fec0b5b001e456d2f214f912cb6105f5345374f10789726451cf3279606afe527d4595cee94caf0400e4391499206c2624a0d73161c872057bf1c496187298ed292e515b835f680702b06f6bb19480515ac8ed030054d0ad17342b4052e223822f68180333ac4759a9c45680c8e02b81adc05712a32380bb4d4e02ca0066700389a3681c018e868ea87b8a77cf2d748edc3534f0948e1dda2b2a7f4da98162b5f54f2fe1151e83dfadff6424f53541665348e3570d45dc551718fcb36d1e9915895f2737f015b2ad446d7f426d7c96b7859627d35c7092491835fad8c20d2606eae4d0802d8599daf3825945762c4e099cdf4472929cde70d9d6039b7fa3d16731fa5fe0c36fa3ea21ff14f28f400063cc7f175f5ff0046d0631d627c50f3f93d3315b434c70ead2ebed7f5cb623769fd3a35b52b24e72fc9b5b4bc8ae71f944064be9c238774ef86a1c2516e2df675add5d5545b725c1cad46b2cd54b6d316ff00252a42f85366e4f123a7a7d7d762c37867265e937ce1bf7fd5f057fc1d6c5e12ff006136bd04b5354565cd06abebb93d924f0712af4bbe6d7bd6348eae9b4f0d3436c17ed8569e08e508acb69154e6a2b2ce65d2b2fb3b6a2456ad66bb6fd14f2fe51853be6f32932eaea8c39c658ef0c0a949e30d8ca60944ada6882f520e4a14daec65302d20aa41c80724c818006c9322649901a493ecadc1ae87c933928ad4f9c3e18d92349f6238b5d1038188a787c8ca404c0ad0dd930056c181da15a017006b2311a02b71034580c014b8a06d2d685710374349a8d43fabe889b68f4fa6ae64b74be59ae52515c944f5318a7c9a45f88c170924536ea6104f9e4e6ea3d424f2a2b839d2b751a9b364385f2135bb55ea71cb49e5fc228d368aed6d8a76271aff0026ad17a6d14e277c94a6747f914c16135fe818b29aa14d6a1058487c9927afae252fd453eb045d74720728fca3936fa86173230ddea6fa865b29af4994fa667be894f984dc59c5d35bea16b5edc70bf276f4fef282f79a6ff043ed86cd36b33c58994cb47ae97f4de601748ec932531c9abd21b79bec72fc1d0a74f5d2b108a45e290c4007a16538c565b0a866bb50e13c2e8965ee4f0b8452f9ec02e6e7ce720c95b8b8f310a9a7c3e190381832100640d2630ad63a01250f82be51767e40d26056a43a90ae256d3405ea436e33a9e3b194c0b593257b83901899154839019320bfa26402e29f656e2d743e43902a53f9e06520ca29a2b706b9881670c8d15a9f87c0ea5900340686230101819a000018180074fd4e73ae9cc4e34b5c92c48f4938c671c496518adf4ad358f2e383496388f555bf245ab843edc9d75e8da65e19743d2f4b0fe886a63852d7592fb2126476eb2d58856d7fa3bce3a4a78c472517eb2b82c4120638f0d36aac97f91b8a2cb1c34f1c7dd21eed5d97cfdba565bf83668fd2bab350f74be018e753a4d46b65c27187c9d8d2fa553424e4b74bf26e8c230588ac20917023151584b012102800aefbd54b9163a984967a02edd8335fac8c3e98f3212cd43926919b6f3902e77ce6b97815c9bed8a422a64391591301f22ca2990990133287e50f1929741ec470f2b8610d90e4ad4da7890df94016b22b580e420201a4c66b22b4d015ca22f28b72069302bc87711c4502c4c2995e49b80bb242b520e407c93a172100833861c1000d27da15c1afb4668802a97c872169315a6ba283d81a026300001001ffd96821c0c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c824800000000', + }, + ]) + ), + getNFTBalance: jest.fn(() => + Promise.resolve([ + { + description: null, + id: '20090103/e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6di0', + name: 'Inscription #70316307', + owner: + 'bc1px9wxdr8ha6swg50lcleq99jav6kkyn7g52j5xa2vunmype67gzyqyq6ah7', + symbol: '', + isNftSpam: false, + location: + 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d:0:0', + contractType: 'ORDINALS', + spamScore: 0, + }, + ]) + ), getBalance: jest.fn(() => Promise.resolve({ getData: jest.fn(() => @@ -55,6 +90,41 @@ describe('msg', () => { }; }); + it('buildTx with insufficient balance should throw an error', async () => { + const chainMsg = new ChainMsg( + { + from: 'qq8s9kmuyl9avm5ef7jlgsnv9x80ygj7scyzcr6vad', + to: 'qq8s9kmuyl9avm5ef7jlgsnv9x80ygj7scyzcr6vad', + amount: 100000, + }, + mockProvider, + MsgEncoding.object + ); + + await expect(chainMsg.buildTx()).rejects.toThrowError(); + }); + + it('buildTx with native token and valid balance', async () => { + const chainMsg = new ChainMsg( + { + from: 'qq8s9kmuyl9avm5ef7jlgsnv9x80ygj7scyzcr6vad', + to: 'qq8s9kmuyl9avm5ef7jlgsnv9x80ygj7scyzcr6vad', + amount: 0.000001, + }, + mockProvider, + MsgEncoding.object + ); + + const { inputs, outputs, utxos } = await chainMsg.buildTx(); + expect(inputs.length).toEqual(1); + expect(inputs[0].hash).toEqual( + 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d' + ); + expect(inputs[0].value).toEqual(546); + expect(utxos[0].index).toEqual(0); + expect(outputs[0].value).toEqual(100); // 0.000001 * 10 ** 8 + }); + it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { diff --git a/packages/bitcoincash/src/signers/trezor.signer.spec.ts b/packages/bitcoincash/src/signers/trezor.signer.spec.ts index 6bdf05a6..d4de7414 100644 --- a/packages/bitcoincash/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoincash/src/signers/trezor.signer.spec.ts @@ -10,8 +10,6 @@ import { BitcoinCashProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { BITCOINCASH_MANIFEST } from '../manifests'; -jest.setTimeout(10000); - import TrezorSigner from './trezor.signer'; jest.mock('@trezor/connect-web', () => ({ init: jest.fn().mockImplementation(), diff --git a/packages/cosmos/.env.example b/packages/cosmos/.env.example new file mode 100644 index 00000000..e886c5a7 --- /dev/null +++ b/packages/cosmos/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=1 \ No newline at end of file diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index eec93605..ba5e71f4 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -73,7 +73,9 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "jest": { - "setupFiles": [], + "setupFiles": [ + "dotenv/config" + ], "preset": "ts-jest", "transform": { ".+\\.(t|j)s$": "ts-jest" diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index e1bc98fe..dca71c45 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -1,39 +1,14 @@ -import { GasFeeSpeed } from '@xdefi-tech/chains-core'; +import { + Response, + GasFeeSpeed, + TransactionStatus, +} from '@xdefi-tech/chains-core'; import { ChainMsg } from './msg'; import { CosmosProvider } from './chain.provider'; import { IndexerDataSource } from './datasource'; import { COSMOS_MANIFESTS } from './manifests'; -jest.mock('axios', () => ({ - create: jest.fn().mockReturnValue({ - get: jest.fn().mockResolvedValue({ - data: { - tx_response: { - height: '17932843', - txhash: - '0269644F832384D033D2223226A5FC25BD17A3646EE2BEF5C1F9009FD19E66B9', - codespace: '', - code: 0, - data: '', - logs: [], - }, - block: { - header: { - height: '17932843', - }, - }, - }, - }), - }), -})); - -jest.mock('./datasource/indexer/queries/balances.query', () => ({ - getBalance: () => { - return []; - }, -})); - describe('chain.provider', () => { let provider: CosmosProvider; @@ -43,7 +18,7 @@ describe('chain.provider', () => { ); }); - it('createMsg(): should create message with data', () => { + it('createMsg() should create a ChainMsg instance for native token', () => { const msg = provider.createMsg({ to: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', from: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', @@ -53,84 +28,139 @@ describe('chain.provider', () => { expect(msg).toBeInstanceOf(ChainMsg); }); - it('should get a transaction from the blockchain', async () => { - const txData = await provider.getTransaction( - '0269644F832384D033D2223226A5FC25BD17A3646EE2BEF5C1F9009FD19E66B9' - ); - expect(txData?.hash).toEqual( - '0269644F832384D033D2223226A5FC25BD17A3646EE2BEF5C1F9009FD19E66B9' - ); + it('createMsg() should create a ChainMsg instance for custom token', () => { + const msg = provider.createMsg({ + to: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', + from: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', + amount: 0.000001, + tokenAddress: '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48', + }); + + expect(msg).toBeInstanceOf(ChainMsg); }); - it('should get a balance', async () => { + it('getBalance() should return balance data', async () => { + jest.spyOn(CosmosProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'cosmoshub-4', + name: 'Cosmos Hub', + symbol: 'ATOM', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/cosmos/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 18, + }, + amount: '1000', + }, + { + asset: { + chainId: 'cosmoshub-4', + name: 'Neutron', + symbol: 'NTRN', + icon: null, + native: false, + address: '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48', + decimals: 18, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'cosmoshub-4', + name: 'Cosmos Hub', + symbol: 'ATOM', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/cosmos/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 18, + }, + amount: '1000', + }, + { + asset: { + chainId: 'cosmoshub-4', + name: 'Neutron', + symbol: 'NTRN', + icon: null, + native: false, + address: '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48', + decimals: 18, + }, + amount: '1000', + }, + ]) + ) + ); + const balance = await provider.getBalance( 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4' ); const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); + expect(balanceData.length).toEqual(2); }); - it('should return false when verifying an invalid address', () => { - expect(CosmosProvider.verifyAddress('0xDEADBEEF')).toBe(false); - }); + it('estimateFee() should return fee estimation', async () => { + jest.spyOn(CosmosProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); - it('should return true when verifying a valid cosmos address', () => { - expect( - CosmosProvider.verifyAddress( - 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' - ) - ).toBe(true); - }); + const msg = provider.createMsg({ + from: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', + to: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', + amount: 0.000001, + }); - it('should return false when verifying a valid cosmos address with "osmo" prefix', () => { - expect( - CosmosProvider.verifyAddress( - 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - 'osmo' - ) - ).toBe(false); - }); + const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.medium); - it('should return true when verifying a valid osmosis address', () => { - expect( - CosmosProvider.verifyAddress( - 'osmo13r2x8duq3k88xjhcksd43phnmdpj97frx32qux', - 'osmo' - ) - ).toBe(true); + expect(estimateFee.length).toEqual(1); + expect(estimateFee[0].gasLimit).toBeTruthy(); }); - it('should return true when verifying a valid mars address', () => { - expect( - CosmosProvider.verifyAddress( - 'mars13r2x8duq3k88xjhcksd43phnmdpj97frnhqfl0', - 'mars' - ) - ).toBe(true); - }); + it('gasFeeOptions() should get fee options', async () => { + jest.spyOn(CosmosProvider.prototype, 'gasFeeOptions').mockResolvedValue({ + high: 0.003, + medium: 0.0025, + low: 0.001, + }); - it('should return true when verifying a valid terra address', () => { - expect( - CosmosProvider.verifyAddress( - 'terra10wn9ztf5vnms746nf07nsajlcqmn0s3q2nm6yz', - 'terra' - ) - ).toBe(true); - }); + const feeOptions = await provider.gasFeeOptions(); - it('should return true when verifying a valid ethermint address', () => { - expect( - CosmosProvider.verifyAddress( - 'evmos14gya7fnnuxhrlnywmp6uzvd4y3yul9vpp7tu6m', - 'evmos' - ) - ).toBe(true); + expect(feeOptions?.low).toBeTruthy(); + expect(feeOptions?.medium).toBeTruthy(); + expect(feeOptions?.high).toBeTruthy(); }); - it('should return true when verifying a valid EVM address', () => { - expect( - CosmosProvider.verifyAddress('0x74EeF25048bA28542600804F68fBF71cCf520C59') - ).toBe(true); + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(CosmosProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); + + const txData = await provider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); + + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); }); diff --git a/packages/cosmos/src/msg.spec.ts b/packages/cosmos/src/msg.spec.ts index add9ddbb..4509277a 100644 --- a/packages/cosmos/src/msg.spec.ts +++ b/packages/cosmos/src/msg.spec.ts @@ -1,9 +1,10 @@ +import { MsgEncoding, Asset, Coin } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; -import { Asset, Coin } from '@xdefi-tech/chains-core'; import { ChainDataSource } from './datasource'; import { COSMOS_MANIFESTS } from './manifests'; import { CosmosProvider } from './chain.provider'; +import { ChainMsg } from './msg'; jest.mock('./chain.provider', () => { const originModule = jest.requireActual('./chain.provider'); @@ -16,8 +17,238 @@ jest.mock('./chain.provider', () => { describe('msg', () => { let provider: CosmosProvider; + let mockProvider: any; beforeEach(() => { + mockProvider = { + getAccount: jest.fn(() => + Promise.resolve({ + account: { + '@type': '/cosmos.auth.v1beta1.BaseAccount', + address: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + pub_key: { + '@type': '/cosmos.crypto.secp256k1.PubKey', + key: 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu', + }, + account_number: '1895821', + sequence: '1', + }, + }) + ), + getBalance: jest.fn(() => + Promise.resolve({ + getData: jest.fn(() => + Promise.resolve([ + { + asset: { + chainId: 'cosmoshub-4', + name: 'Cosmos Hub', + symbol: 'ATOM', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/cosmos/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 18, + }, + amount: '1000', + }, + { + asset: { + chainId: 'cosmoshub-4', + name: 'Neutron', + symbol: 'NTRN', + icon: null, + native: false, + address: '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48', + decimals: 18, + }, + amount: '1000', + }, + ]) + ), + }) + ), + getFee: jest.fn(() => + Promise.resolve({ + high: 0.003, + medium: 0.0025, + low: 0.001, + }) + ), + estimateFee: jest.fn(() => + Promise.resolve([ + { + gasLimit: 31500, + gasPrice: 0.1, + maxFeePerGas: 5390000000, + maxPriorityFeePerGas: 560000000, + }, + ]) + ), + manifest: { + name: 'Cosmos Hub', + description: '', + rpcURL: 'https://rpc-proxy.xdefi.services/cosmos/rpc/mainnet', + lcdURL: 'https://rpc-proxy.xdefi.services/cosmos/lcd/mainnet', + chainSymbol: 'ATOM', + blockExplorerURL: 'https://www.mintscan.io/cosmos/account', + chainId: 'cosmoshub-4', + chain: 'cosmos', + denom: 'uatom', + decimals: 6, + prefix: 'cosmos', + feeGasStep: { + high: 0.003, + medium: 0.0025, + low: 0.001, + }, + maxGapAmount: 0.0001, + }, + }; + }); + + it('buildTx with insufficient balance should throw an error', async () => { + const chainMsg = new ChainMsg( + { + from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: '100000', + }, + mockProvider, + MsgEncoding.object + ); + + try { + await chainMsg.buildTx(); + } catch (e) { + new Error('Insufficient Balance for transaction'); + } + }); + + it('buildTx with native token x valid amount', async () => { + const chainMsg = new ChainMsg( + { + from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: '0.0001', + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.to).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.value).toEqual('100'); // 0.0001 * 10^6 (manifests decimals) + }); + + it('buildTx with non-native token', async () => { + const chainMsg = new ChainMsg( + { + from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: '0.0001', + asset: { + chainId: 'cosmoshub-4', + name: 'Neutron', + symbol: 'NTRN', + icon: null, + native: false, + address: '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48', + decimals: 18, + }, + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.to).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.value).toEqual('100'); // 0.0001 * 10^6 (manifests decimals) + }); + + it('buildTx with non-native token (NFT)', async () => { + const chainMsg = new ChainMsg( + { + from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: '0.0001', + asset: { + chainId: 'cosmoshub-4', + name: 'Neutron', + symbol: 'NTRN', + icon: null, + native: false, + address: '0xf2f6671173363577a07ff3cb1e1e082f68bc2a48', + decimals: 18, + tokenType: 'NFT', + }, + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.to).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.value).toEqual('100'); // 0.0001 * 10^6 (manifests decimals) + }); + + it('buildTx with IBC token x valid amount', async () => { + const chainMsg = new ChainMsg( + { + from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: '0.0001', + feeOptions: { + gasAdjustment: 1, + gasFee: { + denom: + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2', + }, + }, + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.to).toEqual( + 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q' + ); + expect(response.value).toEqual('100'); // 0.0001 * 10^6 (manifests decimals) + }); + + it('getFee should return fee estimation', async () => { + const chainMsg = new ChainMsg( + { + from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: '0.000001', + }, + mockProvider, + MsgEncoding.object + ); provider = new CosmosProvider( new ChainDataSource(COSMOS_MANIFESTS.osmosis) ); @@ -89,6 +320,8 @@ describe('msg', () => { ); }); + jest.setTimeout(30000); + it('should return MaxAmountToSend with ibc token as fee', async () => { const chainMsg = provider.createMsg({ from: 'osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf', diff --git a/packages/dogecoin/.env.example b/packages/dogecoin/.env.example new file mode 100644 index 00000000..69089005 --- /dev/null +++ b/packages/dogecoin/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=0 \ No newline at end of file diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 98d40dad..22e84f57 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -83,7 +83,8 @@ }, "jest": { "setupFiles": [ - "./jest-setup-file.ts" + "./jest-setup-file.ts", + "dotenv/config" ], "preset": "ts-jest/presets/js-with-ts", "transform": { diff --git a/packages/dogecoin/src/chain.provider.spec.ts b/packages/dogecoin/src/chain.provider.spec.ts index 28d70a9a..5a5f83d0 100644 --- a/packages/dogecoin/src/chain.provider.spec.ts +++ b/packages/dogecoin/src/chain.provider.spec.ts @@ -1,22 +1,26 @@ +import { + Response, + GasFeeSpeed, + TransactionStatus, + Coin, +} from '@xdefi-tech/chains-core'; + import { DogecoinProvider } from './chain.provider'; import { IndexerDataSource } from './datasource'; import { DOGECOIN_MANIFEST } from './manifests'; import { ChainMsg } from './msg'; -jest.mock('./datasource/indexer/queries/balances.query', () => ({ - getBalance: () => { - return []; - }, -})); - describe('chain.provider', () => { + const NETWORKED_QUERIES = + process.env.NETWORKED_QUERIES === '1' ? true : false; + let provider: DogecoinProvider; beforeEach(() => { provider = new DogecoinProvider(new IndexerDataSource(DOGECOIN_MANIFEST)); }); - it('createMsg(): should create message with data', () => { + it('createMsg() should create a ChainMsg instance for native token', () => { const msg = provider.createMsg({ to: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', from: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', @@ -26,7 +30,7 @@ describe('chain.provider', () => { expect(msg).toBeInstanceOf(ChainMsg); }); - it('should throw an error when broadcasting an unsigned tx', async () => { + it('createMsg should throw an error when broadcasting an unsigned tx', async () => { const msg = provider.createMsg({ to: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', from: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', @@ -36,15 +40,94 @@ describe('chain.provider', () => { expect(provider.broadcast([msg])).rejects.toThrow(); }); - it('should get transactions for an address from the blockchain', async () => { - const txData = await provider.getTransactions( - 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', - 0 - ); - expect((await txData.getData()).length).toBeGreaterThan(0); + it('getBalance() should return balance data', async () => { + if (!NETWORKED_QUERIES) { + jest.spyOn(DogecoinProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'dogecoin', + name: 'Dogecoin', + symbol: 'DOGE', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/dogecoin/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 8, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'dogecoin', + name: 'Dogecoin', + symbol: 'DOGE', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/dogecoin/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 8, + }, + amount: '1000', + }, + ]) + ) + ); + + const balance = await provider.getBalance( + 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toBeGreaterThanOrEqual(0); + } else { + const balance = await provider.getBalance( + 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toBeGreaterThanOrEqual(0); + expect(balanceData[0]).toBeInstanceOf(Coin); + expect(balanceData[0].amount).toBeTruthy(); + expect(balanceData[0].asset.symbol).toEqual('DOGE'); + } }); - it('should get fee options', async () => { + it('estimateFee() should return fee estimation', async () => { + jest.spyOn(DogecoinProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); + + const msg = provider.createMsg({ + from: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', + to: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', + amount: 0.000001, + }); + + const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.medium); + + expect(estimateFee.length).toEqual(1); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); + + it('gasFeeOptions() should get fee options', async () => { + jest.spyOn(DogecoinProvider.prototype, 'gasFeeOptions').mockResolvedValue({ + low: 1, + medium: 1, + high: 1, + }); + const feeOptions = await provider.gasFeeOptions(); expect(feeOptions?.low).toBeTruthy(); @@ -52,21 +135,22 @@ describe('chain.provider', () => { expect(feeOptions?.high).toBeTruthy(); }); - it('should get a balance', async () => { - const balance = await provider.getBalance( - 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn' - ); + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(DogecoinProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); - }); + const txData = await provider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); - it('should throw for a non-existant transaction on the blockchain', async () => { - expect( - provider.getTransaction( - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' - ) - ).rejects.toThrow(); + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); it('should create message with memo as string', async () => { diff --git a/packages/dogecoin/src/msg.spec.ts b/packages/dogecoin/src/msg.spec.ts index 03ae0533..84a72be7 100644 --- a/packages/dogecoin/src/msg.spec.ts +++ b/packages/dogecoin/src/msg.spec.ts @@ -55,6 +55,20 @@ describe('msg', () => { }; }); + it('buildTx with insufficient balance should throw an error', async () => { + const chainMsg = new ChainMsg( + { + from: 'DPC5kxw8hwpkYYd4dYQdKsrVUjkxtfc6Vj', + to: 'DPC5kxw8hwpkYYd4dYQdKsrVUjkxtfc6Vj', + amount: 1001, + }, + mockProvider, + MsgEncoding.object + ); + + await expect(chainMsg.buildTx()).rejects.toThrowError(); + }); + it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { diff --git a/packages/evm/.env.example b/packages/evm/.env.example new file mode 100644 index 00000000..69089005 --- /dev/null +++ b/packages/evm/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=0 \ No newline at end of file diff --git a/packages/evm/package.json b/packages/evm/package.json index ae0b491a..f0750019 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -13,7 +13,6 @@ "devDependencies": { "@babel/preset-typescript": "7.21.0", "@types/jest": "27.4.1", - "cross-fetch": "3.1.5", "eslint-config-custom": "*", "jest": "27.5.1", "jest-environment-jsdom": "27.5.1", @@ -81,7 +80,8 @@ }, "jest": { "setupFiles": [ - "./jest-setup-file.ts" + "./jest-setup-file.ts", + "dotenv/config" ], "preset": "ts-jest", "transform": { diff --git a/packages/evm/src/chain.provider.spec.ts b/packages/evm/src/chain.provider.spec.ts index 75d798b0..62bdd04e 100644 --- a/packages/evm/src/chain.provider.spec.ts +++ b/packages/evm/src/chain.provider.spec.ts @@ -1,3 +1,9 @@ +import { + Response, + GasFeeSpeed, + TransactionStatus, + Coin, +} from '@xdefi-tech/chains-core'; import { BigNumber, providers } from 'ethers'; import { Eip1559Fee } from './gql/graphql'; @@ -7,67 +13,44 @@ import { ChainDataSource, IndexerDataSource } from './datasource'; import { EVM_MANIFESTS } from './manifests'; describe('chain.provider', () => { + const NETWORKED_QUERIES = + process.env.NETWORKED_QUERIES === '1' ? true : false; + let evmProvider: EvmProvider; - let arbitrumProvider: EvmProvider; - let polygonProvider: EvmProvider; beforeEach(() => { evmProvider = new EvmProvider( new IndexerDataSource(EVM_MANIFESTS.ethereum) ); - arbitrumProvider = new EvmProvider( - new IndexerDataSource(EVM_MANIFESTS.arbitrum) - ); - polygonProvider = new EvmProvider( - new IndexerDataSource(EVM_MANIFESTS.polygon) - ); }); - it('createMsg(): should create message with data', () => { - const msg = evmProvider.createMsg({}); + it('createMsg() should create a ChainMsg instance for native token (ETH)', () => { + const msg = evmProvider.createMsg({ + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + // data: empty for a simple transfer + }); expect(msg).toBeInstanceOf(ChainMsg); }); - it('should throw an error when broadcasting an unsigned tx', async () => { - const msg = evmProvider.createMsg({}); - - expect(evmProvider.broadcast([msg])).rejects.toThrow(); - }); - - it('should get a transaction from the blockchain', async () => { - const txData = await evmProvider.getTransaction( - '0x7f8650389da94aac5c70080982e027653741ec520612dbc8a111f4d2b3645b68' - ); - expect(txData?.hash).toEqual( - '0x7f8650389da94aac5c70080982e027653741ec520612dbc8a111f4d2b3645b68' - ); - }); - - it('should get an address nonce', async () => { - const nonce = await evmProvider.getNonce( - '0x0000000000000000000000000000000000000000' - ); - expect(nonce).toEqual(0); - }); - - it('should get fee options', async () => { - const feeOptions = await evmProvider.gasFeeOptions(); - - expect(feeOptions?.low).toBeTruthy(); - expect(feeOptions?.medium).toBeTruthy(); - expect(feeOptions?.high).toBeTruthy(); - }); - - it('should get a balance', async () => { - const balance = await evmProvider.getBalance( - '0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACC' - ); + it('createMsg() should create a ChainMsg instance for ERC20 (USDT) token', () => { + const msg = evmProvider.createMsg({ + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', // USDT + data: '0xa9059cbb000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100', // ERC20 transfer + }); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(1); - expect(balanceData[0].amount.toString()).toEqual('0'); - expect(balanceData[0].asset.name).toEqual('Ethereum'); + expect(msg).toBeInstanceOf(ChainMsg); }); it('should get a token balance', async () => { @@ -88,109 +71,168 @@ describe('chain.provider', () => { expect(balanceData[1].asset.name).toEqual('Liquid staked Ether 2.0'); }); - it('should throw error for a non-existant address wallet', async () => { - const getBalancePromise = evmProvider.getBalance( - '0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACC', - ['0xae7ab96520DE3A18E5e111B5EaAb095312D7fE8ssaass4'] - ); - expect((await getBalancePromise).getData).rejects.toThrow(); - }); + it('createMsg() should create a ChainMsg instance for ERC721-NFTs (CryptoKitties) token', () => { + const msg = evmProvider.createMsg({ + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 1, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: '0x06012c8cf97bead5deae237070f9587f8e7a266d', // CryptoKitties + data: '0x42842e0e000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100', // ERC721 transfer + }); - it('should throw error for an invalid token address', async () => { - const getBalancePromise = evmProvider.getBalance( - '0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - ['0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84'] - ); - expect((await getBalancePromise).getData).rejects.toThrow(); + expect(msg).toBeInstanceOf(ChainMsg); }); - it('should get null for a non-existant transaction on the blockchain', async () => { - const txData = await evmProvider.getTransaction( - '0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' - ); - expect(txData).toEqual(null); + it('getBalance() should return balance data', async () => { + if (!NETWORKED_QUERIES) { + jest.spyOn(EvmProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: '1', + name: 'Ethereum', + symbol: 'ETH', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '345.55', + decimals: 18, + }, + amount: '1000', + }, + { + asset: { + chainId: '1', + name: 'Liquid staked Ether 2.0', + symbol: 'stETH', + icon: null, + native: false, + address: '0x493c8d6a973246a7B26Aa8Ef4b1494867A825DE5', + decimals: 18, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: '1', + name: 'Ethereum', + symbol: 'ETH', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '345.55', + decimals: 18, + }, + amount: '1000', + }, + { + asset: { + chainId: '1', + name: 'Liquid staked Ether 2.0', + symbol: 'stETH', + icon: null, + native: false, + address: '0x493c8d6a973246a7B26Aa8Ef4b1494867A825DE5', + decimals: 18, + }, + amount: '1000', + }, + ]) + ) + ); + + const balance = await evmProvider.getBalance( + '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(2); + expect(balanceData[0].amount.toString()).toEqual('1000'); + expect(balanceData[0].asset.symbol).toEqual('ETH'); + expect(balanceData[1].amount.toString()).toEqual('1000'); + expect(balanceData[1].asset.symbol).toEqual('stETH'); + } else { + const balance = await evmProvider.getBalance( + '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toBeGreaterThanOrEqual(0); + if (balanceData.length > 0) { + expect(balanceData[0]).toBeInstanceOf(Coin); + expect(balanceData[0].amount).toBeTruthy(); + } + } }); - it('should get a ethereum provider', async () => { - const provider = evmProvider.rpcProvider; - expect(provider).toBeInstanceOf(providers.StaticJsonRpcProvider); - expect(provider.connection.url).toEqual(EVM_MANIFESTS.ethereum.rpcURL); - }); + it('estimateFee() should return fee estimation', async () => { + jest.spyOn(EvmProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); + + const msg = evmProvider.createMsg({ + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + }); - it('[Arbitrum]should get a balance', async () => { - const balance = await arbitrumProvider.getBalance( - '0xC8c16Bb40c03D2Bf020D239f178dd7Ab13fc99e6' + const estimateFee = await evmProvider.estimateFee( + [msg], + GasFeeSpeed.medium ); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(1); - expect(balanceData[0].amount.toString()).toEqual('0'); - expect(balanceData[0].asset.name).toEqual('Arbitrum'); - }); - it('[Arbitrum] should get a token balance', async () => { - const balance = await arbitrumProvider.getBalance( - '0xC8c16Bb40c03D2Bf020D239f178dd7Ab13fc99e6', - ['0x0c880f6761F1af8d9Aa9C466984b80DAb9a8c9e8'] - ); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(1); - expect(balanceData[0].amount.toString()).toEqual('0'); - expect(balanceData[0].asset.symbol).toEqual('PENDLE'); - expect(balanceData[0].asset.name).toEqual('Pendle'); + expect(estimateFee.length).toEqual(1); + expect(estimateFee[0].gasLimit).toBeTruthy(); }); - it('[Arbitrum] should throw error for a non-existant address wallet', async () => { - const getBalancePromise = arbitrumProvider.getBalance( - '0xC8c16Bb40c03D2Bf020D239f178dd7Ab13fc99e6aaaa', - ['0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84'] - ); - expect((await getBalancePromise).getData).rejects.toThrow(); - }); + it('gasFeeOptions() should get fee options', async () => { + const feeOptions = await evmProvider.gasFeeOptions(); - it('[Arbitrum] should throw error for an invalid token address', async () => { - const getBalancePromise = arbitrumProvider.getBalance( - '0xC8c16Bb40c03D2Bf020D239f178dd7Ab13fc99e6', - ['0xae7ab96520DE3A18E5e111sasasaB5EaAb095312D7fE84'] - ); - expect((await getBalancePromise).getData).rejects.toThrow(); + expect(feeOptions?.low).toBeTruthy(); + expect(feeOptions?.medium).toBeTruthy(); + expect(feeOptions?.high).toBeTruthy(); }); - it('[Polygon]should get a balance', async () => { - const balance = await polygonProvider.getBalance( - '0xC8c16Bb40c03D2Bf020D239f178dd7Ab13fc99e6' - ); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(1); - expect(balanceData[0].amount.toString()).toEqual('0'); - expect(balanceData[0].asset.name).toEqual('Polygon'); - }); + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(EvmProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); - it('[Polygon] should get a token balance', async () => { - const balance = await polygonProvider.getBalance( - '0xC8c16Bb40c03D2Bf020D239f178dd7Ab13fc99e6', - ['0x714DB550b574b3E927af3D93E26127D15721D4C2'] + const txData = await evmProvider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' ); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(1); - expect(balanceData[0].amount.toString()).toEqual('0'); - expect(balanceData[0].asset.symbol).toEqual('GMT'); - expect(balanceData[0].asset.name).toEqual('GreenMetaverseToken'); - }); - it('[Polygon] should throw error for a non-existant address wallet', async () => { - const getBalancePromise = polygonProvider.getBalance( - '0xC8c16Bb40c03D2Bf020asdasdD239f178dd7Ab13fc99e6', - ['0x714DB550b574b3E927af3D93E26127D15721D4C2'] + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' ); - expect((await getBalancePromise).getData).rejects.toThrow(); }); - it('[Polygon] should throw error for an invalid token address', async () => { - const getBalancePromise = polygonProvider.getBalance( - '0xC8c16Bb40c03D2Bf020D239f178dd7Ab13fc99e6', - ['0x714DB550b574b3Easkdj927af3D93E26127D15721D4C2'] + it('should get an address nonce', async () => { + const nonce = await evmProvider.getNonce( + '0x0000000000000000000000000000000000000000' ); - expect((await getBalancePromise).getData).rejects.toThrow(); + expect(nonce).toEqual(0); }); it('should return false when verifying an invalid address', () => { diff --git a/packages/evm/src/msg.spec.ts b/packages/evm/src/msg.spec.ts index 5f74e7f7..c5c52934 100644 --- a/packages/evm/src/msg.spec.ts +++ b/packages/evm/src/msg.spec.ts @@ -9,6 +9,7 @@ describe('msg', () => { beforeEach(() => { mockProvider = { + getNonce: jest.fn(() => Promise.resolve(0)), getBalance: jest.fn(() => Promise.resolve({ getData: jest.fn(() => @@ -79,6 +80,117 @@ describe('msg', () => { }; }); + it('buildTx with native token', async () => { + const chainMsg = new ChainMsg( + { + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response.to).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response).toHaveProperty('nonce'); + expect(response).toHaveProperty('value'); + expect(response).toHaveProperty('chainId'); + expect(response).toHaveProperty('maxFeePerGas'); + }); + + it('buildTx with non-native token (ERC-20)', async () => { + const chainMsg = new ChainMsg( + { + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', // USDT - ERC20 + data: '0xa9059cbb000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100', // transfer(address,uint256) + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response.to).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response).toHaveProperty('nonce'); + expect(response).toHaveProperty('value'); + expect(response).toHaveProperty('chainId'); + expect(response).toHaveProperty('maxFeePerGas'); + expect(response.data).toEqual( + '0xa9059cbb000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100' + ); + }); + + it('buildTx with non-native token (ERC-721)', async () => { + const chainMsg = new ChainMsg( + { + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 1, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: '0x06012c8cf97bead5deae237070f9587f8e7a266d', // CryptoKitties - ERC721 + data: '0x42842e0e000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100', // transferFrom(address,address,uint256) + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response.to).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response).toHaveProperty('nonce'); + expect(response).toHaveProperty('value'); + expect(response).toHaveProperty('chainId'); + expect(response).toHaveProperty('maxFeePerGas'); + expect(response.data).toEqual( + '0x42842e0e000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100' + ); + }); + + it('buildTx with non-native token (ERC-1155)', async () => { + const chainMsg = new ChainMsg( + { + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + amount: 1, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: '0x0e3a2a1f2146d86a604adc220b4967a898d7fe07', // EnjinCoin - ERC1155 + data: '0x42842e0e000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100', // safeTransferFrom(address,address,uint256,uint256,bytes) + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.from).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response.to).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response).toHaveProperty('nonce'); + expect(response).toHaveProperty('value'); + expect(response).toHaveProperty('chainId'); + expect(response).toHaveProperty('maxFeePerGas'); + expect(response.data).toEqual( + '0x42842e0e000000000000000000000000aa09df2673e1ae3fc8ed875c131b52449cf958100' + ); + }); + it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { diff --git a/packages/litecoin/.env.example b/packages/litecoin/.env.example new file mode 100644 index 00000000..69089005 --- /dev/null +++ b/packages/litecoin/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=0 \ No newline at end of file diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 066a8003..14886607 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -27,12 +27,12 @@ "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", "@ledgerhq/hw-transport": "6.30.3", - "@ledgerhq/hw-transport-webhid": "6.28.3", "@ledgerhq/hw-transport-mocker": "6.28.3", - "@xdefi-tech/chains-core": "*", - "@xdefi-tech/chains-utxo": "*", + "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", "@scure/btc-signer": "1.2.1", + "@xdefi-tech/chains-core": "*", + "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bignumber.js": "9.0.2", "bip32": "2.0.4", @@ -84,7 +84,8 @@ }, "jest": { "setupFiles": [ - "./jest-setup-file.ts" + "./jest-setup-file.ts", + "dotenv/config" ], "preset": "ts-jest/presets/js-with-ts", "transform": { diff --git a/packages/litecoin/src/chain.provider.spec.ts b/packages/litecoin/src/chain.provider.spec.ts index 7d541fe9..313dc9df 100644 --- a/packages/litecoin/src/chain.provider.spec.ts +++ b/packages/litecoin/src/chain.provider.spec.ts @@ -1,22 +1,26 @@ +import { + Response, + TransactionStatus, + GasFeeSpeed, + Coin, +} from '@xdefi-tech/chains-core'; + import { LitecoinProvider } from './chain.provider'; import { IndexerDataSource } from './datasource'; import { LITECOIN_MANIFEST } from './manifests'; import { ChainMsg } from './msg'; -jest.mock('./datasource/indexer/queries/balances.query', () => ({ - getBalance: () => { - return []; - }, -})); - describe('chain.provider', () => { + const NETWORKED_QUERIES = + process.env.NETWORKED_QUERIES === '1' ? true : false; + let provider: LitecoinProvider; beforeEach(() => { provider = new LitecoinProvider(new IndexerDataSource(LITECOIN_MANIFEST)); }); - it('createMsg(): should create message with data', () => { + it('createMsg() should create a ChainMsg instance for native token', () => { const msg = provider.createMsg({ to: 'Lh5Xtrt8u2rSykk9gG8heb4xBYvKPhT3WY', from: 'Lh5Xtrt8u2rSykk9gG8heb4xBYvKPhT3WY', @@ -43,7 +47,91 @@ describe('chain.provider', () => { expect((await txData.getData()).length).toBeGreaterThan(0); }); - it('should get fee options', async () => { + it('getBalance() should return balance data', async () => { + if (!NETWORKED_QUERIES) { + jest.spyOn(LitecoinProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'litecoin', + name: 'Litecoin', + symbol: 'LTC', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 8, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'litecoin', + name: 'Litecoin', + symbol: 'LTC', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '443.21', + decimals: 8, + }, + amount: '1000', + }, + ]) + ) + ); + + const balance = await provider.getBalance( + 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(1); + expect(balanceData[0].amount).toEqual('1000'); + expect(balanceData[0].asset.symbol).toEqual('LTC'); + } else { + const balance = await provider.getBalance( + 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toBeGreaterThanOrEqual(0); + if (balanceData.length > 0) { + expect(balanceData[0]).toBeInstanceOf(Coin); + expect(balanceData[0].amount).toBeTruthy(); + } + } + }); + + it('estimateFee() should return fee estimation', async () => { + jest.spyOn(LitecoinProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); + + const msg = provider.createMsg({ + from: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + to: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + amount: 0.000001, + }); + + const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.medium); + + expect(estimateFee.length).toEqual(1); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); + + it('gasFeeOptions() should get fee options', async () => { const feeOptions = await provider.gasFeeOptions(); expect(feeOptions?.low).toBeTruthy(); @@ -51,21 +139,35 @@ describe('chain.provider', () => { expect(feeOptions?.high).toBeTruthy(); }); - it('should get a balance', async () => { - const balance = await provider.getBalance( - 'Lh5Xtrt8u2rSykk9gG8heb4xBYvKPhT3WY' + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(LitecoinProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); + + const txData = await provider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' ); - const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); - it('should throw for a non-existant transaction on the blockchain', async () => { - expect( - provider.getTransaction( - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' - ) - ).rejects.toThrow(); + it('should create message with memo as string', async () => { + const memo = 'Test string memo'; + const msg = provider.createMsg({ + to: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', + from: 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn', + amount: 0.000001, + memo: memo, + }); + + expect(msg).toBeInstanceOf(ChainMsg); + expect(msg.toData().memo).toEqual(memo); }); it('should create message with memo as string', async () => { diff --git a/packages/litecoin/src/msg.spec.ts b/packages/litecoin/src/msg.spec.ts index 60524e13..5775ad1b 100644 --- a/packages/litecoin/src/msg.spec.ts +++ b/packages/litecoin/src/msg.spec.ts @@ -8,6 +8,41 @@ describe('msg', () => { beforeEach(() => { mockProvider = { + scanUTXOs: jest.fn(() => + Promise.resolve([ + { + hash: 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d', + value: 546, + index: 0, + witnessUtxo: { + value: 546, + script: Buffer.from( + '5120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e4088', + 'hex' + ), + }, + txHex: + '0200000000010173c12c3f6f99438c02abb77a8d782f651a80b7dac30dac74dbd9ea988e2c966b000000000005000000032202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40882202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40880000000000000000296a5d26020704948db1feb59ec9a6d302010003a40205a9e90706f4f3ccc8010a84f60d08aedf01160103406cb75a669728ffa3529936bd3c37aa8b606442f8a8a5c8cd8c0f2b7774bbffebbc7a770e8789aeb55e0c59540929ba5e837a0ce0b4a7f9bdb3adf61eda2d128bfde62420c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c8248ac0063036f72645d099446cc5ff3244d530101010a696d6167652f6a706567004d0802ffd8ffe000104a46494600010100000100010000ffe201d84943435f50524f46494c45000101000001c800000000043000006d6e74725247422058595a2007e00001000100000000000061637370000000000000000000000000000000000000000000000000000000010000f6d6000100000000d32d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000964657363000000f0000000247258595a00000114000000146758595a00000128000000146258595a0000013c00000014777470740000015000000014725452430000016400000028675452430000016400000028625452430000016400000028637072740000018c0000003c6d6c756300000000000000010000000c656e5553000000080000001c007300520047004258595a200000000000006fa2000038f50000039058595a2000000000000062990000b785000018da58595a2000000000000024a000000f840000b6cf58595a20000000000000f6d6000100000000d32d706172610000000000040000000266660000f2a700000d59000013d000000a5b00000000000000006d6c756300000000000000010000000c656e5553000000200000001c0047006f006f0067006c006500200049006e0063002e00200032003000310036ffdb004300191113161310191614161c1b191e253e29252222254d08024c373a2d3e5a505f5e595057566470907a646a886c56577daa7e889499a1a2a16178b0bdaf9cbb909ea19affdb0043011b1c1c252125492929499a6757679a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9affc00011080190019003012200021101031101ffc4001a000002030101000000000000000000000001020003040506ffc40031100002020104010304020201040301000000010203110412213141051351223261711442238133152452a1436291b1ffc4001801010101010100000000000000000000000001020304ffc4001d110101010101000203000000000000000000011102032131121351ffda000c03010002110311003f00f4ec082c08a88064032800279030030308ac2125da232488c0460616294062c7c8cc58f9003030b158400308000bef2322fbc8fb0000200a842100847d108fa00f84144f08888190c844320a643088641523f79615c7ef1c8190401401080801210840b67432e90b3e865d20080200210800200200a0fa129fec3cbed6253f6cbf611d16041022a201858aca0790327923085030b03012406190180ac563314a031579198abb61018ac662b000020002fbc8fb22fbc8c000090281024c0108fa0e08d70407c220d8e82a127d2602850ded4d7f560c35e02a2185414018fde3891fb87228a1854301028014404840804d0802b2185978180012100042100040802927f6b055ff001ffb0d9f6b257ff1a08de04117c9a44606162b081e40c3e40c00c56160602488c92e88c0562b0b032851576c662aed84462b0b000001000abef41605f7a0bec0042070151070443c20e4f0910051c97d5a594fbe11a68d3a8accbb3425826ae29869a11ed65966211f84194e315cbc1cfd5d8fdc8a4f8c915bac4dc7e9c18a745edf48d3fc8ae1149cb90c2edef88bc7c8197d8718e6512bdadfdb1674da4fb2b9cabfb1b49b039e961f2326596685c9e63302d2db1e9a6501048ebb62b9c15bb2517871cfe80b421846528a963046b1d904210202bed0ec47f721d80081200001030214db7c6b59657a8d46de11835176e8bcbe41ae94e6a55e53e19643fe3472347a9ffe393e3c1d78fd8bf406e17c858be4d322c56160602bec0c2fb0300315840c059740f049744f050ac0c2c561018abb633117dcc08c0162b00300401417dc82fb02fbd0584421064829a11727847474f4a8472fb2ad253c6e66c336ac4200119a9671e08acf753dce5997e0c3aa8d925ba4b62f075c4b2a8598dcb2064d0550954a4e3997cb345f29421fe38e59625182c2c2466d5ea556b6c7993032bd6d95a7bfb1689c5d9ee5cf327d234e9f48a5fe4b965bf05b1d1d519ee480ba324e29ae8c7a8d67b77c611e72cbf516a84308e42b211d439cf9c7488aee71249b40db0f847356a355a878aa1b63f2cd7a7d3c4d0802e1f5593729145f34dc71178316a29b13fa1ca4d9ba5251596f063b7d42b83c47ea7f80055a7b92cca48364955f7c9029f518d9628358c974f49558f32cb0332d4425258792f5252e8b614575ac46290fb52f080a085b29417782895d580459bc45915907d305affc6f00726d9393975d98ef928fecdb2508272f2ce5ea64f73fc8642166db33f0cf49a6b1594c5fe0f2a9ee9a47a1f4e97f8b0163b62f9185f2699415858180afb2323ec0c00c56160602cba0780cba17c140606162b080c55f73198abee023158581801802c01417de8205f720804b74f5ef9a4548e9692bdb0dcfb64a2f8c76a490c0c8bbd61fe0cb44d4d9b2b6cc9e9f395964dff5336bf512b6c5543cbc1d1d252a9a6315df903401b1673508e5986cd44ac6d478463bee72d4e75aedb2b6b0e466aeba55bbe52cbf1928785db0271974ce3fbaff001bfc1d54d35c312fb5555b9330d774aa977946e5b6d826d651db9ee7518b31cb957a8d6cf8cc21f26ca3d3a9ab96b74be59ad612e086d012515c2c155fa885316e4c7b149c711786736dd15b65f194a5ba39e500d8bb58f2decabffe86c5469eb6a2937f26f514a1b71c60e73d0bb752d4dbf6d1064d356efd545d69ed4f2d9de5c212aaa15476c22921db51596046d259664bf5497112ad4ea5b784f831b6db28b2774a4f96239314810ca4d16c2dcac3e8ce14c04d6edaea6d238575bba47a1b2b57d4e0ce46a3d3674d080216dc7c15319b4cb36fe8efe87889c5d3552849ee5c9dad27da88b1dc15f622ba2fc87726fb34c998ac3903015f6464976060062b198ac057d03c05f42ae8a2315858184062afb82c55f701181858a00606100505f721855f721bc816d10df624751709230e863f5391b4cd6a24e5b60d9ce7aac426bcb3a125ba2d7c9c2d5c6dd3d92cc5b8f820b7410f7754e72ea2755dcb7a845e59c1a6ed44deda6b6b3e4ec68f4ee986e9bccdf6c109aab374b622b4b0816bff0033c897592ae1951c9e2eeef4efccf867d53df6a845e1f9123374dca2dee40a655bdd2b1fd4cae9fab55c728cbb63a2f0d1ab433dd5b8fc332786d9a3d3d62b949f9676f170edb720534db4998f55abf6e2d47b0e9a5b34dee4df2f967a1c95eaf54e9bb09f7e0d1a6b27647328e0c9a6ad6a2e95f62e17da6eaac536d2f0516900420262d5ea3faa65da9b7643f2ce5592727928129658320204120320c941c9322b960aa76a441a2166d91add944e2d719c1c6f79e4917276396780345d5c37fd25fa6e383049bddde4d14db89e00e8670156c90ad8ad9b61a23a9f92e8db1979303065ae981d06f216608dd28f65d1d4a7d855ec56056465d30b640ac0ba0be80ba280c56331584017fb045fec01628581801808c01517dc86f222fb90ebb03a1a458af3f25f92aabe9aa286c986e1b22ca3197dc93036619eb97f2e3545f606f8c231fb6290d911481296136065d641c64d08027bd74fb2adca50c32fa7511be5283f057768e49b954ffd1c3d3cb6ec6f9eb142d356db720c615d5d6113dbd42e360d0d15b63cd92dabe1189e5d5fb6afa1773ba4abad7ed9be58a28c2f0834d30a6388aff61b62a75b8bf277e799ccc62dd72945ea6fdbbb08bb572db1869eb79c981d93d2ea5a5e0346a947512b6ce5f8352336eba52be3455ed2e1a41f4b939c2527e59cabb532d4db8ae2db7f076b454fb34462fbf248b71ab246f0b22e4ab5366c81463d5dbba6666194b2c52b2806f0430ebb56ab4d45f205d76aa30e114ad665f839129d96cb2d8d084d72993e475ddfb97057df666a9cd782dcbf2ca2d585fa1a6d61246795bc3427b9f909ad1bb816163f73250e5263c7828efb606c2d342b34c8303234236d00722b264990229ca3d32c8eaa4bb2a62b036475319164649aece630ab651f2074db1598e1abf92f8df197902c62ff006265307f600b1585818500108005f721e1ccd7ecad7dc8b2bff917ec0e9671140dc2cd9cff0051b6d843307c7932d0fa8fa82aa2e15be7c9cad1fb93d6466d3c67b134f5bd46a3eb7c1d0d4b8d1186de30565d68be017cb14c9fe0a68b5595c64bc83552ff0004bf465a7234dabf675dcbe1bc33d14649a4d1e4e153b2c9c9768edfa66a5cead927f544b52574721c95e4a6dbfda9addf6b32d35364c95a9a92ca7c072071bd6310b94be515687d3e7aa7bec6e3037ebb4af51a8aff00f15d9bab4d08028a845462b090094696aa12508acfc9a322648df2032661d6599960d9396d83672ed96e9365080211bc22a33eaee5554df93816d8ecb1b9335fa9dee766d4f846022569834916c2493e4c6a4d054a4351b9dc93e1892b72ccf5c5ce49367568d15718a6d65856385765afe94f068fe2b843749e59be3151584b055a97f41462dbd0e911f482823d0ca257289a1a1251348ccd31597ca25528815311b2c684920132d11cc8d08c02e42b680c56c02d032d790360c816475138f92faf549c96e31b140eb2b232e98727254e51e996c35525d81d0014435319765aa69f4c28ff0064595736afd957f643c5e26981bad78667b529c5c5f92eb1e5265126655c696ed36a963ac9b75aa365196f9c075747b8e325e195eaeb94aa4d3e8a83e95737175bf06bd54bfc3239de9916a5293375ff0055524be08ae4c6f74a9a5db068f532ab50a4f84d829a95ba9db3e8dbaed2c7da52ad7da5475e162945497933ebf9a73f065f4abe53a5c65fd4d1ab79a244699b49acf6a4a329662ceac66a4b299e56726ac3a1a1d63862327f48c495dcc872530b14e29a791f2468f9027c8ad922c817552c57839edf269d5cf32c194b12a14eaa7b296cb4c1ea93db560a38d6cb7cdb148432c8a19010c88b17e9966c476e2b114727430cda8ec1795a067d53e123418f532cd98f8348adf80a03ed05151e9da15a26e264046238a2d62328a6502a944d2d0928a60657124d0802b944d52acaa5008ccc565f281538fc008c51dfe50aff0000281b0b15811832460026468db28f4c4201aaad572b71aa17c64f8672c89b4f8607a48b53a13453207a6665a56db1a688d13224929269f449bc26cc5fcb71b1a97411aa3055f11e876f2858cd4e394c2073b55074dcac8f593a1558ada93ed342db5ab20e2ccda572a6c754baf006caeb8d49a82c6497bcd32264aef962a64572e9829ea5a7d0d7552a67ff00d41a67ff0074d9aefb6bdae326544d1eabdb6a2dfd2ceac66a4b299e6e3349bc7fa37e8354e2d5737df44ab2baf919329521f77046996f966c65434de64c52a21c9f5697291d5393ea9f7128e6910d80a46530121e288a2595c32d222b7fa7d7fd8de53a686cad171d27d25093c26609bccdb35dd2c4198fc952a3ec281e4207a4c0ad8ed0ad00bb8192342b282d8ac8c1900362319a1580ad265728a1d8ac0a6512a957f0687111a682333525d8bc334b4995cab4c0a8563ca0d74267e40001b0068001402ca20a76c62de32c0ee7a7476e917e46b3b2eaab55d2a2bc22ab08d289ae0e3df0ff00b8dbf2ced35c1ccd7476dd097e422bae73d359b65f6b3a316a4b28cfaaad59467ce05d058e55ed7dc40d45538c6525cfd48b59ced64e55dca4981bfc156a64954c6a6c56d6a48328a92c340719b719371ec318b9bcce783a1668e12e57052f40fc480a272aa10c43bf92aabdcb2d5b3e7b35c7d3d67ea91aaaa6152c4d08024501aaa6d4127d96eefa599e2c772fa591a54df200900073bd4619e4e899f555ee8e45238db02a25f2af0c8a073554a26cd2519965a169a5ca5d1d1ae0a11c235214dd2004593c47269967d44b2f051e469bdd26c0bb2a07f608176103d2e40492c742eec011a11a1f22b0118ac768460462b23606ca00ad07206c05680d058ac047115c4b00c0a5a12514cbda12480ceeb6ba11e5768d0c56979028e18f571647f6175af01a6b94ad8c719e423bd559f425f803e64595d2a314bf03ed8a32d2971e0e7fa957fe3ddf0ce94e5f066d457ee552451447ead3afd18f41c5d62f06e8c5c74f87f067d1d4d39c9aed846939bea189347466f645c9f8306a946d82b23f3c809a79bd3d8a32fb65d1d1ed64cfecc2eae0fe0bd2c2480842331eab52e0f117c81ac055a7bd5b0cf92d00a0c9fd2281be0299744645d108001acac0400669e9f2f80474cf3c9a88322e961050584824204428be7c6116ce5b6393249ee7965429104010176102182bd33457288d92640a649a177fc97b49954eb026531588e328be08a7f204944469a2dca60682a8602d947256e2d042e40c2d31594462e4206006c56168802342b896030056d1abd3d62dddf05383a3a2ae2aacf9641ad58db239678028e3a0a87964695bc08dc53c6792bd4ea614f09e647396a25fc88c9bf254751c73c0bb141705d0e629a16688acf38ee4d3395a98ca8dd15f6c8ec48a3514ab60d7924d0802a551a38eda23c9795e9a2e356d7e0b1a08ab51271adb47266e53cc9f475ec9c57d32f264d6462a95b5700acb56fa36d8bed7d9d3aac8d914d328a20a7a64a4369ea8d59519640bd8af81857ca01a0f231545e196f614084210021080403692cb03692cb33d966ee174540b67b9fe0ac20020020f0044102e8207a462b43315b0064391583214cd26552afe0b33920199a7122b3e4d0d26553ab3d00bb93232b94651029fc80cd0ad0d94c0d015b88ad16b42b40540658e223400158c4c00b93a7a04dd7ca30575ef9a47629828414578018cdafd47b34bc76cd671fd4db95d187e48566af4d65d177d8de3c14c9e64d25d1d9bd2ab478fc18b4f4674b658d77d031b3416ab34ebf1c16dd2d9072660f4697d5387e4e8ea239aa4bf015ca77ceed4c229e164dfb70b2ce66997fdec51d69c5b612284b2c9b4a5ddb355b1f4cd897007375953972bb461729c96c933b16637f261d751b56f82eca9544b50aaa9422f9268bdc94dcdfdac5d3e91cdeeb3af837a4a2b096101059cb6c5b7e066caece60d7e00aa1a9ae4fbc33442c4fc9c39adb37fb0c2e9c3a9309aefe7203955eba71ecbe3ae52c05d6e2b9d8a250edddd315b069a737210200200800211f4403e802ba080807a7922b68b58ad0554c563b030a40e43815ac10364991724c805a4fb299d39e8b721c818dc1c58548d4d27d95ce8cf405592342ca1288373403342b59194930e32052e4d080220c60b9a028e59516e8229d9ba5d23a4a51f08a74ba751865f6cd2a2978228672ba39b2d2cb51abdef88c59d5c70578c74073bd433270aa3e4b2e8c68d1ed5f05ea85ef3b25cbf063f54def6d70fec066f478376d93f075e714ab6d89a1d32a288c7cf92cb16e963c203894f1af5fb3ab6bdb16ce5db886bd3fc9a75baa5186c8733611ce9b94f5694565e4ed3fa2b4dfc1468748a987bb6733916d8f772f88a030d92f71c9478687a26adab9ed760d4c7daba16c7ed7c32b9c9696f73fe935902d924bf02b8e4aa2e7a99ee7f4d6bff0066b5158e0a3334556bdb06d9ae5030fa84e30a9c73cb0572a6d3931700264303864ce019200f1b651e9974354ffb1948074637465e47c9cb4dae996c2f947c85d6e219e1a94fb2e538be9853019324f2802420023d53158729803449213058c52291a17234858813b26084c900c0484c8540809900b8a7da2a9d3f05a9840c528342a6d1bdc14bb4553a3e02288cf3d9a74f5ef967c22baf4d29cb18e0e9554aae292283143f5d852c1cef51d54ab7b60c0dd2b12f226f8fca38b0b751645c926e3f22a76dd62ae326b230d776328cba6981d3194d4dacb42e974d1d3c3196df96cb9c92e88a1d26571e7233cb5d020b00707d41ecd53f2fc1afd3f45272f7aeedf499b25a2ae7a8f764b2d78352492e0a98a650c955d56ea6515f0689760c115c37a84a995324dcd3e0cee2e75395b2c38f499a7599d34d08026b1b8c5373e83fc7d91f7751f549f5145649a68d9a94b9db05e0e8a82492326854d4e4f6ed83e91b58228be71aab729748f37a9b5db6ca59e33c1e83d431fc7793813ad3e844aa41819c1a172564081e18180039010024010023464d74c52017c2f6bb2e85d16d18c280df94c2628ce4bc96c6ff0090af5f28e3a1777c9632b920d0f62b0731fd054932283592bc619601ac9023401bf62b414039200020c81b2240326326563440b132cae0e4c5aab737c1b210dab080918a8f43a0602f091424e584d9c4d4e6fd4ed8f6d9d0d6ea125b73839f5dce36b95507297c84ae9c288d5a6d98f07213f67591978c9a6766baceabc154745a9bad4ec585908eca7ba29ae8997e10610db051f8433c4511a235260e1719e4ab53ab8d4b19e4cbe9f39df74ec93e17411bc8df01c2c825c20acf3b36e5bf0535eba1396de983d46ab275e6acfe51cb8ca507b651daff0025474f5347bf64271e70cd0ea8c92dcb3839f45ceb5972e0d3a7d6abdb8a5ca20b5c527842343b030397ead638c631f9397d9d0f5479b52f839ee3f06a334ad0928263f28994c233cab6ba13aecd4d092826114107957f0234d010842600898720200c9845200e402201ee642b19b1701b2b42389630322abdcd764c85a11ac7403000a5f212283401b04c0084636dc964689cbc01528b7d1a2ad3b7ccb82faa8505cf65a9002294561218980b692e4a214ea5c956da195f5b96d54d08022cbfc0ed26b0c838b450f577bdf9dabb3ad5d35d4928c520d74c2aced58c8de42606321c2416d4518afd66d6e3545ca5f80ad739a8acc9e0c3a8d6c79507929746ab54f364b647e0c7abaa3a77b62db654d259beedf672d23abe995fb7a64fcb0e874915a4519ae65cb35c62a11515d204888136a2b2f84577ea214ae797e118adf72ffaad96c87c106c85b1b73b1a7812ed2d76a7be2b261a6f7a5b36ec7b24f8674d4b74535e40e45de9962962a9fd2fe4d9a7d3474f5e177e59a642f20c56d15df6c69adca45ed7c9c4f51d43b2c705f6a2c2b2ea2d76d8e4ca9858ad958462b8a091808d340c8ec0d00b8c8ae2361ae899f902a956238b468038e40a3211e55a623835d0406884cb5d87298002898f807441eeda14715a2ba15802d6004018af91b90a837d202a71156e4fac97fb72ce305d553b565f6419e309359c32c85327df0694864155c298c79c64b17e021e8a06191c94565b16c9ed59671f5baa9cbe983c111d1b75908a7b5e59ccb355a9d4cdc60b0be4d157a6eea549cdee6b253669eea33c657ca28be8b74fa387d73dd63ecb3fea2ec96da6b726fc9874fec2966c8e5fe4ead16d18fa3080babddb16fec62bb7515d6b2da31ffd495967b75472c8adf28a92c302ae11ea2835eedab7761602b59470e71f7fd4943c27c9dd7d1929d2ecd54ed7e7a095a63c24bc11f4335c093e23c85732c78d62c45cfe5fc0daf59846717d3e4d080286babb2c4f1f444cf0c5b54a119622bb6ca8d32846fd227e522686d7656e2fb8f0668dbedd5ecd199c9f9346834f3a54a537cc88366d5e43c0867d66a3d9abf2fa0a4d76b6342db15991c1b1ee9397c96db395927293c94b34c52303c0cc46101832162b604c90010211a2100571f827ec626005234468996bb015c532b957f05fc32600cdca0e4b9c531255fc01ee18065063a8608daa717f018d2e5df05c90c022ae2ba4324904204e119eed5420f1db06aed75c784ccba49d6ecff22cc98127adb3394b0890d7cd3fad706f95709470e28e6eaaa554b8e883a14ea6bb57d3dfc1764e251292d44147cb3b4e4a2b2d814eae129d2f67670ec4f389a69a3d146c84ba6812a6b9fdd14c0e2d7ea16d71518c5c8d354f5ba8feaa11fc9bfd9aa0b2a0bffc33df75dd555b0127a084a3f5cbebf9462b23fc56f36292f05ae9d75af97b51755e951ceeba4e4ca39896a35b628c13dbf276b45a186963f33f2cd15d50aa388452409dd1876c18b1f08495905dc91ced5fa8c62b6c5e5fe0c75d3abd53dcb318fe41aed7bd5ffe488adadbe248e5bf4abf1ff2bc95bd35f43fade57c90771493e98b2e4e3e8f5535aaf6a4f299d60a1626eb925de0e651e9d3949bba6d473f6a3aa408a6ba2ba96211487612632148da4b2ce2fa85deedb85d237ebf50a11708be4e44b9658cd56c4658d15cb82a118ac66c46c00c56303010a40e018020024021004c804d0802c4064214ad132d0c00889a64c130898680f7606d2ec2ce76b2738cb12ca5f246db5dd05dc903f915ff00e48e3ef7f23e9e89ea1bfaf007595f5ffe48656c1ff64731fa7d8bff0090aaca2dafab1303aedd72586d3114298bca514ce4a94d773ffd93dc94b88ee93fc10752dd4c20bbcbf84736fbfdd965f0be07ab477db872fa62742ad1d55afb537f2c0e4d76284d4d768d73d74671c49726e7a6a9f7045362d253f728a031e97ddb3529c13505db3b067d35f5dbc54b8f92e95918f6d20198089a6b2881493ba10fba4914d9afaa0bbc8da8d342e8f3dfc9c8d568ada5b78dd002cbbd5a7649c698b7fa161a4d66af99bf6e3ffb269357553c3ad67f46a9fab5504545ba6f4ba69faa599cbe59b7e98af091c897ace78841b2b7abd55fc42b7c81d4b7555d69b72472355ea2ef93855172fd16c3d3aebda7a89617c237d1a4a74eb108acfc81ccf4dd1ddfc8f7ae8ed5e0ece0242001c7c8322cde136c2a4e7082cc9e0c96fa85714d439655a8dd73c748a1e8fca65466b66e72727db2a66c5461fd45b1a61f03531cdd927e09ec4df83a9edc7e01b57c0d5c733f8ad93f8874f6a15c5134c737f8d815d183a4e057280d31ce748aeb37cab2b95634c617011c59b65588eb2ea632601834bac57584c5180e0b3603683084c0db49801704e82403dcf0c16571b23892c9c9af573aa6b2f397d1d783dd14fe434e4ea348ea93c7dbe0a6bba34bdd4d0802b9e7e11d9d4d1ef57b738fc9569fd3e9a796b74be581cf52d66a9ff8e0e31f965f5fa6592e6eb5fe91d3584b826418c95fa7d10ed67f65f1aab87db148cfaefe425ba8e7f072e7ea37d7c5b09203bce515db48a6dd5d14accec4709eb15ef129b8861ecc732c6f7f909adf77a94eefa74d5c9fe7064fe3fd5ee6b2d4bffae46adea2f588b8d50fc05c74da7799b76cc06fe5dae1b34956d8afeccc754adb75295d6f09f3c9aa76df7c76d55ec88b57a7d517bb516fd4fc2606f9fa9e9a88a8464e6d7845ba4d5bd4e5fb728af962d3a2d3d6938c17ed8f6df1ae3f4e08ad00693586b263d1eafdeb6507e3a370573b57e990b732afe991c8ba89d3625756f8f3e0f4e2d90858b128a61183453d3591588c6323a30504be9c7fa31bd0539ca58fd1755546a5c37fec0b5b001e456d2f214f912cb6105f5345374f10789726451cf3279606afe527d4595cee94caf0400e4391499206c2624a0d73161c872057bf1c496187298ed292e515b835f680702b06f6bb19480515ac8ed030054d0ad17342b4052e223822f68180333ac4759a9c45680c8e02b81adc05712a32380bb4d4e02ca0066700389a3681c018e868ea87b8a77cf2d748edc3534f0948e1dda2b2a7f4da98162b5f54f2fe1151e83dfadff6424f53541665348e3570d45dc551718fcb36d1e9915895f2737f015b2ad446d7f426d7c96b7859627d35c7092491835fad8c20d2606eae4d0802d8599daf3825945762c4e099cdf4472929cde70d9d6039b7fa3d16731fa5fe0c36fa3ea21ff14f28f400063cc7f175f5ff0046d0631d627c50f3f93d3315b434c70ead2ebed7f5cb623769fd3a35b52b24e72fc9b5b4bc8ae71f944064be9c238774ef86a1c2516e2df675add5d5545b725c1cad46b2cd54b6d316ff00252a42f85366e4f123a7a7d7d762c37867265e937ce1bf7fd5f057fc1d6c5e12ff006136bd04b5354565cd06abebb93d924f0712af4bbe6d7bd6348eae9b4f0d3436c17ed8569e08e508acb69154e6a2b2ce65d2b2fb3b6a2456ad66bb6fd14f2fe51853be6f32932eaea8c39c658ef0c0a949e30d8ca60944ada6882f520e4a14daec65302d20aa41c80724c818006c9322649901a493ecadc1ae87c933928ad4f9c3e18d92349f6238b5d1038188a787c8ca404c0ad0dd930056c181da15a017006b2311a02b71034580c014b8a06d2d685710374349a8d43fabe889b68f4fa6ae64b74be59ae52515c944f5318a7c9a45f88c170924536ea6104f9e4e6ea3d424f2a2b839d2b751a9b364385f2135bb55ea71cb49e5fc228d368aed6d8a76271aff0026ad17a6d14e277c94a6747f914c16135fe818b29aa14d6a1058487c9927afae252fd453eb045d74720728fca3936fa86173230ddea6fa865b29af4994fa667be894f984dc59c5d35bea16b5edc70bf276f4fef282f79a6ff043ed86cd36b33c58994cb47ae97f4de601748ec932531c9abd21b79bec72fc1d0a74f5d2b108a45e290c4007a16538c565b0a866bb50e13c2e8965ee4f0b8452f9ec02e6e7ce720c95b8b8f310a9a7c3e190381832100640d2630ad63a01250f82be51767e40d26056a43a90ae256d3405ea436e33a9e3b194c0b593257b83901899154839019320bfa26402e29f656e2d743e43902a53f9e06520ca29a2b706b9881670c8d15a9f87c0ea5900340686230101819a000018180074fd4e73ae9cc4e34b5c92c48f4938c671c496518adf4ad358f2e383496388f555bf245ab843edc9d75e8da65e19743d2f4b0fe886a63852d7592fb2126476eb2d58856d7fa3bce3a4a78c472517eb2b82c4120638f0d36aac97f91b8a2cb1c34f1c7dd21eed5d97cfdba565bf83668fd2bab350f74be018e753a4d46b65c27187c9d8d2fa553424e4b74bf26e8c230588ac20917023151584b012102800aefbd54b9163a984967a02edd8335fac8c3e98f3212cd43926919b6f3902e77ce6b97815c9bed8a422a64391591301f22ca2990990133287e50f1929741ec470f2b8610d90e4ad4da7890df94016b22b580e420201a4c66b22b4d015ca22f28b72069302bc87711c4502c4c2995e49b80bb242b520e407c93a172100833861c1000d27da15c1afb4668802a97c872169315a6ba283d81a026300001001ffd96821c0c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c824800000000', + }, + ]) + ), + getNFTBalance: jest.fn(() => + Promise.resolve([ + { + description: null, + id: '20090103/e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6di0', + name: 'Inscription #70316307', + owner: + 'bc1px9wxdr8ha6swg50lcleq99jav6kkyn7g52j5xa2vunmype67gzyqyq6ah7', + symbol: '', + isNftSpam: false, + location: + 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d:0:0', + contractType: 'ORDINALS', + spamScore: 0, + }, + ]) + ), getBalance: jest.fn(() => Promise.resolve({ getData: jest.fn(() => @@ -55,6 +90,41 @@ describe('msg', () => { }; }); + it('buildTx with insufficient balance should throw an error', async () => { + const chainMsg = new ChainMsg( + { + from: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + to: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + amount: 1001, + }, + mockProvider, + MsgEncoding.object + ); + + await expect(chainMsg.buildTx()).rejects.toThrowError(); + }); + + jest.setTimeout(30000); + + it('buildTx with native token', async () => { + const chainMsg = new ChainMsg( + { + from: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + to: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + amount: 0.000001, + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response.from).toBe('ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5'); + expect(response.to).toBe('ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5'); + expect(response).toHaveProperty('inputs'); + expect(response).toHaveProperty('outputs'); + expect(response).toHaveProperty('utxos'); + }); + it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { diff --git a/packages/litecoin/src/signers/trezor.signer.spec.ts b/packages/litecoin/src/signers/trezor.signer.spec.ts index dec846ea..d0ff82f1 100644 --- a/packages/litecoin/src/signers/trezor.signer.spec.ts +++ b/packages/litecoin/src/signers/trezor.signer.spec.ts @@ -10,8 +10,6 @@ import { LitecoinProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { LITECOIN_MANIFEST } from '../manifests'; -jest.setTimeout(10000); - import TrezorSigner from './trezor.signer'; jest.mock('@trezor/connect-web', () => ({ init: jest.fn().mockImplementation(), diff --git a/packages/solana/.env.example b/packages/solana/.env.example new file mode 100644 index 00000000..69089005 --- /dev/null +++ b/packages/solana/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=0 \ No newline at end of file diff --git a/packages/solana/package.json b/packages/solana/package.json index e3bbab9f..f9272365 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -82,7 +82,8 @@ }, "jest": { "setupFiles": [ - "./jest-setup-file.ts" + "./jest-setup-file.ts", + "dotenv/config" ], "preset": "ts-jest", "transform": { diff --git a/packages/solana/src/chain.provider.spec.ts b/packages/solana/src/chain.provider.spec.ts index f4c9f7c7..9faf8b2c 100644 --- a/packages/solana/src/chain.provider.spec.ts +++ b/packages/solana/src/chain.provider.spec.ts @@ -1,4 +1,9 @@ -import { Response } from '@xdefi-tech/chains-core'; +import { + Response, + GasFeeSpeed, + TransactionStatus, + Coin, +} from '@xdefi-tech/chains-core'; import { ChainMsg } from './msg'; import { SolanaProvider } from './chain.provider'; @@ -6,6 +11,9 @@ import { ChainDataSource, IndexerDataSource } from './datasource'; import { SOLANA_MANIFEST } from './manifests'; describe('chain.provider', () => { + const NETWORKED_QUERIES = + process.env.NETWORKED_QUERIES === '1' ? true : false; + let chainProvider: SolanaProvider; let indexProvider: SolanaProvider; @@ -14,7 +22,7 @@ describe('chain.provider', () => { indexProvider = new SolanaProvider(new IndexerDataSource(SOLANA_MANIFEST)); }); - it('createMsg(): should create message with data', () => { + it('createMsg() should create a ChainMsg instance for native token', () => { let msg = chainProvider.createMsg({ to: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', from: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', @@ -32,56 +40,149 @@ describe('chain.provider', () => { expect(msg).toBeInstanceOf(ChainMsg); }); - it('should get a transaction from the blockchain', async () => { - let txData = await chainProvider.getTransaction( - '2d2QPayaPHj3ZxJ5Ws6ig67HKWLD7FyrGQjpRHz6sHEPHA1apzWqS3MzG1jWRrAgELu79cXgHxjK2V6BcFKUWKJo' - ); - expect(txData?.hash).toEqual( - '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' - ); - - txData = await indexProvider.getTransaction( - '2d2QPayaPHj3ZxJ5Ws6ig67HKWLD7FyrGQjpRHz6sHEPHA1apzWqS3MzG1jWRrAgELu79cXgHxjK2V6BcFKUWKJo' - ); - expect(txData?.hash).toEqual( - '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' - ); + it('getBalance() should return balance data', async () => { + if (!NETWORKED_QUERIES) { + jest.spyOn(SolanaProvider.prototype, 'getBalance').mockResolvedValue( + new Response( + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'mainnet-beta', + name: 'Solana', + symbol: 'SOL', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '123', + decimals: 8, + }, + amount: '1000', + }, + { + asset: { + chainId: 'mainnet-beta', + name: 'Bonk', + symbol: 'BONK', + icon: null, + native: false, + address: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263', + decimals: 8, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'mainnet-beta', + name: 'Solana', + symbol: 'SOL', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '123', + decimals: 8, + }, + amount: '1000', + }, + { + asset: { + chainId: 'mainnet-beta', + name: 'Bonk', + symbol: 'BONK', + icon: null, + native: false, + address: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263', + decimals: 8, + }, + amount: '1000', + }, + ]) + ) + ); + + const balance = await chainProvider.getBalance( + 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toEqual(2); + expect(balanceData[0].amount).toEqual('1000'); + expect(balanceData[0].asset.symbol).toEqual('SOL'); + expect(balanceData[1].amount).toEqual('1000'); + expect(balanceData[1].asset.symbol).toEqual('BONK'); + } else { + const balance = await chainProvider.getBalance( + 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5' + ); + + const balanceData = await balance.getData(); + expect(balanceData.length).toBeGreaterThanOrEqual(0); + if (balanceData.length > 0) { + expect(balanceData[0]).toBeInstanceOf(Coin); + expect(balanceData[0].amount).toBeTruthy(); + } + } }); - it('should get a balance', async () => { - jest.spyOn(SolanaProvider.prototype, 'getBalance').mockResolvedValue( - new Response( - jest.fn().mockImplementation(async () => []), - jest.fn().mockImplementation(async () => []) - ) - ); - let balance = await indexProvider.getBalance( - 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5' + it('estimateFee() should return fee estimation', async () => { + jest.spyOn(SolanaProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); + + const msg = chainProvider.createMsg({ + from: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', + to: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', + amount: 0.000001, + }); + + const estimateFee = await chainProvider.estimateFee( + [msg], + GasFeeSpeed.medium ); - let balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); + expect(estimateFee.length).toEqual(1); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); - balance = await chainProvider.getBalance( - 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5' - ); + it('gasFeeOptions() should get fee options', async () => { + jest.spyOn(SolanaProvider.prototype, 'gasFeeOptions').mockResolvedValue({ + high: 0.003, + medium: 0.0025, + low: 0.001, + }); - balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); + const feeOptions = await chainProvider.gasFeeOptions(); + + expect(feeOptions?.low).toBeTruthy(); + expect(feeOptions?.medium).toBeTruthy(); + expect(feeOptions?.high).toBeTruthy(); }); - it('should throw for a non-existant transaction on the blockchain', async () => { - expect( - chainProvider.getTransaction( - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' - ) - ).rejects.toThrow(); + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(SolanaProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); - expect( - indexProvider.getTransaction( - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' - ) - ).rejects.toThrow(); + const txData = await chainProvider.getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); + + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); it('should return false when verifying an invalid address', () => { diff --git a/packages/solana/src/msg.spec.ts b/packages/solana/src/msg.spec.ts index 2490432d..25e5ff42 100644 --- a/packages/solana/src/msg.spec.ts +++ b/packages/solana/src/msg.spec.ts @@ -1,9 +1,27 @@ import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; -import { LAMPORTS_PER_SOL } from '@solana/web3.js'; +import { + getMint, + getAssociatedTokenAddress, + createTransferInstruction, + TOKEN_PROGRAM_ID, +} from '@solana/spl-token'; +import { + LAMPORTS_PER_SOL, + PublicKey, + TransactionInstruction, +} from '@solana/web3.js'; import { ChainMsg } from './msg'; +// Mock dependencies +jest.mock('@solana/spl-token', () => ({ + ...jest.requireActual('@solana/spl-token'), + getMint: jest.fn(), + getAssociatedTokenAddress: jest.fn(), + createTransferInstruction: jest.fn(), +})); + describe('msg', () => { let mockProvider: any; @@ -42,6 +60,13 @@ describe('msg', () => { ), }) ), + rpcProvider: { + getRecentBlockhash: jest.fn(() => + Promise.resolve({ + blockhash: 'mockBlockhash', + }) + ), + }, gasFeeOptions: jest.fn(() => Promise.resolve({ high: 25000, @@ -68,11 +93,86 @@ describe('msg', () => { }; }); + it('buildTx with native token', async () => { + const chainMsg = new ChainMsg( + { + from: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', + to: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', + amount: 0.000001, + }, + mockProvider, + MsgEncoding.object + ); + + const txBody = await chainMsg.buildTx(); + expect(txBody.from).toBe('9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh'); + expect(txBody.to).toBe('9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh'); + expect(txBody.value).toBe(1000); // 0.000001 * 10 ** 8 + expect(txBody.gasPrice).toBe(5000); + }); + + it('buildTx with non-native token', async () => { + const chainMsg = new ChainMsg( + { + from: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', + to: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', + amount: 0.000001, + contractAddress: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263', // BONK + }, + mockProvider, + MsgEncoding.object + ); + + const decimals = 8; + const value = new BigNumber('0.000001') + .multipliedBy(10 ** decimals) + .toNumber(); + + (getMint as jest.Mock).mockResolvedValue({ decimals }); + const fromTokenAcc = new PublicKey( + 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU6' + ); + const toTokenAcc = new PublicKey( + 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU6' + ); + + (getAssociatedTokenAddress as jest.Mock).mockResolvedValueOnce( + fromTokenAcc + ); + (getAssociatedTokenAddress as jest.Mock).mockResolvedValueOnce(toTokenAcc); + + const mockInstruction = new TransactionInstruction({ + keys: [ + { pubkey: fromTokenAcc, isSigner: false, isWritable: true }, + { pubkey: toTokenAcc, isSigner: false, isWritable: true }, + { + pubkey: new PublicKey('C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5'), + isSigner: true, + isWritable: false, + }, + ], + programId: TOKEN_PROGRAM_ID, + data: Buffer.from([]), + }); + + (createTransferInstruction as jest.Mock).mockReturnValue(mockInstruction); + + const txBody = await chainMsg.buildTx(); + expect(txBody.value).toBe(value); + expect(txBody.to).toBe('C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5'); + expect(txBody.from).toBe('C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5'); + expect(txBody.gasPrice).toBe(5000); + expect(txBody.decimals).toBe(decimals); + expect(txBody.programId).toEqual(TOKEN_PROGRAM_ID); + expect(txBody.toTokenAddress).toBe(toTokenAcc.toBase58()); + expect(txBody.fromTokenAddress).toBe(fromTokenAcc.toBase58()); + }); + it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { - from: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', - to: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + from: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', + to: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', amount: 0.000001, }, mockProvider, @@ -93,8 +193,8 @@ describe('msg', () => { it('getMaxAmountToSend should throw an error with invalid token', async () => { const chainMsg = new ChainMsg( { - from: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', - to: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + from: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', + to: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', amount: 0.000001, }, mockProvider, @@ -109,8 +209,8 @@ describe('msg', () => { it('should return MaxAmountToSend with native token', async () => { const chainMsg = new ChainMsg( { - from: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', - to: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + from: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', + to: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', amount: 0.000001, }, mockProvider, @@ -133,8 +233,8 @@ describe('msg', () => { it('should return MaxAmountToSend with non-native-token', async () => { const chainMsg = new ChainMsg( { - from: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', - to: 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5', + from: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', + to: '9H2zCw7ey8qJgTgyK46pbCNw4ifGKqfzWi8Sc5MeH8fh', amount: 0.000001, }, mockProvider, diff --git a/packages/thor/.env.example b/packages/thor/.env.example new file mode 100644 index 00000000..69089005 --- /dev/null +++ b/packages/thor/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=0 \ No newline at end of file diff --git a/packages/thor/package.json b/packages/thor/package.json index 1b30761f..e886940d 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -64,7 +64,9 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "jest": { - "setupFiles": [], + "setupFiles": [ + "dotenv/config" + ], "preset": "ts-jest/presets/js-with-ts", "transform": { ".+\\.(t|j)s$": "ts-jest" diff --git a/packages/thor/src/chain.provider.spec.ts b/packages/thor/src/chain.provider.spec.ts index 381be02b..7faa5be6 100644 --- a/packages/thor/src/chain.provider.spec.ts +++ b/packages/thor/src/chain.provider.spec.ts @@ -1,4 +1,9 @@ -import { Response, Coin } from '@xdefi-tech/chains-core'; +import { + Response, + TransactionStatus, + GasFeeSpeed, + Coin, +} from '@xdefi-tech/chains-core'; import { ChainMsg } from './msg'; import { ThorProvider } from './chain.provider'; @@ -77,7 +82,7 @@ describe('chain.provider', () => { ), }; - it('createMsg(): should create message with data for thorchain', () => { + it('createMsg() should create a ChainMsg instancefor thorchain', () => { const msg = providers[ThorChains.thorchain].createMsg({ to: 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94', from: 'thor1hccrcavupf7wnl2klud40lan00zp0q3u807g94', @@ -143,19 +148,105 @@ describe('chain.provider', () => { expect(feeOptions?.high).toBeDefined(); }); - it('should get a balance from mayachain', async () => { + it('getBalance() should return balance data', async () => { jest.spyOn(ThorProvider.prototype, 'getBalance').mockResolvedValue( new Response( - jest.fn().mockImplementation(async () => []), - jest.fn().mockImplementation(async () => []) + // getData + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'thorchain-mainnet-v1', + name: 'Thor', + symbol: 'RUNE', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/thorchain/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '6.03', + decimals: 8, + }, + amount: '1000', + }, + ]), + // getObserver + jest.fn().mockImplementation(async () => [ + { + asset: { + chainId: 'thorchain-mainnet-v1', + name: 'Thor', + symbol: 'RUNE', + icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/thorchain/info/logo.png', + native: true, + id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', + price: '6.03', + decimals: 8, + }, + amount: '1000', + }, + ]) ) ); - const balance = await providers[ThorChains.mayachain].getBalance( - 'maya1x5979k5wqgq58f4864glr7w2rtgyuqqm6l2zhx' + + const balance = await providers[ThorChains.thorchain].getBalance( + 'thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l' ); const balanceData = await balance.getData(); - expect(balanceData.length).toEqual(0); + expect(balanceData.length).toEqual(1); + expect(balanceData[0].amount).toEqual('1000'); + expect(balanceData[0].asset.symbol).toEqual('RUNE'); + }); + + it('estimateFee() should return fee estimation', async () => { + jest.spyOn(ThorProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); + + const msg = providers[ThorChains.thorchain].createMsg({ + to: 'maya1x5979k5wqgq58f4864glr7w2rtgyuqqm6l2zhx', + from: 'maya1x5979k5wqgq58f4864glr7w2rtgyuqqm6l2zhx', + amount: 0.000001, + decimals: 18, + }); + + const estimateFee = await providers[ThorChains.thorchain].estimateFee( + [msg], + GasFeeSpeed.medium + ); + + expect(estimateFee.length).toEqual(1); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); + + it('gasFeeOptions() should get fee options', async () => { + const feeOptions = await providers[ThorChains.thorchain].gasFeeOptions(); + + expect(feeOptions?.low).toEqual(0); + expect(feeOptions?.medium).toEqual(0); + expect(feeOptions?.high).toEqual(0); + }); + + it('getTransaction() should return data transaction on the blockchain', async () => { + jest.spyOn(ThorProvider.prototype, 'getTransaction').mockResolvedValue({ + hash: '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw', + to: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + from: '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8', + status: TransactionStatus.pending, + amount: '1000', + }); + + const txData = await providers[ThorChains.thorchain].getTransaction( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); + + expect(txData?.hash).toEqual( + '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' + ); }); it('should return false when verifying an invalid address', () => { diff --git a/packages/thor/src/msg.spec.ts b/packages/thor/src/msg.spec.ts index b7ca21cc..dfb4c6c2 100644 --- a/packages/thor/src/msg.spec.ts +++ b/packages/thor/src/msg.spec.ts @@ -8,6 +8,7 @@ describe('msg', () => { beforeEach(() => { mockProvider = { + getAccount: jest.fn(() => Promise.resolve({})), getBalance: jest.fn(() => Promise.resolve({ getData: jest.fn(() => @@ -80,6 +81,59 @@ describe('msg', () => { }; }); + it('buildTx with native token x valid amount', async () => { + const chainMsg = new ChainMsg( + { + from: 'thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l', + to: 'thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l', + amount: 0.000001, + decimals: 8, + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.txBody).toBeDefined(); + expect(response.account).toBeDefined(); + expect(response.from).toEqual( + 'thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l' + ); + expect(response.to).toEqual('thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l'); + expect(response.decimals).toEqual(8); + expect(response.value).toEqual(100); // 0.000001 * 10^8 + expect(response.chainId).toEqual('thorchain-mainnet-v1'); + expect(response.denom).toEqual('rune'); + }); + + it('buildTx with non-native token x valid amount', async () => { + const chainMsg = new ChainMsg( + { + from: 'thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l', + to: 'thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l', + amount: 0.000001, + decimals: 8, + denom: 'BLZ', + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response.txBody).toBeDefined(); + expect(response.account).toBeDefined(); + expect(response.from).toEqual( + 'thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l' + ); + expect(response.to).toEqual('thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l'); + expect(response.decimals).toEqual(8); + expect(response.value).toEqual(100); // 0.000001 * 10^8 + expect(response.chainId).toEqual('thorchain-mainnet-v1'); + expect(response.denom).toEqual('BLZ'); + }); + it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { diff --git a/packages/tron/.env.example b/packages/tron/.env.example new file mode 100644 index 00000000..69089005 --- /dev/null +++ b/packages/tron/.env.example @@ -0,0 +1 @@ +NETWORKED_QUERIES=0 \ No newline at end of file diff --git a/packages/tron/package.json b/packages/tron/package.json index f0919329..efd64f47 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -78,6 +78,7 @@ }, "jest": { "setupFiles": [ + "dotenv/config", "./jest-setup-file.ts" ], "preset": "ts-jest", diff --git a/packages/tron/src/chain.provider.spec.ts b/packages/tron/src/chain.provider.spec.ts index 143eab28..f8005622 100644 --- a/packages/tron/src/chain.provider.spec.ts +++ b/packages/tron/src/chain.provider.spec.ts @@ -41,7 +41,7 @@ describe('chain.providers.chain', () => { }; }); - it('createMsg(): should create message with data', () => { + it('createMsg() should create a ChainMsg instance for native token', () => { let msg = providers.chain.createMsg({}); expect(msg).toBeInstanceOf(ChainMsg); diff --git a/packages/tron/src/msg.spec.ts b/packages/tron/src/msg.spec.ts index 3021b009..a2fd0043 100644 --- a/packages/tron/src/msg.spec.ts +++ b/packages/tron/src/msg.spec.ts @@ -69,6 +69,66 @@ describe('msg', () => { }; }); + it('buildTx with native token x valid amount', async () => { + const chainMsg = new ChainMsg( + { + from: 'TJrf5jjCXsc19sQHb6GWBmzT1rbJivmR52', + to: 'TN4JsVEuLVBG9Ru7YSjDxkTdoRTychnJkH', + amount: 1000, + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response).toHaveProperty('txID'); + expect(response).toHaveProperty('raw_data_hex'); + expect(response).toHaveProperty('raw_data'); + }); + + it('buildTx with non-native token (TRC10)', async () => { + const chainMsg = new ChainMsg( + { + from: 'TJrf5jjCXsc19sQHb6GWBmzT1rbJivmR52', + to: 'TN4JsVEuLVBG9Ru7YSjDxkTdoRTychnJkH', + decimals: 18, + tokenId: '10', + amount: 1000, + contractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', // USDT + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response).toHaveProperty('txID'); + expect(response).toHaveProperty('raw_data_hex'); + expect(response).toHaveProperty('raw_data'); + }); + + it('buildTx with non-native token (TRC20)', async () => { + const chainMsg = new ChainMsg( + { + from: 'TJrf5jjCXsc19sQHb6GWBmzT1rbJivmR52', + to: 'TN4JsVEuLVBG9Ru7YSjDxkTdoRTychnJkH', + decimals: 18, + tokenId: '1002000', + amount: 1000, + contractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', // USDT + }, + mockProvider, + MsgEncoding.object + ); + + const response = await chainMsg.buildTx(); + expect(response).toBeDefined(); + expect(response).toHaveProperty('txID'); + expect(response).toHaveProperty('raw_data_hex'); + expect(response).toHaveProperty('raw_data'); + }); + it('getMaxAmountToSend should throw an error with invalid token', async () => { const chainMsg = new ChainMsg( { diff --git a/turbo.json b/turbo.json index a5bdf3f6..af624a50 100644 --- a/turbo.json +++ b/turbo.json @@ -53,5 +53,7 @@ "cache": false, "outputs": [] } - } + }, + "globalDependencies": [".env", "tsconfig.json"], + "globalEnv": ["NETWORKED_QUERIES"] } From 6307f1a907b0fee042c6b5709bf5ba9705819ed0 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 4 Jul 2024 10:53:13 +0000 Subject: [PATCH 039/176] Version packages --- .changeset/ten-eyes-grab.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/ten-eyes-grab.md diff --git a/.changeset/ten-eyes-grab.md b/.changeset/ten-eyes-grab.md deleted file mode 100644 index a4206271..00000000 --- a/.changeset/ten-eyes-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -fix: use data if present and not assume transfer for ERC20 tokens diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 3e812943..f1532ae0 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.32 + +### Patch Changes + +- 2f8a9425: fix: use data if present and not assume transfer for ERC20 tokens + ## 2.0.31 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index f0750019..f50c16fb 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.31", + "version": "2.0.32", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From d7c806e8cad3e1bdaf3e1c5f74265a6ab959c45f Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Thu, 4 Jul 2024 20:11:28 +0100 Subject: [PATCH 040/176] Fix/evm base fee per gas (#263) * fix: evm baseFeePerGas * chore: patch --- .changeset/lazy-bobcats-grow.md | 5 +++++ .../evm/src/datasource/chain/chain.data-source.ts | 12 +++++++++--- .../src/datasource/indexer/indexer.data-source.ts | 12 +++++++++--- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .changeset/lazy-bobcats-grow.md diff --git a/.changeset/lazy-bobcats-grow.md b/.changeset/lazy-bobcats-grow.md new file mode 100644 index 00000000..7c1d6baf --- /dev/null +++ b/.changeset/lazy-bobcats-grow.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +fix: evm baseFeePerGas diff --git a/packages/evm/src/datasource/chain/chain.data-source.ts b/packages/evm/src/datasource/chain/chain.data-source.ts index e4ed7c01..d09b0750 100644 --- a/packages/evm/src/datasource/chain/chain.data-source.ts +++ b/packages/evm/src/datasource/chain/chain.data-source.ts @@ -325,7 +325,9 @@ export class ChainDataSource extends DataSource { return { [GasFeeSpeed.high]: { - baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + baseFeePerGas: new BigNumber( + formatFixed(fee?.lastBaseFeePerGas ?? fee.gasPrice) + ) .multipliedBy(this.manifest.feeGasStep.high) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), @@ -339,7 +341,9 @@ export class ChainDataSource extends DataSource { .toNumber(), }, [GasFeeSpeed.medium]: { - baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + baseFeePerGas: new BigNumber( + formatFixed(fee?.lastBaseFeePerGas ?? fee.gasPrice) + ) .multipliedBy(this.manifest.feeGasStep.medium) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), @@ -353,7 +357,9 @@ export class ChainDataSource extends DataSource { .toNumber(), }, [GasFeeSpeed.low]: { - baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + baseFeePerGas: new BigNumber( + formatFixed(fee?.lastBaseFeePerGas ?? fee.gasPrice) + ) .multipliedBy(this.manifest.feeGasStep.low) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), diff --git a/packages/evm/src/datasource/indexer/indexer.data-source.ts b/packages/evm/src/datasource/indexer/indexer.data-source.ts index c07db49e..c5e0832c 100644 --- a/packages/evm/src/datasource/indexer/indexer.data-source.ts +++ b/packages/evm/src/datasource/indexer/indexer.data-source.ts @@ -366,7 +366,9 @@ export class IndexerDataSource extends DataSource { return { [GasFeeSpeed.high]: { - baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + baseFeePerGas: new BigNumber( + formatFixed(fee?.lastBaseFeePerGas ?? fee.gasPrice) + ) .multipliedBy(this.manifest.feeGasStep.high) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), @@ -380,7 +382,9 @@ export class IndexerDataSource extends DataSource { .toNumber(), }, [GasFeeSpeed.medium]: { - baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + baseFeePerGas: new BigNumber( + formatFixed(fee?.lastBaseFeePerGas ?? fee.gasPrice) + ) .multipliedBy(this.manifest.feeGasStep.medium) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), @@ -394,7 +398,9 @@ export class IndexerDataSource extends DataSource { .toNumber(), }, [GasFeeSpeed.low]: { - baseFeePerGas: new BigNumber(formatFixed(fee.gasPrice)) + baseFeePerGas: new BigNumber( + formatFixed(fee?.lastBaseFeePerGas ?? fee.gasPrice) + ) .multipliedBy(this.manifest.feeGasStep.low) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), From 05241a25658eefb60553b9c7ed9f6844557038c9 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 4 Jul 2024 19:13:54 +0000 Subject: [PATCH 041/176] Version packages --- .changeset/lazy-bobcats-grow.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/lazy-bobcats-grow.md diff --git a/.changeset/lazy-bobcats-grow.md b/.changeset/lazy-bobcats-grow.md deleted file mode 100644 index 7c1d6baf..00000000 --- a/.changeset/lazy-bobcats-grow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -fix: evm baseFeePerGas diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index f1532ae0..16b41960 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.33 + +### Patch Changes + +- f549279a: fix: evm baseFeePerGas + ## 2.0.32 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index f50c16fb..4c554489 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.32", + "version": "2.0.33", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From ff622b78204436c061f9ba81e303c85f4cfbc89f Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Fri, 5 Jul 2024 19:54:10 +0700 Subject: [PATCH 042/176] test: add aproval test cases (#264) --- packages/evm/src/msg.spec.ts | 113 ++++++++++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/packages/evm/src/msg.spec.ts b/packages/evm/src/msg.spec.ts index c5c52934..366f3357 100644 --- a/packages/evm/src/msg.spec.ts +++ b/packages/evm/src/msg.spec.ts @@ -1,8 +1,11 @@ import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import { ethers } from 'ethers'; +import erc20ABI from './consts/erc20.json'; +import erc721ABI from './consts/erc721.json'; +import erc1155ABI from './consts/erc1155.json'; -import { ChainMsg } from './msg'; +import { ChainMsg, MsgBody } from './msg'; describe('msg', () => { let mockProvider: any; @@ -306,4 +309,112 @@ describe('msg', () => { expect(response).toEqual(new BigNumber('1000').minus(gap).toString()); }); + + it('buildTx with ERC-20 approve', async () => { + const contractAddress = '0xdac17f958d2ee523a2206206994597c13d831ec7'; // USDT + const spenderAddress = '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'; + const erc20Interface = new ethers.utils.Interface(erc20ABI); + + const erc20ApproveData = erc20Interface.encodeFunctionData('approve', [ + spenderAddress, + ethers.utils.parseUnits('1.0', 18), + ]); + + const msgBody: MsgBody = { + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: contractAddress, + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: contractAddress, + data: erc20ApproveData, // approve(address,uint256) + }; + + const chainMsg = new ChainMsg(msgBody, mockProvider, MsgEncoding.object); + + const response = await chainMsg.buildTx(); + + // Assertions + expect(response).toBeDefined(); + expect(response.from).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response.to).toEqual(contractAddress); + expect(response).toHaveProperty('nonce'); + expect(response).toHaveProperty('value'); + expect(response).toHaveProperty('chainId'); + expect(response).toHaveProperty('maxFeePerGas'); + expect(response.data).toEqual(erc20ApproveData); + }); + + it('buildTx with ERC-721 approve', async () => { + const contractAddress = '0x06012c8cf97bead5deae237070f9587f8e7a266d'; // CryptoKitties - ERC721 + const spenderAddress = '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'; + const erc721Interface = new ethers.utils.Interface(erc721ABI); + + const erc721ApproveData = erc721Interface.encodeFunctionData( + 'setApprovalForAll', + [spenderAddress, true] + ); + + const msgBody: MsgBody = { + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: contractAddress, + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: contractAddress, + data: erc721ApproveData, + }; + + const chainMsg = new ChainMsg(msgBody, mockProvider, MsgEncoding.object); + + const response = await chainMsg.buildTx(); + + // Assertions + expect(response).toBeDefined(); + expect(response.from).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response.to).toEqual(contractAddress); + expect(response).toHaveProperty('nonce'); + expect(response).toHaveProperty('value'); + expect(response).toHaveProperty('chainId'); + expect(response).toHaveProperty('maxFeePerGas'); + expect(response.data).toEqual(erc721ApproveData); + }); + + it('buildTx with ERC-1155 approve', async () => { + const contractAddress = '0x0e3a2a1f2146d86a604adc220b4967a898d7fe07'; // EnjinCoin - ERC1155 + const spenderAddress = '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'; + const erc1155Interface = new ethers.utils.Interface(erc1155ABI); + + const erc1155ApproveData = erc1155Interface.encodeFunctionData( + 'setApprovalForAll', + [spenderAddress, true] + ); + // Creating the data for ERC-1155 approve + const msgBody: MsgBody = { + from: '0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581', + to: contractAddress, + amount: 0.000001, + nonce: 0, + decimals: 18, + chainId: 1, + contractAddress: contractAddress, + data: erc1155ApproveData, + }; + + const chainMsg = new ChainMsg(msgBody, mockProvider, MsgEncoding.object); + + const response = await chainMsg.buildTx(); + + // Assertions + expect(response).toBeDefined(); + expect(response.from).toEqual('0xAa09Df2673e1ae3fcC8ed875C131b52449CF9581'); + expect(response.to).toEqual(contractAddress); + expect(response).toHaveProperty('nonce'); + expect(response).toHaveProperty('value'); + expect(response).toHaveProperty('chainId'); + expect(response).toHaveProperty('maxFeePerGas'); + expect(response.data).toEqual(erc1155ApproveData); + }); }); From e9ddaacf671719fa0b508069130ca90dfbfa413f Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Fri, 5 Jul 2024 20:01:00 +0700 Subject: [PATCH 043/176] perf: re-import osmojs in cosmos lib (#260) * re-import osmojs in cosmos lib * fix: Skips building dependencies for node modules, and use them as they are imported * chore: reduce import size osmojs --------- Co-authored-by: tuannda1503 --- .changeset/tasty-wolves-warn.md | 5 ++++ packages/cosmos/package.json | 15 +++++----- packages/cosmos/src/chain.provider.ts | 13 ++++---- packages/cosmos/src/msg.ts | 43 +++++++++++++-------------- packages/cosmos/src/utils.ts | 4 +-- packages/cosmos/tsup.config.cjs | 17 ++++++----- 6 files changed, 51 insertions(+), 46 deletions(-) create mode 100644 .changeset/tasty-wolves-warn.md diff --git a/.changeset/tasty-wolves-warn.md b/.changeset/tasty-wolves-warn.md new file mode 100644 index 00000000..f8b51b59 --- /dev/null +++ b/.changeset/tasty-wolves-warn.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +reduce size import osmojs diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index ba5e71f4..e6a34d93 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -12,19 +12,20 @@ ], "devDependencies": { "@esbuild-plugins/node-modules-polyfill": "0.2.2", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", "eslint-config-custom": "*", + "graphql": "16.6.0", "jest": "27.5.1", "jest-environment-jsdom": "27.5.1", "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", + "ts-proto": "^1.181.0", "tsup": "6.6.3", - "typescript": "4.8.3", - "@graphql-codegen/cli": "3.2.2", - "@graphql-codegen/client-preset": "2.1.1", - "@graphql-codegen/named-operations-object": "2.3.1", - "@graphql-codegen/near-operation-file-preset": "2.5.0", - "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0" + "typescript": "4.8.3" }, "dependencies": { "@cosmjs/amino": "0.32.3", diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index 19711dcb..c59d5497 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -15,19 +15,18 @@ import { TransactionData, TransactionStatus, } from '@xdefi-tech/chains-core'; -import { - LcdClient, - setupAuthExtension, - setupBankExtension, -} from '@cosmjs/launchpad'; -import { BroadcastTxError, Account } from '@cosmjs/stargate'; +import { setupAuthExtension } from '@cosmjs/launchpad/build/lcdapi/auth'; +import { setupBankExtension } from '@cosmjs/launchpad/build/lcdapi/bank'; +import { LcdClient } from '@cosmjs/launchpad/build/lcdapi/lcdclient'; +import { Account } from '@cosmjs/stargate/build/accounts'; +import { BroadcastTxError } from '@cosmjs/stargate/build/stargateclient'; import { some } from 'lodash'; import axios, { AxiosInstance } from 'axios'; import 'reflect-metadata'; import { bech32 } from 'bech32'; import { utils } from 'ethers'; import { AccAddress } from '@terra-money/feather.js'; -import { osmosis } from 'osmojs'; +import { osmosis } from 'osmojs/osmosis/bundle'; import { ChainMsg } from './msg'; import * as manifests from './manifests'; diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index d51e6a45..99befc77 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -7,9 +7,18 @@ import { NumberIsh, Coin, } from '@xdefi-tech/chains-core'; -import { StdTx, Coin as AminoCoin } from '@cosmjs/amino'; +import { StdTx } from '@cosmjs/amino/build/stdtx'; +import { Coin as AminoCoin } from '@cosmjs/amino/build/coins'; import BigNumber from 'bignumber.js'; -import { cosmos, ibc, osmosis } from 'osmojs'; +import { MsgSend } from 'osmojs/cosmos/bank/v1beta1/tx'; +import { MessageComposer as MessageComposerCosmos } from 'osmojs/cosmos/bank/v1beta1/tx.registry'; +import { AminoConverter as AminoConverterCosmos } from 'osmojs/cosmos/bank/v1beta1/tx.amino'; +import { MsgSwapExactAmountIn } from 'osmojs/osmosis/gamm/v1beta1/tx'; +import { MessageComposer as MessageComposerGamm } from 'osmojs/osmosis/gamm/v1beta1/tx.registry'; +import { AminoConverter as AminoConverterGamm } from 'osmojs/osmosis/gamm/v1beta1/tx.amino'; +import { MsgTransfer } from 'osmojs/ibc/applications/transfer/v1/tx'; +import { MessageComposer as MessageComposerIbc } from 'osmojs/ibc/applications/transfer/v1/tx.registry'; +import { AminoConverter as AminoConverterIbc } from 'osmojs/ibc/applications/transfer/v1/tx.amino'; import Long from 'long'; import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; @@ -84,12 +93,9 @@ export class ChainMsg extends BasMsg { if (rawMsg.timeoutTimestamp) { rawMsg.timeoutTimestamp = Long.fromValue(rawMsg.timeoutTimestamp); } - const ibcTransfer = - ibc.applications.transfer.v1.MsgTransfer.fromPartial(rawMsg); + const ibcTransfer = MsgTransfer.fromPartial(rawMsg); - return ibc.applications.transfer.v1.MessageComposer.withTypeUrl.transfer( - ibcTransfer - ); + return MessageComposerIbc.withTypeUrl.transfer(ibcTransfer); } private getSwapMsg(rawMsg: any) { @@ -99,9 +105,8 @@ export class ChainMsg extends BasMsg { rawMsg.tokenIn.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; } rawMsg.tokenOutMinAmount = rawMsg.tokenOutMinAmount.toString(); - const msgSwapExactAmountIn = - osmosis.gamm.v1beta1.MsgSwapExactAmountIn.fromPartial(rawMsg); - return osmosis.gamm.v1beta1.MessageComposer.withTypeUrl.swapExactAmountIn( + const msgSwapExactAmountIn = MsgSwapExactAmountIn.fromPartial(rawMsg); + return MessageComposerGamm.withTypeUrl.swapExactAmountIn( msgSwapExactAmountIn ); } @@ -119,8 +124,8 @@ export class ChainMsg extends BasMsg { amount: coin.amount.toString(), }; }); - const msgSend = cosmos.bank.v1beta1.MsgSend.fromPartial(rawMsg); - return cosmos.bank.v1beta1.MessageComposer.withTypeUrl.send(msgSend); + const msgSend = MsgSend.fromPartial(rawMsg); + return MessageComposerCosmos.withTypeUrl.send(msgSend); } private getExecuteContract(rawMsg: any) { @@ -165,7 +170,7 @@ export class ChainMsg extends BasMsg { msgs = [ { typeUrl: typeUrl, - value: cosmos.bank.v1beta1.MsgSend.fromPartial({ + value: MsgSend.fromPartial({ fromAddress: msgData.from, toAddress: msgData.to, amount: [ @@ -208,25 +213,19 @@ export class ChainMsg extends BasMsg { const rawMsg = signDocMsg?.value ?? signDocMsg; const isIBCTransfer = - ibc.applications.transfer.v1.AminoConverter[ - key as keyof typeof ibc.applications.transfer.v1.AminoConverter - ]; + AminoConverterIbc[key as keyof typeof AminoConverterIbc]; if (isIBCTransfer) { return this.getIBCTransferMsg(rawMsg); } const isMsgSwapExactAmountIn = - osmosis.gamm.v1beta1.AminoConverter[ - key as keyof typeof osmosis.gamm.v1beta1.AminoConverter - ]; + AminoConverterGamm[key as keyof typeof AminoConverterGamm]; if (isMsgSwapExactAmountIn) { return this.getSwapMsg(rawMsg); } const isMsgSend = - cosmos.bank.v1beta1.AminoConverter[ - key as keyof typeof cosmos.bank.v1beta1.AminoConverter - ]; + AminoConverterCosmos[key as keyof typeof AminoConverterCosmos]; if (isMsgSend) { return this.getMsgSend(rawMsg); } diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index 1fe1b09a..1b2f0a6a 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -1,7 +1,7 @@ import { createDefaultAminoConverters, defaultRegistryTypes, -} from '@cosmjs/stargate'; +} from '@cosmjs/stargate/build/signingstargateclient'; import { AminoTypes } from '@cosmjs/stargate/build/aminotypes'; import { Registry } from '@cosmjs/proto-signing/build/registry'; import { @@ -10,7 +10,7 @@ import { } from 'osmojs/osmosis/client'; import axios from 'axios'; import { wasmTypes } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/messages'; -import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate'; +import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/aminomessages'; import { COSMOS_MANIFESTS, CosmosHubChains } from './manifests'; import { MsgBody } from './msg'; diff --git a/packages/cosmos/tsup.config.cjs b/packages/cosmos/tsup.config.cjs index 9301c385..f702ea76 100644 --- a/packages/cosmos/tsup.config.cjs +++ b/packages/cosmos/tsup.config.cjs @@ -1,11 +1,13 @@ -const { NodeModulesPolyfillPlugin } = require("@esbuild-plugins/node-modules-polyfill"); +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); module.exports = { tsup: { entry: [ 'src/index.ts', 'src/signers/web.ts', - 'src/signers/react-native.ts' + 'src/signers/react-native.ts', ], format: 'cjs', splitting: false, @@ -14,13 +16,12 @@ module.exports = { types: [ './dist/index.d.ts', './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts' + './dist/signers/react-native.d.ts', ], platform: 'browser', target: 'ES6', external: ['crypto', 'stream', '@cosmjs'], - plugins: [ - NodeModulesPolyfillPlugin(), - ] - } -}; \ No newline at end of file + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; From f36221642ba88e80dcf377071474a67b2eb619ae Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 5 Jul 2024 13:03:27 +0000 Subject: [PATCH 044/176] Version packages --- .changeset/tasty-wolves-warn.md | 5 --- packages/cosmos/CHANGELOG.md | 6 ++++ packages/cosmos/package.json | 2 +- yarn.lock | 55 +++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 6 deletions(-) delete mode 100644 .changeset/tasty-wolves-warn.md diff --git a/.changeset/tasty-wolves-warn.md b/.changeset/tasty-wolves-warn.md deleted file mode 100644 index f8b51b59..00000000 --- a/.changeset/tasty-wolves-warn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -reduce size import osmojs diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index e59daffc..cbf331e6 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.23 + +### Patch Changes + +- ab92e93c: reduce size import osmojs + ## 2.0.22 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index e6a34d93..24ffe9a5 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.22", + "version": "2.0.23", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/yarn.lock b/yarn.lock index 2a748e60..4f2b5486 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8657,6 +8657,11 @@ capital-case@^1.0.4: tslib "^2.0.3" upper-case-first "^2.0.2" +case-anything@^2.1.13: + version "2.1.13" + resolved "https://registry.yarnpkg.com/case-anything/-/case-anything-2.1.13.tgz#0cdc16278cb29a7fcdeb072400da3f342ba329e9" + integrity sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng== + cashaddrjs@0.4.4: version "0.4.4" resolved "https://registry.npmjs.org/cashaddrjs/-/cashaddrjs-0.4.4.tgz" @@ -9767,6 +9772,13 @@ dotenv@^16.0.0: resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.1.tgz" integrity sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ== +dprint-node@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/dprint-node/-/dprint-node-1.0.8.tgz#a02470722d8208a7d7eb3704328afda1d6758625" + integrity sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg== + dependencies: + detect-libc "^1.0.3" + drbg.js@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz" @@ -15955,6 +15967,24 @@ protobufjs@^6.11.2, protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2: "@types/node" ">=13.7.0" long "^4.0.0" +protobufjs@^7.2.4: + version "7.3.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.3.2.tgz#60f3b7624968868f6f739430cfbc8c9370e26df4" + integrity sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + protocol-buffers-encodings@^1.1.0: version "1.2.0" resolved "https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.2.0.tgz" @@ -18373,6 +18403,31 @@ ts-node@10.7.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" +ts-poet@^6.7.0: + version "6.9.0" + resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-6.9.0.tgz#e63ac8d8a9e91a2e0e5d2bf0755db71346728bd2" + integrity sha512-roe6W6MeZmCjRmppyfOURklO5tQFQ6Sg7swURKkwYJvV7dbGCrK28um5+51iW3twdPRKtwarqFAVMU6G1mvnuQ== + dependencies: + dprint-node "^1.0.8" + +ts-proto-descriptors@1.16.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/ts-proto-descriptors/-/ts-proto-descriptors-1.16.0.tgz#e9f15d5d23774088f8573fa5a2d75130c64a565a" + integrity sha512-3yKuzMLpltdpcyQji1PJZRfoo4OJjNieKTYkQY8pF7xGKsYz/RHe3aEe4KiRxcinoBmnEhmuI+yJTxLb922ULA== + dependencies: + long "^5.2.3" + protobufjs "^7.2.4" + +ts-proto@^1.181.0: + version "1.181.0" + resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.181.0.tgz#9f87240c3cd9a6ac512fbbdab09ce51664f9c541" + integrity sha512-5+ZnxOgPsSn/lU93x8ApEFQPHE9G8kZubCSF1/EUjyeKImbGRp27iPXHilelQLOdClYHLUgr3hJwqtVqfsjNYQ== + dependencies: + case-anything "^2.1.13" + protobufjs "^7.2.4" + ts-poet "^6.7.0" + ts-proto-descriptors "1.16.0" + tsconfig-paths-webpack-plugin@4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.0.1.tgz" From 0c6e37ca1175d8d8366c662186f293ed9acba2ff Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:30:32 +0300 Subject: [PATCH 045/176] bump: version (#265) --- .changeset/proud-moose-grab.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/proud-moose-grab.md diff --git a/.changeset/proud-moose-grab.md b/.changeset/proud-moose-grab.md new file mode 100644 index 00000000..ec76e17a --- /dev/null +++ b/.changeset/proud-moose-grab.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-thor': patch +--- + +Feat: use nodeURL instead of rpcURL From b74ba3a10912302dac9ba43a545560984394381b Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 5 Jul 2024 14:33:01 +0000 Subject: [PATCH 046/176] Version packages --- .changeset/proud-moose-grab.md | 5 ----- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/proud-moose-grab.md diff --git a/.changeset/proud-moose-grab.md b/.changeset/proud-moose-grab.md deleted file mode 100644 index ec76e17a..00000000 --- a/.changeset/proud-moose-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch ---- - -Feat: use nodeURL instead of rpcURL diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 8c5983e2..5590033c 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.0.21 + +### Patch Changes + +- 5e307619: Feat: use nodeURL instead of rpcURL + ## 2.0.20 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index e886940d..3c66b198 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.20", + "version": "2.0.21", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 098115c865c0612b98943a6ed2a1e14734c20b9f Mon Sep 17 00:00:00 2001 From: dp <25910069+davidp94@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:40:24 +0300 Subject: [PATCH 047/176] fix: lint --- packages/evm/src/msg.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/evm/src/msg.spec.ts b/packages/evm/src/msg.spec.ts index 366f3357..3510db4e 100644 --- a/packages/evm/src/msg.spec.ts +++ b/packages/evm/src/msg.spec.ts @@ -1,10 +1,10 @@ import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import { ethers } from 'ethers'; + import erc20ABI from './consts/erc20.json'; import erc721ABI from './consts/erc721.json'; import erc1155ABI from './consts/erc1155.json'; - import { ChainMsg, MsgBody } from './msg'; describe('msg', () => { From f7fb560dec741e2999d6549ed287255c4efebd35 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Sat, 6 Jul 2024 13:16:04 +0100 Subject: [PATCH 048/176] bump: version (#266) --- .changeset/happy-games-promise.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/happy-games-promise.md diff --git a/.changeset/happy-games-promise.md b/.changeset/happy-games-promise.md new file mode 100644 index 00000000..5c7adb9a --- /dev/null +++ b/.changeset/happy-games-promise.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-thor': patch +--- + +use nodeURL instead of rpcURL && reduce size import osmojs From c7f18be543b4a8dff0a808ddaf2e457e8617ab66 Mon Sep 17 00:00:00 2001 From: cicd Date: Sat, 6 Jul 2024 12:18:26 +0000 Subject: [PATCH 049/176] Version packages --- .changeset/happy-games-promise.md | 6 ------ packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 .changeset/happy-games-promise.md diff --git a/.changeset/happy-games-promise.md b/.changeset/happy-games-promise.md deleted file mode 100644 index 5c7adb9a..00000000 --- a/.changeset/happy-games-promise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-thor': patch ---- - -use nodeURL instead of rpcURL && reduce size import osmojs diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index cbf331e6..7288b1e0 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.24 + +### Patch Changes + +- 34e22132: use nodeURL instead of rpcURL && reduce size import osmojs + ## 2.0.23 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 24ffe9a5..183e6973 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.23", + "version": "2.0.24", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 5590033c..92bd72d3 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.0.22 + +### Patch Changes + +- 34e22132: use nodeURL instead of rpcURL && reduce size import osmojs + ## 2.0.21 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 3c66b198..3c3ee1ad 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.21", + "version": "2.0.22", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From c74595f1d08855f9beb76dd0a4a978b869f304e5 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Sun, 7 Jul 2024 08:12:06 +0100 Subject: [PATCH 050/176] fix: evm ledger signer (#268) --- .changeset/warm-plums-visit.md | 5 +++++ packages/evm/src/signers/ledger.signer.ts | 25 ++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 .changeset/warm-plums-visit.md diff --git a/.changeset/warm-plums-visit.md b/.changeset/warm-plums-visit.md new file mode 100644 index 00000000..58e2044c --- /dev/null +++ b/.changeset/warm-plums-visit.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +fix: ledger signer diff --git a/packages/evm/src/signers/ledger.signer.ts b/packages/evm/src/signers/ledger.signer.ts index c77b8202..5effdcfe 100644 --- a/packages/evm/src/signers/ledger.signer.ts +++ b/packages/evm/src/signers/ledger.signer.ts @@ -1,7 +1,8 @@ import App from '@ledgerhq/hw-app-eth'; +import ledgerService from '@ledgerhq/hw-app-eth/lib/services/ledger'; import Transport from '@ledgerhq/hw-transport'; import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import { utils } from 'ethers'; +import { ethers, utils, UnsignedTransaction } from 'ethers'; import EthCrypto from 'eth-crypto'; import { ChainMsg, EncryptedObject, EIP712Data, Signature } from '../msg'; @@ -36,9 +37,8 @@ export class LedgerSigner extends Signer.Provider { async sign(msg: ChainMsg, derivation: string): Promise { const app = new App(this.transport as Transport); const txData = await msg.buildTx(); - const unsignedTx = { + const unsignedTx: UnsignedTransaction = { to: txData.to, - from: txData.from, chainId: parseInt(txData.chainId), nonce: Number(txData.nonce), gasLimit: txData.gasLimit, @@ -51,15 +51,20 @@ export class LedgerSigner extends Signer.Provider { data: txData.data, type: txData.type, }; + const rawTx = ethers.utils.serializeTransaction(unsignedTx).substring(2); + const resolution = await ledgerService.resolveTransaction(rawTx, {}, {}); + const rawSig = await app.signTransaction(derivation, rawTx, resolution); + const sig = { + v: ethers.BigNumber.from('0x' + rawSig.v).toNumber(), + r: '0x' + rawSig.r, + s: '0x' + rawSig.s, + }; - const rawTx = utils - .hexlify(Buffer.from(JSON.stringify(unsignedTx))) - .slice(2); - const signature = await app.signTransaction(derivation, rawTx); - const signedTransaction = utils.hexlify( - Buffer.from(JSON.stringify({ ...unsignedTx, ...signature })) + const signedTransaction = ethers.utils.serializeTransaction( + unsignedTx, + sig ); - msg.sign('0x' + signedTransaction); + msg.sign(signedTransaction); } // EIP 1024: Public Key Management From f46821015a1c37c1af1ecea15f57d1ff22f09a4b Mon Sep 17 00:00:00 2001 From: cicd Date: Sun, 7 Jul 2024 07:14:32 +0000 Subject: [PATCH 051/176] Version packages --- .changeset/warm-plums-visit.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/warm-plums-visit.md diff --git a/.changeset/warm-plums-visit.md b/.changeset/warm-plums-visit.md deleted file mode 100644 index 58e2044c..00000000 --- a/.changeset/warm-plums-visit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -fix: ledger signer diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 16b41960..e204a66d 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.34 + +### Patch Changes + +- 88df53e5: fix: ledger signer + ## 2.0.33 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 4c554489..63b2884c 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.33", + "version": "2.0.34", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 8db7c101f38745030f0405492160540a9e679236 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:35:55 +0100 Subject: [PATCH 052/176] feat: added bundle analysis on react app (#267) --- examples/react/next.config.js | 7 +++++-- examples/react/package.json | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/react/next.config.js b/examples/react/next.config.js index e308d308..db2fdd16 100644 --- a/examples/react/next.config.js +++ b/examples/react/next.config.js @@ -1,7 +1,10 @@ -module.exports = { +const withBundleAnalyzer = require('@next/bundle-analyzer')({ + enabled: process.env.ANALYZE === 'true', +}); +module.exports = withBundleAnalyzer({ reactStrictMode: true, webpack: function (config, options) { config.experiments = { asyncWebAssembly: true }; return config; } -}; +}); diff --git a/examples/react/package.json b/examples/react/package.json index 1349088e..0082622c 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -3,8 +3,8 @@ "version": "0.2.2", "private": true, "scripts": { - "dev": "next dev", - "start": "next start", + "dev": "ANALYZE=true next dev", + "start": "ANALYZE=true next start", "clean": "rimraf .next .turbo node_modules" }, "dependencies": { From b038b95b9c6f26b9e99f664f8b74a41ffe5836a9 Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Thu, 11 Jul 2024 20:03:37 +0700 Subject: [PATCH 053/176] Chore: add tsup config for all packages (skip node modules bundle) (#270) --- .changeset/little-lizards-mate.md | 17 ++++++++++ packages/binance/.eslintignore | 1 + packages/binance/jest-setup-file.ts | 13 ++++++++ packages/binance/package.json | 24 ++------------ .../binance/src/signers/trezor.signer.spec.ts | 33 +++++++++++++++++-- packages/binance/tsup.config.cjs | 27 +++++++++++++++ packages/bitcoin/jest-setup-file.ts | 10 ++++++ packages/bitcoin/package.json | 18 ---------- .../bitcoin/src/signers/trezor.signer.spec.ts | 26 ++++++++++++++- packages/bitcoin/tsup.config.cjs | 26 +++++++++++++++ packages/bitcoincash/jest-setup-file.ts | 10 ++++++ packages/bitcoincash/package.json | 18 ---------- .../src/signers/trezor.signer.spec.ts | 26 ++++++++++++++- packages/bitcoincash/tsup.config.cjs | 26 +++++++++++++++ packages/core/package.json | 16 --------- .../core/src/core/signer/trezor.provider.ts | 4 +-- packages/core/tsup.config.cjs | 7 ++-- packages/cosmos/.eslintignore | 3 +- packages/cosmos/jest-setup-file.ts | 13 ++++++++ packages/cosmos/package.json | 1 + packages/cosmos/src/chain.provider.spec.ts | 1 + packages/dogecoin/jest-setup-file.ts | 10 ++++++ packages/dogecoin/package.json | 18 ---------- .../src/signers/trezor.signer.spec.ts | 26 ++++++++++++++- packages/dogecoin/tsup.config.cjs | 26 +++++++++++++++ packages/evm/jest-setup-file.ts | 14 ++++++-- packages/evm/package.json | 33 ++++--------------- .../evm/src/signers/ledger.signer.spec.ts | 5 +++ packages/evm/src/signers/ledger.signer.ts | 8 ++--- .../src/signers/seed-phrase.signer.spec.ts | 1 + .../evm/src/signers/trezor.signer.spec.ts | 30 ++++++++++++++++- packages/evm/tsup.config.cjs | 27 +++++++++++++++ packages/litecoin/jest-setup-file.ts | 10 ++++++ packages/litecoin/package.json | 18 ---------- .../src/signers/trezor.signer.spec.ts | 26 ++++++++++++++- packages/litecoin/tsup.config.cjs | 26 +++++++++++++++ packages/solana/jest-setup-file.ts | 10 ++++++ packages/solana/package.json | 18 ---------- packages/solana/tsup.config.cjs | 26 +++++++++++++++ packages/thor/.eslintignore | 1 + packages/thor/jest-setup-file.ts | 13 ++++++++ packages/thor/package.json | 1 + packages/thor/tsup.config.cjs | 5 +-- packages/tron/jest-setup-file.ts | 10 ++++++ packages/tron/package.json | 18 ---------- packages/tron/tsup.config.cjs | 26 +++++++++++++++ packages/utxo/tsup.config.cjs | 17 ++++++++++ .../chains-controller/jest-setup-file.ts | 10 ++++++ 48 files changed, 560 insertions(+), 193 deletions(-) create mode 100644 .changeset/little-lizards-mate.md create mode 100644 packages/binance/jest-setup-file.ts create mode 100644 packages/binance/tsup.config.cjs create mode 100644 packages/bitcoin/tsup.config.cjs create mode 100644 packages/bitcoincash/tsup.config.cjs create mode 100644 packages/cosmos/jest-setup-file.ts create mode 100644 packages/dogecoin/tsup.config.cjs create mode 100644 packages/evm/tsup.config.cjs create mode 100644 packages/litecoin/tsup.config.cjs create mode 100644 packages/solana/tsup.config.cjs create mode 100644 packages/thor/jest-setup-file.ts create mode 100644 packages/tron/tsup.config.cjs create mode 100644 packages/utxo/tsup.config.cjs diff --git a/.changeset/little-lizards-mate.md b/.changeset/little-lizards-mate.md new file mode 100644 index 00000000..11e33a4c --- /dev/null +++ b/.changeset/little-lizards-mate.md @@ -0,0 +1,17 @@ +--- +'@xdefi-tech/chains-controller': patch +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-utxo': patch +'@xdefi-tech/chains-evm': patch +--- + +Feat: update builder and test cases environment diff --git a/packages/binance/.eslintignore b/packages/binance/.eslintignore index 393c8172..35f5038c 100644 --- a/packages/binance/.eslintignore +++ b/packages/binance/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.cjs dist node_modules +jest-setup-file.ts diff --git a/packages/binance/jest-setup-file.ts b/packages/binance/jest-setup-file.ts new file mode 100644 index 00000000..b724edaf --- /dev/null +++ b/packages/binance/jest-setup-file.ts @@ -0,0 +1,13 @@ +import 'reflect-metadata'; +import { TextEncoder, TextDecoder } from 'util'; +Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/binance/package.json b/packages/binance/package.json index a769b839..2743d608 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -53,32 +53,12 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "targer": "ES6", - "external": [ - "@binance-chain/javascript-sdk" - ] - }, "jest": { "setupFiles": [ + "./jest-setup-file.ts", "dotenv/config" ], - "preset": "ts-jest/presets/js-with-ts", + "preset": "ts-jest", "transform": { ".+\\.(t|j)s$": "ts-jest" }, diff --git a/packages/binance/src/signers/trezor.signer.spec.ts b/packages/binance/src/signers/trezor.signer.spec.ts index b82eb61b..c10f134d 100644 --- a/packages/binance/src/signers/trezor.signer.spec.ts +++ b/packages/binance/src/signers/trezor.signer.spec.ts @@ -1,4 +1,10 @@ -import { GetAddress, Params, Success, PROTO } from '@trezor/connect-web'; +import { + GetAddress, + Params, + Success, + PROTO, + parseConnectSettings, +} from '@trezor/connect-web'; import { ChainMsg, MsgBody } from '../msg'; import { BinanceProvider } from '../chain.provider'; @@ -32,6 +38,26 @@ jest.mock('@trezor/connect-web', () => ({ return addressResponse; }), + parseConnectSettings: jest.fn().mockImplementation(() => { + return { + configSrc: './data/config.json', + version: '9.1.4', + debug: false, + priority: 2, + trustedHost: true, + connectSrc: undefined, + iframeSrc: 'https://connect.trezor.io/9/iframe.html', + popup: false, + popupSrc: 'https://connect.trezor.io/9/popup.html', + webusbSrc: 'https://connect.trezor.io/9/webusb.html', + transports: undefined, + pendingTransportEvent: true, + env: 'web', + lazyLoad: false, + timestamp: 1720698767783, + interactionTimeout: 600, + }; + }), })); jest.mock('../datasource/indexer/queries/balances.query', () => ({ @@ -78,7 +104,10 @@ describe('trezor.signer', () => { }); it('should get an address from the trezor device', async () => { - await signer.initTrezor('test@test.com', 'localhost'); + await signer.initTrezor('test@test.com', 'localhost', { + ...parseConnectSettings(), + lazyLoad: true, + }); expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); diff --git a/packages/binance/tsup.config.cjs b/packages/binance/tsup.config.cjs new file mode 100644 index 00000000..6902cd90 --- /dev/null +++ b/packages/binance/tsup.config.cjs @@ -0,0 +1,27 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + external: ['@binance-chain/javascript-sdk'], + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/bitcoin/jest-setup-file.ts b/packages/bitcoin/jest-setup-file.ts index 07990058..b724edaf 100644 --- a/packages/bitcoin/jest-setup-file.ts +++ b/packages/bitcoin/jest-setup-file.ts @@ -1,3 +1,13 @@ import 'reflect-metadata'; import { TextEncoder, TextDecoder } from 'util'; Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index e085411b..5caf990e 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -64,24 +64,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/bitcoin/src/signers/trezor.signer.spec.ts b/packages/bitcoin/src/signers/trezor.signer.spec.ts index 5dcf6d4d..5955e5db 100644 --- a/packages/bitcoin/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoin/src/signers/trezor.signer.spec.ts @@ -3,6 +3,7 @@ import { GetAddress, Params, Success, + parseConnectSettings, } from '@trezor/connect-web'; import { ChainMsg, MsgBody } from '@xdefi-tech/chains-utxo'; @@ -35,6 +36,26 @@ jest.mock('@trezor/connect-web', () => ({ return addressResponse; }), + parseConnectSettings: jest.fn().mockImplementation(() => { + return { + configSrc: './data/config.json', + version: '9.1.4', + debug: false, + priority: 2, + trustedHost: true, + connectSrc: undefined, + iframeSrc: 'https://connect.trezor.io/9/iframe.html', + popup: false, + popupSrc: 'https://connect.trezor.io/9/popup.html', + webusbSrc: 'https://connect.trezor.io/9/webusb.html', + transports: undefined, + pendingTransportEvent: true, + env: 'web', + lazyLoad: false, + timestamp: 1720698767783, + interactionTimeout: 600, + }; + }), })); jest.mock('../datasource/indexer/queries/balances.query', () => ({ @@ -80,7 +101,10 @@ describe('trezor.signer', () => { }); it('should get an address from the trezor device', async () => { - await signer.initTrezor('test@test.com', 'localhost'); + await signer.initTrezor('test@test.com', 'localhost', { + ...parseConnectSettings(), + lazyLoad: true, + }); expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); diff --git a/packages/bitcoin/tsup.config.cjs b/packages/bitcoin/tsup.config.cjs new file mode 100644 index 00000000..042cde65 --- /dev/null +++ b/packages/bitcoin/tsup.config.cjs @@ -0,0 +1,26 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/bitcoincash/jest-setup-file.ts b/packages/bitcoincash/jest-setup-file.ts index 07990058..b724edaf 100644 --- a/packages/bitcoincash/jest-setup-file.ts +++ b/packages/bitcoincash/jest-setup-file.ts @@ -1,3 +1,13 @@ import 'reflect-metadata'; import { TextEncoder, TextDecoder } from 'util'; Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 12fef7e4..f5298088 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -67,24 +67,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/bitcoincash/src/signers/trezor.signer.spec.ts b/packages/bitcoincash/src/signers/trezor.signer.spec.ts index d4de7414..fd6254cc 100644 --- a/packages/bitcoincash/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoincash/src/signers/trezor.signer.spec.ts @@ -3,6 +3,7 @@ import { GetAddress, Params, Success, + parseConnectSettings, } from '@trezor/connect-web'; import { ChainMsg, MsgBody } from '@xdefi-tech/chains-utxo'; @@ -35,6 +36,26 @@ jest.mock('@trezor/connect-web', () => ({ return addressResponse; }), + parseConnectSettings: jest.fn().mockImplementation(() => { + return { + configSrc: './data/config.json', + version: '9.1.4', + debug: false, + priority: 2, + trustedHost: true, + connectSrc: undefined, + iframeSrc: 'https://connect.trezor.io/9/iframe.html', + popup: false, + popupSrc: 'https://connect.trezor.io/9/popup.html', + webusbSrc: 'https://connect.trezor.io/9/webusb.html', + transports: undefined, + pendingTransportEvent: true, + env: 'web', + lazyLoad: false, + timestamp: 1720698767783, + interactionTimeout: 600, + }; + }), })); jest.mock('../datasource/indexer/queries/balances.query', () => ({ @@ -80,7 +101,10 @@ describe('trezor.signer', () => { }); it('should get an address from the trezor device', async () => { - await signer.initTrezor('test@test.com', 'localhost'); + await signer.initTrezor('test@test.com', 'localhost', { + ...parseConnectSettings(), + lazyLoad: true, + }); expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); diff --git a/packages/bitcoincash/tsup.config.cjs b/packages/bitcoincash/tsup.config.cjs new file mode 100644 index 00000000..042cde65 --- /dev/null +++ b/packages/bitcoincash/tsup.config.cjs @@ -0,0 +1,26 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/core/package.json b/packages/core/package.json index 973da8da..d47a7ee2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -70,22 +70,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/index.ts", - "!src/**/*.spec.*", - "!src/custom.d.ts" - ], - "outDir": "dist", - "format": "cjs", - "splitting": false, - "dts": true, - "types": [ - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [], "preset": "ts-jest", diff --git a/packages/core/src/core/signer/trezor.provider.ts b/packages/core/src/core/signer/trezor.provider.ts index c241b01c..c9e12b57 100644 --- a/packages/core/src/core/signer/trezor.provider.ts +++ b/packages/core/src/core/signer/trezor.provider.ts @@ -66,8 +66,8 @@ export class TrezorProvider extends Provider { * Initializes Trezor Connection * * @param {string} email - The email of the client app. - * @param {string} url - The URL of the client app - * @param {ConnectSettings} url - Other optional configuration parameters for the Trezor Connection + * @param {string} appUrl - The URL of the client app + * @param {ConnectSettings} options - Other optional configuration parameters for the Trezor Connection * @returns {void} */ async initTrezor(email: string, appUrl: string, options?: ConnectSettings): Promise { diff --git a/packages/core/tsup.config.cjs b/packages/core/tsup.config.cjs index 601e454b..4cef9fb3 100644 --- a/packages/core/tsup.config.cjs +++ b/packages/core/tsup.config.cjs @@ -2,15 +2,16 @@ const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-pol module.exports = { tsup: { - entry: ['src/index.ts'], + entry: ['src/index.ts', '!src/**/*.spec.*', '!src/custom.d.ts'], + outDir: 'dist', format: ['esm', 'cjs'], - splitting: true, + splitting: false, dts: true, shims: true, types: ['./dist/index.d.ts'], platform: 'browser', target: 'ES6', - external: ['crypto', 'stream', '@cosmjs'], plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, }, }; diff --git a/packages/cosmos/.eslintignore b/packages/cosmos/.eslintignore index 58203d4a..71c4137e 100644 --- a/packages/cosmos/.eslintignore +++ b/packages/cosmos/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.cjs dist -node_modules \ No newline at end of file +node_modules +jest-setup-file.ts \ No newline at end of file diff --git a/packages/cosmos/jest-setup-file.ts b/packages/cosmos/jest-setup-file.ts new file mode 100644 index 00000000..b724edaf --- /dev/null +++ b/packages/cosmos/jest-setup-file.ts @@ -0,0 +1,13 @@ +import 'reflect-metadata'; +import { TextEncoder, TextDecoder } from 'util'; +Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 183e6973..b9eb1cbe 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -75,6 +75,7 @@ }, "jest": { "setupFiles": [ + "./jest-setup-file.ts", "dotenv/config" ], "preset": "ts-jest", diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index dca71c45..e93bbb1a 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -174,6 +174,7 @@ describe('chain.provider', () => { }); it('getFeeTokens(): should get a list of fee tokens', async () => { + jest.setTimeout(30000); const feeTokens = await provider.getFeeTokens(); expect(Array.isArray(feeTokens)).toBe(true); expect( diff --git a/packages/dogecoin/jest-setup-file.ts b/packages/dogecoin/jest-setup-file.ts index 07990058..b724edaf 100644 --- a/packages/dogecoin/jest-setup-file.ts +++ b/packages/dogecoin/jest-setup-file.ts @@ -1,3 +1,13 @@ import 'reflect-metadata'; import { TextEncoder, TextDecoder } from 'util'; Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 22e84f57..36f9eb2c 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -63,24 +63,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/dogecoin/src/signers/trezor.signer.spec.ts b/packages/dogecoin/src/signers/trezor.signer.spec.ts index 93dca831..5d858e7f 100644 --- a/packages/dogecoin/src/signers/trezor.signer.spec.ts +++ b/packages/dogecoin/src/signers/trezor.signer.spec.ts @@ -3,6 +3,7 @@ import { GetAddress, Params, Success, + parseConnectSettings, } from '@trezor/connect-web'; import { ChainMsg, MsgBody } from '@xdefi-tech/chains-utxo'; @@ -37,6 +38,26 @@ jest.mock('@trezor/connect-web', () => ({ return addressResponse; }), + parseConnectSettings: jest.fn().mockImplementation(() => { + return { + configSrc: './data/config.json', + version: '9.1.4', + debug: false, + priority: 2, + trustedHost: true, + connectSrc: undefined, + iframeSrc: 'https://connect.trezor.io/9/iframe.html', + popup: false, + popupSrc: 'https://connect.trezor.io/9/popup.html', + webusbSrc: 'https://connect.trezor.io/9/webusb.html', + transports: undefined, + pendingTransportEvent: true, + env: 'web', + lazyLoad: false, + timestamp: 1720698767783, + interactionTimeout: 600, + }; + }), })); jest.mock('../datasource/indexer/queries/balances.query', () => ({ @@ -107,7 +128,10 @@ describe('trezor.signer', () => { }); it('should get an address from the trezor device', async () => { - await signer.initTrezor('test@test.com', 'localhost'); + await signer.initTrezor('test@test.com', 'localhost', { + ...parseConnectSettings(), + lazyLoad: true, + }); expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); diff --git a/packages/dogecoin/tsup.config.cjs b/packages/dogecoin/tsup.config.cjs new file mode 100644 index 00000000..042cde65 --- /dev/null +++ b/packages/dogecoin/tsup.config.cjs @@ -0,0 +1,26 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/evm/jest-setup-file.ts b/packages/evm/jest-setup-file.ts index 03a7a63b..b724edaf 100644 --- a/packages/evm/jest-setup-file.ts +++ b/packages/evm/jest-setup-file.ts @@ -1,3 +1,13 @@ import 'reflect-metadata'; -import { TextEncoder } from 'util'; -global.TextEncoder = TextEncoder; +import { TextEncoder, TextDecoder } from 'util'; +Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/evm/package.json b/packages/evm/package.json index 63b2884c..111f573f 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -12,20 +12,20 @@ ], "devDependencies": { "@babel/preset-typescript": "7.21.0", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", "@types/jest": "27.4.1", "eslint-config-custom": "*", + "graphql": "16.6.0", "jest": "27.5.1", "jest-environment-jsdom": "27.5.1", "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3", - "@graphql-codegen/cli": "3.2.2", - "@graphql-codegen/client-preset": "2.1.1", - "@graphql-codegen/named-operations-object": "2.3.1", - "@graphql-codegen/near-operation-file-preset": "2.5.0", - "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0" + "typescript": "4.8.3" }, "dependencies": { "@ledgerhq/cryptoassets": "13.0.0", @@ -59,25 +59,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "outDir": "dist", - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/evm/src/signers/ledger.signer.spec.ts b/packages/evm/src/signers/ledger.signer.spec.ts index 080079d7..2ac0a040 100644 --- a/packages/evm/src/signers/ledger.signer.spec.ts +++ b/packages/evm/src/signers/ledger.signer.spec.ts @@ -21,6 +21,11 @@ jest.mock('@ledgerhq/hw-app-eth', () => { r: '0x2284d1273433b82201150965837d843b4978d50a26f1a93be3ee686c7f36ee6c', s: '0x40aafc22ba5cb3d5147e953af0acf45d768d8976dd61d8917118814302680421', }), + clearSignTransaction: jest.fn().mockResolvedValue({ + v: '1', + r: '2284d1273433b82201150965837d843b4978d50a26f1a93be3ee686c7f36ee6c', + s: '40aafc22ba5cb3d5147e953af0acf45d768d8976dd61d8917118814302680421', + }), getAddress: jest.fn().mockResolvedValue({ address: '0x62e4f988d231E16c9A666DD9220865934a347900', publicKey: 'PUBKEY', diff --git a/packages/evm/src/signers/ledger.signer.ts b/packages/evm/src/signers/ledger.signer.ts index 5effdcfe..b9f47ba4 100644 --- a/packages/evm/src/signers/ledger.signer.ts +++ b/packages/evm/src/signers/ledger.signer.ts @@ -1,8 +1,7 @@ import App from '@ledgerhq/hw-app-eth'; -import ledgerService from '@ledgerhq/hw-app-eth/lib/services/ledger'; import Transport from '@ledgerhq/hw-transport'; import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import { ethers, utils, UnsignedTransaction } from 'ethers'; +import { ethers, UnsignedTransaction } from 'ethers'; import EthCrypto from 'eth-crypto'; import { ChainMsg, EncryptedObject, EIP712Data, Signature } from '../msg'; @@ -52,8 +51,9 @@ export class LedgerSigner extends Signer.Provider { type: txData.type, }; const rawTx = ethers.utils.serializeTransaction(unsignedTx).substring(2); - const resolution = await ledgerService.resolveTransaction(rawTx, {}, {}); - const rawSig = await app.signTransaction(derivation, rawTx, resolution); + // const resolution = await ledgerService.resolveTransaction(rawTx, {}, {}); + // const rawSig = await app.signTransaction(derivation, rawTx, resolution); + const rawSig = await app.clearSignTransaction(derivation, rawTx, {}); const sig = { v: ethers.BigNumber.from('0x' + rawSig.v).toNumber(), r: '0x' + rawSig.r, diff --git a/packages/evm/src/signers/seed-phrase.signer.spec.ts b/packages/evm/src/signers/seed-phrase.signer.spec.ts index 470bbea0..bb1dae8f 100644 --- a/packages/evm/src/signers/seed-phrase.signer.spec.ts +++ b/packages/evm/src/signers/seed-phrase.signer.spec.ts @@ -81,6 +81,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a typed message using a seed phrase', async () => { + jest.setTimeout(15000); const record: Record> = { test: [{ name: 'test', type: 'string' }], }; diff --git a/packages/evm/src/signers/trezor.signer.spec.ts b/packages/evm/src/signers/trezor.signer.spec.ts index 8a123ef3..015bebee 100644 --- a/packages/evm/src/signers/trezor.signer.spec.ts +++ b/packages/evm/src/signers/trezor.signer.spec.ts @@ -4,6 +4,7 @@ import { GetAddress, Params, Success, + parseConnectSettings, } from '@trezor/connect-web'; import { EvmProvider } from '../chain.provider'; @@ -49,6 +50,26 @@ jest.mock('@trezor/connect-web', () => ({ }, }; }), + parseConnectSettings: jest.fn().mockImplementation(() => { + return { + configSrc: './data/config.json', + version: '9.1.4', + debug: false, + priority: 2, + trustedHost: true, + connectSrc: undefined, + iframeSrc: 'https://connect.trezor.io/9/iframe.html', + popup: false, + popupSrc: 'https://connect.trezor.io/9/popup.html', + webusbSrc: 'https://connect.trezor.io/9/webusb.html', + transports: undefined, + pendingTransportEvent: true, + env: 'web', + lazyLoad: false, + timestamp: 1720698767783, + interactionTimeout: 600, + }; + }), })); describe('trezor.signer', () => { @@ -89,12 +110,19 @@ describe('trezor.signer', () => { }); it('should get an address from the trezor device', async () => { - await signer.initTrezor('test@test.com', 'localhost'); + await signer.initTrezor('test@test.com', 'localhost', { + ...parseConnectSettings(), + lazyLoad: true, + }); expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); it('should sign a transaction using a trezor device', async () => { + await signer.initTrezor('test@test.com', 'localhost', { + ...parseConnectSettings(), + lazyLoad: true, + }); await signer.sign(message as ChainMsg, derivationPath); expect(message.signedTransaction).toBeTruthy(); diff --git a/packages/evm/tsup.config.cjs b/packages/evm/tsup.config.cjs new file mode 100644 index 00000000..9fbb9733 --- /dev/null +++ b/packages/evm/tsup.config.cjs @@ -0,0 +1,27 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + external: [], + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/litecoin/jest-setup-file.ts b/packages/litecoin/jest-setup-file.ts index 07990058..b724edaf 100644 --- a/packages/litecoin/jest-setup-file.ts +++ b/packages/litecoin/jest-setup-file.ts @@ -1,3 +1,13 @@ import 'reflect-metadata'; import { TextEncoder, TextDecoder } from 'util'; Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 14886607..0be1673a 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -64,24 +64,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/litecoin/src/signers/trezor.signer.spec.ts b/packages/litecoin/src/signers/trezor.signer.spec.ts index d0ff82f1..756c151d 100644 --- a/packages/litecoin/src/signers/trezor.signer.spec.ts +++ b/packages/litecoin/src/signers/trezor.signer.spec.ts @@ -3,6 +3,7 @@ import { GetAddress, Params, Success, + parseConnectSettings, } from '@trezor/connect-web'; import { ChainMsg, MsgBody } from '@xdefi-tech/chains-utxo'; @@ -35,6 +36,26 @@ jest.mock('@trezor/connect-web', () => ({ return addressResponse; }), + parseConnectSettings: jest.fn().mockImplementation(() => { + return { + configSrc: './data/config.json', + version: '9.1.4', + debug: false, + priority: 2, + trustedHost: true, + connectSrc: undefined, + iframeSrc: 'https://connect.trezor.io/9/iframe.html', + popup: false, + popupSrc: 'https://connect.trezor.io/9/popup.html', + webusbSrc: 'https://connect.trezor.io/9/webusb.html', + transports: undefined, + pendingTransportEvent: true, + env: 'web', + lazyLoad: false, + timestamp: 1720698767783, + interactionTimeout: 600, + }; + }), })); jest.mock('../datasource/indexer/queries/balances.query', () => ({ @@ -82,7 +103,10 @@ describe('trezor.signer', () => { }); it('should get an address from the trezor device', async () => { - await signer.initTrezor('test@test.com', 'localhost'); + await signer.initTrezor('test@test.com', 'localhost', { + ...parseConnectSettings(), + lazyLoad: true, + }); expect(await signer.getAddress(derivationPath)).toBe(txInput.from); }); diff --git a/packages/litecoin/tsup.config.cjs b/packages/litecoin/tsup.config.cjs new file mode 100644 index 00000000..042cde65 --- /dev/null +++ b/packages/litecoin/tsup.config.cjs @@ -0,0 +1,26 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/solana/jest-setup-file.ts b/packages/solana/jest-setup-file.ts index f41e7609..ad8b6e09 100644 --- a/packages/solana/jest-setup-file.ts +++ b/packages/solana/jest-setup-file.ts @@ -3,3 +3,13 @@ import 'reflect-metadata'; import XMLHttpRequest from 'xhr2'; global.XMLHttpRequest = XMLHttpRequest; + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/solana/package.json b/packages/solana/package.json index f9272365..49cdad2f 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -62,24 +62,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/solana/tsup.config.cjs b/packages/solana/tsup.config.cjs new file mode 100644 index 00000000..042cde65 --- /dev/null +++ b/packages/solana/tsup.config.cjs @@ -0,0 +1,26 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/thor/.eslintignore b/packages/thor/.eslintignore index 393c8172..35f5038c 100644 --- a/packages/thor/.eslintignore +++ b/packages/thor/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.cjs dist node_modules +jest-setup-file.ts diff --git a/packages/thor/jest-setup-file.ts b/packages/thor/jest-setup-file.ts new file mode 100644 index 00000000..b724edaf --- /dev/null +++ b/packages/thor/jest-setup-file.ts @@ -0,0 +1,13 @@ +import 'reflect-metadata'; +import { TextEncoder, TextDecoder } from 'util'; +Object.assign(global, { TextDecoder, TextEncoder }); + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/thor/package.json b/packages/thor/package.json index 3c3ee1ad..442f307a 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -65,6 +65,7 @@ }, "jest": { "setupFiles": [ + "./jest-setup-file.ts", "dotenv/config" ], "preset": "ts-jest/presets/js-with-ts", diff --git a/packages/thor/tsup.config.cjs b/packages/thor/tsup.config.cjs index b52c473b..071b1d2e 100644 --- a/packages/thor/tsup.config.cjs +++ b/packages/thor/tsup.config.cjs @@ -7,7 +7,7 @@ module.exports = { entry: [ 'src/index.ts', 'src/signers/web.ts', - 'src/signers/react-native.ts' + 'src/signers/react-native.ts', ], format: 'cjs', splitting: false, @@ -16,11 +16,12 @@ module.exports = { types: [ './dist/index.d.ts', './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts' + './dist/signers/react-native.d.ts', ], platform: 'browser', target: 'ES6', external: ['crypto', 'bip32'], plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, }, }; diff --git a/packages/tron/jest-setup-file.ts b/packages/tron/jest-setup-file.ts index f41e7609..ad8b6e09 100644 --- a/packages/tron/jest-setup-file.ts +++ b/packages/tron/jest-setup-file.ts @@ -3,3 +3,13 @@ import 'reflect-metadata'; import XMLHttpRequest from 'xhr2'; global.XMLHttpRequest = XMLHttpRequest; + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); diff --git a/packages/tron/package.json b/packages/tron/package.json index efd64f47..07f0e364 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -58,24 +58,6 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", - "tsup": { - "entry": [ - "src/signers/web.ts", - "src/signers/react-native.ts", - "src/index.ts" - ], - "format": "cjs", - "splitting": false, - "dts": true, - "shims": true, - "types": [ - "./dist/signers/web.d.ts", - "./dist/signers/react-native.d.ts", - "./dist/index.d.ts" - ], - "platform": "browser", - "target": "ES6" - }, "jest": { "setupFiles": [ "dotenv/config", diff --git a/packages/tron/tsup.config.cjs b/packages/tron/tsup.config.cjs new file mode 100644 index 00000000..042cde65 --- /dev/null +++ b/packages/tron/tsup.config.cjs @@ -0,0 +1,26 @@ +const { + NodeModulesPolyfillPlugin, +} = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: [ + 'src/index.ts', + 'src/signers/web.ts', + 'src/signers/react-native.ts', + ], + format: 'cjs', + splitting: false, + dts: true, + shims: true, + types: [ + './dist/index.d.ts', + './dist/signers/web.d.ts', + './dist/signers/react-native.d.ts', + ], + platform: 'browser', + target: 'ES6', + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/packages/utxo/tsup.config.cjs b/packages/utxo/tsup.config.cjs new file mode 100644 index 00000000..9b5ee8b3 --- /dev/null +++ b/packages/utxo/tsup.config.cjs @@ -0,0 +1,17 @@ +const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-polyfill'); + +module.exports = { + tsup: { + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + splitting: true, + dts: true, + shims: true, + types: ['./dist/index.d.ts'], + platform: 'browser', + target: 'ES6', + external: [], + plugins: [NodeModulesPolyfillPlugin()], + skipNodeModulesBundle: true, + }, +}; diff --git a/utility-packages/chains-controller/jest-setup-file.ts b/utility-packages/chains-controller/jest-setup-file.ts index d2c9bc6e..eb8f1fac 100644 --- a/utility-packages/chains-controller/jest-setup-file.ts +++ b/utility-packages/chains-controller/jest-setup-file.ts @@ -1 +1,11 @@ import 'reflect-metadata'; + +const crypto = require('crypto'); + +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: ( + arr: Array + ) => crypto.randomBytes(arr.length), + }, +}); From 7634777acd0cb28af32bab9b292a123ecdba9470 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 11 Jul 2024 13:06:05 +0000 Subject: [PATCH 054/176] Version packages --- .changeset/little-lizards-mate.md | 17 ----------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 9 +++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 9 +++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 9 +++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 9 +++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- packages/utxo/CHANGELOG.md | 8 ++++++++ packages/utxo/package.json | 2 +- utility-packages/chains-controller/CHANGELOG.md | 17 +++++++++++++++++ utility-packages/chains-controller/package.json | 2 +- 27 files changed, 128 insertions(+), 30 deletions(-) delete mode 100644 .changeset/little-lizards-mate.md diff --git a/.changeset/little-lizards-mate.md b/.changeset/little-lizards-mate.md deleted file mode 100644 index 11e33a4c..00000000 --- a/.changeset/little-lizards-mate.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@xdefi-tech/chains-controller': patch -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-utxo': patch -'@xdefi-tech/chains-evm': patch ---- - -Feat: update builder and test cases environment diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 2a925278..69395408 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.16 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + ## 2.0.15 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 2743d608..f154419a 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.15", + "version": "2.0.16", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index bdf501ab..60eaaa38 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoin +## 2.0.21 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + - @xdefi-tech/chains-utxo@2.0.11 + ## 2.0.20 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 5caf990e..7cdee481 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.20", + "version": "2.0.21", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index c5017b21..77fce5be 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.22 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + - @xdefi-tech/chains-utxo@2.0.11 + ## 2.0.21 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index f5298088..e2cc08ef 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.21", + "version": "2.0.22", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 90df91d1..2adf81f9 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.20 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment + ## 2.0.19 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index d47a7ee2..43b30c61 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.19", + "version": "2.0.20", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 7288b1e0..338e88ad 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.25 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + ## 2.0.24 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index b9eb1cbe..af492516 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.24", + "version": "2.0.25", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 7ad87b70..f063a813 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-dogecoin +## 2.0.21 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + - @xdefi-tech/chains-utxo@2.0.11 + ## 2.0.20 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 36f9eb2c..e08b204b 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.20", + "version": "2.0.21", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index e204a66d..97eddf01 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.35 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + ## 2.0.34 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 111f573f..a412b64e 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.34", + "version": "2.0.35", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index ae01aae2..9b6ddd82 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-litecoin +## 2.0.19 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + - @xdefi-tech/chains-utxo@2.0.11 + ## 2.0.18 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 0be1673a..2d621970 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.18", + "version": "2.0.19", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index dd23ac27..5bbad18b 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.23 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + ## 2.0.22 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 49cdad2f..2be6b895 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.22", + "version": "2.0.23", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 92bd72d3..a71bf461 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.0.23 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + ## 2.0.22 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 442f307a..b3ff7d17 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.22", + "version": "2.0.23", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index a2fa50e3..9c9b2cbb 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.22 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + ## 2.0.21 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 07f0e364..a3fdfe33 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.21", + "version": "2.0.22", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index 2279478c..13282b9a 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-utxo +## 2.0.11 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-core@2.0.20 + ## 2.0.10 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index d49b9fae..d041a45a 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.10", + "version": "2.0.11", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/utility-packages/chains-controller/CHANGELOG.md b/utility-packages/chains-controller/CHANGELOG.md index 102c3f7e..b727e480 100644 --- a/utility-packages/chains-controller/CHANGELOG.md +++ b/utility-packages/chains-controller/CHANGELOG.md @@ -1,5 +1,22 @@ # @xdefi-tech/chains-controller +## 2.0.7 + +### Patch Changes + +- f593f316: Feat: update builder and test cases environment +- Updated dependencies [f593f316] + - @xdefi-tech/chains-bitcoincash@2.0.22 + - @xdefi-tech/chains-dogecoin@2.0.21 + - @xdefi-tech/chains-litecoin@2.0.19 + - @xdefi-tech/chains-binance@2.0.16 + - @xdefi-tech/chains-bitcoin@2.0.21 + - @xdefi-tech/chains-cosmos@2.0.25 + - @xdefi-tech/chains-solana@2.0.23 + - @xdefi-tech/chains-core@2.0.20 + - @xdefi-tech/chains-thor@2.0.23 + - @xdefi-tech/chains-evm@2.0.35 + ## 2.0.6 ### Patch Changes diff --git a/utility-packages/chains-controller/package.json b/utility-packages/chains-controller/package.json index 6720b763..f1438ab1 100644 --- a/utility-packages/chains-controller/package.json +++ b/utility-packages/chains-controller/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-controller", - "version": "2.0.6", + "version": "2.0.7", "license": "MIT", "repository": "https://github.com/XDeFi-tech/chains/", "main": "dist/index.js", From 73de4b6857889d2d0057ae6456ea8e74ce700e38 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:15:52 +0700 Subject: [PATCH 055/176] feat: improve msg and provider (#274) Co-authored-by: sotatek-tyler-nguyen4 --- packages/binance/src/chain.provider.ts | 2 +- .../binance/src/signers/ledger.signer.spec.ts | 7 +++--- .../src/signers/private-key.signer.spec.ts | 10 ++++----- .../src/signers/seed-phrase.signer.spec.ts | 8 +++---- .../binance/src/signers/trezor.signer.spec.ts | 4 ++-- packages/bitcoin/src/chain.provider.ts | 7 ++---- packages/bitcoin/src/msg.ts | 12 +++++++++- .../bitcoin/src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 6 ++--- .../src/signers/seed-phrase.signer.spec.ts | 6 ++--- .../bitcoin/src/signers/trezor.signer.spec.ts | 6 ++--- packages/bitcoincash/src/chain.provider.ts | 2 +- packages/bitcoincash/src/msg.ts | 13 ++++++++++- .../src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 6 ++--- .../src/signers/seed-phrase.signer.spec.ts | 6 ++--- .../src/signers/trezor.signer.spec.ts | 4 ++-- .../core/src/core/chain/chain.provider.ts | 10 ++++----- .../src/core/datasource/base.data-source.ts | 1 + .../core/src/core/signer/signer.provider.ts | 6 ++--- .../core/src/core/signer/trezor.provider.ts | 4 ++-- packages/cosmos/README.md | 4 ++-- packages/cosmos/src/chain.provider.spec.ts | 5 +---- packages/cosmos/src/chain.provider.ts | 8 +++---- .../cosmos/src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 8 +++---- .../src/signers/seed-phrase.signer.spec.ts | 9 ++++---- packages/dogecoin/src/chain.provider.ts | 2 +- packages/dogecoin/src/msg.ts | 13 ++++++++++- .../src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 6 ++--- .../src/signers/seed-phrase.signer.spec.ts | 6 ++--- .../src/signers/trezor.signer.spec.ts | 4 ++-- packages/evm/src/chain.provider.ts | 4 ++-- .../evm/src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 10 ++++----- .../src/signers/seed-phrase.signer.spec.ts | 22 ++++--------------- .../evm/src/signers/trezor.signer.spec.ts | 6 ++--- packages/litecoin/src/chain.provider.ts | 2 +- packages/litecoin/src/msg.ts | 13 ++++++++++- .../src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 6 ++--- .../src/signers/seed-phrase.signer.spec.ts | 6 ++--- .../src/signers/trezor.signer.spec.ts | 4 ++-- packages/solana/src/chain.provider.ts | 4 ++-- .../solana/src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 10 ++++----- .../src/signers/seed-phrase.signer.spec.ts | 14 ++++++------ packages/thor/src/chain.provider.ts | 7 ++---- .../thor/src/signers/ledger.signer.spec.ts | 5 ++--- .../src/signers/private-key.signer.spec.ts | 8 +++---- .../src/signers/seed-phrase.signer.spec.ts | 8 +++---- packages/tron/src/chain.provider.ts | 4 ++-- .../tron/src/signers/ledger.signer.spec.ts | 9 ++++---- packages/utxo/src/chain.provider.ts | 12 ++++++---- packages/utxo/src/msg.ts | 15 +++++++++++-- 56 files changed, 194 insertions(+), 195 deletions(-) diff --git a/packages/binance/src/chain.provider.ts b/packages/binance/src/chain.provider.ts index 829c3555..94e75c2b 100644 --- a/packages/binance/src/chain.provider.ts +++ b/packages/binance/src/chain.provider.ts @@ -25,7 +25,7 @@ import { ChainMsg, MsgBody } from './msg'; providerType: 'Binance', features: [Chain.ChainFeatures.TOKENS], }) -export class BinanceProvider extends Chain.Provider { +export class BinanceProvider extends Chain.Provider { public rpcProvider: BncClient; public rest: Axios; diff --git a/packages/binance/src/signers/ledger.signer.spec.ts b/packages/binance/src/signers/ledger.signer.spec.ts index ce45f756..9e024981 100644 --- a/packages/binance/src/signers/ledger.signer.spec.ts +++ b/packages/binance/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg, GasFeeSpeed } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { BinanceProvider } from '../chain.provider'; @@ -37,7 +36,7 @@ describe('binance::ledger.signer', () => { let derivationPath: string; let provider: BinanceProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -66,7 +65,7 @@ describe('binance::ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); @@ -76,7 +75,7 @@ describe('binance::ledger.signer', () => { }); it('should return FeeEstimation', async () => { - const feeEstimation = await message.getFee(GasFeeSpeed.medium); + const feeEstimation = await message.getFee(); expect(feeEstimation); }); }); diff --git a/packages/binance/src/signers/private-key.signer.spec.ts b/packages/binance/src/signers/private-key.signer.spec.ts index 112fb0ae..230ec97d 100644 --- a/packages/binance/src/signers/private-key.signer.spec.ts +++ b/packages/binance/src/signers/private-key.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg, GasFeeSpeed } from '@xdefi-tech/chains-core'; - import { BinanceProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { BINANCE_MANIFEST } from '../manifests'; @@ -18,7 +16,7 @@ describe('private-key.signer', () => { let signer: PrivateKeySigner; let provider: BinanceProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { privateKey = @@ -42,9 +40,9 @@ describe('private-key.signer', () => { }); it('should sign a transaction using a private key', async () => { - await signer.sign(message as ChainMsg); + await signer.sign(message); - expect(message.signedTransaction.toString('hex')).toBeTruthy(); + expect(message.signedTransaction).toBeTruthy(); }); it('should get a private key', async () => { @@ -52,7 +50,7 @@ describe('private-key.signer', () => { }); it('should return FeeEstimation', async () => { - const feeEstimation = await message.getFee(GasFeeSpeed.medium); + const feeEstimation = await message.getFee(); expect(feeEstimation); }); }); diff --git a/packages/binance/src/signers/seed-phrase.signer.spec.ts b/packages/binance/src/signers/seed-phrase.signer.spec.ts index de2b011f..78619742 100644 --- a/packages/binance/src/signers/seed-phrase.signer.spec.ts +++ b/packages/binance/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg, GasFeeSpeed } from '@xdefi-tech/chains-core'; - import { BinanceProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { BINANCE_MANIFEST } from '../manifests'; @@ -14,7 +12,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: BinanceProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let derivation: string; beforeEach(() => { @@ -41,7 +39,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a transaction using a private key', async () => { - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction).toBeTruthy(); }); @@ -53,7 +51,7 @@ describe('seed-phrase.signer', () => { }); it('should return FeeEstimation', async () => { - const feeEstimation = await message.getFee(GasFeeSpeed.medium); + const feeEstimation = await message.getFee(); expect(feeEstimation); }); }); diff --git a/packages/binance/src/signers/trezor.signer.spec.ts b/packages/binance/src/signers/trezor.signer.spec.ts index c10f134d..b7a303dc 100644 --- a/packages/binance/src/signers/trezor.signer.spec.ts +++ b/packages/binance/src/signers/trezor.signer.spec.ts @@ -93,7 +93,7 @@ describe('trezor.signer', () => { it('should fail signing if trezor device is not initialized', async () => { expect(async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); }).rejects.toThrow('Trezor connection is not initialized yet!'); }); @@ -113,7 +113,7 @@ describe('trezor.signer', () => { }); it('should sign a transaction using a trezor device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toEqual('SIGNED'); }); diff --git a/packages/bitcoin/src/chain.provider.ts b/packages/bitcoin/src/chain.provider.ts index 02302986..d78551fb 100644 --- a/packages/bitcoin/src/chain.provider.ts +++ b/packages/bitcoin/src/chain.provider.ts @@ -16,7 +16,7 @@ import { ChainMsg, MsgBody } from './msg'; providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class BitcoinProvider extends UtxoProvider { +export class BitcoinProvider extends UtxoProvider { declare dataSource: IndexerDataSource; static get dataSourceList() { @@ -25,10 +25,7 @@ export class BitcoinProvider extends UtxoProvider { }; } - createMsg( - data: MsgBody, - encoding: MsgEncoding = MsgEncoding.object - ): ChainMsg { + createMsg(data: MsgBody, encoding: MsgEncoding = MsgEncoding.object) { return new ChainMsg(data, this, encoding); } diff --git a/packages/bitcoin/src/msg.ts b/packages/bitcoin/src/msg.ts index aec24949..3cdf51c5 100644 --- a/packages/bitcoin/src/msg.ts +++ b/packages/bitcoin/src/msg.ts @@ -24,7 +24,17 @@ export interface MsgBody { nftId?: string; } -export class ChainMsg extends BaseMsg { +export interface TxBody { + to: string; + from: string; + inputs: UTXO[]; + outputs: { address?: string; script?: Buffer; value: number }[]; + utxos: UTXO[]; + fee: string; + compiledMemo?: '' | Buffer; +} + +export class ChainMsg extends BaseMsg { declare signedTransaction: string | null; constructor( diff --git a/packages/bitcoin/src/signers/ledger.signer.spec.ts b/packages/bitcoin/src/signers/ledger.signer.spec.ts index 30bfa995..80bdb9de 100644 --- a/packages/bitcoin/src/signers/ledger.signer.spec.ts +++ b/packages/bitcoin/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { BitcoinProvider } from '../chain.provider'; @@ -70,7 +69,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: BitcoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -101,7 +100,7 @@ describe('ledger.signer', () => { jest.setTimeout(15000); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toEqual( '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a536c070000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302483045022100aebc0d5d7ae241077cb33e635ef36cf347674c0468051e5c4fab6d919d52ddf102203609428e2d61c4ab7208ab78801f45215d5a32b037be4257ca22fb85f585188f012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' diff --git a/packages/bitcoin/src/signers/private-key.signer.spec.ts b/packages/bitcoin/src/signers/private-key.signer.spec.ts index 71602c10..c67dc6d6 100644 --- a/packages/bitcoin/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoin/src/signers/private-key.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { BitcoinProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { BITCOIN_MANIFEST } from '../manifests'; @@ -67,7 +65,7 @@ describe('private-key.signer', () => { let signer: PrivateKeySigner; let provider: BitcoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { privateKey = 'KyaowqfYE7mJmTYEpxPJmAXwErQQY6KdDRynbg7SQPTAvC3bLNmF'; @@ -92,7 +90,7 @@ describe('private-key.signer', () => { jest.setTimeout(15000); it('should sign a transaction using a private key', async () => { - await signer.sign(message as ChainMsg); + await signer.sign(message); expect(message.signedTransaction).toEqual( '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5399040000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022063256998af5b4eb17aab21bfe3db37fda7716561a2df0e58870c237a59a7abf10220407ad63ee39943fb5d1bfcd5808dcde4c72940202f6758f6420888b7975202a7012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts index ca8b0deb..aa676541 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { BitcoinProvider } from '../chain.provider'; import { BITCOIN_MANIFEST } from '../manifests'; import { ChainMsg, MsgBody } from '../msg'; @@ -68,7 +66,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: BitcoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { seedPhrase = @@ -96,7 +94,7 @@ describe('seed-phrase.signer', () => { jest.setTimeout(15000); it('should sign a transaction using the seed phrase', async () => { - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction).toEqual( '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5399040000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022063256998af5b4eb17aab21bfe3db37fda7716561a2df0e58870c237a59a7abf10220407ad63ee39943fb5d1bfcd5808dcde4c72940202f6758f6420888b7975202a7012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' diff --git a/packages/bitcoin/src/signers/trezor.signer.spec.ts b/packages/bitcoin/src/signers/trezor.signer.spec.ts index 5955e5db..54d299d3 100644 --- a/packages/bitcoin/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoin/src/signers/trezor.signer.spec.ts @@ -5,11 +5,11 @@ import { Success, parseConnectSettings, } from '@trezor/connect-web'; -import { ChainMsg, MsgBody } from '@xdefi-tech/chains-utxo'; import { BitcoinProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { BITCOIN_MANIFEST } from '../manifests'; +import { ChainMsg, MsgBody } from '../msg'; import TrezorSigner from './trezor.signer'; jest.mock('@trezor/connect-web', () => ({ @@ -90,7 +90,7 @@ describe('trezor.signer', () => { it('should fail signing if trezor device is not initialized', async () => { expect(async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); }).rejects.toThrow('Trezor connection is not initialized yet!'); }); @@ -112,7 +112,7 @@ describe('trezor.signer', () => { jest.setTimeout(15000); it('should sign a transaction using a trezor device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/bitcoincash/src/chain.provider.ts b/packages/bitcoincash/src/chain.provider.ts index 13b71223..9b923abc 100644 --- a/packages/bitcoincash/src/chain.provider.ts +++ b/packages/bitcoincash/src/chain.provider.ts @@ -16,7 +16,7 @@ import { ChainMsg } from './msg'; providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class BitcoinCashProvider extends UtxoProvider { +export class BitcoinCashProvider extends UtxoProvider { declare dataSource: IndexerDataSource; createMsg( diff --git a/packages/bitcoincash/src/msg.ts b/packages/bitcoincash/src/msg.ts index 079c0750..b18b6d97 100644 --- a/packages/bitcoincash/src/msg.ts +++ b/packages/bitcoincash/src/msg.ts @@ -9,6 +9,7 @@ import { import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; +import { UTXO } from '@xdefi-tech/chains-utxo'; import type { BitcoinCashProvider } from './chain.provider'; @@ -21,7 +22,17 @@ export interface MsgBody { decimals?: number; } -export class ChainMsg extends BaseMsg { +export interface TxBody { + to: string; + from: string; + inputs: UTXO[]; + outputs: { address?: string; script?: Buffer; value: number }[]; + utxos: UTXO[]; + fee: string; + compiledMemo?: '' | Buffer; +} + +export class ChainMsg extends BaseMsg { declare signedTransaction: string | null; constructor( diff --git a/packages/bitcoincash/src/signers/ledger.signer.spec.ts b/packages/bitcoincash/src/signers/ledger.signer.spec.ts index b4afdbc9..cd969110 100644 --- a/packages/bitcoincash/src/signers/ledger.signer.spec.ts +++ b/packages/bitcoincash/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { BitcoinCashProvider } from '../chain.provider'; @@ -62,7 +61,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: BitcoinCashProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -92,7 +91,7 @@ describe('ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toEqual('SIGNEDTX'); }); diff --git a/packages/bitcoincash/src/signers/private-key.signer.spec.ts b/packages/bitcoincash/src/signers/private-key.signer.spec.ts index e54dcd16..b7a65ea8 100644 --- a/packages/bitcoincash/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoincash/src/signers/private-key.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { BitcoinCashProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { BITCOINCASH_MANIFEST } from '../manifests'; @@ -59,7 +57,7 @@ describe('private-key.signer', () => { let signer: PrivateKeySigner; let provider: BitcoinCashProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { privateKey = 'Kz1YMmxrFVd2uyCnEHT546Bjw3Wime47AoTQeYATUCSsuirJczu5'; @@ -83,7 +81,7 @@ describe('private-key.signer', () => { }); it('should sign a transaction using a private key', async () => { - await signer.sign(message as ChainMsg); + await signer.sign(message); expect(message.signedTransaction).toEqual( '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100d14a8a5e39396e6e12c696bf0ab72a6c366492f134427671e6802b44d5894c06022038eff7ab48600dbe7fe26baee098f0b5810f2a6d5738d471ba5984377823fadf41210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac180b0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' diff --git a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts index f9629a5e..65ff3a58 100644 --- a/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoincash/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { BitcoinCashProvider } from '../chain.provider'; import { BITCOINCASH_MANIFEST } from '../manifests'; import { ChainMsg, MsgBody } from '../msg'; @@ -60,7 +58,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: BitcoinCashProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { seedPhrase = @@ -89,7 +87,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a transaction using the seed phrase', async () => { - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction).toEqual( '02000000012e7931eb31528682bb962a260339b4dfb3b6b786f699597448de9baaa67fe003000000006b483045022100d14a8a5e39396e6e12c696bf0ab72a6c366492f134427671e6802b44d5894c06022038eff7ab48600dbe7fe26baee098f0b5810f2a6d5738d471ba5984377823fadf41210398c7d1ac211564fa1243fa250debac08f822a0e98490ac365d528918b019da1bffffffff0264000000000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac180b0300000000001976a9140f02db7c27cbd66e994fa5f4426c298ef2225e8688ac00000000' diff --git a/packages/bitcoincash/src/signers/trezor.signer.spec.ts b/packages/bitcoincash/src/signers/trezor.signer.spec.ts index fd6254cc..2030eb50 100644 --- a/packages/bitcoincash/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoincash/src/signers/trezor.signer.spec.ts @@ -90,7 +90,7 @@ describe('trezor.signer', () => { it('should fail signing if trezor device is not initialized', async () => { expect(async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); }).rejects.toThrow('Trezor connection is not initialized yet!'); }); @@ -110,7 +110,7 @@ describe('trezor.signer', () => { }); it('should sign a transaction using a trezor device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/core/src/core/chain/chain.provider.ts b/packages/core/src/core/chain/chain.provider.ts index a5536181..530a727d 100644 --- a/packages/core/src/core/chain/chain.provider.ts +++ b/packages/core/src/core/chain/chain.provider.ts @@ -40,7 +40,7 @@ export interface DataSourceList { * ``` */ @Injectable() -export abstract class Provider { +export abstract class Provider { public readonly rpcProvider: any; public readonly id: string; @@ -119,7 +119,7 @@ export abstract class Provider { * @returns {Promise} - A promise that resolves with an array of Transaction objects that correspond to the broadcasted messages. * @throws {Error} - Throws an error if any of the messages in the input array do not have a signature. */ - abstract broadcast(msgs: Msg[]): Promise; + abstract broadcast(msgs: ChainMsg[]): Promise; /** * Creates a new instance of a message. @@ -128,7 +128,7 @@ export abstract class Provider { * @param encoding Type for parsing and building transacrion * @returns A new instance of a message. */ - abstract createMsg(data: MsgData, encoding: MsgEncoding): Msg; + abstract createMsg(data: MsgData, encoding: MsgEncoding): ChainMsg; /** * Retrieves the current gas fee options for the chain, including base and priority fees per gas for EIP-1559 chains. @@ -162,9 +162,9 @@ export abstract class Provider { * * @returns A promise that resolves to the transaction hash of the broadcasted transaction. */ - public async signAndBroadcast(derivation: string, signer: SignerProvider, msgs: Msg[]) { + public async signAndBroadcast(derivation: string, signer: SignerProvider, msgs: ChainMsg[]) { for await (const msg of msgs) { - const signature = await signer.sign(derivation, msg.toData()); + const signature = await signer.sign(msg, derivation); msg.sign(signature); } diff --git a/packages/core/src/core/datasource/base.data-source.ts b/packages/core/src/core/datasource/base.data-source.ts index 6d771893..a2b98313 100644 --- a/packages/core/src/core/datasource/base.data-source.ts +++ b/packages/core/src/core/datasource/base.data-source.ts @@ -3,6 +3,7 @@ import { Observable } from 'rxjs'; import { Manifest } from '../chain'; import { Coin, FeeOptions, GasFeeSpeed, Msg, Transaction, TransactionData } from '../../core'; import { FeeData } from '../interfaces'; +import { NfTv3 } from '../../common/graphql'; export interface BalanceFilter { address: string; diff --git a/packages/core/src/core/signer/signer.provider.ts b/packages/core/src/core/signer/signer.provider.ts index f6bd97d6..542fe89e 100644 --- a/packages/core/src/core/signer/signer.provider.ts +++ b/packages/core/src/core/signer/signer.provider.ts @@ -1,5 +1,5 @@ import { Injectable } from '../../common'; -import { MsgData } from '../msg'; +import { Msg } from '../msg'; @Injectable() export abstract class Provider { @@ -24,8 +24,8 @@ export abstract class Provider { * @param {any} rest - rest props for custom signer * @returns {Promise} A promise that resolves to the signature. */ - abstract sign(msg: MsgData, derivation: string, ...rest: any): Promise; - abstract sign(msg: MsgData, ...rest: any): Promise; + abstract sign(msg: Msg, derivation: string, ...rest: any): Promise; + abstract sign(msg: Msg, ...rest: any): Promise; async getPrivateKey(_derivation: string, ..._rest: any): Promise { throw new Error('Method not implemented.'); diff --git a/packages/core/src/core/signer/trezor.provider.ts b/packages/core/src/core/signer/trezor.provider.ts index c9e12b57..9688990a 100644 --- a/packages/core/src/core/signer/trezor.provider.ts +++ b/packages/core/src/core/signer/trezor.provider.ts @@ -1,6 +1,6 @@ import TrezorConnect, { ConnectSettings } from '@trezor/connect-web'; -import { MsgData } from '../msg'; +import { Msg } from '../msg'; import { Provider } from './signer.provider'; @@ -43,7 +43,7 @@ export class TrezorProvider extends Provider { * @param {any} _rest - rest props for custom signer * @returns {Promise} A promise that resolves to the signature. */ - async sign(_msg: MsgData, ..._rest: any): Promise { + async sign(_msg: Msg, ..._rest: any): Promise { throw new Error('Method must be implented in an inhereted class'); } diff --git a/packages/cosmos/README.md b/packages/cosmos/README.md index 95b9e7b0..61f8ea04 100644 --- a/packages/cosmos/README.md +++ b/packages/cosmos/README.md @@ -97,7 +97,7 @@ const estimateAbstractionFee = await provider.calculateFeeAbs( const msg = provider.createMsg(txInputWithAbsFee); // Sign the tx - await signer.sign(msg as ChainMsg, derivation); + await signer.sign(msg, derivation); // Send tx to the chain - const tx = await provider.broadcast([msg as ChainMsg]); + const tx = await provider.broadcast([msg]); ``` diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index e93bbb1a..4adda9da 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -201,10 +201,7 @@ describe('chain.provider', () => { }, }; const msg = provider.createMsg(txInput); - const estimateFee = await provider.estimateFee( - [msg as ChainMsg], - GasFeeSpeed.low - ); + const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.low); expect(estimateFee[0].gasLimit).toBeTruthy(); }); }); diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index c59d5497..9d581dbc 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -55,7 +55,7 @@ export interface IBCData { providerType: 'Cosmos', features: [Chain.ChainFeatures.TOKENS], }) -export class CosmosProvider extends Chain.Provider { +export class CosmosProvider extends Chain.Provider { declare rpcProvider: LcdClient; private readonly lcdAxiosClient: AxiosInstance; declare dataSource: ChainDataSource | IndexerDataSource; @@ -73,7 +73,7 @@ export class CosmosProvider extends Chain.Provider { }); } - createMsg(data: MsgData, encoding: MsgEncoding = MsgEncoding.object): Msg { + createMsg(data: MsgData, encoding: MsgEncoding = MsgEncoding.object) { return new ChainMsg(data, this, encoding); } @@ -87,8 +87,8 @@ export class CosmosProvider extends Chain.Provider { ); } - async estimateFee(msgs: Msg[], speed: GasFeeSpeed): Promise { - return this.dataSource.estimateFee(msgs as ChainMsg[], speed); + async estimateFee(msgs: ChainMsg[], speed: GasFeeSpeed): Promise { + return this.dataSource.estimateFee(msgs, speed); } async getFeeTokens() { diff --git a/packages/cosmos/src/signers/ledger.signer.spec.ts b/packages/cosmos/src/signers/ledger.signer.spec.ts index 98a4e876..28f64ea4 100644 --- a/packages/cosmos/src/signers/ledger.signer.spec.ts +++ b/packages/cosmos/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { bech32 } from 'bech32'; import { Hash, PrivKeySecp256k1 } from '@keplr-wallet/crypto'; @@ -63,7 +62,7 @@ describe('cosmos::ledger.signer', () => { let derivationPath: string; let provider: CosmosProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -95,7 +94,7 @@ describe('cosmos::ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath, 'cosmos'); + await signer.sign(message, derivationPath, 'cosmos'); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index 1584df28..c6b3f258 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -1,4 +1,4 @@ -import { Msg, MsgEncoding } from '@xdefi-tech/chains-core'; +import { MsgEncoding } from '@xdefi-tech/chains-core'; import { Hash, PrivKeySecp256k1 } from '@keplr-wallet/crypto'; import { bech32 } from 'bech32'; import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; @@ -23,7 +23,7 @@ describe('private-key.signer', () => { let terraSigner: PrivateKeySigner; let provider: CosmosProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let derivations: CosmosHdPathTypes; let backendSwapTransaction: any; @@ -111,7 +111,7 @@ describe('private-key.signer', () => { }); it('should sign a transaction using a private key', async () => { - await cosmosSigner.sign(message as ChainMsg); + await cosmosSigner.sign(message); expect(message.signedTransaction).toBeTruthy(); }); @@ -121,7 +121,7 @@ describe('private-key.signer', () => { { data: backendSwapTransaction.unsignedStdTx }, MsgEncoding.string ); - await cosmosSigner.sign(msg as ChainMsg); + await cosmosSigner.sign(msg); expect(msg.signedTransaction).toBeTruthy(); }); diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index 6e957130..03bb6879 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import { Hash, PrivKeySecp256k1 } from '@keplr-wallet/crypto'; import { bech32 } from 'bech32'; import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; @@ -46,7 +45,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: CosmosProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let derivations: CosmosHdPathTypes; beforeEach(() => { @@ -104,7 +103,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a transaction using a seed phrase', async () => { - await signer.sign(message as ChainMsg, derivations.cosmos); + await signer.sign(message, derivations.cosmos); expect(message.signedTransaction).toBeTruthy(); }); @@ -407,7 +406,7 @@ describe('abstrction fee', () => { const newInputTx = { ...txInput, ...abstractionFee }; const newMessage = provider.createMsg(newInputTx); const buildTxData = await newMessage.buildTx(); - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction).toBeTruthy(); expect((buildTxData as any).fee.amount[0].amount).toEqual(fee); }); @@ -464,7 +463,7 @@ describe('IBC token transfer', () => { new IndexerDataSource(COSMOS_MANIFESTS.osmosis) ); const message = provider.createMsg(msgBody); - await signer.sign(message as ChainMsg, derivations); + await signer.sign(message, derivations); expect(message.signedTransaction).toBeTruthy(); }); }); diff --git a/packages/dogecoin/src/chain.provider.ts b/packages/dogecoin/src/chain.provider.ts index 769410b3..9db6458d 100644 --- a/packages/dogecoin/src/chain.provider.ts +++ b/packages/dogecoin/src/chain.provider.ts @@ -17,7 +17,7 @@ import { ChainMsg } from './msg'; providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class DogecoinProvider extends UtxoProvider { +export class DogecoinProvider extends UtxoProvider { declare dataSource: IndexerDataSource; createMsg( diff --git a/packages/dogecoin/src/msg.ts b/packages/dogecoin/src/msg.ts index e7cd8469..8ef23564 100644 --- a/packages/dogecoin/src/msg.ts +++ b/packages/dogecoin/src/msg.ts @@ -9,6 +9,7 @@ import { import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; +import { UTXO } from '@xdefi-tech/chains-utxo'; import type { DogecoinProvider } from './chain.provider'; @@ -21,9 +22,19 @@ export interface MsgBody { decimals?: number; } +export interface TxBody { + to: string; + from: string; + inputs: UTXO[]; + outputs: { address?: string; script?: Buffer; value: number }[]; + utxos: UTXO[]; + fee: string; + compiledMemo?: '' | Buffer; +} + export const MINIMUM_DOGECOIN_FEE = 40000; -export class ChainMsg extends BaseMsg { +export class ChainMsg extends BaseMsg { declare signedTransaction: string | null; constructor( diff --git a/packages/dogecoin/src/signers/ledger.signer.spec.ts b/packages/dogecoin/src/signers/ledger.signer.spec.ts index 43a00021..84aa7bde 100644 --- a/packages/dogecoin/src/signers/ledger.signer.spec.ts +++ b/packages/dogecoin/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { DogecoinProvider } from '../chain.provider'; @@ -62,7 +61,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: DogecoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeAll(() => { @@ -115,7 +114,7 @@ describe('ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toEqual('SIGNEDTX'); }); diff --git a/packages/dogecoin/src/signers/private-key.signer.spec.ts b/packages/dogecoin/src/signers/private-key.signer.spec.ts index 6985c30c..5a34394e 100644 --- a/packages/dogecoin/src/signers/private-key.signer.spec.ts +++ b/packages/dogecoin/src/signers/private-key.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { DogecoinProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { DOGECOIN_MANIFEST } from '../manifests'; @@ -59,7 +57,7 @@ describe('private-key.signer', () => { let signer: PrivateKeySigner; let provider: DogecoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { privateKey = 'QSyxzBP6nd6bUCqNE11fNBK4MTB7BVPvLMJy6NuveCSUUhACNHSH'; @@ -83,7 +81,7 @@ describe('private-key.signer', () => { }); it('should sign a transaction using the private key', async () => { - await signer.sign(message as ChainMsg); + await signer.sign(message); expect(message.signedTransaction).toEqual( '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a473044022068b491ee366b00d7ee0643111977b4f9d69d280446e4672c25f91e137f82ca5702205ce414f90daa6cb99f79ad80db6b2fb6cc700dcb74594e57b4f87b72d60260bf0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0164000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' diff --git a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts index 0570030f..2379f4f6 100644 --- a/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/dogecoin/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { DogecoinProvider } from '../chain.provider'; import { DOGECOIN_MANIFEST } from '../manifests'; import { ChainMsg, MsgBody } from '../msg'; @@ -60,7 +58,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: DogecoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { seedPhrase = @@ -85,7 +83,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a transaction using the seed phrase', async () => { - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction).toEqual( '0200000001ad2c88f940cd48f724d667e58323efd048bdea62e32f426cf04b8fdf87071216000000006a473044022068b491ee366b00d7ee0643111977b4f9d69d280446e4672c25f91e137f82ca5702205ce414f90daa6cb99f79ad80db6b2fb6cc700dcb74594e57b4f87b72d60260bf0121037e6c9ff86d24858e73a75d08d1c4270cf3aa56d421e362eacdd063e264e5b12cffffffff0164000000000000001976a914c602dc308aa94acd75537757eeca791da957e4f188ac00000000' diff --git a/packages/dogecoin/src/signers/trezor.signer.spec.ts b/packages/dogecoin/src/signers/trezor.signer.spec.ts index 5d858e7f..b27b26f7 100644 --- a/packages/dogecoin/src/signers/trezor.signer.spec.ts +++ b/packages/dogecoin/src/signers/trezor.signer.spec.ts @@ -117,7 +117,7 @@ describe('trezor.signer', () => { it('should fail signing if trezor device is not initialized', async () => { expect(async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); }).rejects.toThrow('Trezor connection is not initialized yet!'); }); @@ -137,7 +137,7 @@ describe('trezor.signer', () => { }); it('should sign a transaction using a trezor device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/evm/src/chain.provider.ts b/packages/evm/src/chain.provider.ts index 5e0cc15b..537224da 100644 --- a/packages/evm/src/chain.provider.ts +++ b/packages/evm/src/chain.provider.ts @@ -31,7 +31,7 @@ import { decryptParams, paramToString } from './utils'; Chain.ChainFeatures.EIP1559, ], }) -export class EvmProvider extends Chain.Provider { +export class EvmProvider extends Chain.Provider { public readonly rpcProvider: providers.StaticJsonRpcProvider; constructor(dataSource: DataSource, options?: Chain.IOptions) { @@ -45,7 +45,7 @@ export class EvmProvider extends Chain.Provider { return this.dataSource.manifest; } - createMsg(data: MsgData, encoding: MsgEncoding = MsgEncoding.object): Msg { + createMsg(data: MsgData, encoding: MsgEncoding = MsgEncoding.object) { return new ChainMsg(data, this, encoding); } diff --git a/packages/evm/src/signers/ledger.signer.spec.ts b/packages/evm/src/signers/ledger.signer.spec.ts index 2ac0a040..f2ad2244 100644 --- a/packages/evm/src/signers/ledger.signer.spec.ts +++ b/packages/evm/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { EvmProvider } from '../chain.provider'; @@ -44,7 +43,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: EvmProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -75,7 +74,7 @@ describe('ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/evm/src/signers/private-key.signer.spec.ts b/packages/evm/src/signers/private-key.signer.spec.ts index 3ade6671..fe8f25f2 100644 --- a/packages/evm/src/signers/private-key.signer.spec.ts +++ b/packages/evm/src/signers/private-key.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { EvmProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { EVM_MANIFESTS } from '../manifests'; @@ -18,7 +16,7 @@ describe('private-key.signer', () => { let signer: PrivateKeySigner; let provider: EvmProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let signature: string; let pubKey: string; @@ -56,7 +54,7 @@ describe('private-key.signer', () => { }); it('should sign a transaction using a private key', async () => { - await signer.sign(message as ChainMsg, '', SignatureType.Transaction); + await signer.sign(message, '', SignatureType.Transaction); expect(message.signedTransaction).toBeTruthy(); }); @@ -64,7 +62,7 @@ describe('private-key.signer', () => { it('should sign a message using a private key', async () => { txInput.data = 'test test'; const chainMsg = provider.createMsg(txInput); - await signer.sign(chainMsg as ChainMsg, '', SignatureType.PersonalSign); + await signer.sign(chainMsg, '', SignatureType.PersonalSign); expect(chainMsg.signedTransaction).toBeTruthy(); }); @@ -86,7 +84,7 @@ describe('private-key.signer', () => { txInput.typedData = testData; const chainMsg = provider.createMsg(txInput); - await signer.sign(chainMsg as ChainMsg, '', SignatureType.SignTypedData); + await signer.sign(chainMsg, '', SignatureType.SignTypedData); expect(chainMsg.signedTransaction).toEqual(signature); }); diff --git a/packages/evm/src/signers/seed-phrase.signer.spec.ts b/packages/evm/src/signers/seed-phrase.signer.spec.ts index bb1dae8f..4a550af1 100644 --- a/packages/evm/src/signers/seed-phrase.signer.spec.ts +++ b/packages/evm/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { EvmProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { EVM_MANIFESTS } from '../manifests'; @@ -18,7 +16,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: EvmProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let derivation: string; let signature: string; let pubKey: string; @@ -59,11 +57,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a transaction using a seed phrase', async () => { - await signer.sign( - message as ChainMsg, - derivation, - SignatureType.Transaction - ); + await signer.sign(message, derivation, SignatureType.Transaction); expect(message.signedTransaction).toBeTruthy(); }); @@ -71,11 +65,7 @@ describe('seed-phrase.signer', () => { it('should sign a message using a seed phrase', async () => { txInput.data = 'test test'; const chainMsg = provider.createMsg(txInput); - await signer.sign( - chainMsg as ChainMsg, - derivation, - SignatureType.PersonalSign - ); + await signer.sign(chainMsg, derivation, SignatureType.PersonalSign); expect(chainMsg.signedTransaction).toBeTruthy(); }); @@ -98,11 +88,7 @@ describe('seed-phrase.signer', () => { txInput.typedData = testData; const chainMsg = provider.createMsg(txInput); - await signer.sign( - chainMsg as ChainMsg, - derivation, - SignatureType.SignTypedData - ); + await signer.sign(chainMsg, derivation, SignatureType.SignTypedData); expect(chainMsg.signedTransaction).toEqual(signature); }); diff --git a/packages/evm/src/signers/trezor.signer.spec.ts b/packages/evm/src/signers/trezor.signer.spec.ts index 015bebee..e260080f 100644 --- a/packages/evm/src/signers/trezor.signer.spec.ts +++ b/packages/evm/src/signers/trezor.signer.spec.ts @@ -77,7 +77,7 @@ describe('trezor.signer', () => { let derivationPath: string; let provider: EvmProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { signer = new TrezorSigner(); @@ -99,7 +99,7 @@ describe('trezor.signer', () => { it('should fail signing if trezor device is not initialized', async () => { expect(async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); }).rejects.toThrow('Trezor connection is not initialized yet!'); }); @@ -123,7 +123,7 @@ describe('trezor.signer', () => { ...parseConnectSettings(), lazyLoad: true, }); - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/litecoin/src/chain.provider.ts b/packages/litecoin/src/chain.provider.ts index fa1d54ad..eacd8786 100644 --- a/packages/litecoin/src/chain.provider.ts +++ b/packages/litecoin/src/chain.provider.ts @@ -17,7 +17,7 @@ import { ChainMsg } from './msg'; providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class LitecoinProvider extends UtxoProvider { +export class LitecoinProvider extends UtxoProvider { declare dataSource: IndexerDataSource; createMsg( diff --git a/packages/litecoin/src/msg.ts b/packages/litecoin/src/msg.ts index e7e6adc6..5e0f59ad 100644 --- a/packages/litecoin/src/msg.ts +++ b/packages/litecoin/src/msg.ts @@ -9,6 +9,7 @@ import { import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; +import { UTXO } from '@xdefi-tech/chains-utxo'; import type { LitecoinProvider } from './chain.provider'; @@ -21,7 +22,17 @@ export interface MsgBody { decimals?: number; } -export class ChainMsg extends BaseMsg { +export interface TxBody { + to: string; + from: string; + inputs: UTXO[]; + outputs: { address?: string; script?: Buffer; value: number }[]; + utxos: UTXO[]; + fee: string; + compiledMemo?: '' | Buffer; +} + +export class ChainMsg extends BaseMsg { declare signedTransaction: string | null; constructor( diff --git a/packages/litecoin/src/signers/ledger.signer.spec.ts b/packages/litecoin/src/signers/ledger.signer.spec.ts index 3cdda88a..9167bfcd 100644 --- a/packages/litecoin/src/signers/ledger.signer.spec.ts +++ b/packages/litecoin/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { LitecoinProvider } from '../chain.provider'; @@ -62,7 +61,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: LitecoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -95,7 +94,7 @@ describe('ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toEqual('SIGNEDTX'); }); diff --git a/packages/litecoin/src/signers/private-key.signer.spec.ts b/packages/litecoin/src/signers/private-key.signer.spec.ts index 830226f6..544251c2 100644 --- a/packages/litecoin/src/signers/private-key.signer.spec.ts +++ b/packages/litecoin/src/signers/private-key.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { LitecoinProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { LITECOIN_MANIFEST } from '../manifests'; @@ -59,7 +57,7 @@ describe('private-key.signer', () => { let signer: PrivateKeySigner; let provider: LitecoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { privateKey = 'T4gbj9QbHwmYkUMS5edgsjN8e1aYvh19d9jWAMeXQMUBZh9mNJwM'; @@ -83,7 +81,7 @@ describe('private-key.signer', () => { }); it('should sign a transaction using a private key', async () => { - await signer.sign(message as ChainMsg); + await signer.sign(message); expect(message.signedTransaction).toEqual( '02000000000101467066a38eef3daa8a2bb0e35dccfd098e505b17efa7fcee45e390446679c35c0000000000ffffffff0264000000000000001600145c62b57d49ea96f0ff6a8473c3332ec3fc501ca4ca250000000000001600145c62b57d49ea96f0ff6a8473c3332ec3fc501ca40248304502210095104f03cf04aa7e9f8516b9280dc30ad091f7a1aafb49e9e1bdd8c4513701f2022039e449e17cc4613128b320b15c6a7f2937158f0fa6b6714f8472c6f035d977c00121026d165716c33a95fbbed7c3bdfc155afc43dce53eacf059fc65aa6092f8625ad800000000' diff --git a/packages/litecoin/src/signers/seed-phrase.signer.spec.ts b/packages/litecoin/src/signers/seed-phrase.signer.spec.ts index 18a8bd9e..2fd1b14d 100644 --- a/packages/litecoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/litecoin/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { LitecoinProvider } from '../chain.provider'; import { LITECOIN_MANIFEST } from '../manifests'; import { ChainMsg, MsgBody } from '../msg'; @@ -60,7 +58,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: LitecoinProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { seedPhrase = @@ -86,7 +84,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a transaction using a seed phrase', async () => { - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction).toEqual( '02000000000101467066a38eef3daa8a2bb0e35dccfd098e505b17efa7fcee45e390446679c35c0000000000ffffffff0264000000000000001600145c62b57d49ea96f0ff6a8473c3332ec3fc501ca4ca250000000000001600145c62b57d49ea96f0ff6a8473c3332ec3fc501ca40248304502210095104f03cf04aa7e9f8516b9280dc30ad091f7a1aafb49e9e1bdd8c4513701f2022039e449e17cc4613128b320b15c6a7f2937158f0fa6b6714f8472c6f035d977c00121026d165716c33a95fbbed7c3bdfc155afc43dce53eacf059fc65aa6092f8625ad800000000' diff --git a/packages/litecoin/src/signers/trezor.signer.spec.ts b/packages/litecoin/src/signers/trezor.signer.spec.ts index 756c151d..216ee2b0 100644 --- a/packages/litecoin/src/signers/trezor.signer.spec.ts +++ b/packages/litecoin/src/signers/trezor.signer.spec.ts @@ -92,7 +92,7 @@ describe('trezor.signer', () => { it('should fail signing if trezor device is not initialized', async () => { expect(async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); }).rejects.toThrow('Trezor connection is not initialized yet!'); }); @@ -112,7 +112,7 @@ describe('trezor.signer', () => { }); it('should sign a transaction using a trezor device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/solana/src/chain.provider.ts b/packages/solana/src/chain.provider.ts index c58abcc8..d72387e3 100644 --- a/packages/solana/src/chain.provider.ts +++ b/packages/solana/src/chain.provider.ts @@ -26,7 +26,7 @@ import { ChainMsg } from './msg'; providerType: 'Solana', features: [Chain.ChainFeatures.TOKENS], }) -export class SolanaProvider extends Chain.Provider { +export class SolanaProvider extends Chain.Provider { declare rpcProvider: Connection; constructor(dataSource: DataSource, options?: Chain.IOptions) { @@ -34,7 +34,7 @@ export class SolanaProvider extends Chain.Provider { this.rpcProvider = new Connection(this.manifest.rpcURL); } - createMsg(data: MsgData, encoding: MsgEncoding = MsgEncoding.object): Msg { + createMsg(data: MsgData, encoding: MsgEncoding = MsgEncoding.object) { return new ChainMsg(data, this, encoding); } diff --git a/packages/solana/src/signers/ledger.signer.spec.ts b/packages/solana/src/signers/ledger.signer.spec.ts index 73b38f2a..89a32b70 100644 --- a/packages/solana/src/signers/ledger.signer.spec.ts +++ b/packages/solana/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import TransportWebHID from '@ledgerhq/hw-transport-webhid'; import { Connection } from '@solana/web3.js'; @@ -38,7 +37,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: SolanaProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -72,7 +71,7 @@ describe('ledger.signer', () => { feeCalculator: { lamportsPerSignature: 5000 }, }); - await signer.sign(message as ChainMsg, "44'/501'/0'"); + await signer.sign(message, "44'/501'/0'"); expect(message.signedTransaction.toString('hex')).toBe( '016132ba1ca152cf3fdf70bc76ac49f3c0fe7468f24e7d051ba11ebf2b8c4e30a14c97623fa089924f9320026cabfc412f242bc0db8e405d9c7ea6e608f8d4120a0100010316821af3d7d203354d558ce9f6828ce040fe388541c1b7cdadc9dcd03bda42fba216d8118c45c50f08f511fcbffa02d9e23f670c8765b135be2d58ef49bb95990000000000000000000000000000000000000000000000000000000000000000de371d4c7efe41c73e69650c01ee6f845716e0578dcbb8cc6760f31cfab73d0d01020200010c020000008096980000000000' diff --git a/packages/solana/src/signers/private-key.signer.spec.ts b/packages/solana/src/signers/private-key.signer.spec.ts index 87ab3ada..057b9d22 100644 --- a/packages/solana/src/signers/private-key.signer.spec.ts +++ b/packages/solana/src/signers/private-key.signer.spec.ts @@ -1,4 +1,4 @@ -import { Msg, MsgEncoding } from '@xdefi-tech/chains-core'; +import { MsgEncoding } from '@xdefi-tech/chains-core'; import { Connection } from '@solana/web3.js'; import { SolanaProvider } from '../chain.provider'; @@ -19,7 +19,7 @@ describe('private-key.signer', () => { let signer: PrivateKeySigner; let provider: SolanaProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { privateKey = @@ -47,7 +47,7 @@ describe('private-key.signer', () => { blockhash: '9uGQVaoBdc2u6cjZmX4A8yLzrNCBLEeD5UY6conMuGLD', feeCalculator: { lamportsPerSignature: 5000 }, }); - await signer.sign(message as ChainMsg); + await signer.sign(message); expect(message.signedTransaction.toString('hex')).toBe( '01cddbcf18f06a7d75dd6da254bf1c8169bae2446fce1c55fca85930e11b29ea6e4968335156697f6662d4768ba27102384c1be5a95dcc818a3e478387f3bc620b01000203a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000084411db3e89763453608d1096cf16877aac2dba6a0a73d094d32aba4540031f602020009031027000000000000010200000c02000000e803000000000000' @@ -62,7 +62,7 @@ describe('private-key.signer', () => { }, MsgEncoding.base64 ); - await signer.sign(message as ChainMsg); + await signer.sign(message); expect(message.signedTransaction.toString('hex')).toBe( '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' @@ -77,7 +77,7 @@ describe('private-key.signer', () => { const message = provider.createMsg({ data: '726eSG6YzuM2gGVRSbGZptsMzM17zPZP5KAv8GM96CxdtDX4BkZBVV4JbRQgrdGs83mqFBPh2j7XiFsQVhskmq7cEd3TS561e1VPTw84Z9LnXPTxJHZTgucPkmmUrDQTgtGeYMw1BiKyHYg4j9aPAULMwihHVvmjMzYwVKQVqr3PNMeYcLcw8oYNWkWfBddzoL2gJL8W8pAHGhrV46F3me4hJLxU59VU1GBKThv6LHo5frUcS3j15YFkWVaFipVQeoemiKQgjfL3q21ziEkaA8LvvoFfJmaXfAKAoyhKhrzWTzDzfk1t2UPX5qxgzXy5K7Qcst6hG1w3MSTtEbenDDLjNgmrspFw83hNftzeU2pdKQ2wjwjCAnLgzSLZBtrLNUcU9fqf5EbXYernV8qtZvRxChnzvt7ekyoyuDktVY8rk3JJDGNoyMqDF9zkrrA625eUWjSC9fedgfBACys1Q8gjBj3ET1qrj5Q9ZAst1yQtwKhzuC3tfJBtevjRByu9dgLVhW4n76DbgEPgSDjqwsGEymP6gtfbFJT8ZhhyW8yrxKASv44zkpEo3EqQuVFjteDHs3GtpP4qoMQwYHQbomccPtcv2KoDCLj45ueRsF4gsQS8QgVWS664zgPvBBqKdHqxA4gmuQpH7kL6T3w3BiTRGCZ4zZMHWbbssiDfrouYsxGJ518FfL7pMPiDvzGiJsAiDzU7mnpJpc52SmREH3ahjqf4DEiBMhorrjxKYPJ6KB5KuZv8BVmmpDgsdkt1wPbNBjJK13qmGzaueW9GVb7W1kq8wRCMhRqb6uHuofRMGZ9awcN5TKKeSCGaN68H2mHKMWbzgj7CVLAHstgTWcaqEauHxnTjfZT7njnA3WjG5vE46BSDKwBvXQcctjDEDUkGBqadKfFyvECoTF5uVwg3NizpoCEg43YJ2ACsJmkobmvsNPirnFCkY19h8FWe8fp3X2T4f4tTVeeSE3wQr6JqffZjZ4b5qzTYWLvtXoB9z5sqaJ3HoQthEvQzExByj2PLvuNGFcPZeMy7DStysnmZVb1WJhWGwA4374iQpR5Vi7Sa6yQyFhRbv2ZFE66PXziH4AKgKTQs3CKikV7cwwq5LqktFFoonr2g9EPz536zcBka4rdan6SbrVo2gTzgYDusJRjU9Yf9XRscMmx6nt246wDvVCrHdBdukCyiajzngKkJrQY9SMfh7VHhq34YtVjS6dDtLqCJmw6vnhFvjspTSoJ8czZjsadfcnki7B7fJbBjPY6iL8fFSyZtsHdu21NQxttqCQiBGk1mFj1ohwTr7a3rCLpHsn8yyaJ66iGXHruBX2CZeL61gX8wuDM', }); - const signature = await signer.signMessage(message as ChainMsg); + const signature = await signer.signMessage(message); expect(signature).toEqual({ pubKey: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', sig: 'LvYxkcdz3E2NmhwAX2EAnPgudhaWyGRkxkNdEu7ZnPaBcyU4giu8VjCM7TMyYPmVn2rsvJvWfYpmhLK5HL7GPiE', diff --git a/packages/solana/src/signers/seed-phrase.signer.spec.ts b/packages/solana/src/signers/seed-phrase.signer.spec.ts index 716b527d..69ccb4a5 100644 --- a/packages/solana/src/signers/seed-phrase.signer.spec.ts +++ b/packages/solana/src/signers/seed-phrase.signer.spec.ts @@ -1,4 +1,4 @@ -import { Msg, MsgEncoding } from '@xdefi-tech/chains-core'; +import { MsgEncoding } from '@xdefi-tech/chains-core'; import { Connection } from '@solana/web3.js'; import { SolanaProvider } from '../chain.provider'; @@ -21,7 +21,7 @@ describe('seed-phrase.signer', () => { let signer: SeedPhraseSigner; let provider: SolanaProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; beforeEach(() => { mnemonic = @@ -52,7 +52,7 @@ describe('seed-phrase.signer', () => { blockhash: '9uGQVaoBdc2u6cjZmX4A8yLzrNCBLEeD5UY6conMuGLD', feeCalculator: { lamportsPerSignature: 5000 }, }); - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction.toString('hex')).toBe( '01cddbcf18f06a7d75dd6da254bf1c8169bae2446fce1c55fca85930e11b29ea6e4968335156697f6662d4768ba27102384c1be5a95dcc818a3e478387f3bc620b01000203a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000084411db3e89763453608d1096cf16877aac2dba6a0a73d094d32aba4540031f602020009031027000000000000010200000c02000000e803000000000000' @@ -67,7 +67,7 @@ describe('seed-phrase.signer', () => { }, MsgEncoding.base64 ); - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction.toString('hex')).toBe( '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' @@ -81,7 +81,7 @@ describe('seed-phrase.signer', () => { }, MsgEncoding.base58 ); - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction.toString('hex')).toBe( '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' @@ -95,7 +95,7 @@ describe('seed-phrase.signer', () => { }, MsgEncoding.base58 ); - await signer.sign(message as ChainMsg, derivation); + await signer.sign(message, derivation); expect(message.signedTransaction.toString('hex')).toBe( '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' @@ -110,7 +110,7 @@ describe('seed-phrase.signer', () => { const message = provider.createMsg({ data: '726eSG6YzuM2gGVRSbGZptsMzM17zPZP5KAv8GM96CxdtDX4BkZBVV4JbRQgrdGs83mqFBPh2j7XiFsQVhskmq7cEd3TS561e1VPTw84Z9LnXPTxJHZTgucPkmmUrDQTgtGeYMw1BiKyHYg4j9aPAULMwihHVvmjMzYwVKQVqr3PNMeYcLcw8oYNWkWfBddzoL2gJL8W8pAHGhrV46F3me4hJLxU59VU1GBKThv6LHo5frUcS3j15YFkWVaFipVQeoemiKQgjfL3q21ziEkaA8LvvoFfJmaXfAKAoyhKhrzWTzDzfk1t2UPX5qxgzXy5K7Qcst6hG1w3MSTtEbenDDLjNgmrspFw83hNftzeU2pdKQ2wjwjCAnLgzSLZBtrLNUcU9fqf5EbXYernV8qtZvRxChnzvt7ekyoyuDktVY8rk3JJDGNoyMqDF9zkrrA625eUWjSC9fedgfBACys1Q8gjBj3ET1qrj5Q9ZAst1yQtwKhzuC3tfJBtevjRByu9dgLVhW4n76DbgEPgSDjqwsGEymP6gtfbFJT8ZhhyW8yrxKASv44zkpEo3EqQuVFjteDHs3GtpP4qoMQwYHQbomccPtcv2KoDCLj45ueRsF4gsQS8QgVWS664zgPvBBqKdHqxA4gmuQpH7kL6T3w3BiTRGCZ4zZMHWbbssiDfrouYsxGJ518FfL7pMPiDvzGiJsAiDzU7mnpJpc52SmREH3ahjqf4DEiBMhorrjxKYPJ6KB5KuZv8BVmmpDgsdkt1wPbNBjJK13qmGzaueW9GVb7W1kq8wRCMhRqb6uHuofRMGZ9awcN5TKKeSCGaN68H2mHKMWbzgj7CVLAHstgTWcaqEauHxnTjfZT7njnA3WjG5vE46BSDKwBvXQcctjDEDUkGBqadKfFyvECoTF5uVwg3NizpoCEg43YJ2ACsJmkobmvsNPirnFCkY19h8FWe8fp3X2T4f4tTVeeSE3wQr6JqffZjZ4b5qzTYWLvtXoB9z5sqaJ3HoQthEvQzExByj2PLvuNGFcPZeMy7DStysnmZVb1WJhWGwA4374iQpR5Vi7Sa6yQyFhRbv2ZFE66PXziH4AKgKTQs3CKikV7cwwq5LqktFFoonr2g9EPz536zcBka4rdan6SbrVo2gTzgYDusJRjU9Yf9XRscMmx6nt246wDvVCrHdBdukCyiajzngKkJrQY9SMfh7VHhq34YtVjS6dDtLqCJmw6vnhFvjspTSoJ8czZjsadfcnki7B7fJbBjPY6iL8fFSyZtsHdu21NQxttqCQiBGk1mFj1ohwTr7a3rCLpHsn8yyaJ66iGXHruBX2CZeL61gX8wuDM', }); - const signature = await signer.signMessage(message as ChainMsg, derivation); + const signature = await signer.signMessage(message, derivation); expect(signature).toEqual({ pubKey: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', sig: 'LvYxkcdz3E2NmhwAX2EAnPgudhaWyGRkxkNdEu7ZnPaBcyU4giu8VjCM7TMyYPmVn2rsvJvWfYpmhLK5HL7GPiE', diff --git a/packages/thor/src/chain.provider.ts b/packages/thor/src/chain.provider.ts index d4e19067..2b3c5567 100644 --- a/packages/thor/src/chain.provider.ts +++ b/packages/thor/src/chain.provider.ts @@ -28,7 +28,7 @@ import { assetFromString } from './utils'; providerType: 'Thor', features: [Chain.ChainFeatures.TOKENS], }) -export class ThorProvider extends Chain.Provider { +export class ThorProvider extends Chain.Provider { public rest: Axios; declare dataSource: any; @@ -37,10 +37,7 @@ export class ThorProvider extends Chain.Provider { this.rest = axios.create({ baseURL: this.manifest.nodeURL }); } - createMsg( - data: MsgBody, - encoding: MsgEncoding = MsgEncoding.object - ): ChainMsg { + createMsg(data: MsgBody, encoding: MsgEncoding = MsgEncoding.object) { return new ChainMsg(data, this, encoding); } diff --git a/packages/thor/src/signers/ledger.signer.spec.ts b/packages/thor/src/signers/ledger.signer.spec.ts index 93566647..c410c486 100644 --- a/packages/thor/src/signers/ledger.signer.spec.ts +++ b/packages/thor/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { ThorProvider } from '../chain.provider'; @@ -34,7 +33,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: ThorProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -65,7 +64,7 @@ describe('ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/thor/src/signers/private-key.signer.spec.ts b/packages/thor/src/signers/private-key.signer.spec.ts index c6e74f67..05282150 100644 --- a/packages/thor/src/signers/private-key.signer.spec.ts +++ b/packages/thor/src/signers/private-key.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { ThorProvider } from '../chain.provider'; import { ChainDataSource } from '../datasource'; import { THORCHAIN_MANIFESTS, ThorChains } from '../manifests'; @@ -32,7 +30,7 @@ describe('private-key.signer', () => { decimals: 8, }, }; - const messages: Record = { + const messages: Record = { [ThorChains.thorchain]: providers.thorchain.createMsg(txInputs.thorchain), [ThorChains.mayachain]: providers.mayachain.createMsg(txInputs.mayachain), }; @@ -69,7 +67,7 @@ describe('private-key.signer', () => { }); it('should sign a transaction using a private key for thorchain', async () => { - await signer.sign(messages.thorchain as ChainMsg); + await signer.sign(messages.thorchain); expect(messages.thorchain.signedTransaction).toEqual( 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJYClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIEEMCaDBpARKIPDEXsG3U3PH+TtNqy3/qEC/a71PoAsvuAl1vZcigQBcWXF85nWL4gluaTGFJRhJQroBDWwlB4ftwB2LlKEA==' @@ -77,7 +75,7 @@ describe('private-key.signer', () => { }); it('should sign a transaction using a private key for mayachain', async () => { - await signer.sign(messages.mayachain as ChainMsg); + await signer.sign(messages.mayachain); expect(messages.mayachain.signedTransaction).toEqual( 'Ck4KTAoOL3R5cGVzLk1zZ1NlbmQSOgoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgwKBWNhY2FvEgMxMDASWApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA/C5ZHhO0v4GaeGiMT6ZF1tF/C6v15Jwjjjwq/Au6v1HEgQKAggBGAASBBDAmgwaQBbam0ygnZSKGaEHYRkpIAo/J+tK2YqCOQNJzoJonwA7bUvjj+8GX/o3dxba15QOc4o0PYKj3pRXwFzYfrf1q30=' diff --git a/packages/thor/src/signers/seed-phrase.signer.spec.ts b/packages/thor/src/signers/seed-phrase.signer.spec.ts index ecbae2ce..995b1c03 100644 --- a/packages/thor/src/signers/seed-phrase.signer.spec.ts +++ b/packages/thor/src/signers/seed-phrase.signer.spec.ts @@ -1,5 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; - import { ThorProvider } from '../chain.provider'; import { ChainDataSource } from '../datasource'; import { THORCHAIN_MANIFESTS, ThorChains } from '../manifests'; @@ -33,7 +31,7 @@ describe('seed-phrase.signer', () => { decimals: 8, }, }; - const messages: Record = { + const messages: Record = { [ThorChains.thorchain]: providers.thorchain.createMsg(txInputs.thorchain), [ThorChains.mayachain]: providers.mayachain.createMsg(txInputs.mayachain), }; @@ -60,7 +58,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a transaction using a seed phrase', async () => { - await signer.sign(messages.thorchain as ChainMsg, derivation); + await signer.sign(messages.thorchain, derivation); expect(messages.thorchain.signedTransaction).toEqual( 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJjClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIPCgkKBHJ1bmUSATAQwJoMGkCcsjR8tN2XlDJIN6WBlTtcvoqP3wNNEX5icxtynFY+hReK41XbLWqDiihvzBkpyikDBz6jyvCoWXdCY9A07hYx' @@ -68,7 +66,7 @@ describe('seed-phrase.signer', () => { }); it('should sign a mayachain transaction using a seed phrase', async () => { - await signer.sign(messages.mayachain as ChainMsg, derivation); + await signer.sign(messages.mayachain, derivation); expect(messages.mayachain.signedTransaction).toEqual( 'Ck4KTAoOL3R5cGVzLk1zZ1NlbmQSOgoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgwKBWNhY2FvEgMxMDASZApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA/C5ZHhO0v4GaeGiMT6ZF1tF/C6v15Jwjjjwq/Au6v1HEgQKAggBGAASEAoKCgVjYWNhbxIBMBDAmgwaQMLpXq11jlObzM8FMtor3iIXP5aOy3uavo6+8QDlBK9LTolUuiA7JACOAd9c+QlS0ML5lETTFpKH63nTmO8cxSQ=' diff --git a/packages/tron/src/chain.provider.ts b/packages/tron/src/chain.provider.ts index f98c8295..07626c00 100644 --- a/packages/tron/src/chain.provider.ts +++ b/packages/tron/src/chain.provider.ts @@ -25,7 +25,7 @@ import { IndexerDataSource, ChainDataSource } from './datasource'; deps: [], providerType: 'Tron', }) -export class TronProvider extends Chain.Provider { +export class TronProvider extends Chain.Provider { declare rpcProvider: any; declare dataSource: ChainDataSource | IndexerDataSource; @@ -40,7 +40,7 @@ export class TronProvider extends Chain.Provider { this.rpcProvider.setAddress('TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t'); } - createMsg(data: MsgData): Msg { + createMsg(data: MsgData) { return new ChainMsg(data, this); } diff --git a/packages/tron/src/signers/ledger.signer.spec.ts b/packages/tron/src/signers/ledger.signer.spec.ts index e2eadfa5..e2fcb2a4 100644 --- a/packages/tron/src/signers/ledger.signer.spec.ts +++ b/packages/tron/src/signers/ledger.signer.spec.ts @@ -1,4 +1,3 @@ -import { Msg } from '@xdefi-tech/chains-core'; import Transport from '@ledgerhq/hw-transport-webhid'; import { TronProvider } from '../chain.provider'; @@ -36,7 +35,7 @@ describe('ledger.signer', () => { let derivationPath: string; let provider: TronProvider; let txInput: MsgBody; - let message: Msg; + let message: ChainMsg; let externalTransport: any; beforeEach(async () => { @@ -64,7 +63,7 @@ describe('ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message as ChainMsg, derivationPath); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); @@ -74,7 +73,7 @@ describe('ledger.signer', () => { }); it('should signMessage a transaction using a ledger device', async () => { - const { raw_data_hex } = await (message as ChainMsg).buildTx(); + const { raw_data_hex } = await message.buildTx(); const signature = await signer.signMessageV2(raw_data_hex, derivationPath); expect(signature).toEqual( @@ -83,7 +82,7 @@ describe('ledger.signer', () => { }); it('should signTransaction a transaction using a ledger device', async () => { - const { raw_data_hex } = await (message as ChainMsg).buildTx(); + const { raw_data_hex } = await message.buildTx(); const signature = await signer.signTransaction( derivationPath, raw_data_hex diff --git a/packages/utxo/src/chain.provider.ts b/packages/utxo/src/chain.provider.ts index 4c0e2c2a..32f36c1b 100644 --- a/packages/utxo/src/chain.provider.ts +++ b/packages/utxo/src/chain.provider.ts @@ -6,6 +6,8 @@ import { FeeData, FeeOptions, GasFeeSpeed, + Msg, + MsgData, MsgEncoding, Response, Transaction, @@ -13,7 +15,6 @@ import { } from '@xdefi-tech/chains-core'; import axios, { Axios } from 'axios'; -import { ChainMsg, MsgBody } from './msg'; import { UTXOManifest } from './manifests'; import { UTXO } from './data-provider'; @@ -21,7 +22,9 @@ export interface UtxoProviderOptions extends Chain.IOptions { apiKey?: string; } -export class UtxoProvider extends Chain.Provider { +export class UtxoProvider< + ChainMsg extends Msg = Msg +> extends Chain.Provider { public rpcProvider = null; public rest: Axios; @@ -34,10 +37,11 @@ export class UtxoProvider extends Chain.Provider { } createMsg( - data: MsgBody, + data: MsgData, encoding: MsgEncoding = MsgEncoding.object ): ChainMsg { - return new ChainMsg(data, this, encoding); + // return new ChainMsg(data, this, encoding); + throw new Error('Method not implemented.'); } async getTransactions( diff --git a/packages/utxo/src/msg.ts b/packages/utxo/src/msg.ts index f9b1af9d..8c212c58 100644 --- a/packages/utxo/src/msg.ts +++ b/packages/utxo/src/msg.ts @@ -11,6 +11,7 @@ import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; import type { UtxoProvider } from './chain.provider'; +import { UTXO } from './data-provider/utxo/utxo.data-provider'; export interface MsgBody { amount: NumberIsh; @@ -22,12 +23,22 @@ export interface MsgBody { nftId?: string; } -export class ChainMsg extends BaseMsg { +export interface TxBody { + to: string; + from: string; + inputs: UTXO[]; + outputs: { address?: string; script?: Buffer; value: number }[]; + utxos: UTXO[]; + fee: string; + compiledMemo?: '' | Buffer; +} + +export class ChainMsg extends BaseMsg { declare signedTransaction: string | null; constructor( public readonly data: MsgBody, - public readonly provider: UtxoProvider, + public readonly provider: UtxoProvider, public readonly encoding: MsgEncoding ) { super(data, provider, encoding); From 70eee8c2d1ad1c05b81c30afcf4ef1733d3b962e Mon Sep 17 00:00:00 2001 From: Justin <102846781+HoangVD2@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:21:39 +0700 Subject: [PATCH 056/176] feat: Implement estimateFee for Tron provider (XDEFI-9048) (#273) * feat: Implement estimateFee for Tron provider * chore: exceeded timeout * chore: jest.setTimeout --- .changeset/silent-birds-return.md | 6 ++++ .../core/src/core/chain/chain.provider.ts | 4 +-- packages/core/src/core/interfaces/index.ts | 7 +++++ packages/tron/package.json | 2 +- packages/tron/src/chain.provider.spec.ts | 28 +++++++++++++------ packages/tron/src/chain.provider.ts | 8 +----- 6 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 .changeset/silent-birds-return.md diff --git a/.changeset/silent-birds-return.md b/.changeset/silent-birds-return.md new file mode 100644 index 00000000..ff0527cb --- /dev/null +++ b/.changeset/silent-birds-return.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-tron': patch +--- + +feat: Implement estimateFee for Tron provider diff --git a/packages/core/src/core/chain/chain.provider.ts b/packages/core/src/core/chain/chain.provider.ts index 530a727d..65307d4f 100644 --- a/packages/core/src/core/chain/chain.provider.ts +++ b/packages/core/src/core/chain/chain.provider.ts @@ -7,7 +7,7 @@ import { Transaction, TransactionData } from 'core/transaction'; import { ChainFeatures, Manifest } from 'core/chain/interfaces'; import { METADATA_KEY, SIGNER_SCOPE_NAME } from 'core/constants'; import { FeeOptions, GasFeeSpeed } from 'core/fee'; -import { Balance, DataSource, MsgEncoding, Response, FeeData } from 'core'; +import { Balance, DataSource, MsgEncoding, Response, FeeData, TronFee } from 'core'; import { forEach } from 'lodash'; export interface IOptions { @@ -109,7 +109,7 @@ export abstract class Provider { * @param {GasFeeSpeed} speed - An enumerated value indicating the speed at which the transaction should be processed. Possible values are "high", "medium", and "low". * @returns {Promise} - A promise that resolves with an array of Msg objects representing the messages with the calculated transaction fees included. */ - abstract estimateFee(msgs: Msg[], speed: GasFeeSpeed): Promise; + abstract estimateFee(msgs: Msg[], speed: GasFeeSpeed): Promise; /** * Sends a list of signed messages to the RPC provider and returns a list of corresponding transactions. diff --git a/packages/core/src/core/interfaces/index.ts b/packages/core/src/core/interfaces/index.ts index b12849cf..e8e43a14 100644 --- a/packages/core/src/core/interfaces/index.ts +++ b/packages/core/src/core/interfaces/index.ts @@ -10,6 +10,13 @@ export interface FeeData { maxPriorityFeePerGas?: NumberIsh; } +export interface TronFee { + bandwidth: number; + energy: number; + cost: number; + willRevert: boolean; +} + export enum MsgEncoding { buffer = 'buffer', object = 'object', diff --git a/packages/tron/package.json b/packages/tron/package.json index a3fdfe33..dd383724 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -48,7 +48,7 @@ "watch": "tsup --watch", "clean": "rimraf dist .turbo node_modules", "lint": "eslint .", - "test:disabled": "jest", + "test": "jest", "lint:fix": "eslint . --fix", "test:watch": "jest --watch", "coverage": "jest --coverageReporters='json-summary' --coverage", diff --git a/packages/tron/src/chain.provider.spec.ts b/packages/tron/src/chain.provider.spec.ts index f8005622..93ed1055 100644 --- a/packages/tron/src/chain.provider.spec.ts +++ b/packages/tron/src/chain.provider.spec.ts @@ -65,6 +65,8 @@ describe('chain.providers.chain', () => { expect((await txData.getData()).length).toBeGreaterThanOrEqual(0); }); + jest.setTimeout(15000); + it('should get transactions for an address from the blockchain using an indexer data source', async () => { const txData = await providers.indexer.getTransactions( 'TYCq2iBVHTKMhybfkwGeHdW72gsfYfrN18' @@ -75,20 +77,22 @@ describe('chain.providers.chain', () => { it('should estimate fees for an unsigned TRX transaction using any data source', async () => { let msg = new ChainMsg({ ...messageData, provider: providers.chain }); - let fees = await providers.chain.estimateTronFees([msg]); + let fees = await providers.chain.estimateFee([msg]); expect(fees.length).toEqual(1); expect(fees[0].bandwidth).toEqual(265); expect(fees[0].energy).toEqual(0); expect(fees[0].cost).toEqual(0.265); msg = new ChainMsg({ ...messageData, provider: providers.indexer }); - fees = await providers.indexer.estimateTronFees([msg]); + fees = await providers.indexer.estimateFee([msg]); expect(fees.length).toEqual(1); expect(fees[0].bandwidth).toEqual(265); expect(fees[0].energy).toEqual(0); expect(fees[0].cost).toEqual(0.265); }); + jest.setTimeout(15000); + it('should estimate fees for an unsigned TRC20 transaction using any data source', async () => { let msg = new ChainMsg({ ...messageData, @@ -98,7 +102,7 @@ describe('chain.providers.chain', () => { provider: providers.chain, }); - let fees = await providers.chain.estimateTronFees([msg]); + let fees = await providers.chain.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); expect(fees[0].cost).toEqual('27.255900345'); @@ -112,20 +116,22 @@ describe('chain.providers.chain', () => { provider: providers.indexer, }); - fees = await providers.indexer.estimateTronFees([msg]); + fees = await providers.indexer.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); expect(fees[0].cost).toEqual('27.255900345'); expect(fees[0].willRevert).toBeFalsy(); }); + jest.setTimeout(15000); + it('should estimate fees for a TRX transaction using a chain data source', async () => { const msg = new ChainMsg({ ...messageData, provider: providers.chain }); const signer = new PrivateKeySigner(pk, TRON_MANIFEST); await signer.sign(msg); - const fees = await providers.chain.estimateTronFees([msg]); + const fees = await providers.chain.estimateFee([msg]); expect(fees.length).toEqual(1); expect(fees[0].bandwidth).toEqual(265); expect(fees[0].energy).toEqual(0); @@ -137,12 +143,14 @@ describe('chain.providers.chain', () => { await signer.sign(msg); - const fees = await providers.indexer.estimateTronFees([msg]); + const fees = await providers.indexer.estimateFee([msg]); expect(fees.length).toEqual(1); expect(fees[0].bandwidth).toEqual(265); expect(fees[0].energy).toEqual(0); }); + jest.setTimeout(15000); + it('should estimate fees for a TRC20 transaction using a chain data source', async () => { const msg = new ChainMsg({ ...messageData, @@ -155,13 +163,15 @@ describe('chain.providers.chain', () => { await signer.sign(msg); - const fees = await providers.chain.estimateTronFees([msg]); + const fees = await providers.chain.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); expect(fees[0].cost).toEqual('27.255900345'); expect(fees[0].willRevert).toBeFalsy(); }); + jest.setTimeout(15000); + it('should estimate fees for a TRC20 transaction using an indexer data source', async () => { const msg = new ChainMsg({ ...messageData, @@ -174,13 +184,15 @@ describe('chain.providers.chain', () => { await signer.sign(msg); - const fees = await providers.indexer.estimateTronFees([msg]); + const fees = await providers.indexer.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); expect(fees[0].cost).toEqual('27.255900345'); expect(fees[0].willRevert).toBeFalsy(); }); + jest.setTimeout(15000); + it('should get a token transaction from the blockchain using a chain data source', async () => { const txData = await providers.chain.getTransaction( '992151e0fafb2e86504efbfd42074434af1ac03f460b2e96b687338471e7c79d' diff --git a/packages/tron/src/chain.provider.ts b/packages/tron/src/chain.provider.ts index 07626c00..7d35fc86 100644 --- a/packages/tron/src/chain.provider.ts +++ b/packages/tron/src/chain.provider.ts @@ -4,13 +4,11 @@ import { ChainDecorator, Coin, FeeOptions, - GasFeeSpeed, Msg, MsgData, Response, Transaction, Balance, - FeeData, TransactionData, TransactionStatus, } from '@xdefi-tech/chains-core'; @@ -54,11 +52,7 @@ export class TronProvider extends Chain.Provider { ); } - async estimateFee(_msgs: Msg[], _speed: GasFeeSpeed): Promise { - throw new Error('Method Not Implemented - Use estimateTronFee'); - } - - async estimateTronFees(msgs: Msg[]): Promise { + async estimateFee(msgs: Msg[]): Promise { const feeData: TronFee[] = []; // Can change with a network update / fork, but not worth using an API call here. From bdead5e963b839b262263d88192de5873202aa1b Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 15 Jul 2024 10:24:16 +0000 Subject: [PATCH 057/176] Version packages --- .changeset/silent-birds-return.md | 6 ------ packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 .changeset/silent-birds-return.md diff --git a/.changeset/silent-birds-return.md b/.changeset/silent-birds-return.md deleted file mode 100644 index ff0527cb..00000000 --- a/.changeset/silent-birds-return.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-tron': patch ---- - -feat: Implement estimateFee for Tron provider diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 2adf81f9..67272188 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.21 + +### Patch Changes + +- 0dbc7648: feat: Implement estimateFee for Tron provider + ## 2.0.20 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 43b30c61..c6eda414 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.20", + "version": "2.0.21", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 9c9b2cbb..260305fb 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.23 + +### Patch Changes + +- 0dbc7648: feat: Implement estimateFee for Tron provider +- Updated dependencies [0dbc7648] + - @xdefi-tech/chains-core@2.0.21 + ## 2.0.22 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index dd383724..a2f0a5ea 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.22", + "version": "2.0.23", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 0a4b56e18bfc4cebec0cdbc56d2d3b412fdcffab Mon Sep 17 00:00:00 2001 From: Justin <102846781+HoangVD2@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:08:57 +0700 Subject: [PATCH 058/176] chore: add default fee config for Cosmos chains (XDEFI-8966) (#275) * fix: add default fee config for Cosmos chains * chore: changeset * chore: revert * chore: update * chore: update --- .changeset/neat-dingos-deny.md | 5 +++++ packages/cosmos/src/chain.provider.ts | 14 ++++++++++++-- packages/cosmos/src/msg.ts | 10 ++++++++++ packages/cosmos/src/signers/ledger.signer.spec.ts | 2 ++ .../cosmos/src/signers/seed-phrase.signer.spec.ts | 5 ++++- 5 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .changeset/neat-dingos-deny.md diff --git a/.changeset/neat-dingos-deny.md b/.changeset/neat-dingos-deny.md new file mode 100644 index 00000000..f3fcd2a5 --- /dev/null +++ b/.changeset/neat-dingos-deny.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +add default fee config for Cosmos chains diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index 9d581dbc..9ff0bfd2 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -87,8 +87,18 @@ export class CosmosProvider extends Chain.Provider { ); } - async estimateFee(msgs: ChainMsg[], speed: GasFeeSpeed): Promise { - return this.dataSource.estimateFee(msgs, speed); + async estimateFee(msgs: Msg[], speed: GasFeeSpeed): Promise { + try { + return this.dataSource.estimateFee(msgs as ChainMsg[], speed); + } catch { + console.warn('Estimate fee failed, using default fee'); + + const defaultFee = [ + { gasLimit: '20000', gasPrice: this.manifest.feeGasStep[speed] }, + ] as FeeData[]; + + return defaultFee; + } } async getFeeTokens() { diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 99befc77..9945b7c7 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -255,6 +255,16 @@ export class ChainMsg extends BasMsg { const { typeUrl, msgs } = this.getMsgToSend(); const feeOptions = msgData.feeOptions; + + if (!msgData.gasLimit && !msgData.gasPrice && this.provider) { + const [feeEstimation] = await this.provider.estimateFee( + [this], + GasFeeSpeed.medium + ); + msgData.gasLimit = feeEstimation.gasLimit; + msgData.gasPrice = feeEstimation.gasPrice; + } + const fee = { amount: [ { diff --git a/packages/cosmos/src/signers/ledger.signer.spec.ts b/packages/cosmos/src/signers/ledger.signer.spec.ts index 28f64ea4..c045d0c0 100644 --- a/packages/cosmos/src/signers/ledger.signer.spec.ts +++ b/packages/cosmos/src/signers/ledger.signer.spec.ts @@ -78,6 +78,8 @@ describe('cosmos::ledger.signer', () => { from: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', to: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', amount: '0.000001', + gasLimit: '200000', + gasPrice: COSMOS_MANIFESTS.cosmos.feeGasStep.medium, }; message = provider.createMsg(txInput); diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index 03bb6879..e278b7cd 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -68,7 +68,8 @@ describe('seed-phrase.signer', () => { from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', amount: '0.000001', - msgs: [], + gasLimit: '200000', + gasPrice: COSMOS_MANIFESTS.cosmos.feeGasStep.medium, }; message = provider.createMsg(txInput); @@ -381,6 +382,8 @@ describe('abstrction fee', () => { ); }); + jest.setTimeout(15000); + it('should sign a transaction using a seed phrase', async () => { const ibcToken = 'ibc/B547DC9B897E7C3AA5B824696110B8E3D2C31E3ED3F02FF363DCBAD82457E07E'; // uxki; From fcf16fcdd6d75e920ce0a0138ad1c43c2fe93aa7 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 16 Jul 2024 11:11:24 +0000 Subject: [PATCH 059/176] Version packages --- .changeset/neat-dingos-deny.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/neat-dingos-deny.md diff --git a/.changeset/neat-dingos-deny.md b/.changeset/neat-dingos-deny.md deleted file mode 100644 index f3fcd2a5..00000000 --- a/.changeset/neat-dingos-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -add default fee config for Cosmos chains diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 338e88ad..7563ea3a 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.26 + +### Patch Changes + +- 54e5f927: add default fee config for Cosmos chains + ## 2.0.25 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index af492516..f26f887c 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.25", + "version": "2.0.26", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 835e2725461e531609ab5191736a7e6b89186012 Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:27:39 +0700 Subject: [PATCH 060/176] fix: revert tsup (#278) --- .changeset/empty-toes-doubt.md | 14 ++++++++++++++ packages/binance/package.json | 21 +++++++++++++++++++++ packages/binance/tsup.config.cjs | 27 --------------------------- packages/bitcoin/package.json | 18 ++++++++++++++++++ packages/bitcoin/tsup.config.cjs | 26 -------------------------- packages/bitcoincash/package.json | 18 ++++++++++++++++++ packages/bitcoincash/tsup.config.cjs | 26 -------------------------- packages/core/package.json | 16 ++++++++++++++++ packages/core/tsup.config.cjs | 17 ----------------- packages/dogecoin/package.json | 18 ++++++++++++++++++ packages/dogecoin/tsup.config.cjs | 26 -------------------------- packages/evm/package.json | 19 +++++++++++++++++++ packages/evm/tsup.config.cjs | 27 --------------------------- packages/litecoin/package.json | 18 ++++++++++++++++++ packages/litecoin/tsup.config.cjs | 26 -------------------------- packages/solana/package.json | 18 ++++++++++++++++++ packages/solana/tsup.config.cjs | 26 -------------------------- packages/thor/tsup.config.cjs | 1 - packages/tron/package.json | 18 ++++++++++++++++++ packages/tron/tsup.config.cjs | 26 -------------------------- 20 files changed, 178 insertions(+), 228 deletions(-) create mode 100644 .changeset/empty-toes-doubt.md delete mode 100644 packages/binance/tsup.config.cjs delete mode 100644 packages/bitcoin/tsup.config.cjs delete mode 100644 packages/bitcoincash/tsup.config.cjs delete mode 100644 packages/core/tsup.config.cjs delete mode 100644 packages/dogecoin/tsup.config.cjs delete mode 100644 packages/evm/tsup.config.cjs delete mode 100644 packages/litecoin/tsup.config.cjs delete mode 100644 packages/solana/tsup.config.cjs delete mode 100644 packages/tron/tsup.config.cjs diff --git a/.changeset/empty-toes-doubt.md b/.changeset/empty-toes-doubt.md new file mode 100644 index 00000000..30dcca73 --- /dev/null +++ b/.changeset/empty-toes-doubt.md @@ -0,0 +1,14 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-evm': patch +--- + +Revert tsup config diff --git a/packages/binance/package.json b/packages/binance/package.json index f154419a..014060cd 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -53,6 +53,27 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "targer": "ES6", + "external": [ + "@binance-chain/javascript-sdk" + ] + }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/binance/tsup.config.cjs b/packages/binance/tsup.config.cjs deleted file mode 100644 index 6902cd90..00000000 --- a/packages/binance/tsup.config.cjs +++ /dev/null @@ -1,27 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - external: ['@binance-chain/javascript-sdk'], - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 7cdee481..670d0112 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -64,6 +64,24 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/bitcoin/tsup.config.cjs b/packages/bitcoin/tsup.config.cjs deleted file mode 100644 index 042cde65..00000000 --- a/packages/bitcoin/tsup.config.cjs +++ /dev/null @@ -1,26 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index e2cc08ef..c4503bd1 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -67,6 +67,24 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/bitcoincash/tsup.config.cjs b/packages/bitcoincash/tsup.config.cjs deleted file mode 100644 index 042cde65..00000000 --- a/packages/bitcoincash/tsup.config.cjs +++ /dev/null @@ -1,26 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/core/package.json b/packages/core/package.json index c6eda414..3a6263b9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -70,6 +70,22 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/index.ts", + "!src/**/*.spec.*", + "!src/custom.d.ts" + ], + "outDir": "dist", + "format": "cjs", + "splitting": false, + "dts": true, + "types": [ + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [], "preset": "ts-jest", diff --git a/packages/core/tsup.config.cjs b/packages/core/tsup.config.cjs deleted file mode 100644 index 4cef9fb3..00000000 --- a/packages/core/tsup.config.cjs +++ /dev/null @@ -1,17 +0,0 @@ -const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: ['src/index.ts', '!src/**/*.spec.*', '!src/custom.d.ts'], - outDir: 'dist', - format: ['esm', 'cjs'], - splitting: false, - dts: true, - shims: true, - types: ['./dist/index.d.ts'], - platform: 'browser', - target: 'ES6', - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index e08b204b..4434eb7f 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -63,6 +63,24 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/dogecoin/tsup.config.cjs b/packages/dogecoin/tsup.config.cjs deleted file mode 100644 index 042cde65..00000000 --- a/packages/dogecoin/tsup.config.cjs +++ /dev/null @@ -1,26 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/evm/package.json b/packages/evm/package.json index a412b64e..b94fb01d 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -59,6 +59,25 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "outDir": "dist", + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/evm/tsup.config.cjs b/packages/evm/tsup.config.cjs deleted file mode 100644 index 9fbb9733..00000000 --- a/packages/evm/tsup.config.cjs +++ /dev/null @@ -1,27 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - external: [], - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 2d621970..ac657b3c 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -64,6 +64,24 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/litecoin/tsup.config.cjs b/packages/litecoin/tsup.config.cjs deleted file mode 100644 index 042cde65..00000000 --- a/packages/litecoin/tsup.config.cjs +++ /dev/null @@ -1,26 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/solana/package.json b/packages/solana/package.json index 2be6b895..41cef859 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -62,6 +62,24 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [ "./jest-setup-file.ts", diff --git a/packages/solana/tsup.config.cjs b/packages/solana/tsup.config.cjs deleted file mode 100644 index 042cde65..00000000 --- a/packages/solana/tsup.config.cjs +++ /dev/null @@ -1,26 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; diff --git a/packages/thor/tsup.config.cjs b/packages/thor/tsup.config.cjs index 071b1d2e..f9b62316 100644 --- a/packages/thor/tsup.config.cjs +++ b/packages/thor/tsup.config.cjs @@ -22,6 +22,5 @@ module.exports = { target: 'ES6', external: ['crypto', 'bip32'], plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, }, }; diff --git a/packages/tron/package.json b/packages/tron/package.json index a2f0a5ea..11897c5e 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -58,6 +58,24 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "type": "commonjs", + "tsup": { + "entry": [ + "src/signers/web.ts", + "src/signers/react-native.ts", + "src/index.ts" + ], + "format": "cjs", + "splitting": false, + "dts": true, + "shims": true, + "types": [ + "./dist/signers/web.d.ts", + "./dist/signers/react-native.d.ts", + "./dist/index.d.ts" + ], + "platform": "browser", + "target": "ES6" + }, "jest": { "setupFiles": [ "dotenv/config", diff --git a/packages/tron/tsup.config.cjs b/packages/tron/tsup.config.cjs deleted file mode 100644 index 042cde65..00000000 --- a/packages/tron/tsup.config.cjs +++ /dev/null @@ -1,26 +0,0 @@ -const { - NodeModulesPolyfillPlugin, -} = require('@esbuild-plugins/node-modules-polyfill'); - -module.exports = { - tsup: { - entry: [ - 'src/index.ts', - 'src/signers/web.ts', - 'src/signers/react-native.ts', - ], - format: 'cjs', - splitting: false, - dts: true, - shims: true, - types: [ - './dist/index.d.ts', - './dist/signers/web.d.ts', - './dist/signers/react-native.d.ts', - ], - platform: 'browser', - target: 'ES6', - plugins: [NodeModulesPolyfillPlugin()], - skipNodeModulesBundle: true, - }, -}; From 9837e38a99dbf602bc4dd08d3cbfe7380e9d1dd5 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 17 Jul 2024 08:30:04 +0000 Subject: [PATCH 061/176] Version packages --- .changeset/empty-toes-doubt.md | 14 -------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 8 ++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 ++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 ++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 ++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- 21 files changed, 88 insertions(+), 24 deletions(-) delete mode 100644 .changeset/empty-toes-doubt.md diff --git a/.changeset/empty-toes-doubt.md b/.changeset/empty-toes-doubt.md deleted file mode 100644 index 30dcca73..00000000 --- a/.changeset/empty-toes-doubt.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-evm': patch ---- - -Revert tsup config diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 69395408..5181f3f8 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.17 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.16 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 014060cd..79c22786 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.16", + "version": "2.0.17", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 60eaaa38..89b1d350 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.0.22 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.21 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 670d0112..6f67e180 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.21", + "version": "2.0.22", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 77fce5be..43e08ebd 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.23 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.22 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index c4503bd1..17d85c66 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.22", + "version": "2.0.23", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 67272188..f6c3f7d7 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.22 + +### Patch Changes + +- 9a9fe602: Revert tsup config + ## 2.0.21 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 3a6263b9..75381892 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.21", + "version": "2.0.22", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index f063a813..9b5d69fc 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.0.22 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.21 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 4434eb7f..aa53c4d2 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.21", + "version": "2.0.22", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 97eddf01..857b2547 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.36 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.35 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index b94fb01d..28edc8b0 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.35", + "version": "2.0.36", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 9b6ddd82..43314e72 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.0.20 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.19 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index ac657b3c..c43b81ba 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.19", + "version": "2.0.20", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 5bbad18b..82c82cc6 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.24 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.23 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 41cef859..9e2a1c87 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.23", + "version": "2.0.24", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index a71bf461..668dcdea 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.0.24 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.23 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index b3ff7d17..d81ddd67 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.23", + "version": "2.0.24", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 260305fb..ca1f9585 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.24 + +### Patch Changes + +- 9a9fe602: Revert tsup config +- Updated dependencies [9a9fe602] + - @xdefi-tech/chains-core@2.0.22 + ## 2.0.23 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 11897c5e..42e8c061 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.23", + "version": "2.0.24", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 9281ca20d1626241130fa4e53d0e600b5360e9f9 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Thu, 18 Jul 2024 22:52:53 +0300 Subject: [PATCH 062/176] fix: getBalance method indexer datasouce decimals for thorchain/mayachain (#281) --- .changeset/chilled-jeans-pump.md | 5 +++++ packages/thor/src/datasource/indexer/indexer.data-source.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilled-jeans-pump.md diff --git a/.changeset/chilled-jeans-pump.md b/.changeset/chilled-jeans-pump.md new file mode 100644 index 00000000..df5f31b6 --- /dev/null +++ b/.changeset/chilled-jeans-pump.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-thor': patch +--- + +Fix: getBalance decimals for indexer datasource diff --git a/packages/thor/src/datasource/indexer/indexer.data-source.ts b/packages/thor/src/datasource/indexer/indexer.data-source.ts index 84d32058..04a6bb3a 100644 --- a/packages/thor/src/datasource/indexer/indexer.data-source.ts +++ b/packages/thor/src/datasource/indexer/indexer.data-source.ts @@ -15,6 +15,7 @@ import { Observable } from 'rxjs'; import cosmosclient from '@cosmos-client/core'; import axios, { Axios } from 'axios'; import Long from 'long'; +import BigNumber from 'bignumber.js'; import { ChainMsg } from '../../msg'; import * as manifests from '../../manifests'; @@ -64,7 +65,9 @@ export class IndexerDataSource extends DataSource { price: asset.price?.amount, decimals: asset.price?.scalingFactor, }), - amount.value + new BigNumber(amount.value) + .integerValue() + .dividedBy(Math.pow(10, asset.decimals)) ); }); } From 84a4c19a2bd3c36c1d50769d84887c0a914ab21f Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 18 Jul 2024 19:55:23 +0000 Subject: [PATCH 063/176] Version packages --- .changeset/chilled-jeans-pump.md | 5 ----- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/chilled-jeans-pump.md diff --git a/.changeset/chilled-jeans-pump.md b/.changeset/chilled-jeans-pump.md deleted file mode 100644 index df5f31b6..00000000 --- a/.changeset/chilled-jeans-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch ---- - -Fix: getBalance decimals for indexer datasource diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 668dcdea..30789374 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.0.25 + +### Patch Changes + +- 6ed254de: Fix: getBalance decimals for indexer datasource + ## 2.0.24 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index d81ddd67..a2899d4e 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.24", + "version": "2.0.25", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 10c21e48da94f59795a4c3414873c7f8847caa49 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:22:33 +0700 Subject: [PATCH 064/176] feat: Ordinals - allow to spend UTXOs without losing the Ordinals (#231) * feat: Ordinals - allow to spend UTXOs without losing the Ordinals * fix: Add logic to spend UTXOs containing ordinals without losing the ordinals * fix: Add logic to spend UTXOs containing ordinals without losing the ordinals * chore: add logic to prevent creating bitcoin dust when splitting ordinals * feat: handle mutilple ordinals in a utxo and refactor code with new bitcoin dust filter * feat: handle mutilple ordinals in a utxo * feat: handle mutilple ordinals in a utxo * bump: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 Co-authored-by: danilxdefi --- .changeset/red-flowers-double.md | 5 + packages/bitcoin/src/chain.provider.ts | 17 +- .../datasource/indexer/indexer.data-source.ts | 2 + .../queries/getTransactionByHash.query.ts | 25 +- .../datasource/indexer/queries/nfts.query.ts | 1 + packages/bitcoin/src/msg.spec.ts | 458 +++++++++++------- packages/bitcoin/src/msg.ts | 438 ++++++++++++++--- packages/bitcoin/src/signers/ledger.signer.ts | 1 + .../bitcoin/src/signers/trezor.signer.spec.ts | 17 +- packages/bitcoin/src/signers/trezor.signer.ts | 7 +- 10 files changed, 712 insertions(+), 259 deletions(-) create mode 100644 .changeset/red-flowers-double.md diff --git a/.changeset/red-flowers-double.md b/.changeset/red-flowers-double.md new file mode 100644 index 00000000..c1fad9f9 --- /dev/null +++ b/.changeset/red-flowers-double.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-bitcoin': patch +--- + +Fix: allow to spend UTXOs without losing the ordinals diff --git a/packages/bitcoin/src/chain.provider.ts b/packages/bitcoin/src/chain.provider.ts index d78551fb..63e0e0a3 100644 --- a/packages/bitcoin/src/chain.provider.ts +++ b/packages/bitcoin/src/chain.provider.ts @@ -37,8 +37,21 @@ export class BitcoinProvider extends UtxoProvider { return this.dataSource.getTransaction(txHash); } - public async scanUTXOs(address: string) { - return this.dataSource.scanUTXOs(address); + public async scanUTXOs( + address: string, + options?: { includeOrigins: boolean } + ) { + const utxos = await this.dataSource.scanUTXOs(address); + if (options?.includeOrigins) { + return utxos; + } + const ordinals = await this.getNFTBalance(address); + return utxos.filter((utxo) => + (ordinals as any[]).every( + (ordinals) => + !String(ordinals.location).startsWith(`${utxo.hash}:${utxo.index}`) + ) + ); } static verifyAddress(address: string): boolean { diff --git a/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts b/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts index d4017810..21a977a0 100644 --- a/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts +++ b/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts @@ -153,6 +153,8 @@ export class IndexerDataSource extends DataSource { (tx.blockNumber || 0) > 0 ? TransactionStatus.success : TransactionStatus.pending, + inputs: tx.inputs, + outputs: tx.outputs, }; } diff --git a/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts b/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts index 7714f927..97940030 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/getTransactionByHash.query.ts @@ -1,11 +1,34 @@ import { gqlClient } from '@xdefi-tech/chains-core'; +import { gql } from 'graphql-tag'; import { BitcoinGetTransactionByHashDocument } from '../../../gql/graphql'; +export const BITCOIN_GET_TRANSACTION_BY_HASH = gql` + query GetTransactionByHash($txHash: String!) { + bitcoin { + getTransactionByHashV5(txHash: $txHash) { + hash + outputs { + address + amount { + value + } + } + inputs { + address + amount { + value + } + } + blockNumber + } + } + } +`; export const getTransactionByHash = async (txHash: string) => { try { const response = await gqlClient.query({ - query: BitcoinGetTransactionByHashDocument, + query: BITCOIN_GET_TRANSACTION_BY_HASH, variables: { txHash, }, diff --git a/packages/bitcoin/src/datasource/indexer/queries/nfts.query.ts b/packages/bitcoin/src/datasource/indexer/queries/nfts.query.ts index 189a3317..8e86d134 100644 --- a/packages/bitcoin/src/datasource/indexer/queries/nfts.query.ts +++ b/packages/bitcoin/src/datasource/indexer/queries/nfts.query.ts @@ -6,6 +6,7 @@ export const BITCOIN_NFTS_QUERY = gql` bitcoin { legacyNFTs(address: $address) { ...LegacyNftData + location } } } diff --git a/packages/bitcoin/src/msg.spec.ts b/packages/bitcoin/src/msg.spec.ts index bee53581..3e58807e 100644 --- a/packages/bitcoin/src/msg.spec.ts +++ b/packages/bitcoin/src/msg.spec.ts @@ -9,24 +9,22 @@ import { IndexerDataSource } from './datasource'; import { BITCOIN_MANIFEST } from './manifests'; import * as scanUtxosMoudle from './datasource/indexer/queries/scanUTXOs.query'; import * as feeModule from './datasource/indexer/queries/fees.query'; +import * as nftModule from './datasource/indexer/queries/nfts.query'; jest.mock('./datasource/indexer/queries/scanUTXOs.query', () => { const originalModule = jest.requireActual( './datasource/indexer/queries/scanUTXOs.query' ); - return { __esModule: true, ...originalModule, scanUTXOs: jest.fn(), }; }); - jest.mock('./datasource/indexer/queries/fees.query', () => { const originalModule = jest.requireActual( './datasource/indexer/queries/fees.query' ); - return { __esModule: true, ...originalModule, @@ -38,124 +36,120 @@ jest.mock('./datasource/indexer/queries/fees.query', () => { }; }); -describe('msg', () => { - let mockProvider: any; +jest.mock('./datasource/indexer/queries/nfts.query.ts', () => { + const originalModule = jest.requireActual( + './datasource/indexer/queries/nfts.query' + ); + return { + __esModule: true, + ...originalModule, + getNFTBalance: jest.fn(), + }; +}); - beforeEach(() => { - mockProvider = { - scanUTXOs: jest.fn(() => - Promise.resolve([ - { - hash: 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d', - value: 1000, - index: 0, - witnessUtxo: { - value: 1000, - script: Buffer.from( - '5120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e4088', - 'hex' - ), - }, - txHex: - '0200000000010173c12c3f6f99438c02abb77a8d782f651a80b7dac30dac74dbd9ea988e2c966b000000000005000000032202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40882202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40880000000000000000296a5d26020704948db1feb59ec9a6d302010003a40205a9e90706f4f3ccc8010a84f60d08aedf01160103406cb75a669728ffa3529936bd3c37aa8b606442f8a8a5c8cd8c0f2b7774bbffebbc7a770e8789aeb55e0c59540929ba5e837a0ce0b4a7f9bdb3adf61eda2d128bfde62420c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c8248ac0063036f72645d099446cc5ff3244d530101010a696d6167652f6a706567004d0802ffd8ffe000104a46494600010100000100010000ffe201d84943435f50524f46494c45000101000001c800000000043000006d6e74725247422058595a2007e00001000100000000000061637370000000000000000000000000000000000000000000000000000000010000f6d6000100000000d32d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000964657363000000f0000000247258595a00000114000000146758595a00000128000000146258595a0000013c00000014777470740000015000000014725452430000016400000028675452430000016400000028625452430000016400000028637072740000018c0000003c6d6c756300000000000000010000000c656e5553000000080000001c007300520047004258595a200000000000006fa2000038f50000039058595a2000000000000062990000b785000018da58595a2000000000000024a000000f840000b6cf58595a20000000000000f6d6000100000000d32d706172610000000000040000000266660000f2a700000d59000013d000000a5b00000000000000006d6c756300000000000000010000000c656e5553000000200000001c0047006f006f0067006c006500200049006e0063002e00200032003000310036ffdb004300191113161310191614161c1b191e253e29252222254d08024c373a2d3e5a505f5e595057566470907a646a886c56577daa7e889499a1a2a16178b0bdaf9cbb909ea19affdb0043011b1c1c252125492929499a6757679a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9affc00011080190019003012200021101031101ffc4001a000002030101000000000000000000000001020003040506ffc40031100002020104010304020201040301000000010203110412213141051351223261711442238133152452a1436291b1ffc4001801010101010100000000000000000000000001020304ffc4001d110101010101000203000000000000000000011102032131121351ffda000c03010002110311003f00f4ec082c08a88064032800279030030308ac2125da232488c0460616294062c7c8cc58f9003030b158400308000bef2322fbc8fb0000200a842100847d108fa00f84144f08888190c844320a643088641523f79615c7ef1c8190401401080801210840b67432e90b3e865d20080200210800200200a0fa129fec3cbed6253f6cbf611d16041022a201858aca0790327923085030b03012406190180ac563314a031579198abb61018ac662b000020002fbc8fb22fbc8c000090281024c0108fa0e08d70407c220d8e82a127d2602850ded4d7f560c35e02a2185414018fde3891fb87228a1854301028014404840804d0802b2185978180012100042100040802927f6b055ff001ffb0d9f6b257ff1a08de04117c9a44606162b081e40c3e40c00c56160602488c92e88c0562b0b032851576c662aed84462b0b000001000abef41605f7a0bec0042070151070443c20e4f0910051c97d5a594fbe11a68d3a8accbb3425826ae29869a11ed65966211f84194e315cbc1cfd5d8fdc8a4f8c915bac4dc7e9c18a745edf48d3fc8ae1149cb90c2edef88bc7c8197d8718e6512bdadfdb1674da4fb2b9cabfb1b49b039e961f2326596685c9e63302d2db1e9a6501048ebb62b9c15bb2517871cfe80b421846528a963046b1d904210202bed0ec47f721d80081200001030214db7c6b59657a8d46de11835176e8bcbe41ae94e6a55e53e19643fe3472347a9ffe393e3c1d78fd8bf406e17c858be4d322c56160602bec0c2fb0300315840c059740f049744f050ac0c2c561018abb633117dcc08c0162b00300401417dc82fb02fbd0584421064829a11727847474f4a8472fb2ad253c6e66c336ac4200119a9671e08acf753dce5997e0c3aa8d925ba4b62f075c4b2a8598dcb2064d0550954a4e3997cb345f29421fe38e59625182c2c2466d5ea556b6c7993032bd6d95a7bfb1689c5d9ee5cf327d234e9f48a5fe4b965bf05b1d1d519ee480ba324e29ae8c7a8d67b77c611e72cbf516a84308e42b211d439cf9c7488aee71249b40db0f847356a355a878aa1b63f2cd7a7d3c4d0802e1f5593729145f34dc71178316a29b13fa1ca4d9ba5251596f063b7d42b83c47ea7f80055a7b92cca48364955f7c9029f518d9628358c974f49558f32cb0332d4425258792f5252e8b614575ac46290fb52f080a085b29417782895d580459bc45915907d305affc6f00726d9393975d98ef928fecdb2508272f2ce5ea64f73fc8642166db33f0cf49a6b1594c5fe0f2a9ee9a47a1f4e97f8b0163b62f9185f2699415858180afb2323ec0c00c56160602cba0780cba17c140606162b080c55f73198abee023158581801802c01417de8205f720804b74f5ef9a4548e9692bdb0dcfb64a2f8c76a490c0c8bbd61fe0cb44d4d9b2b6cc9e9f395964dff5336bf512b6c5543cbc1d1d252a9a6315df903401b1673508e5986cd44ac6d478463bee72d4e75aedb2b6b0e466aeba55bbe52cbf1928785db0271974ce3fbaff001bfc1d54d35c312fb5555b9330d774aa977946e5b6d826d651db9ee7518b31cb957a8d6cf8cc21f26ca3d3a9ab96b74be59ad612e086d012515c2c155fa885316e4c7b149c711786736dd15b65f194a5ba39e500d8bb58f2decabffe86c5469eb6a2937f26f514a1b71c60e73d0bb752d4dbf6d1064d356efd545d69ed4f2d9de5c212aaa15476c22921db51596046d259664bf5497112ad4ea5b784f831b6db28b2774a4f96239314810ca4d16c2dcac3e8ce14c04d6edaea6d238575bba47a1b2b57d4e0ce46a3d3674d080216dc7c15319b4cb36fe8efe87889c5d3552849ee5c9dad27da88b1dc15f622ba2fc87726fb34c998ac3903015f6464976060062b198ac057d03c05f42ae8a2315858184062afb82c55f701181858a00606100505f721855f721bc816d10df624751709230e863f5391b4cd6a24e5b60d9ce7aac426bcb3a125ba2d7c9c2d5c6dd3d92cc5b8f820b7410f7754e72ea2755dcb7a845e59c1a6ed44deda6b6b3e4ec68f4ee986e9bccdf6c109aab374b622b4b0816bff0033c897592ae1951c9e2eeef4efccf867d53df6a845e1f9123374dca2dee40a655bdd2b1fd4cae9fab55c728cbb63a2f0d1ab433dd5b8fc332786d9a3d3d62b949f9676f170edb720534db4998f55abf6e2d47b0e9a5b34dee4df2f967a1c95eaf54e9bb09f7e0d1a6b27647328e0c9a6ad6a2e95f62e17da6eaac536d2f0516900420262d5ea3faa65da9b7643f2ce5592727928129658320204120320c941c9322b960aa76a441a2166d91add944e2d719c1c6f79e4917276396780345d5c37fd25fa6e383049bddde4d14db89e00e8670156c90ad8ad9b61a23a9f92e8db1979303065ae981d06f216608dd28f65d1d4a7d855ec56056465d30b640ac0ba0be80ba280c56331584017fb045fec01628581801808c01517dc86f222fb90ebb03a1a458af3f25f92aabe9aa286c986e1b22ca3197dc93036619eb97f2e3545f606f8c231fb6290d911481296136065d641c64d08027bd74fb2adca50c32fa7511be5283f057768e49b954ffd1c3d3cb6ec6f9eb142d356db720c615d5d6113dbd42e360d0d15b63cd92dabe1189e5d5fb6afa1773ba4abad7ed9be58a28c2f0834d30a6388aff61b62a75b8bf277e799ccc62dd72945ea6fdbbb08bb572db1869eb79c981d93d2ea5a5e0346a947512b6ce5f8352336eba52be3455ed2e1a41f4b939c2527e59cabb532d4db8ae2db7f076b454fb34462fbf248b71ab246f0b22e4ab5366c81463d5dbba6666194b2c52b2806f0430ebb56ab4d45f205d76aa30e114ad665f839129d96cb2d8d084d72993e475ddfb97057df666a9cd782dcbf2ca2d585fa1a6d61246795bc3427b9f909ad1bb816163f73250e5263c7828efb606c2d342b34c8303234236d00722b264990229ca3d32c8eaa4bb2a62b036475319164649aece630ab651f2074db1598e1abf92f8df197902c62ff006265307f600b1585818500108005f721e1ccd7ecad7dc8b2bff917ec0e9671140dc2cd9cff0051b6d843307c7932d0fa8fa82aa2e15be7c9cad1fb93d6466d3c67b134f5bd46a3eb7c1d0d4b8d1186de30565d68be017cb14c9fe0a68b5595c64bc83552ff0004bf465a7234dabf675dcbe1bc33d14649a4d1e4e153b2c9c9768edfa66a5cead927f544b52574721c95e4a6dbfda9addf6b32d35364c95a9a92ca7c072071bd6310b94be515687d3e7aa7bec6e3037ebb4af51a8aff00f15d9bab4d08028a845462b090094696aa12508acfc9a322648df2032661d6599960d9396d83672ed96e9365080211bc22a33eaee5554df93816d8ecb1b9335fa9dee766d4f846022569834916c2493e4c6a4d054a4351b9dc93e1892b72ccf5c5ce49367568d15718a6d65856385765afe94f068fe2b843749e59be3151584b055a97f41462dbd0e911f482823d0ca257289a1a1251348ccd31597ca25528815311b2c684920132d11cc8d08c02e42b680c56c02d032d790360c816475138f92faf549c96e31b140eb2b232e98727254e51e996c35525d81d0014435319765aa69f4c28ff0064595736afd957f643c5e26981bad78667b529c5c5f92eb1e5265126655c696ed36a963ac9b75aa365196f9c075747b8e325e195eaeb94aa4d3e8a83e95737175bf06bd54bfc3239de9916a5293375ff0055524be08ae4c6f74a9a5db068f532ab50a4f84d829a95ba9db3e8dbaed2c7da52ad7da5475e162945497933ebf9a73f065f4abe53a5c65fd4d1ab79a244699b49acf6a4a329662ceac66a4b299e56726ac3a1a1d63862327f48c495dcc872530b14e29a791f2468f9027c8ad922c817552c57839edf269d5cf32c194b12a14eaa7b296cb4c1ea93db560a38d6cb7cdb148432c8a19010c88b17e9966c476e2b114727430cda8ec1795a067d53e123418f532cd98f8348adf80a03ed05151e9da15a26e264046238a2d62328a6502a944d2d0928a60657124d0802b944d52acaa5008ccc565f281538fc008c51dfe50aff0000281b0b15811832460026468db28f4c4201aaad572b71aa17c64f8672c89b4f8607a48b53a13453207a6665a56db1a688d13224929269f449bc26cc5fcb71b1a97411aa3055f11e876f2858cd4e394c2073b55074dcac8f593a1558ada93ed342db5ab20e2ccda572a6c754baf006caeb8d49a82c6497bcd32264aef962a64572e9829ea5a7d0d7552a67ff00d41a67ff0074d9aefb6bdae326544d1eabdb6a2dfd2ceac66a4b299e6e3349bc7fa37e8354e2d5737df44ab2baf919329521f77046996f966c65434de64c52a21c9f5697291d5393ea9f7128e6910d80a46530121e288a2595c32d222b7fa7d7fd8de53a686cad171d27d25093c26609bccdb35dd2c4198fc952a3ec281e4207a4c0ad8ed0ad00bb8192342b282d8ac8c1900362319a1580ad265728a1d8ac0a6512a957f0687111a682333525d8bc334b4995cab4c0a8563ca0d74267e40001b0068001402ca20a76c62de32c0ee7a7476e917e46b3b2eaab55d2a2bc22ab08d289ae0e3df0ff00b8dbf2ced35c1ccd7476dd097e422bae73d359b65f6b3a316a4b28cfaaad59467ce05d058e55ed7dc40d45538c6525cfd48b59ced64e55dca4981bfc156a64954c6a6c56d6a48328a92c340719b719371ec318b9bcce783a1668e12e57052f40fc480a272aa10c43bf92aabdcb2d5b3e7b35c7d3d67ea91aaaa6152c4d08024501aaa6d4127d96eefa599e2c772fa591a54df200900073bd4619e4e899f555ee8e45238db02a25f2af0c8a073554a26cd2519965a169a5ca5d1d1ae0a11c235214dd2004593c47269967d44b2f051e469bdd26c0bb2a07f608176103d2e40492c742eec011a11a1f22b0118ac768460462b23606ca00ad07206c05680d058ac047115c4b00c0a5a12514cbda12480ceeb6ba11e5768d0c56979028e18f571647f6175af01a6b94ad8c719e423bd559f425f803e64595d2a314bf03ed8a32d2971e0e7fa957fe3ddf0ce94e5f066d457ee552451447ead3afd18f41c5d62f06e8c5c74f87f067d1d4d39c9aed846939bea189347466f645c9f8306a946d82b23f3c809a79bd3d8a32fb65d1d1ed64cfecc2eae0fe0bd2c2480842331eab52e0f117c81ac055a7bd5b0cf92d00a0c9fd2281be0299744645d108001acac0400669e9f2f80474cf3c9a88322e961050584824204428be7c6116ce5b6393249ee7965429104010176102182bd33457288d92640a649a177fc97b49954eb026531588e328be08a7f204944469a2dca60682a8602d947256e2d042e40c2d31594462e4206006c56168802342b896030056d1abd3d62dddf05383a3a2ae2aacf9641ad58db239678028e3a0a87964695bc08dc53c6792bd4ea614f09e647396a25fc88c9bf254751c73c0bb141705d0e629a16688acf38ee4d3395a98ca8dd15f6c8ec48a3514ab60d7924d0802a551a38eda23c9795e9a2e356d7e0b1a08ab51271adb47266e53cc9f475ec9c57d32f264d6462a95b5700acb56fa36d8bed7d9d3aac8d914d328a20a7a64a4369ea8d59519640bd8af81857ca01a0f231545e196f614084210021080403692cb03692cb33d966ee174540b67b9fe0ac20020020f0044102e8207a462b43315b0064391583214cd26552afe0b33920199a7122b3e4d0d26553ab3d00bb93232b94651029fc80cd0ad0d94c0d015b88ad16b42b40540658e223400158c4c00b93a7a04dd7ca30575ef9a47629828414578018cdafd47b34bc76cd671fd4db95d187e48566af4d65d177d8de3c14c9e64d25d1d9bd2ab478fc18b4f4674b658d77d031b3416ab34ebf1c16dd2d9072660f4697d5387e4e8ea239aa4bf015ca77ceed4c229e164dfb70b2ce66997fdec51d69c5b612284b2c9b4a5ddb355b1f4cd897007375953972bb461729c96c933b16637f261d751b56f82eca9544b50aaa9422f9268bdc94dcdfdac5d3e91cdeeb3af837a4a2b096101059cb6c5b7e066caece60d7e00aa1a9ae4fbc33442c4fc9c39adb37fb0c2e9c3a9309aefe7203955eba71ecbe3ae52c05d6e2b9d8a250edddd315b069a737210200200800211f4403e802ba080807a7922b68b58ad0554c563b030a40e43815ac10364991724c805a4fb299d39e8b721c818dc1c58548d4d27d95ce8cf405592342ca1288373403342b59194930e32052e4d080220c60b9a028e59516e8229d9ba5d23a4a51f08a74ba751865f6cd2a2978228672ba39b2d2cb51abdef88c59d5c70578c74073bd433270aa3e4b2e8c68d1ed5f05ea85ef3b25cbf063f54def6d70fec066f478376d93f075e714ab6d89a1d32a288c7cf92cb16e963c203894f1af5fb3ab6bdb16ce5db886bd3fc9a75baa5186c8733611ce9b94f5694565e4ed3fa2b4dfc1468748a987bb6733916d8f772f88a030d92f71c9478687a26adab9ed760d4c7daba16c7ed7c32b9c9696f73fe935902d924bf02b8e4aa2e7a99ee7f4d6bff0066b5158e0a3334556bdb06d9ae5030fa84e30a9c73cb0572a6d3931700264303864ce019200f1b651e9974354ffb1948074637465e47c9cb4dae996c2f947c85d6e219e1a94fb2e538be9853019324f2802420023d53158729803449213058c52291a17234858813b26084c900c0484c8540809900b8a7da2a9d3f05a9840c528342a6d1bdc14bb4553a3e02288cf3d9a74f5ef967c22baf4d29cb18e0e9554aae292283143f5d852c1cef51d54ab7b60c0dd2b12f226f8fca38b0b751645c926e3f22a76dd62ae326b230d776328cba6981d3194d4dacb42e974d1d3c3196df96cb9c92e88a1d26571e7233cb5d020b00707d41ecd53f2fc1afd3f45272f7aeedf499b25a2ae7a8f764b2d78352492e0a98a650c955d56ea6515f0689760c115c37a84a995324dcd3e0cee2e75395b2c38f499a7599d34d08026b1b8c5373e83fc7d91f7751f549f5145649a68d9a94b9db05e0e8a82492326854d4e4f6ed83e91b58228be71aab729748f37a9b5db6ca59e33c1e83d431fc7793813ad3e844aa41819c1a172564081e18180039010024010023464d74c52017c2f6bb2e85d16d18c280df94c2628ce4bc96c6ff0090af5f28e3a1777c9632b920d0f62b0731fd054932283592bc619601ac9023401bf62b414039200020c81b2240326326563440b132cae0e4c5aab737c1b210dab080918a8f43a0602f091424e584d9c4d4e6fd4ed8f6d9d0d6ea125b73839f5dce36b95507297c84ae9c288d5a6d98f07213f67591978c9a6766baceabc154745a9bad4ec585908eca7ba29ae8997e10610db051f8433c4511a235260e1719e4ab53ab8d4b19e4cbe9f39df74ec93e17411bc8df01c2c825c20acf3b36e5bf0535eba1396de983d46ab275e6acfe51cb8ca507b651daff0025474f5347bf64271e70cd0ea8c92dcb3839f45ceb5972e0d3a7d6abdb8a5ca20b5c527842343b030397ead638c631f9397d9d0f5479b52f839ee3f06a334ad0928263f28994c233cab6ba13aecd4d092826114107957f0234d010842600898720200c9845200e402201ee642b19b1701b2b42389630322abdcd764c85a11ac7403000a5f212283401b04c0084636dc964689cbc01528b7d1a2ad3b7ccb82faa8505cf65a9002294561218980b692e4a214ea5c956da195f5b96d54d08022cbfc0ed26b0c838b450f577bdf9dabb3ad5d35d4928c520d74c2aced58c8de42606321c2416d4518afd66d6e3545ca5f80ad739a8acc9e0c3a8d6c79507929746ab54f364b647e0c7abaa3a77b62db654d259beedf672d23abe995fb7a64fcb0e874915a4519ae65cb35c62a11515d204888136a2b2f84577ea214ae797e118adf72ffaad96c87c106c85b1b73b1a7812ed2d76a7be2b261a6f7a5b36ec7b24f8674d4b74535e40e45de9962962a9fd2fe4d9a7d3474f5e177e59a642f20c56d15df6c69adca45ed7c9c4f51d43b2c705f6a2c2b2ea2d76d8e4ca9858ad958462b8a091808d340c8ec0d00b8c8ae2361ae899f902a956238b468038e40a3211e55a623835d0406884cb5d87298002898f807441eeda14715a2ba15802d6004018af91b90a837d202a71156e4fac97fb72ce305d553b565f6419e309359c32c85327df0694864155c298c79c64b17e021e8a06191c94565b16c9ed59671f5baa9cbe983c111d1b75908a7b5e59ccb355a9d4cdc60b0be4d157a6eea549cdee6b253669eea33c657ca28be8b74fa387d73dd63ecb3fea2ec96da6b726fc9874fec2966c8e5fe4ead16d18fa3080babddb16fec62bb7515d6b2da31ffd495967b75472c8adf28a92c302ae11ea2835eedab7761602b59470e71f7fd4943c27c9dd7d1929d2ecd54ed7e7a095a63c24bc11f4335c093e23c85732c78d62c45cfe5fc0daf59846717d3e4d080286babb2c4f1f444cf0c5b54a119622bb6ca8d32846fd227e522686d7656e2fb8f0668dbedd5ecd199c9f9346834f3a54a537cc88366d5e43c0867d66a3d9abf2fa0a4d76b6342db15991c1b1ee9397c96db395927293c94b34c52303c0cc46101832162b604c90010211a2100571f827ec626005234468996bb015c532b957f05fc32600cdca0e4b9c531255fc01ee18065063a8608daa717f018d2e5df05c90c022ae2ba4324904204e119eed5420f1db06aed75c784ccba49d6ecff22cc98127adb3394b0890d7cd3fad706f95709470e28e6eaaa554b8e883a14ea6bb57d3dfc1764e251292d44147cb3b4e4a2b2d814eae129d2f67670ec4f389a69a3d146c84ba6812a6b9fdd14c0e2d7ea16d71518c5c8d354f5ba8feaa11fc9bfd9aa0b2a0bffc33df75dd555b0127a084a3f5cbebf9462b23fc56f36292f05ae9d75af97b51755e951ceeba4e4ca39896a35b628c13dbf276b45a186963f33f2cd15d50aa388452409dd1876c18b1f08495905dc91ced5fa8c62b6c5e5fe0c75d3abd53dcb318fe41aed7bd5ffe488adadbe248e5bf4abf1ff2bc95bd35f43fade57c90771493e98b2e4e3e8f5535aaf6a4f299d60a1626eb925de0e651e9d3949bba6d473f6a3aa408a6ba2ba96211487612632148da4b2ce2fa85deedb85d237ebf50a11708be4e44b9658cd56c4658d15cb82a118ac66c46c00c56303010a40e018020024021004c804d0802c4064214ad132d0c00889a64c130898680f7606d2ec2ce76b2738cb12ca5f246db5dd05dc903f915ff00e48e3ef7f23e9e89ea1bfaf007595f5ffe48656c1ff64731fa7d8bff0090aaca2dafab1303aedd72586d3114298bca514ce4a94d773ffd93dc94b88ee93fc10752dd4c20bbcbf84736fbfdd965f0be07ab477db872fa62742ad1d55afb537f2c0e4d76284d4d768d73d74671c49726e7a6a9f7045362d253f728a031e97ddb3529c13505db3b067d35f5dbc54b8f92e95918f6d20198089a6b2881493ba10fba4914d9afaa0bbc8da8d342e8f3dfc9c8d568ada5b78dd002cbbd5a7649c698b7fa161a4d66af99bf6e3ffb269357553c3ad67f46a9fab5504545ba6f4ba69faa599cbe59b7e98af091c897ace78841b2b7abd55fc42b7c81d4b7555d69b72472355ea2ef93855172fd16c3d3aebda7a89617c237d1a4a74eb108acfc81ccf4dd1ddfc8f7ae8ed5e0ece0242001c7c8322cde136c2a4e7082cc9e0c96fa85714d439655a8dd73c748a1e8fca65466b66e72727db2a66c5461fd45b1a61f03531cdd927e09ec4df83a9edc7e01b57c0d5c733f8ad93f8874f6a15c5134c737f8d815d183a4e057280d31ce748aeb37cab2b95634c617011c59b65588eb2ea632601834bac57584c5180e0b3603683084c0db49801704e82403dcf0c16571b23892c9c9af573aa6b2f397d1d783dd14fe434e4ea348ea93c7dbe0a6bba34bdd4d0802b9e7e11d9d4d1ef57b738fc9569fd3e9a796b74be581cf52d66a9ff8e0e31f965f5fa6592e6eb5fe91d3584b826418c95fa7d10ed67f65f1aab87db148cfaefe425ba8e7f072e7ea37d7c5b09203bce515db48a6dd5d14accec4709eb15ef129b8861ecc732c6f7f909adf77a94eefa74d5c9fe7064fe3fd5ee6b2d4bffae46adea2f588b8d50fc05c74da7799b76cc06fe5dae1b34956d8afeccc754adb75295d6f09f3c9aa76df7c76d55ec88b57a7d517bb516fd4fc2606f9fa9e9a88a8464e6d7845ba4d5bd4e5fb728af962d3a2d3d6938c17ed8f6df1ae3f4e08ad00693586b263d1eafdeb6507e3a370573b57e990b732afe991c8ba89d3625756f8f3e0f4e2d90858b128a61183453d3591588c6323a30504be9c7fa31bd0539ca58fd1755546a5c37fec0b5b001e456d2f214f912cb6105f5345374f10789726451cf3279606afe527d4595cee94caf0400e4391499206c2624a0d73161c872057bf1c496187298ed292e515b835f680702b06f6bb19480515ac8ed030054d0ad17342b4052e223822f68180333ac4759a9c45680c8e02b81adc05712a32380bb4d4e02ca0066700389a3681c018e868ea87b8a77cf2d748edc3534f0948e1dda2b2a7f4da98162b5f54f2fe1151e83dfadff6424f53541665348e3570d45dc551718fcb36d1e9915895f2737f015b2ad446d7f426d7c96b7859627d35c7092491835fad8c20d2606eae4d0802d8599daf3825945762c4e099cdf4472929cde70d9d6039b7fa3d16731fa5fe0c36fa3ea21ff14f28f400063cc7f175f5ff0046d0631d627c50f3f93d3315b434c70ead2ebed7f5cb623769fd3a35b52b24e72fc9b5b4bc8ae71f944064be9c238774ef86a1c2516e2df675add5d5545b725c1cad46b2cd54b6d316ff00252a42f85366e4f123a7a7d7d762c37867265e937ce1bf7fd5f057fc1d6c5e12ff006136bd04b5354565cd06abebb93d924f0712af4bbe6d7bd6348eae9b4f0d3436c17ed8569e08e508acb69154e6a2b2ce65d2b2fb3b6a2456ad66bb6fd14f2fe51853be6f32932eaea8c39c658ef0c0a949e30d8ca60944ada6882f520e4a14daec65302d20aa41c80724c818006c9322649901a493ecadc1ae87c933928ad4f9c3e18d92349f6238b5d1038188a787c8ca404c0ad0dd930056c181da15a017006b2311a02b71034580c014b8a06d2d685710374349a8d43fabe889b68f4fa6ae64b74be59ae52515c944f5318a7c9a45f88c170924536ea6104f9e4e6ea3d424f2a2b839d2b751a9b364385f2135bb55ea71cb49e5fc228d368aed6d8a76271aff0026ad17a6d14e277c94a6747f914c16135fe818b29aa14d6a1058487c9927afae252fd453eb045d74720728fca3936fa86173230ddea6fa865b29af4994fa667be894f984dc59c5d35bea16b5edc70bf276f4fef282f79a6ff043ed86cd36b33c58994cb47ae97f4de601748ec932531c9abd21b79bec72fc1d0a74f5d2b108a45e290c4007a16538c565b0a866bb50e13c2e8965ee4f0b8452f9ec02e6e7ce720c95b8b8f310a9a7c3e190381832100640d2630ad63a01250f82be51767e40d26056a43a90ae256d3405ea436e33a9e3b194c0b593257b83901899154839019320bfa26402e29f656e2d743e43902a53f9e06520ca29a2b706b9881670c8d15a9f87c0ea5900340686230101819a000018180074fd4e73ae9cc4e34b5c92c48f4938c671c496518adf4ad358f2e383496388f555bf245ab843edc9d75e8da65e19743d2f4b0fe886a63852d7592fb2126476eb2d58856d7fa3bce3a4a78c472517eb2b82c4120638f0d36aac97f91b8a2cb1c34f1c7dd21eed5d97cfdba565bf83668fd2bab350f74be018e753a4d46b65c27187c9d8d2fa553424e4b74bf26e8c230588ac20917023151584b012102800aefbd54b9163a984967a02edd8335fac8c3e98f3212cd43926919b6f3902e77ce6b97815c9bed8a422a64391591301f22ca2990990133287e50f1929741ec470f2b8610d90e4ad4da7890df94016b22b580e420201a4c66b22b4d015ca22f28b72069302bc87711c4502c4c2995e49b80bb242b520e407c93a172100833861c1000d27da15c1afb4668802a97c872169315a6ba283d81a026300001001ffd96821c0c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c824800000000', - }, - { - hash: 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d', - value: 1000, - index: 1, - witnessUtxo: { - value: 1000, - script: Buffer.from( - '5120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e4088', - 'hex' - ), - }, - txHex: - '0200000000010173c12c3f6f99438c02abb77a8d782f651a80b7dac30dac74dbd9ea988e2c966b000000000005000000032202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40882202000000000000225120315c668cf7eea0e451ffc7f202965d66ad624fc8a2a543754ce4f640e75e40880000000000000000296a5d26020704948db1feb59ec9a6d302010003a40205a9e90706f4f3ccc8010a84f60d08aedf01160103406cb75a669728ffa3529936bd3c37aa8b606442f8a8a5c8cd8c0f2b7774bbffebbc7a770e8789aeb55e0c59540929ba5e837a0ce0b4a7f9bdb3adf61eda2d128bfde62420c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c8248ac0063036f72645d099446cc5ff3244d530101010a696d6167652f6a706567004d0802ffd8ffe000104a46494600010100000100010000ffe201d84943435f50524f46494c45000101000001c800000000043000006d6e74725247422058595a2007e00001000100000000000061637370000000000000000000000000000000000000000000000000000000010000f6d6000100000000d32d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000964657363000000f0000000247258595a00000114000000146758595a00000128000000146258595a0000013c00000014777470740000015000000014725452430000016400000028675452430000016400000028625452430000016400000028637072740000018c0000003c6d6c756300000000000000010000000c656e5553000000080000001c007300520047004258595a200000000000006fa2000038f50000039058595a2000000000000062990000b785000018da58595a2000000000000024a000000f840000b6cf58595a20000000000000f6d6000100000000d32d706172610000000000040000000266660000f2a700000d59000013d000000a5b00000000000000006d6c756300000000000000010000000c656e5553000000200000001c0047006f006f0067006c006500200049006e0063002e00200032003000310036ffdb004300191113161310191614161c1b191e253e29252222254d08024c373a2d3e5a505f5e595057566470907a646a886c56577daa7e889499a1a2a16178b0bdaf9cbb909ea19affdb0043011b1c1c252125492929499a6757679a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9affc00011080190019003012200021101031101ffc4001a000002030101000000000000000000000001020003040506ffc40031100002020104010304020201040301000000010203110412213141051351223261711442238133152452a1436291b1ffc4001801010101010100000000000000000000000001020304ffc4001d110101010101000203000000000000000000011102032131121351ffda000c03010002110311003f00f4ec082c08a88064032800279030030308ac2125da232488c0460616294062c7c8cc58f9003030b158400308000bef2322fbc8fb0000200a842100847d108fa00f84144f08888190c844320a643088641523f79615c7ef1c8190401401080801210840b67432e90b3e865d20080200210800200200a0fa129fec3cbed6253f6cbf611d16041022a201858aca0790327923085030b03012406190180ac563314a031579198abb61018ac662b000020002fbc8fb22fbc8c000090281024c0108fa0e08d70407c220d8e82a127d2602850ded4d7f560c35e02a2185414018fde3891fb87228a1854301028014404840804d0802b2185978180012100042100040802927f6b055ff001ffb0d9f6b257ff1a08de04117c9a44606162b081e40c3e40c00c56160602488c92e88c0562b0b032851576c662aed84462b0b000001000abef41605f7a0bec0042070151070443c20e4f0910051c97d5a594fbe11a68d3a8accbb3425826ae29869a11ed65966211f84194e315cbc1cfd5d8fdc8a4f8c915bac4dc7e9c18a745edf48d3fc8ae1149cb90c2edef88bc7c8197d8718e6512bdadfdb1674da4fb2b9cabfb1b49b039e961f2326596685c9e63302d2db1e9a6501048ebb62b9c15bb2517871cfe80b421846528a963046b1d904210202bed0ec47f721d80081200001030214db7c6b59657a8d46de11835176e8bcbe41ae94e6a55e53e19643fe3472347a9ffe393e3c1d78fd8bf406e17c858be4d322c56160602bec0c2fb0300315840c059740f049744f050ac0c2c561018abb633117dcc08c0162b00300401417dc82fb02fbd0584421064829a11727847474f4a8472fb2ad253c6e66c336ac4200119a9671e08acf753dce5997e0c3aa8d925ba4b62f075c4b2a8598dcb2064d0550954a4e3997cb345f29421fe38e59625182c2c2466d5ea556b6c7993032bd6d95a7bfb1689c5d9ee5cf327d234e9f48a5fe4b965bf05b1d1d519ee480ba324e29ae8c7a8d67b77c611e72cbf516a84308e42b211d439cf9c7488aee71249b40db0f847356a355a878aa1b63f2cd7a7d3c4d0802e1f5593729145f34dc71178316a29b13fa1ca4d9ba5251596f063b7d42b83c47ea7f80055a7b92cca48364955f7c9029f518d9628358c974f49558f32cb0332d4425258792f5252e8b614575ac46290fb52f080a085b29417782895d580459bc45915907d305affc6f00726d9393975d98ef928fecdb2508272f2ce5ea64f73fc8642166db33f0cf49a6b1594c5fe0f2a9ee9a47a1f4e97f8b0163b62f9185f2699415858180afb2323ec0c00c56160602cba0780cba17c140606162b080c55f73198abee023158581801802c01417de8205f720804b74f5ef9a4548e9692bdb0dcfb64a2f8c76a490c0c8bbd61fe0cb44d4d9b2b6cc9e9f395964dff5336bf512b6c5543cbc1d1d252a9a6315df903401b1673508e5986cd44ac6d478463bee72d4e75aedb2b6b0e466aeba55bbe52cbf1928785db0271974ce3fbaff001bfc1d54d35c312fb5555b9330d774aa977946e5b6d826d651db9ee7518b31cb957a8d6cf8cc21f26ca3d3a9ab96b74be59ad612e086d012515c2c155fa885316e4c7b149c711786736dd15b65f194a5ba39e500d8bb58f2decabffe86c5469eb6a2937f26f514a1b71c60e73d0bb752d4dbf6d1064d356efd545d69ed4f2d9de5c212aaa15476c22921db51596046d259664bf5497112ad4ea5b784f831b6db28b2774a4f96239314810ca4d16c2dcac3e8ce14c04d6edaea6d238575bba47a1b2b57d4e0ce46a3d3674d080216dc7c15319b4cb36fe8efe87889c5d3552849ee5c9dad27da88b1dc15f622ba2fc87726fb34c998ac3903015f6464976060062b198ac057d03c05f42ae8a2315858184062afb82c55f701181858a00606100505f721855f721bc816d10df624751709230e863f5391b4cd6a24e5b60d9ce7aac426bcb3a125ba2d7c9c2d5c6dd3d92cc5b8f820b7410f7754e72ea2755dcb7a845e59c1a6ed44deda6b6b3e4ec68f4ee986e9bccdf6c109aab374b622b4b0816bff0033c897592ae1951c9e2eeef4efccf867d53df6a845e1f9123374dca2dee40a655bdd2b1fd4cae9fab55c728cbb63a2f0d1ab433dd5b8fc332786d9a3d3d62b949f9676f170edb720534db4998f55abf6e2d47b0e9a5b34dee4df2f967a1c95eaf54e9bb09f7e0d1a6b27647328e0c9a6ad6a2e95f62e17da6eaac536d2f0516900420262d5ea3faa65da9b7643f2ce5592727928129658320204120320c941c9322b960aa76a441a2166d91add944e2d719c1c6f79e4917276396780345d5c37fd25fa6e383049bddde4d14db89e00e8670156c90ad8ad9b61a23a9f92e8db1979303065ae981d06f216608dd28f65d1d4a7d855ec56056465d30b640ac0ba0be80ba280c56331584017fb045fec01628581801808c01517dc86f222fb90ebb03a1a458af3f25f92aabe9aa286c986e1b22ca3197dc93036619eb97f2e3545f606f8c231fb6290d911481296136065d641c64d08027bd74fb2adca50c32fa7511be5283f057768e49b954ffd1c3d3cb6ec6f9eb142d356db720c615d5d6113dbd42e360d0d15b63cd92dabe1189e5d5fb6afa1773ba4abad7ed9be58a28c2f0834d30a6388aff61b62a75b8bf277e799ccc62dd72945ea6fdbbb08bb572db1869eb79c981d93d2ea5a5e0346a947512b6ce5f8352336eba52be3455ed2e1a41f4b939c2527e59cabb532d4db8ae2db7f076b454fb34462fbf248b71ab246f0b22e4ab5366c81463d5dbba6666194b2c52b2806f0430ebb56ab4d45f205d76aa30e114ad665f839129d96cb2d8d084d72993e475ddfb97057df666a9cd782dcbf2ca2d585fa1a6d61246795bc3427b9f909ad1bb816163f73250e5263c7828efb606c2d342b34c8303234236d00722b264990229ca3d32c8eaa4bb2a62b036475319164649aece630ab651f2074db1598e1abf92f8df197902c62ff006265307f600b1585818500108005f721e1ccd7ecad7dc8b2bff917ec0e9671140dc2cd9cff0051b6d843307c7932d0fa8fa82aa2e15be7c9cad1fb93d6466d3c67b134f5bd46a3eb7c1d0d4b8d1186de30565d68be017cb14c9fe0a68b5595c64bc83552ff0004bf465a7234dabf675dcbe1bc33d14649a4d1e4e153b2c9c9768edfa66a5cead927f544b52574721c95e4a6dbfda9addf6b32d35364c95a9a92ca7c072071bd6310b94be515687d3e7aa7bec6e3037ebb4af51a8aff00f15d9bab4d08028a845462b090094696aa12508acfc9a322648df2032661d6599960d9396d83672ed96e9365080211bc22a33eaee5554df93816d8ecb1b9335fa9dee766d4f846022569834916c2493e4c6a4d054a4351b9dc93e1892b72ccf5c5ce49367568d15718a6d65856385765afe94f068fe2b843749e59be3151584b055a97f41462dbd0e911f482823d0ca257289a1a1251348ccd31597ca25528815311b2c684920132d11cc8d08c02e42b680c56c02d032d790360c816475138f92faf549c96e31b140eb2b232e98727254e51e996c35525d81d0014435319765aa69f4c28ff0064595736afd957f643c5e26981bad78667b529c5c5f92eb1e5265126655c696ed36a963ac9b75aa365196f9c075747b8e325e195eaeb94aa4d3e8a83e95737175bf06bd54bfc3239de9916a5293375ff0055524be08ae4c6f74a9a5db068f532ab50a4f84d829a95ba9db3e8dbaed2c7da52ad7da5475e162945497933ebf9a73f065f4abe53a5c65fd4d1ab79a244699b49acf6a4a329662ceac66a4b299e56726ac3a1a1d63862327f48c495dcc872530b14e29a791f2468f9027c8ad922c817552c57839edf269d5cf32c194b12a14eaa7b296cb4c1ea93db560a38d6cb7cdb148432c8a19010c88b17e9966c476e2b114727430cda8ec1795a067d53e123418f532cd98f8348adf80a03ed05151e9da15a26e264046238a2d62328a6502a944d2d0928a60657124d0802b944d52acaa5008ccc565f281538fc008c51dfe50aff0000281b0b15811832460026468db28f4c4201aaad572b71aa17c64f8672c89b4f8607a48b53a13453207a6665a56db1a688d13224929269f449bc26cc5fcb71b1a97411aa3055f11e876f2858cd4e394c2073b55074dcac8f593a1558ada93ed342db5ab20e2ccda572a6c754baf006caeb8d49a82c6497bcd32264aef962a64572e9829ea5a7d0d7552a67ff00d41a67ff0074d9aefb6bdae326544d1eabdb6a2dfd2ceac66a4b299e6e3349bc7fa37e8354e2d5737df44ab2baf919329521f77046996f966c65434de64c52a21c9f5697291d5393ea9f7128e6910d80a46530121e288a2595c32d222b7fa7d7fd8de53a686cad171d27d25093c26609bccdb35dd2c4198fc952a3ec281e4207a4c0ad8ed0ad00bb8192342b282d8ac8c1900362319a1580ad265728a1d8ac0a6512a957f0687111a682333525d8bc334b4995cab4c0a8563ca0d74267e40001b0068001402ca20a76c62de32c0ee7a7476e917e46b3b2eaab55d2a2bc22ab08d289ae0e3df0ff00b8dbf2ced35c1ccd7476dd097e422bae73d359b65f6b3a316a4b28cfaaad59467ce05d058e55ed7dc40d45538c6525cfd48b59ced64e55dca4981bfc156a64954c6a6c56d6a48328a92c340719b719371ec318b9bcce783a1668e12e57052f40fc480a272aa10c43bf92aabdcb2d5b3e7b35c7d3d67ea91aaaa6152c4d08024501aaa6d4127d96eefa599e2c772fa591a54df200900073bd4619e4e899f555ee8e45238db02a25f2af0c8a073554a26cd2519965a169a5ca5d1d1ae0a11c235214dd2004593c47269967d44b2f051e469bdd26c0bb2a07f608176103d2e40492c742eec011a11a1f22b0118ac768460462b23606ca00ad07206c05680d058ac047115c4b00c0a5a12514cbda12480ceeb6ba11e5768d0c56979028e18f571647f6175af01a6b94ad8c719e423bd559f425f803e64595d2a314bf03ed8a32d2971e0e7fa957fe3ddf0ce94e5f066d457ee552451447ead3afd18f41c5d62f06e8c5c74f87f067d1d4d39c9aed846939bea189347466f645c9f8306a946d82b23f3c809a79bd3d8a32fb65d1d1ed64cfecc2eae0fe0bd2c2480842331eab52e0f117c81ac055a7bd5b0cf92d00a0c9fd2281be0299744645d108001acac0400669e9f2f80474cf3c9a88322e961050584824204428be7c6116ce5b6393249ee7965429104010176102182bd33457288d92640a649a177fc97b49954eb026531588e328be08a7f204944469a2dca60682a8602d947256e2d042e40c2d31594462e4206006c56168802342b896030056d1abd3d62dddf05383a3a2ae2aacf9641ad58db239678028e3a0a87964695bc08dc53c6792bd4ea614f09e647396a25fc88c9bf254751c73c0bb141705d0e629a16688acf38ee4d3395a98ca8dd15f6c8ec48a3514ab60d7924d0802a551a38eda23c9795e9a2e356d7e0b1a08ab51271adb47266e53cc9f475ec9c57d32f264d6462a95b5700acb56fa36d8bed7d9d3aac8d914d328a20a7a64a4369ea8d59519640bd8af81857ca01a0f231545e196f614084210021080403692cb03692cb33d966ee174540b67b9fe0ac20020020f0044102e8207a462b43315b0064391583214cd26552afe0b33920199a7122b3e4d0d26553ab3d00bb93232b94651029fc80cd0ad0d94c0d015b88ad16b42b40540658e223400158c4c00b93a7a04dd7ca30575ef9a47629828414578018cdafd47b34bc76cd671fd4db95d187e48566af4d65d177d8de3c14c9e64d25d1d9bd2ab478fc18b4f4674b658d77d031b3416ab34ebf1c16dd2d9072660f4697d5387e4e8ea239aa4bf015ca77ceed4c229e164dfb70b2ce66997fdec51d69c5b612284b2c9b4a5ddb355b1f4cd897007375953972bb461729c96c933b16637f261d751b56f82eca9544b50aaa9422f9268bdc94dcdfdac5d3e91cdeeb3af837a4a2b096101059cb6c5b7e066caece60d7e00aa1a9ae4fbc33442c4fc9c39adb37fb0c2e9c3a9309aefe7203955eba71ecbe3ae52c05d6e2b9d8a250edddd315b069a737210200200800211f4403e802ba080807a7922b68b58ad0554c563b030a40e43815ac10364991724c805a4fb299d39e8b721c818dc1c58548d4d27d95ce8cf405592342ca1288373403342b59194930e32052e4d080220c60b9a028e59516e8229d9ba5d23a4a51f08a74ba751865f6cd2a2978228672ba39b2d2cb51abdef88c59d5c70578c74073bd433270aa3e4b2e8c68d1ed5f05ea85ef3b25cbf063f54def6d70fec066f478376d93f075e714ab6d89a1d32a288c7cf92cb16e963c203894f1af5fb3ab6bdb16ce5db886bd3fc9a75baa5186c8733611ce9b94f5694565e4ed3fa2b4dfc1468748a987bb6733916d8f772f88a030d92f71c9478687a26adab9ed760d4c7daba16c7ed7c32b9c9696f73fe935902d924bf02b8e4aa2e7a99ee7f4d6bff0066b5158e0a3334556bdb06d9ae5030fa84e30a9c73cb0572a6d3931700264303864ce019200f1b651e9974354ffb1948074637465e47c9cb4dae996c2f947c85d6e219e1a94fb2e538be9853019324f2802420023d53158729803449213058c52291a17234858813b26084c900c0484c8540809900b8a7da2a9d3f05a9840c528342a6d1bdc14bb4553a3e02288cf3d9a74f5ef967c22baf4d29cb18e0e9554aae292283143f5d852c1cef51d54ab7b60c0dd2b12f226f8fca38b0b751645c926e3f22a76dd62ae326b230d776328cba6981d3194d4dacb42e974d1d3c3196df96cb9c92e88a1d26571e7233cb5d020b00707d41ecd53f2fc1afd3f45272f7aeedf499b25a2ae7a8f764b2d78352492e0a98a650c955d56ea6515f0689760c115c37a84a995324dcd3e0cee2e75395b2c38f499a7599d34d08026b1b8c5373e83fc7d91f7751f549f5145649a68d9a94b9db05e0e8a82492326854d4e4f6ed83e91b58228be71aab729748f37a9b5db6ca59e33c1e83d431fc7793813ad3e844aa41819c1a172564081e18180039010024010023464d74c52017c2f6bb2e85d16d18c280df94c2628ce4bc96c6ff0090af5f28e3a1777c9632b920d0f62b0731fd054932283592bc619601ac9023401bf62b414039200020c81b2240326326563440b132cae0e4c5aab737c1b210dab080918a8f43a0602f091424e584d9c4d4e6fd4ed8f6d9d0d6ea125b73839f5dce36b95507297c84ae9c288d5a6d98f07213f67591978c9a6766baceabc154745a9bad4ec585908eca7ba29ae8997e10610db051f8433c4511a235260e1719e4ab53ab8d4b19e4cbe9f39df74ec93e17411bc8df01c2c825c20acf3b36e5bf0535eba1396de983d46ab275e6acfe51cb8ca507b651daff0025474f5347bf64271e70cd0ea8c92dcb3839f45ceb5972e0d3a7d6abdb8a5ca20b5c527842343b030397ead638c631f9397d9d0f5479b52f839ee3f06a334ad0928263f28994c233cab6ba13aecd4d092826114107957f0234d010842600898720200c9845200e402201ee642b19b1701b2b42389630322abdcd764c85a11ac7403000a5f212283401b04c0084636dc964689cbc01528b7d1a2ad3b7ccb82faa8505cf65a9002294561218980b692e4a214ea5c956da195f5b96d54d08022cbfc0ed26b0c838b450f577bdf9dabb3ad5d35d4928c520d74c2aced58c8de42606321c2416d4518afd66d6e3545ca5f80ad739a8acc9e0c3a8d6c79507929746ab54f364b647e0c7abaa3a77b62db654d259beedf672d23abe995fb7a64fcb0e874915a4519ae65cb35c62a11515d204888136a2b2f84577ea214ae797e118adf72ffaad96c87c106c85b1b73b1a7812ed2d76a7be2b261a6f7a5b36ec7b24f8674d4b74535e40e45de9962962a9fd2fe4d9a7d3474f5e177e59a642f20c56d15df6c69adca45ed7c9c4f51d43b2c705f6a2c2b2ea2d76d8e4ca9858ad958462b8a091808d340c8ec0d00b8c8ae2361ae899f902a956238b468038e40a3211e55a623835d0406884cb5d87298002898f807441eeda14715a2ba15802d6004018af91b90a837d202a71156e4fac97fb72ce305d553b565f6419e309359c32c85327df0694864155c298c79c64b17e021e8a06191c94565b16c9ed59671f5baa9cbe983c111d1b75908a7b5e59ccb355a9d4cdc60b0be4d157a6eea549cdee6b253669eea33c657ca28be8b74fa387d73dd63ecb3fea2ec96da6b726fc9874fec2966c8e5fe4ead16d18fa3080babddb16fec62bb7515d6b2da31ffd495967b75472c8adf28a92c302ae11ea2835eedab7761602b59470e71f7fd4943c27c9dd7d1929d2ecd54ed7e7a095a63c24bc11f4335c093e23c85732c78d62c45cfe5fc0daf59846717d3e4d080286babb2c4f1f444cf0c5b54a119622bb6ca8d32846fd227e522686d7656e2fb8f0668dbedd5ecd199c9f9346834f3a54a537cc88366d5e43c0867d66a3d9abf2fa0a4d76b6342db15991c1b1ee9397c96db395927293c94b34c52303c0cc46101832162b604c90010211a2100571f827ec626005234468996bb015c532b957f05fc32600cdca0e4b9c531255fc01ee18065063a8608daa717f018d2e5df05c90c022ae2ba4324904204e119eed5420f1db06aed75c784ccba49d6ecff22cc98127adb3394b0890d7cd3fad706f95709470e28e6eaaa554b8e883a14ea6bb57d3dfc1764e251292d44147cb3b4e4a2b2d814eae129d2f67670ec4f389a69a3d146c84ba6812a6b9fdd14c0e2d7ea16d71518c5c8d354f5ba8feaa11fc9bfd9aa0b2a0bffc33df75dd555b0127a084a3f5cbebf9462b23fc56f36292f05ae9d75af97b51755e951ceeba4e4ca39896a35b628c13dbf276b45a186963f33f2cd15d50aa388452409dd1876c18b1f08495905dc91ced5fa8c62b6c5e5fe0c75d3abd53dcb318fe41aed7bd5ffe488adadbe248e5bf4abf1ff2bc95bd35f43fade57c90771493e98b2e4e3e8f5535aaf6a4f299d60a1626eb925de0e651e9d3949bba6d473f6a3aa408a6ba2ba96211487612632148da4b2ce2fa85deedb85d237ebf50a11708be4e44b9658cd56c4658d15cb82a118ac66c46c00c56303010a40e018020024021004c804d0802c4064214ad132d0c00889a64c130898680f7606d2ec2ce76b2738cb12ca5f246db5dd05dc903f915ff00e48e3ef7f23e9e89ea1bfaf007595f5ffe48656c1ff64731fa7d8bff0090aaca2dafab1303aedd72586d3114298bca514ce4a94d773ffd93dc94b88ee93fc10752dd4c20bbcbf84736fbfdd965f0be07ab477db872fa62742ad1d55afb537f2c0e4d76284d4d768d73d74671c49726e7a6a9f7045362d253f728a031e97ddb3529c13505db3b067d35f5dbc54b8f92e95918f6d20198089a6b2881493ba10fba4914d9afaa0bbc8da8d342e8f3dfc9c8d568ada5b78dd002cbbd5a7649c698b7fa161a4d66af99bf6e3ffb269357553c3ad67f46a9fab5504545ba6f4ba69faa599cbe59b7e98af091c897ace78841b2b7abd55fc42b7c81d4b7555d69b72472355ea2ef93855172fd16c3d3aebda7a89617c237d1a4a74eb108acfc81ccf4dd1ddfc8f7ae8ed5e0ece0242001c7c8322cde136c2a4e7082cc9e0c96fa85714d439655a8dd73c748a1e8fca65466b66e72727db2a66c5461fd45b1a61f03531cdd927e09ec4df83a9edc7e01b57c0d5c733f8ad93f8874f6a15c5134c737f8d815d183a4e057280d31ce748aeb37cab2b95634c617011c59b65588eb2ea632601834bac57584c5180e0b3603683084c0db49801704e82403dcf0c16571b23892c9c9af573aa6b2f397d1d783dd14fe434e4ea348ea93c7dbe0a6bba34bdd4d0802b9e7e11d9d4d1ef57b738fc9569fd3e9a796b74be581cf52d66a9ff8e0e31f965f5fa6592e6eb5fe91d3584b826418c95fa7d10ed67f65f1aab87db148cfaefe425ba8e7f072e7ea37d7c5b09203bce515db48a6dd5d14accec4709eb15ef129b8861ecc732c6f7f909adf77a94eefa74d5c9fe7064fe3fd5ee6b2d4bffae46adea2f588b8d50fc05c74da7799b76cc06fe5dae1b34956d8afeccc754adb75295d6f09f3c9aa76df7c76d55ec88b57a7d517bb516fd4fc2606f9fa9e9a88a8464e6d7845ba4d5bd4e5fb728af962d3a2d3d6938c17ed8f6df1ae3f4e08ad00693586b263d1eafdeb6507e3a370573b57e990b732afe991c8ba89d3625756f8f3e0f4e2d90858b128a61183453d3591588c6323a30504be9c7fa31bd0539ca58fd1755546a5c37fec0b5b001e456d2f214f912cb6105f5345374f10789726451cf3279606afe527d4595cee94caf0400e4391499206c2624a0d73161c872057bf1c496187298ed292e515b835f680702b06f6bb19480515ac8ed030054d0ad17342b4052e223822f68180333ac4759a9c45680c8e02b81adc05712a32380bb4d4e02ca0066700389a3681c018e868ea87b8a77cf2d748edc3534f0948e1dda2b2a7f4da98162b5f54f2fe1151e83dfadff6424f53541665348e3570d45dc551718fcb36d1e9915895f2737f015b2ad446d7f426d7c96b7859627d35c7092491835fad8c20d2606eae4d0802d8599daf3825945762c4e099cdf4472929cde70d9d6039b7fa3d16731fa5fe0c36fa3ea21ff14f28f400063cc7f175f5ff0046d0631d627c50f3f93d3315b434c70ead2ebed7f5cb623769fd3a35b52b24e72fc9b5b4bc8ae71f944064be9c238774ef86a1c2516e2df675add5d5545b725c1cad46b2cd54b6d316ff00252a42f85366e4f123a7a7d7d762c37867265e937ce1bf7fd5f057fc1d6c5e12ff006136bd04b5354565cd06abebb93d924f0712af4bbe6d7bd6348eae9b4f0d3436c17ed8569e08e508acb69154e6a2b2ce65d2b2fb3b6a2456ad66bb6fd14f2fe51853be6f32932eaea8c39c658ef0c0a949e30d8ca60944ada6882f520e4a14daec65302d20aa41c80724c818006c9322649901a493ecadc1ae87c933928ad4f9c3e18d92349f6238b5d1038188a787c8ca404c0ad0dd930056c181da15a017006b2311a02b71034580c014b8a06d2d685710374349a8d43fabe889b68f4fa6ae64b74be59ae52515c944f5318a7c9a45f88c170924536ea6104f9e4e6ea3d424f2a2b839d2b751a9b364385f2135bb55ea71cb49e5fc228d368aed6d8a76271aff0026ad17a6d14e277c94a6747f914c16135fe818b29aa14d6a1058487c9927afae252fd453eb045d74720728fca3936fa86173230ddea6fa865b29af4994fa667be894f984dc59c5d35bea16b5edc70bf276f4fef282f79a6ff043ed86cd36b33c58994cb47ae97f4de601748ec932531c9abd21b79bec72fc1d0a74f5d2b108a45e290c4007a16538c565b0a866bb50e13c2e8965ee4f0b8452f9ec02e6e7ce720c95b8b8f310a9a7c3e190381832100640d2630ad63a01250f82be51767e40d26056a43a90ae256d3405ea436e33a9e3b194c0b593257b83901899154839019320bfa26402e29f656e2d743e43902a53f9e06520ca29a2b706b9881670c8d15a9f87c0ea5900340686230101819a000018180074fd4e73ae9cc4e34b5c92c48f4938c671c496518adf4ad358f2e383496388f555bf245ab843edc9d75e8da65e19743d2f4b0fe886a63852d7592fb2126476eb2d58856d7fa3bce3a4a78c472517eb2b82c4120638f0d36aac97f91b8a2cb1c34f1c7dd21eed5d97cfdba565bf83668fd2bab350f74be018e753a4d46b65c27187c9d8d2fa553424e4b74bf26e8c230588ac20917023151584b012102800aefbd54b9163a984967a02edd8335fac8c3e98f3212cd43926919b6f3902e77ce6b97815c9bed8a422a64391591301f22ca2990990133287e50f1929741ec470f2b8610d90e4ad4da7890df94016b22b580e420201a4c66b22b4d015ca22f28b72069302bc87711c4502c4c2995e49b80bb242b520e407c93a172100833861c1000d27da15c1afb4668802a97c872169315a6ba283d81a026300001001ffd96821c0c69c3c844f045d9a786266588d89b96bfc636c3ff39a9afd3b346784a24c824800000000', - }, - ]) - ), - getNFTBalance: jest.fn(() => - Promise.resolve([ - { - description: null, - id: '20090103/e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6di0', - name: 'Inscription #70316307', - owner: - 'bc1px9wxdr8ha6swg50lcleq99jav6kkyn7g52j5xa2vunmype67gzyqyq6ah7', - symbol: '', - isNftSpam: false, - location: - 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d:0:0', - contractType: 'ORDINALS', - spamScore: 0, - }, - ]) - ), - gasFeeOptions: jest.fn(() => - Promise.resolve({ - high: 3000, - low: 3000, - medium: 3000, - }) - ), - getBalance: jest.fn(() => - Promise.resolve({ - getData: jest.fn(() => - Promise.resolve([ - { - asset: { - chainId: 'bitcoin', - name: 'Bitcoin', - symbol: 'BTC', - icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoin/info/logo.png', - native: true, - id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', - price: '65000.00', - decimals: 8, - }, - amount: '100', - }, - ]) - ), - }) - ), - manifest: { - name: 'Bitcoin', - description: '', - rpcURL: 'https://btc-haskoin.xdefiservices.com', - chainSymbol: 'BTC', - blockExplorerURL: 'https://blockchair.com/bitcoin', - chainId: 'bitcoin', - chain: 'bitcoin', +jest.mock('./datasource/indexer/queries/balances.query.ts', () => ({ + getBalance: jest.fn().mockResolvedValue([ + { + address: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + asset: { + chain: 'Bitcoin', + contract: null, decimals: 8, - feeGasStep: { - high: 1, - medium: 1, - low: 1, + id: 'bcafa2bf-d442-483a-96a4-0199f4371678', + image: + 'https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579', + name: 'Bitcoin', + symbol: 'BTC', + type: 'CRYPTOCURRENCY', + }, + amount: { + value: '100000000', // 1 BTC + }, + }, + ]), +})); + +describe('msg', () => { + let provider: BitcoinProvider; + const address = 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw'; + const mockFirstTx = new bitcoin.Transaction(); + mockFirstTx.addInput(Buffer.alloc(32, 0), 0); + mockFirstTx.addOutput(bitcoin.address.toOutputScript(address), 10000); // TX contains ordinals + const mockSecondTx = new bitcoin.Transaction(); + mockSecondTx.addInput(Buffer.alloc(32, 0), 0); + mockSecondTx.addOutput(bitcoin.address.toOutputScript(address), 3000); // Tx not contain ordinals + beforeEach(() => { + provider = new BitcoinProvider(new IndexerDataSource(BITCOIN_MANIFEST)); + (scanUtxosMoudle.scanUTXOs as any).mockResolvedValue([ + { + oTxHash: mockFirstTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockFirstTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockFirstTx.outs[0].script.toString('hex'), + value: { + value: '10000', }, - maxGapAmount: 0.0001, }, - }; + { + oTxHash: mockSecondTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockSecondTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockSecondTx.outs[0].script.toString('hex'), + value: { + value: '3000', + }, + }, + ]); + + (nftModule.getNFTBalance as any).mockResolvedValue([ + { + balance: { + value: '1', + }, + description: null, + id: '20090103/3cdf1ac8d4f969647b88d0c448169c57f6cb1d4acbe5d2ded2fd82f04a011e04i0', // 546 sat + name: 'Pixel Pepes #772', + owner: 'bc1petmz5t6sue8s0s9xgnnydtgektadm3g85x2w0ahtmwpl5v0p9xtsrzgqry', + isNftSpam: false, + location: `${mockFirstTx.getHash().toString('hex')}:0:1000`, + contractType: 'ORDINALS', + }, + { + balance: { + value: '1', + }, + description: null, + id: '20090103/970b90249fdd4650938b2f2dbf6e0a2617c54b34b8f4325d13f08a1d0c596f02i0', // 546 sat + name: 'Pixel Pepes #772', + owner: 'bc1petmz5t6sue8s0s9xgnnydtgektadm3g85x2w0ahtmwpl5v0p9xtsrzgqry', + isNftSpam: false, + location: `${mockFirstTx.getHash().toString('hex')}:0:3000`, + contractType: 'ORDINALS', + }, + ]); }); it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', - to: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', + from: address, + to: address, amount: 0.000001, }, - mockProvider, + provider, MsgEncoding.object ); const response = await chainMsg.getFee(); - const feeOptions = await mockProvider.gasFeeOptions(); + const feeOptions = await provider.gasFeeOptions(); expect(response.fee).toEqual( - new BigNumber(feeOptions[GasFeeSpeed.medium] as number) - .dividedBy(10 ** mockProvider.manifest.decimals) + new BigNumber(feeOptions?.[GasFeeSpeed.medium] as number) + .dividedBy(10 ** provider.manifest.decimals) .toString() ); expect(response.maxFee).toBeNull(); @@ -164,32 +158,29 @@ describe('msg', () => { it('buildTx with sufficient funds and no NFT', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', - to: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', + from: address, + to: address, amount: 0.000001, }, - mockProvider, + provider, MsgEncoding.object ); - const { inputs, outputs, utxos } = await chainMsg.buildTx(); + const { inputs, outputs } = await chainMsg.buildTx(); expect(inputs.length).toEqual(1); - expect(inputs[0].hash).toEqual( - 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d' + expect(inputs[0].hash).not.toEqual( + mockFirstTx.getHash().toString('hex') // Different utxos containing ordinal ); - expect(inputs[0].index).toEqual(1); - expect(utxos.length).toEqual(1); - expect(utxos[0].index).toEqual(1); expect(outputs[0].value).toEqual(100); // 0.000001 * 10 ** 8 }); it('buildTx with insufficient funds and no NFT', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', - to: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', + from: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + to: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', amount: 0.01, }, - mockProvider, + provider, MsgEncoding.object ); try { @@ -204,36 +195,30 @@ describe('msg', () => { it('buildTx with nft and sufficient balance for paying the fee', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', - to: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', + from: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + to: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', amount: 0, - nftId: - 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d:0:0', + nftId: `${mockFirstTx.getHash().toString('hex')}:0:1000`, }, - mockProvider, + provider, MsgEncoding.object ); - const { inputs, outputs, utxos } = await chainMsg.buildTx(); + const { inputs } = await chainMsg.buildTx(); expect(inputs.length).toEqual(2); - expect(inputs[0].hash).toEqual( - 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d' - ); + expect(inputs[0].hash).toEqual(mockFirstTx.getHash().toString('hex')); expect(inputs[0].index).toEqual(0); - expect(utxos.length).toEqual(2); - expect(outputs[0].value).toEqual(inputs[0].value); }); it('buildTx with nft and insufficient balance for paying the fee', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', - to: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', + from: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + to: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', amount: 0, - nftId: - 'e08df1abc9c1618ba7fe3c3652c5911263ceb75a95dcee0424e7700ac0e63a6d:0:0', + nftId: `${mockFirstTx.getHash().toString('hex')}:0:1000`, gasLimit: 100_000_000_000, }, - mockProvider, + provider, MsgEncoding.object ); try { @@ -248,13 +233,13 @@ describe('msg', () => { it('buildTx with non-owned nft ', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', - to: 'bc1qqqszrzvw3l5437qw66df0779ycuumwhnnf5yqz', + from: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + to: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', amount: 0, nftId: - '86681fb16190a28e563380bb53ad3c47fecd05bb878bc2da2d77d78c16c46b4e:0:0', + 'a4a1f74719c94a0343dcfde960465fd6849ca0e240c2b3169f61b3e93c64acda:0:0', }, - mockProvider, + provider, MsgEncoding.object ); try { @@ -264,45 +249,157 @@ describe('msg', () => { } }); - it('getMaxAmountToSend should throw an error with invalid token', async () => { + it('should return MaxAmountToSend with native token', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', - to: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + from: address, + to: address, amount: 0.000001, }, - mockProvider, + provider, MsgEncoding.object ); - const response = chainMsg.getMaxAmountToSend('invalid'); + const response = await chainMsg.getMaxAmountToSend(); - await expect(response).rejects.toThrowError(); + const feeEstimation = await chainMsg.getFee(); + const gap = chainMsg.provider.manifest?.maxGapAmount || 0; + + expect(response); + expect(response).toEqual( + new BigNumber(1) // Balance mocks + .minus((2 * 546) / 1e8) // ordinals values + .minus(feeEstimation.fee || 0) + .minus(gap) + .toString() + ); }); - it('should return MaxAmountToSend with native token', async () => { + it('Should can not spend utxos', async () => { const chainMsg = new ChainMsg( { - from: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', - to: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + from: 'bc1petmz5t6sue8s0s9xgnnydtgektadm3g85x2w0ahtmwpl5v0p9xtsrzgqry', + to: 'bc1petmz5t6sue8s0s9xgnnydtgektadm3g85x2w0ahtmwpl5v0p9xtsrzgqry', amount: 0.000001, }, - mockProvider, + provider, MsgEncoding.object ); + try { + await chainMsg.buildTx(); + } catch (error) { + expect(error).toMatchObject( + new Error('Insufficient Balance for transaction') + ); + } + }); - const response = await chainMsg.getMaxAmountToSend(); + it('Should can spend utxos without losing ordinals', async () => { + const chainMsg = new ChainMsg( + { + from: address, + to: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + amount: 0.00001, + nftId: `${mockFirstTx.getHash().toString('hex')}:0:1000`, + spendUtxosContainOrdinal: true, + }, + provider, + MsgEncoding.object + ); + const response = await chainMsg.buildTx(); // Expect tx [10000, 3000] => [1000, ord_to_send, 2000 - 546, ord, 7000 - 546, amount_to_send] + expect(response.inputs[0].hash).toEqual( + mockFirstTx.getHash().toString('hex') + ); + expect(response.inputs[1].hash).toEqual( + mockSecondTx.getHash().toString('hex') + ); + expect(response.outputs[0].value).toEqual(1000); + expect(response.outputs[1].value).toEqual(546); + expect(response.outputs[1].address).toEqual( + 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q' + ); + expect(response.outputs[2].value).toEqual(2000 - 546); + expect(response.outputs[3].value).toEqual(546); + expect(response.outputs[4].value).toEqual(7000 - 546); + expect(response.outputs[5].value).toEqual(1000); + }); - const feeEstimation = await chainMsg.getFee(); - const gap = chainMsg.provider.manifest?.maxGapAmount || 0; + it('Should can spend utxos without losing ordinals with only utxos', async () => { + (scanUtxosMoudle.scanUTXOs as any).mockResolvedValue([ + // Have only utxos + { + oTxHash: mockFirstTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockFirstTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockFirstTx.outs[0].script.toString('hex'), + value: { + value: '10000', + }, + }, + ]); + const chainMsg = new ChainMsg( + { + from: address, + to: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + amount: 0.00001, + spendUtxosContainOrdinal: true, + nftId: `${mockFirstTx.getHash().toString('hex')}:0:1000`, + }, + provider, + MsgEncoding.object + ); + const response = await chainMsg.buildTx(); // Expect TX: [10000] => [amount_to_send, ord_to_send, 2000 - 546, 546, 7000 - 546 -fee] + expect(response.inputs[0].hash).toEqual( + mockFirstTx.getHash().toString('hex') + ); + expect(response.outputs[0].value).toEqual(1000); // Genesis ordinal value + expect(response.outputs[0].address).toEqual( + 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q' + ); + expect(response.outputs[1].value).toEqual(546); + expect(response.outputs[1].address).toEqual( + 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q' + ); + expect(response.outputs[2].value).toEqual(2000 - 546); + expect(response.outputs[3].value).toEqual(546); + expect(response.outputs[4].value).toBeLessThan(7000 - 546); + }); - expect(response); - expect(response).toEqual( - new BigNumber('100') - .minus(feeEstimation.fee || 0) - .minus(gap) - .toString() + it('Should can not spend utxos without losing ordinals with only utxos', async () => { + (scanUtxosMoudle.scanUTXOs as any).mockResolvedValue([ + // Have only utxos + { + oTxHash: mockFirstTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockFirstTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockFirstTx.outs[0].script.toString('hex'), + value: { + value: '10000', + }, + }, + ]); + const chainMsg = new ChainMsg( + { + from: address, + to: 'bc1p9uwwu7cyakk325c8cnp9hhegtl3qxd2vjeydwk7wv3wx6zj26a2s3q0v6q', + amount: 0.00067, // 6700 sat + spendUtxosContainOrdinal: true, + nftId: `${mockFirstTx.getHash().toString('hex')}:0:1000`, + }, + provider, + MsgEncoding.object ); + try { + await chainMsg.buildTx(); + } catch (error) { + expect(error).toMatchObject( + new Error('Cannot create transaction to send NFT and amount') + ); + } }); }); @@ -315,35 +412,36 @@ describe('msg: Bitcoin dust filter', () => { mockSecondTx.addInput(Buffer.alloc(32, 0), 0); mockSecondTx.addOutput(bitcoin.address.toOutputScript(address), 3000); - (scanUtxosMoudle.scanUTXOs as any).mockResolvedValue([ - { - oTxHash: mockFirstTx.getHash().toString('hex'), - oIndex: 0, - oTxHex: mockFirstTx.toHex(), - address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', - isCoinbase: false, - scriptHex: mockFirstTx.outs[0].script.toString('hex'), - value: { - value: '1000', - }, - }, - { - oTxHash: mockSecondTx.getHash().toString('hex'), - oIndex: 0, - oTxHex: mockSecondTx.toHex(), - address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', - isCoinbase: false, - scriptHex: mockSecondTx.outs[0].script.toString('hex'), - value: { - value: '3000', - }, - }, - ]); - let provider: BitcoinProvider; beforeEach(() => { provider = new BitcoinProvider(new IndexerDataSource(BITCOIN_MANIFEST)); + (scanUtxosMoudle.scanUTXOs as any).mockResolvedValue([ + { + oTxHash: mockFirstTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockFirstTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockFirstTx.outs[0].script.toString('hex'), + value: { + value: '1000', + }, + }, + { + oTxHash: mockSecondTx.getHash().toString('hex'), + oIndex: 0, + oTxHex: mockSecondTx.toHex(), + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + isCoinbase: false, + scriptHex: mockSecondTx.outs[0].script.toString('hex'), + value: { + value: '3000', + }, + }, + ]); + + (nftModule.getNFTBalance as any).mockResolvedValue([]); }); it('should remove utxo with value 1000 sats', async () => { diff --git a/packages/bitcoin/src/msg.ts b/packages/bitcoin/src/msg.ts index 3cdf51c5..901e7a26 100644 --- a/packages/bitcoin/src/msg.ts +++ b/packages/bitcoin/src/msg.ts @@ -4,15 +4,18 @@ import { Msg as BaseMsg, MsgEncoding, NumberIsh, - Coin, } from '@xdefi-tech/chains-core'; import { UTXO } from '@xdefi-tech/chains-utxo'; import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; import isEmpty from 'lodash/isEmpty'; +import { utils as ethersUtils } from 'ethers'; +import utils from 'coinselect/utils'; +import sortBy from 'lodash/sortBy'; import type { BitcoinProvider } from './chain.provider'; +import { NfTv3 } from './gql'; export interface MsgBody { amount: NumberIsh; @@ -22,6 +25,7 @@ export interface MsgBody { gasLimit?: NumberIsh; // ByteFee decimals?: number; nftId?: string; + spendUtxosContainOrdinal?: boolean; } export interface TxBody { @@ -49,83 +53,345 @@ export class ChainMsg extends BaseMsg { return this.data; } - async buildTx() { + async buildTx(): Promise { const msgData = this.toData(); - let utxos: UTXO[] = await this.provider.scanUTXOs(this.data.from); - // check is the user has ordinals to erase them from utxos - let ordinals: any[] = []; - try { - ordinals = await this.provider.getNFTBalance(msgData.from); - } catch (err) { - console.error(err); + const { fee } = await this.getFee(); + if (!fee) + throw new Error('Fee estimation is required for building transaction'); + const feeRate = Number(fee) * 1e5; + + // Calculate dust threshold filter for utxo outputs + const dustThreshold = utils.inputBytes({}) * feeRate; + + // Scan UTXOs for the sender's address + const utxos = await this.provider.scanUTXOs(this.data.from, { + includeOrigins: true, + }); + const ordinalsMapping = await this.getOrdinalsMapping(); + const utxosWithoutOrdinals = this.filterUtxosWithoutOrdinals( + utxos, + ordinalsMapping + ); + + // Handle ordinals if nftId is present + const { ordinalInputUtxos, ordinalOutputUtxos, feeToSendOrdinals } = + await this.handleOrdinals(utxos, ordinalsMapping, feeRate, dustThreshold); + + const compiledMemo = msgData.memo + ? this.compileMemo(msgData.memo) + : undefined; + + // Create target outputs for the transaction + const targetOutputs = this.createTargetOutputs( + compiledMemo, + feeToSendOrdinals + ); + + const { inputs, outputs } = accumulative( + utxosWithoutOrdinals, + targetOutputs, + feeRate + ); + + if (msgData.nftId) { + return this.buildOrdinalTransaction( + utxosWithoutOrdinals, + inputs, + ordinalInputUtxos, + ordinalOutputUtxos, + feeRate, + dustThreshold, + compiledMemo + ); + } else { + if (!inputs || !outputs) { + throw new Error('Insufficient Balance for transaction'); + } + return this.createTxBody(inputs, outputs, utxos, fee, compiledMemo); } + } + + private filterUtxosWithoutOrdinals( + utxos: UTXO[], + ordinalsMapping: { [utxo: string]: NfTv3[] } + ): UTXO[] { + return utxos.filter( + (utxo) => !ordinalsMapping[`${utxo.hash}:${utxo.index}`] + ); + } + + private async handleOrdinals( + utxos: UTXO[], + ordinalsMapping: { [utxo: string]: NfTv3[] }, + feeRate: number, + dustThreshold: number + ) { + const msgData = this.toData(); + let ordinalInputUtxos: UTXO[] = []; + let ordinalOutputUtxos: { address?: string; value: number }[] = []; + let feeToSendOrdinals = 0; - // check if the user is sending an ordinal - let ordinalToSend = null; if (msgData.nftId) { - const [ordinalId, index, _] = msgData.nftId.split(':'); - const ordinalUTXOIndex = utxos.findIndex( - ({ hash, index: UTXOIndex }) => - ordinalId === hash && UTXOIndex === Number(index) + const [hash, index] = msgData.nftId.split(':'); + const utxoContainOrdinal = utxos.find( + (utxo) => utxo.hash === hash && utxo.index === Number(index) ); + if (!utxoContainOrdinal) throw new Error('Cannot find ordinal to send'); - if (ordinalUTXOIndex > -1) { - ordinalToSend = utxos[ordinalUTXOIndex]; + if (msgData.spendUtxosContainOrdinal) { + const { inputUtxos, outputUtxos } = await this.spendOrdinals( + msgData, + utxoContainOrdinal, + ordinalsMapping, + dustThreshold + ); + ordinalInputUtxos = inputUtxos; + ordinalOutputUtxos = outputUtxos; + } else { + ordinalInputUtxos.push(utxoContainOrdinal); + ordinalOutputUtxos.push({ + address: msgData.to, + value: utxoContainOrdinal.value, + }); } - if (!ordinalToSend) { - throw new Error('Cannot find ordinal to send'); - } + feeToSendOrdinals = + utils.transactionBytes(ordinalInputUtxos, ordinalOutputUtxos) * feeRate; } - if (!isEmpty(ordinals)) { - // remove all ordinal to make sure we dnt spend associated UTXOs - utxos = utxos.filter( - ({ hash, index: UTXOIndex }) => - !ordinals.find((ordinal) => { - if (!ordinal?.location) return false; - const [ordinalId, index, _] = ordinal.location.split(':'); - return ordinalId === hash && UTXOIndex === Number(index); - }) - ); + + return { ordinalInputUtxos, ordinalOutputUtxos, feeToSendOrdinals }; + } + + private async spendOrdinals( + msgData: MsgBody, + utxoContainOrdinal: UTXO, + ordinalsMapping: { [utxo: string]: NfTv3[] }, + dustThreshold: number + ) { + const inputUtxos: UTXO[] = [utxoContainOrdinal]; + const nfts = + ordinalsMapping[`${utxoContainOrdinal.hash}:${utxoContainOrdinal.index}`]; + const [_, __, offset] = msgData.nftId!.split(':'); + + sortBy(nfts, 'location', (nft) => { + return Number(nft.location!.split(':')[2]); + }); + const separateOrdinals = this.calculateSeparateOrdinals( + nfts, + utxoContainOrdinal.value + ); + const offsetIndex = Number(nfts[0].location!.split(':')[2]) > 0 ? 1 : 0; + const spendUtxoCalculation = await Promise.all( + nfts.map(async (nft, index) => { + const [genesisTx, genesisIndex] = nft.id.split('/')[1].split('i'); + const tx = await this.provider.getTransaction(genesisTx); + const txIndex = Number(genesisIndex); + const ordinalValue = tx!.outputs[txIndex].amount.value; + const isSendOrdinal = nft.location!.split(':')[2] === offset; + if ( + separateOrdinals[index + offsetIndex] - ordinalValue > + dustThreshold + ) { + return [ + { + address: isSendOrdinal ? msgData.to : msgData.from, + value: Number(ordinalValue), + }, + { + value: separateOrdinals[index + offsetIndex] - ordinalValue, + }, + ]; + } else { + return [ + { + address: isSendOrdinal ? msgData.to : msgData.from, + value: separateOrdinals[index + offsetIndex], + }, + ]; + } + }) + ); + if (offsetIndex === 1) { + spendUtxoCalculation.unshift([ + { + value: separateOrdinals[0], + }, + ]); } + return { inputUtxos, outputUtxos: spendUtxoCalculation.flat() }; + } - const { fee } = await this.getFee(); // unit is btc/kvB - if (!fee) - throw new Error('Fee estimation is required for building transaction'); - const feeRate = Number(fee) * 1e5; // sat/vB - const feeRateWhole = parseInt(feeRate.toString()); - const compiledMemo = msgData?.memo && this.compileMemo(msgData.memo); + private calculateSeparateOrdinals( + nfts: NfTv3[], + utxoValue: number + ): number[] { + let startOffset = 0; + const separateOrdinals: number[] = []; + for (const nft of nfts) { + const nftOffset = Number(nft.location!.split(':')[2]); + if (nftOffset > startOffset) { + separateOrdinals.push(nftOffset - startOffset); + startOffset = nftOffset; + } + } + separateOrdinals.push(utxoValue - startOffset); + return separateOrdinals; + } - const targetOutputs = []; - const valueToSend = new BigNumber(msgData.amount?.toString()) // ? - for nfts, but still required + private createTargetOutputs( + compiledMemo: Buffer | undefined, + feeToSendOrdinals: number + ) { + const msgData = this.toData(); + const targetOutputs: { + address?: string; + value: number; + script?: Buffer; + }[] = []; + const valueToSend = new BigNumber(msgData.amount?.toString()) .multipliedBy(10 ** (msgData.decimals || this.provider.manifest.decimals)) .toNumber(); if (valueToSend > 0) { - targetOutputs.push({ - address: msgData.to, - value: valueToSend, - }); + targetOutputs.push({ address: msgData.to, value: valueToSend }); } if (compiledMemo) { targetOutputs.push({ script: compiledMemo, value: 0 }); } - let { inputs, outputs } = accumulative(utxos, targetOutputs, feeRateWhole); - if (!inputs || !outputs) { - throw new Error('Insufficient Balance for transaction'); + if (feeToSendOrdinals > 0) { + targetOutputs.push({ value: feeToSendOrdinals }); } - if (ordinalToSend) { - inputs = [ordinalToSend, ...inputs]; - outputs = [ - { address: msgData.to, value: ordinalToSend.value }, - ...outputs, - ]; - utxos.unshift(ordinalToSend); + return targetOutputs; + } + + private buildOrdinalTransaction( + utxos: UTXO[], + inputs: UTXO[], + ordinalInputUtxos: UTXO[], + ordinalOutputUtxos: { address?: string; value: number }[], + feeRate: number, + dustThreshold: number, + compiledMemo: Buffer | undefined + ): TxBody { + const msgData = this.toData(); + const finalInputs = inputs + ? [...ordinalInputUtxos, ...inputs] + : ordinalInputUtxos; + const finalOutputs: { address?: string; value: number; script?: Buffer }[] = + []; + + const valueToSend = new BigNumber(msgData.amount?.toString()) + .multipliedBy(10 ** (msgData.decimals || this.provider.manifest.decimals)) + .toNumber(); + + if (finalInputs.length === 1 && valueToSend > 0) { + this.handleSingleInput(finalOutputs, ordinalOutputUtxos, dustThreshold); + const totalFee = + utils.transactionBytes(finalInputs, finalOutputs) * feeRate; + + this.adjustOutputsForFee(finalOutputs, totalFee, dustThreshold); + + return this.createTxBody( + finalInputs, + finalOutputs, + utxos, + (feeRate / 1e5).toString(), + compiledMemo + ); + } else { + finalOutputs.push(...ordinalOutputUtxos); + if (valueToSend > 0) { + finalOutputs.push({ address: msgData.to, value: valueToSend }); + } + if (compiledMemo) { + finalOutputs.push({ script: compiledMemo, value: 0 }); + } + const totalFee = + utils.transactionBytes(finalInputs, finalOutputs) * feeRate; + const remainAmount = + utils.sumOrNaN(finalInputs) - + finalInputs[0].value - + valueToSend - + totalFee - + utils.outputBytes({}) * feeRate; + if (remainAmount > dustThreshold) { + finalOutputs.push({ value: remainAmount }); + } + + return this.createTxBody( + finalInputs, + finalOutputs, + utxos, + (feeRate / 1e5).toString(), + compiledMemo + ); + } + } + + private handleSingleInput( + finalOutputs: { address?: string; value: number; script?: Buffer }[], + ordinalOutputUtxos: { address?: string; value: number }[], + dustThreshold: number + ) { + const msgData = this.toData(); + let remainAmount = new BigNumber(msgData.amount?.toString()) + .multipliedBy(10 ** (msgData.decimals || this.provider.manifest.decimals)) + .toNumber(); + + for (const outputUtxo of ordinalOutputUtxos) { + if (remainAmount === 0 || outputUtxo.address) { + finalOutputs.push(outputUtxo); + } else { + const diff = remainAmount - outputUtxo.value; + if (diff === 0) { + finalOutputs.push({ address: msgData.to, value: remainAmount }); + remainAmount = 0; + } else if (diff > dustThreshold) { + finalOutputs.push({ value: outputUtxo.value, address: msgData.to }); + remainAmount -= outputUtxo.value; + } else if (-diff > dustThreshold) { + finalOutputs.push({ address: msgData.to, value: remainAmount }); + remainAmount = 0; + finalOutputs.push({ value: -diff }); + } else { + finalOutputs.push(outputUtxo); + } + } + } + + if (remainAmount > 0) { + throw Error('Cannot create transaction to send NFT and amount'); + } + } + + private adjustOutputsForFee( + finalOutputs: { address?: string; value: number; script?: Buffer }[], + totalFee: number, + dustThreshold: number + ) { + const lastOutput = finalOutputs[finalOutputs.length - 1]; + if (lastOutput.address || lastOutput.value <= totalFee) { + throw new Error('Insufficient Balance for transaction'); + } else { + if (lastOutput.value - totalFee > dustThreshold) { + lastOutput.value -= totalFee; + } else { + finalOutputs.pop(); + } } + } + private createTxBody( + inputs: UTXO[], + outputs: { address?: string; value: number; script?: Buffer }[], + utxos: UTXO[], + fee: string, + compiledMemo: Buffer | undefined + ): TxBody { + const msgData = this.toData(); return { to: msgData.to, from: msgData.from, @@ -137,6 +403,29 @@ export class ChainMsg extends BaseMsg { }; } + /** + * This method uses to fetch the list of NFTs of sender and map the UTXOs with ordinals value. + * @returns a mapping of UTXOs (transaction, index) to the ordinals + */ + async getOrdinalsMapping(): Promise<{ [utxo: string]: NfTv3[] }> { + try { + const msgData = this.toData(); + const ordinals: NfTv3[] = await this.provider.getNFTBalance(msgData.from); + const mappingUtxosToOrdinalsValue: { [utxo: string]: NfTv3[] } = {}; + ordinals.forEach((ordinal) => { + const [txHash, index] = ordinal.location!.split(':'); + const utxo = `${txHash}:${index}`; + if (!mappingUtxosToOrdinalsValue[utxo]) { + mappingUtxosToOrdinalsValue[utxo] = []; + } + mappingUtxosToOrdinalsValue[utxo].push(ordinal); + }); + return mappingUtxosToOrdinalsValue; + } catch (error) { + return {}; + } + } + /** * Current method in used to compile a bitcoinjs-lib script. Bitcoin scripts are used to define the conditions * under which funds can be spent in a Bitcoin transaction. Mark a transaction output as unspendable @@ -177,35 +466,38 @@ export class ChainMsg extends BaseMsg { return feeEstimation; } - async getMaxAmountToSend(contract?: string) { + async getMaxAmountToSend() { const msgData = this.toData(); const balances = await this.provider.getBalance(msgData.from); + const [balance] = await balances.getData(); const gap = new BigNumber(this.provider.manifest?.maxGapAmount || 0); - let balance: Coin | undefined; - - if (!contract) { - balance = (await balances.getData()).find( - (b) => - b.asset.chainId === this.provider.manifest.chainId && b.asset.native - ); - } else { - balance = (await balances.getData()).find( - (b) => - b.asset.chainId === this.provider.manifest.chainId && - b.asset.address === contract - ); - } + const ordinals = await this.provider.getNFTBalance(msgData.from); + const ordinalValues = await Promise.all( + (ordinals as any[]).map(async (ordinal) => { + // Get the transactions creating ordinals to determine inscribed sats + const [txId, outputIndex] = ordinal.id.split('/')[1].split('i'); + const txInfo = await this.provider.getTransaction(txId); + return new BigNumber( + ethersUtils.formatUnits( + txInfo!.outputs[outputIndex].amount.value, + this.provider.manifest.decimals + ) + ); + }) + ); + const totalOrdinalValue = ordinalValues.reduce((prev, curr) => + prev.plus(curr) + ); if (!balance) throw new Error('No balance found'); - let maxAmount: BigNumber = new BigNumber(balance.amount).minus(gap); - - if (balance.asset.native) { - const feeEstimation = await this.getFee(); - maxAmount = maxAmount.minus(feeEstimation.fee || 0); - } + let maxAmount: BigNumber = new BigNumber(balance.amount) + .minus(totalOrdinalValue) + .minus(gap); + const feeEstimation = await this.getFee(); + maxAmount = maxAmount.minus(feeEstimation.fee || 0); if (maxAmount.isLessThan(0)) { return '0'; } diff --git a/packages/bitcoin/src/signers/ledger.signer.ts b/packages/bitcoin/src/signers/ledger.signer.ts index 2077eae4..fa7e817a 100644 --- a/packages/bitcoin/src/signers/ledger.signer.ts +++ b/packages/bitcoin/src/signers/ledger.signer.ts @@ -75,6 +75,7 @@ export class LedgerSigner extends Signer.Provider { app.splitTransaction(utxo.txHex, true), utxo.index, utxo.witnessUtxo.script.toString('hex'), + undefined, ]), associatedKeysets: [derivation], outputScriptHex, diff --git a/packages/bitcoin/src/signers/trezor.signer.spec.ts b/packages/bitcoin/src/signers/trezor.signer.spec.ts index 54d299d3..950ef104 100644 --- a/packages/bitcoin/src/signers/trezor.signer.spec.ts +++ b/packages/bitcoin/src/signers/trezor.signer.spec.ts @@ -9,7 +9,7 @@ import { import { BitcoinProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { BITCOIN_MANIFEST } from '../manifests'; -import { ChainMsg, MsgBody } from '../msg'; +import { MsgBody, ChainMsg } from '../msg'; import TrezorSigner from './trezor.signer'; jest.mock('@trezor/connect-web', () => ({ @@ -64,6 +64,21 @@ jest.mock('../datasource/indexer/queries/balances.query', () => ({ }, })); +jest.mock('../datasource/indexer/queries/fees.query', () => { + const originalModule = jest.requireActual( + '../datasource/indexer/queries/fees.query' + ); + return { + __esModule: true, + ...originalModule, + getFees: jest.fn().mockResolvedValue({ + high: 3000, + medium: 3000, // 3000 sat/kvB => 3 sat/vB + low: 3000, + }), + }; +}); + describe('trezor.signer', () => { let signer: TrezorSigner; let derivationPath: string; diff --git a/packages/bitcoin/src/signers/trezor.signer.ts b/packages/bitcoin/src/signers/trezor.signer.ts index db088edd..5462747c 100644 --- a/packages/bitcoin/src/signers/trezor.signer.ts +++ b/packages/bitcoin/src/signers/trezor.signer.ts @@ -4,7 +4,9 @@ import { IsTrezorInitialized, } from '@xdefi-tech/chains-core'; import TrezorConnect, { Params, SignTransaction } from '@trezor/connect-web'; -import { UTXO, ChainMsg } from '@xdefi-tech/chains-utxo'; +import { UTXO } from '@xdefi-tech/chains-utxo'; + +import { ChainMsg } from '../msg'; @SignerDecorator(Signer.SignerType.TREZOR) export class TrezorSigner extends Signer.TrezorProvider { @@ -53,7 +55,7 @@ export class TrezorSigner extends Signer.TrezorProvider { prev_hash: utxo.hash, prev_index: utxo.index, amount: utxo.value, - script_type: scriptType, + script_type: scriptType as any, address_n: [ (derivationArray[0] | 0x80000000) >>> 0, (derivationArray[1] | 0x80000000) >>> 0, @@ -69,6 +71,7 @@ export class TrezorSigner extends Signer.TrezorProvider { return { address: to, amount: output.value, + script_type: 'PAYTOADDRESS' as any, }; }); From 751ca98e8aa9563a8a22d1a3cae885b663cae0d2 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 19 Jul 2024 06:25:04 +0000 Subject: [PATCH 065/176] Version packages --- .changeset/red-flowers-double.md | 5 ----- packages/bitcoin/CHANGELOG.md | 6 ++++++ packages/bitcoin/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/red-flowers-double.md diff --git a/.changeset/red-flowers-double.md b/.changeset/red-flowers-double.md deleted file mode 100644 index c1fad9f9..00000000 --- a/.changeset/red-flowers-double.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoin': patch ---- - -Fix: allow to spend UTXOs without losing the ordinals diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 89b1d350..cac0788a 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-bitcoin +## 2.0.23 + +### Patch Changes + +- fc1d1a2f: Fix: allow to spend UTXOs without losing the ordinals + ## 2.0.22 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 6f67e180..983849e1 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.22", + "version": "2.0.23", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 87fcf74b6b1e8bee6a414fadb1118ed392a0566a Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:57:40 +0300 Subject: [PATCH 066/176] feat: XDEFI-9177 add gnosis (#279) * feat: add gnosis support to EVM provider fix: ling for generic files * feat: add missing file, add changeset * fix: gnosis chain name --- .changeset/breezy-turtles-tap.md | 15 + .changeset/moody-rings-fail.md | 5 + packages/binance/.eslintignore | 1 + packages/binance/src/gql/graphql.ts | 655 ++++++- packages/bitcoin/.eslintignore | 3 +- packages/bitcoin/src/gql/graphql.ts | 655 ++++++- packages/bitcoincash/.eslintignore | 3 +- packages/bitcoincash/src/gql/graphql.ts | 655 ++++++- packages/core/.eslintignore | 3 + packages/core/src/common/graphql.ts | 655 ++++++- packages/cosmos/.eslintignore | 3 +- packages/cosmos/src/gql/graphql.ts | 655 ++++++- packages/dogecoin/.eslintignore | 3 +- packages/dogecoin/src/gql/graphql.ts | 655 ++++++- packages/evm/.eslintignore | 1 + .../src/datasource/indexer/gql/gnosis.graphql | 97 + .../indexer/queries/balances.query.ts | 5 + .../datasource/indexer/queries/fees.query.ts | 5 + .../indexer/queries/status.query.ts | 5 + .../indexer/queries/transactions.query.ts | 5 + packages/evm/src/gql/gql.ts | 16 +- packages/evm/src/gql/graphql.ts | 1722 ++++++++++++++--- packages/evm/src/manifests.ts | 20 +- packages/litecoin/.eslintignore | 3 +- packages/litecoin/src/gql/graphql.ts | 655 ++++++- packages/solana/.eslintignore | 3 +- packages/solana/src/gql/graphql.ts | 1591 ++++++++------- packages/solana/src/gql/index.ts | 6 +- packages/thor/.eslintignore | 1 + packages/thor/src/gql/graphql.ts | 655 ++++++- packages/tron/.eslintignore | 3 +- packages/tron/src/gql/graphql.ts | 655 ++++++- 32 files changed, 7995 insertions(+), 1419 deletions(-) create mode 100644 .changeset/breezy-turtles-tap.md create mode 100644 .changeset/moody-rings-fail.md create mode 100644 packages/evm/src/datasource/indexer/gql/gnosis.graphql diff --git a/.changeset/breezy-turtles-tap.md b/.changeset/breezy-turtles-tap.md new file mode 100644 index 00000000..09b7d3ed --- /dev/null +++ b/.changeset/breezy-turtles-tap.md @@ -0,0 +1,15 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-evm': patch +--- + +Feat: add generic files to .eslintignore diff --git a/.changeset/moody-rings-fail.md b/.changeset/moody-rings-fail.md new file mode 100644 index 00000000..ac0e66a8 --- /dev/null +++ b/.changeset/moody-rings-fail.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +Feat: add Gnosis chain support diff --git a/packages/binance/.eslintignore b/packages/binance/.eslintignore index 35f5038c..2c8fb98c 100644 --- a/packages/binance/.eslintignore +++ b/packages/binance/.eslintignore @@ -2,3 +2,4 @@ dist node_modules jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/binance/src/gql/graphql.ts b/packages/binance/src/gql/graphql.ts index 6b181bc6..61c8a04a 100644 --- a/packages/binance/src/gql/graphql.ts +++ b/packages/binance/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type GetBinanceBalancesQueryVariables = Exact<{ diff --git a/packages/bitcoin/.eslintignore b/packages/bitcoin/.eslintignore index bef04218..b7a4f3d7 100644 --- a/packages/bitcoin/.eslintignore +++ b/packages/bitcoin/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.js webpack* -jest-setup-file.ts \ No newline at end of file +jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/bitcoin/src/gql/graphql.ts b/packages/bitcoin/src/gql/graphql.ts index 40def958..bfbd197f 100644 --- a/packages/bitcoin/src/gql/graphql.ts +++ b/packages/bitcoin/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type BitcoinBalanceQueryVariables = Exact<{ diff --git a/packages/bitcoincash/.eslintignore b/packages/bitcoincash/.eslintignore index bef04218..b7a4f3d7 100644 --- a/packages/bitcoincash/.eslintignore +++ b/packages/bitcoincash/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.js webpack* -jest-setup-file.ts \ No newline at end of file +jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/bitcoincash/src/gql/graphql.ts b/packages/bitcoincash/src/gql/graphql.ts index 586ccf69..341628c3 100644 --- a/packages/bitcoincash/src/gql/graphql.ts +++ b/packages/bitcoincash/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type BitcoinCashBalanceQueryVariables = Exact<{ diff --git a/packages/core/.eslintignore b/packages/core/.eslintignore index 0a4a6eb8..d15250eb 100644 --- a/packages/core/.eslintignore +++ b/packages/core/.eslintignore @@ -1,2 +1,5 @@ .eslintrc.cjs webpack* +src/common/fragment-masking.ts +src/common/gql.ts +src/common/graphql.ts \ No newline at end of file diff --git a/packages/core/src/common/graphql.ts b/packages/core/src/common/graphql.ts index 97fbb771..7af6d5f9 100644 --- a/packages/core/src/common/graphql.ts +++ b/packages/core/src/common/graphql.ts @@ -36,6 +36,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -182,12 +194,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -245,8 +265,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -262,7 +284,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -347,6 +368,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -489,6 +511,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -578,6 +601,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -612,6 +639,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -907,9 +935,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1025,6 +1088,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1042,6 +1107,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1091,6 +1162,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1107,6 +1180,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1151,6 +1230,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1167,6 +1248,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1218,9 +1305,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1305,9 +1427,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1321,23 +1478,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1407,16 +1553,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1626,14 +1781,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1674,18 +1839,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1702,6 +1897,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2047,12 +2248,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2070,18 +2265,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2092,10 +2287,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2103,6 +2320,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2126,6 +2356,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2133,10 +2365,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2186,13 +2425,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2209,6 +2485,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2267,9 +2549,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2347,6 +2664,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2617,9 +2974,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2847,6 +3239,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2861,7 +3254,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3015,17 +3407,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3040,6 +3433,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3070,11 +3465,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3192,6 +3582,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3360,6 +3751,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3752,6 +4144,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3782,6 +4214,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3827,7 +4260,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3915,8 +4348,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3924,10 +4367,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3955,6 +4405,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4117,7 +4577,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4128,9 +4587,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4165,8 +4624,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4280,7 +4739,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4534,6 +4993,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4560,6 +5027,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4626,6 +5113,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4697,18 +5191,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type GetCryptoAssetsQueryVariables = Exact<{ diff --git a/packages/cosmos/.eslintignore b/packages/cosmos/.eslintignore index 71c4137e..2c8fb98c 100644 --- a/packages/cosmos/.eslintignore +++ b/packages/cosmos/.eslintignore @@ -1,4 +1,5 @@ .eslintrc.cjs dist node_modules -jest-setup-file.ts \ No newline at end of file +jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/cosmos/src/gql/graphql.ts b/packages/cosmos/src/gql/graphql.ts index 07bed7af..9f96e7ee 100644 --- a/packages/cosmos/src/gql/graphql.ts +++ b/packages/cosmos/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type GetAssetsWithFilterQueryVariables = Exact<{ diff --git a/packages/dogecoin/.eslintignore b/packages/dogecoin/.eslintignore index bef04218..b7a4f3d7 100644 --- a/packages/dogecoin/.eslintignore +++ b/packages/dogecoin/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.js webpack* -jest-setup-file.ts \ No newline at end of file +jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/dogecoin/src/gql/graphql.ts b/packages/dogecoin/src/gql/graphql.ts index c3199141..ab71bc62 100644 --- a/packages/dogecoin/src/gql/graphql.ts +++ b/packages/dogecoin/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type DogecoinBalanceQueryVariables = Exact<{ diff --git a/packages/evm/.eslintignore b/packages/evm/.eslintignore index f1d36922..8ddf54ec 100644 --- a/packages/evm/.eslintignore +++ b/packages/evm/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.cjs jest-setup-file.ts webpack* +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/evm/src/datasource/indexer/gql/gnosis.graphql b/packages/evm/src/datasource/indexer/gql/gnosis.graphql new file mode 100644 index 00000000..6b42c2dd --- /dev/null +++ b/packages/evm/src/datasource/indexer/gql/gnosis.graphql @@ -0,0 +1,97 @@ +query GetGnosisBalance($address: String!) { + gnosis { + balances(address: $address) { + address + asset { + symbol + contract + id + name + image + chain + decimals + price { + amount + dayPriceChange + } + } + amount { + value + } + } + } +} + +query GnosisEIP1559GasFees { + gnosis { + fee { + high { + baseFeePerGas + maxFeePerGas + priorityFeePerGas + } + low { + baseFeePerGas + maxFeePerGas + priorityFeePerGas + } + medium { + baseFeePerGas + maxFeePerGas + priorityFeePerGas + } + } + } +} + +query GetGnosisTransactions($address: String!, $first: Int) { + gnosis { + transactions(address: $address, first: $first) { + pageInfo { + endCursor + hasNextPage + } + edges { + node { + hash + blockIndex + blockNumber + status + value + timestamp + fromAddress + transfers { + amount { + value + } + asset { + ... on CryptoAsset { + chain + contract + decimals + id + image + name + price { + amount + scalingFactor + } + symbol + } + } + fromAddress + toAddress + } + } + } + } + } +} + +query GetGnosisStatus { + gnosis { + status { + lastBlock + } + } +} \ No newline at end of file diff --git a/packages/evm/src/datasource/indexer/queries/balances.query.ts b/packages/evm/src/datasource/indexer/queries/balances.query.ts index 80fe7284..b24701fd 100644 --- a/packages/evm/src/datasource/indexer/queries/balances.query.ts +++ b/packages/evm/src/datasource/indexer/queries/balances.query.ts @@ -12,6 +12,7 @@ import { GetSmartChainBalanceDocument, GetCronosEvmBalanceDocument, GetCantoEvmBalanceDocument, + GetGnosisBalanceDocument, } from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; @@ -52,6 +53,10 @@ export const getBalance = async (chain: EVMChains, address: string) => { indexerChain = 'cronosEVM'; query = GetCronosEvmBalanceDocument; break; + case EVMChains.gnosis: + indexerChain = 'gnosis'; + query = GetGnosisBalanceDocument; + break; default: throw new Error( `Unsupported chain: ${chain}. Please check the configuration.` diff --git a/packages/evm/src/datasource/indexer/queries/fees.query.ts b/packages/evm/src/datasource/indexer/queries/fees.query.ts index 5cba64cb..e3ea0f76 100644 --- a/packages/evm/src/datasource/indexer/queries/fees.query.ts +++ b/packages/evm/src/datasource/indexer/queries/fees.query.ts @@ -11,6 +11,7 @@ import { OptimismEip1559GasFeesDocument, PolygonEip1559GasFeesDocument, SmartChainDefaultGasFeesDocument, + GnosisEip1559GasFeesDocument, } from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; @@ -52,6 +53,10 @@ export const getFees = async (chain: string) => { indexerChain = 'cronosEVM'; query = CronosEvmeip1559GasFeesDocument; break; + case EVMChains.gnosis: + indexerChain = 'gnosis'; + query = GnosisEip1559GasFeesDocument; + break; default: throw new Error( `Unsupported chain: ${chain}. Please check the configuration.` diff --git a/packages/evm/src/datasource/indexer/queries/status.query.ts b/packages/evm/src/datasource/indexer/queries/status.query.ts index b899770e..177ec61d 100644 --- a/packages/evm/src/datasource/indexer/queries/status.query.ts +++ b/packages/evm/src/datasource/indexer/queries/status.query.ts @@ -11,6 +11,7 @@ import { GetOptimismStatusDocument, GetPolygonStatusDocument, GetSmartChainStatusDocument, + GetGnosisStatusDocument, } from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; @@ -52,6 +53,10 @@ export const getStatus = async (chain: string) => { indexerChain = 'cronosEVM'; query = GetCronosEvmStatusDocument; break; + case EVMChains.gnosis: + indexerChain = 'gnosis'; + query = GetGnosisStatusDocument; + break; default: throw new Error( `Unsupported chain: ${chain}. Please check the configuration.` diff --git a/packages/evm/src/datasource/indexer/queries/transactions.query.ts b/packages/evm/src/datasource/indexer/queries/transactions.query.ts index 7cb7db77..97b1b82b 100644 --- a/packages/evm/src/datasource/indexer/queries/transactions.query.ts +++ b/packages/evm/src/datasource/indexer/queries/transactions.query.ts @@ -12,6 +12,7 @@ import { GetOptimismTransactionsDocument, GetPolygonTransactionsDocument, GetSmartChainTransactionsDocument, + GetGnosisTransactionsDocument, } from '../../../gql/graphql'; import { EVMChains } from '../../../manifests'; @@ -57,6 +58,10 @@ export const getTransactions = async ( indexerChain = 'cronosEVM'; query = GetCronosEvmTransactionsDocument; break; + case EVMChains.gnosis: + indexerChain = 'gnosis'; + query = GetGnosisTransactionsDocument; + break; default: throw new Error( `Unsupported chain: ${chain}. Please check the configuration.` diff --git a/packages/evm/src/gql/gql.ts b/packages/evm/src/gql/gql.ts index 0cb4a9c9..d42c1dad 100644 --- a/packages/evm/src/gql/gql.ts +++ b/packages/evm/src/gql/gql.ts @@ -27,14 +27,14 @@ const documents = { types.GetEthereumBalanceDocument, 'query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}': types.GetFantomBalanceDocument, + 'query GetGnosisBalance($address: String!) {\n gnosis {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery GnosisEIP1559GasFees {\n gnosis {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetGnosisTransactions($address: String!, $first: Int) {\n gnosis {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetGnosisStatus {\n gnosis {\n status {\n lastBlock\n }\n }\n}': + types.GetGnosisBalanceDocument, 'query GetOptimismBalance($address: String!) {\n optimism {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery OptimismEIP1559GasFees {\n optimism {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetOptimismTransactions($address: String!, $first: Int) {\n optimism {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetOptimismStatus {\n optimism {\n status {\n lastBlock\n }\n }\n}': types.GetOptimismBalanceDocument, 'query GetPolygonBalance($address: String!) {\n polygon {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery PolygonEIP1559GasFees {\n polygon {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetPolygonTransactions($address: String!, $first: Int) {\n polygon {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetPolygonStatus {\n polygon {\n status {\n lastBlock\n }\n }\n}': types.GetPolygonBalanceDocument, 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}': types.GetSmartChainBalanceDocument, - 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}': - types.GetCryptoAssetsDocument, }; /** @@ -93,6 +93,12 @@ export function gql( export function gql( source: 'query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}' ): typeof documents['query GetFantomBalance($address: String!) {\n fantom {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery FantomEIP1559GasFees {\n fantom {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetFantomTransactions($address: String!, $first: Int) {\n fantom {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetFantomStatus {\n fantom {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query GetGnosisBalance($address: String!) {\n gnosis {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery GnosisEIP1559GasFees {\n gnosis {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetGnosisTransactions($address: String!, $first: Int) {\n gnosis {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetGnosisStatus {\n gnosis {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query GetGnosisBalance($address: String!) {\n gnosis {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery GnosisEIP1559GasFees {\n gnosis {\n fee {\n high {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n low {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n medium {\n baseFeePerGas\n maxFeePerGas\n priorityFeePerGas\n }\n }\n }\n}\n\nquery GetGnosisTransactions($address: String!, $first: Int) {\n gnosis {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetGnosisStatus {\n gnosis {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -111,12 +117,6 @@ export function gql( export function gql( source: 'query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}' ): typeof documents['query GetSmartChainBalance($address: String!) {\n binanceSmartChain {\n balances(address: $address) {\n address\n asset {\n symbol\n contract\n id\n name\n image\n chain\n decimals\n price {\n amount\n dayPriceChange\n }\n }\n amount {\n value\n }\n }\n }\n}\n\nquery SmartChainDefaultGasFees {\n binanceSmartChain {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSmartChainTransactions($address: String!, $first: Int) {\n binanceSmartChain {\n transactions(address: $address, first: $first) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n hash\n blockIndex\n blockNumber\n status\n value\n timestamp\n fromAddress\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n }\n symbol\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetSmartChainStatus {\n binanceSmartChain {\n status {\n lastBlock\n }\n }\n}']; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql( - source: 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}' -): typeof documents['query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}']; export function gql(source: string) { return (documents as any)[source] ?? {}; diff --git a/packages/evm/src/gql/graphql.ts b/packages/evm/src/gql/graphql.ts index c71f5bb8..33c0836a 100644 --- a/packages/evm/src/gql/graphql.ts +++ b/packages/evm/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1248,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1335,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1351,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1665,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1713,15 +1845,43 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; @@ -2097,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2120,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2142,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2153,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2245,9 +2434,44 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { @@ -2334,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2414,24 +2673,64 @@ export type MediaV2 = { url: Scalars['String']; }; -export type Mutation = { - __typename?: 'Mutation'; - addComment: Reputation; - claimFees?: Maybe; - /** Publicly exposed Create a referrer */ - createReferrer?: Maybe; - transactionHashV2: Scalars['String']; - transactions: Array; - transactionsV2: PostRouteTypeV2; - transactonHash: Scalars['String']; - /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ - upsertReferrer?: Maybe; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; }; -export type MutationAddCommentArgs = { +export type ModeActivityHistoryV0Args = { address: Scalars['String']; - comment: Scalars['String']; - source: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + +export type Mutation = { + __typename?: 'Mutation'; + addComment: Reputation; + claimFees?: Maybe; + /** Publicly exposed Create a referrer */ + createReferrer?: Maybe; + transactionHashV2: Scalars['String']; + transactions: Array; + transactionsV2: PostRouteTypeV2; + transactonHash: Scalars['String']; + /** Create or update a referrer. If id is provided, the referrer will be updated.Otherwise, a new referrer will be created. Sig controlled by an admin */ + upsertReferrer?: Maybe; +}; + +export type MutationAddCommentArgs = { + address: Scalars['String']; + comment: Scalars['String']; + source: Scalars['String']; }; export type MutationCreateReferrerArgs = { @@ -2684,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2914,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2928,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3082,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3107,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3137,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3259,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3427,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3819,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3849,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3894,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3982,6 +4357,14 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; /** activity history for address in descending order */ @@ -4031,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4193,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4204,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4241,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4356,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4610,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4636,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4702,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4773,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type GetArbitrumBalanceQueryVariables = Exact<{ @@ -5660,14 +6164,14 @@ export type GetFantomStatusQuery = { }; }; -export type GetOptimismBalanceQueryVariables = Exact<{ +export type GetGnosisBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; -export type GetOptimismBalanceQuery = { +export type GetGnosisBalanceQuery = { __typename?: 'Query'; - optimism: { - __typename?: 'Optimism'; + gnosis: { + __typename?: 'Gnosis'; balances: Array<{ __typename?: 'Balance'; address: string; @@ -5691,14 +6195,14 @@ export type GetOptimismBalanceQuery = { }; }; -export type OptimismEip1559GasFeesQueryVariables = Exact<{ +export type GnosisEip1559GasFeesQueryVariables = Exact<{ [key: string]: never; }>; -export type OptimismEip1559GasFeesQuery = { +export type GnosisEip1559GasFeesQuery = { __typename?: 'Query'; - optimism: { - __typename?: 'Optimism'; + gnosis: { + __typename?: 'Gnosis'; fee?: { __typename?: 'EIP1559GasFee'; high?: { @@ -5723,15 +6227,15 @@ export type OptimismEip1559GasFeesQuery = { }; }; -export type GetOptimismTransactionsQueryVariables = Exact<{ +export type GetGnosisTransactionsQueryVariables = Exact<{ address: Scalars['String']; first?: InputMaybe; }>; -export type GetOptimismTransactionsQuery = { +export type GetGnosisTransactionsQuery = { __typename?: 'Query'; - optimism: { - __typename?: 'Optimism'; + gnosis: { + __typename?: 'Gnosis'; transactions: { __typename?: 'EVMTransactionV2Connection'; pageInfo: { @@ -5779,24 +6283,24 @@ export type GetOptimismTransactionsQuery = { }; }; -export type GetOptimismStatusQueryVariables = Exact<{ [key: string]: never }>; +export type GetGnosisStatusQueryVariables = Exact<{ [key: string]: never }>; -export type GetOptimismStatusQuery = { +export type GetGnosisStatusQuery = { __typename?: 'Query'; - optimism: { - __typename?: 'Optimism'; + gnosis: { + __typename?: 'Gnosis'; status: { __typename?: 'Status'; lastBlock: number }; }; }; -export type GetPolygonBalanceQueryVariables = Exact<{ +export type GetOptimismBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; -export type GetPolygonBalanceQuery = { +export type GetOptimismBalanceQuery = { __typename?: 'Query'; - polygon: { - __typename?: 'Polygon'; + optimism: { + __typename?: 'Optimism'; balances: Array<{ __typename?: 'Balance'; address: string; @@ -5820,14 +6324,14 @@ export type GetPolygonBalanceQuery = { }; }; -export type PolygonEip1559GasFeesQueryVariables = Exact<{ +export type OptimismEip1559GasFeesQueryVariables = Exact<{ [key: string]: never; }>; -export type PolygonEip1559GasFeesQuery = { +export type OptimismEip1559GasFeesQuery = { __typename?: 'Query'; - polygon: { - __typename?: 'Polygon'; + optimism: { + __typename?: 'Optimism'; fee?: { __typename?: 'EIP1559GasFee'; high?: { @@ -5852,15 +6356,15 @@ export type PolygonEip1559GasFeesQuery = { }; }; -export type GetPolygonTransactionsQueryVariables = Exact<{ +export type GetOptimismTransactionsQueryVariables = Exact<{ address: Scalars['String']; first?: InputMaybe; }>; -export type GetPolygonTransactionsQuery = { +export type GetOptimismTransactionsQuery = { __typename?: 'Query'; - polygon: { - __typename?: 'Polygon'; + optimism: { + __typename?: 'Optimism'; transactions: { __typename?: 'EVMTransactionV2Connection'; pageInfo: { @@ -5908,24 +6412,153 @@ export type GetPolygonTransactionsQuery = { }; }; -export type GetPolygonStatusQueryVariables = Exact<{ [key: string]: never }>; +export type GetOptimismStatusQueryVariables = Exact<{ [key: string]: never }>; -export type GetPolygonStatusQuery = { +export type GetOptimismStatusQuery = { __typename?: 'Query'; - polygon: { - __typename?: 'Polygon'; + optimism: { + __typename?: 'Optimism'; status: { __typename?: 'Status'; lastBlock: number }; }; }; -export type GetSmartChainBalanceQueryVariables = Exact<{ +export type GetPolygonBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; -export type GetSmartChainBalanceQuery = { +export type GetPolygonBalanceQuery = { __typename?: 'Query'; - binanceSmartChain: { - __typename?: 'BinanceSmartChain'; + polygon: { + __typename?: 'Polygon'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + asset: { + __typename?: 'CryptoAsset'; + symbol?: string | null; + contract?: string | null; + id?: string | null; + name?: string | null; + image?: string | null; + chain?: string | null; + decimals?: number | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + amount: { __typename?: 'Amount'; value: string }; + }>; + }; +}; + +export type PolygonEip1559GasFeesQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type PolygonEip1559GasFeesQuery = { + __typename?: 'Query'; + polygon: { + __typename?: 'Polygon'; + fee?: { + __typename?: 'EIP1559GasFee'; + high?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + low?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + medium?: { + __typename?: 'EIP1559Fee'; + baseFeePerGas: number; + maxFeePerGas: number; + priorityFeePerGas: number; + } | null; + } | null; + }; +}; + +export type GetPolygonTransactionsQueryVariables = Exact<{ + address: Scalars['String']; + first?: InputMaybe; +}>; + +export type GetPolygonTransactionsQuery = { + __typename?: 'Query'; + polygon: { + __typename?: 'Polygon'; + transactions: { + __typename?: 'EVMTransactionV2Connection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'EVMTransactionV2Edge'; + node: { + __typename?: 'EVMTransactionV2'; + hash: string; + blockIndex: number; + blockNumber: number; + status: string; + value: string; + timestamp: any; + fromAddress: string; + transfers: Array<{ + __typename?: 'AssetTransferV2'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: + | { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + } | null; + } + | { __typename?: 'NftAsset' }; + }>; + }; + }>; + }; + }; +}; + +export type GetPolygonStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetPolygonStatusQuery = { + __typename?: 'Query'; + polygon: { + __typename?: 'Polygon'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + +export type GetSmartChainBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type GetSmartChainBalanceQuery = { + __typename?: 'Query'; + binanceSmartChain: { + __typename?: 'BinanceSmartChain'; balances: Array<{ __typename?: 'Balance'; address: string; @@ -6032,32 +6665,6 @@ export type GetSmartChainStatusQuery = { }; }; -export type GetCryptoAssetsQueryVariables = Exact<{ - input: Array | CryptoAssetArgs; -}>; - -export type GetCryptoAssetsQuery = { - __typename?: 'Query'; - assets: { - __typename?: 'AssetType'; - cryptoAssets?: Array<{ - __typename?: 'CryptoAsset'; - chain?: string | null; - contract?: string | null; - id?: string | null; - name?: string | null; - symbol?: string | null; - image?: string | null; - decimals?: number | null; - price?: { - __typename?: 'AssetAmountType'; - amount: string; - scalingFactor: number; - } | null; - }> | null; - }; -}; - export const GetArbitrumBalanceDocument = { kind: 'Document', definitions: [ @@ -7078,13 +7685,589 @@ export const GetAuroraStatusDocument = { GetAuroraStatusQuery, GetAuroraStatusQueryVariables >; -export const GetAvalancheBalanceDocument = { +export const GetAvalancheBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAvalancheBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAvalancheBalanceQuery, + GetAvalancheBalanceQueryVariables +>; +export const AvalancheEip1559GasFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'AvalancheEIP1559GasFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'high' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'low' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'baseFeePerGas' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'maxFeePerGas' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'priorityFeePerGas', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + AvalancheEip1559GasFeesQuery, + AvalancheEip1559GasFeesQueryVariables +>; +export const GetAvalancheTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAvalancheTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockIndex' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'blockNumber', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'InlineFragment', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: 'CryptoAsset', + }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'scalingFactor', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAvalancheTransactionsQuery, + GetAvalancheTransactionsQueryVariables +>; +export const GetAvalancheStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetAvalancheStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'avalanche' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetAvalancheStatusQuery, + GetAvalancheStatusQueryVariables +>; +export const GetCantoEvmBalanceDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetAvalancheBalance' }, + name: { kind: 'Name', value: 'GetCantoEVMBalance' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -7106,7 +8289,7 @@ export const GetAvalancheBalanceDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'avalanche' }, + name: { kind: 'Name', value: 'cantoEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -7211,22 +8394,22 @@ export const GetAvalancheBalanceDocument = { }, ], } as unknown as DocumentNode< - GetAvalancheBalanceQuery, - GetAvalancheBalanceQueryVariables + GetCantoEvmBalanceQuery, + GetCantoEvmBalanceQueryVariables >; -export const AvalancheEip1559GasFeesDocument = { +export const CantoEvmeip1559GasFeesDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'AvalancheEIP1559GasFees' }, + name: { kind: 'Name', value: 'CantoEVMEIP1559GasFees' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'avalanche' }, + name: { kind: 'Name', value: 'cantoEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -7319,16 +8502,16 @@ export const AvalancheEip1559GasFeesDocument = { }, ], } as unknown as DocumentNode< - AvalancheEip1559GasFeesQuery, - AvalancheEip1559GasFeesQueryVariables + CantoEvmeip1559GasFeesQuery, + CantoEvmeip1559GasFeesQueryVariables >; -export const GetAvalancheTransactionsDocument = { +export const GetCantoEvmTransactionsDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetAvalancheTransactions' }, + name: { kind: 'Name', value: 'GetCantoEVMTransactions' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -7358,7 +8541,7 @@ export const GetAvalancheTransactionsDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'avalanche' }, + name: { kind: 'Name', value: 'cantoEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -7611,22 +8794,22 @@ export const GetAvalancheTransactionsDocument = { }, ], } as unknown as DocumentNode< - GetAvalancheTransactionsQuery, - GetAvalancheTransactionsQueryVariables + GetCantoEvmTransactionsQuery, + GetCantoEvmTransactionsQueryVariables >; -export const GetAvalancheStatusDocument = { +export const GetCantoEvmStatusDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetAvalancheStatus' }, + name: { kind: 'Name', value: 'GetCantoEVMStatus' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'avalanche' }, + name: { kind: 'Name', value: 'cantoEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -7651,16 +8834,16 @@ export const GetAvalancheStatusDocument = { }, ], } as unknown as DocumentNode< - GetAvalancheStatusQuery, - GetAvalancheStatusQueryVariables + GetCantoEvmStatusQuery, + GetCantoEvmStatusQueryVariables >; -export const GetCantoEvmBalanceDocument = { +export const GetCronosEvmBalanceDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetCantoEVMBalance' }, + name: { kind: 'Name', value: 'GetCronosEVMBalance' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -7682,7 +8865,7 @@ export const GetCantoEvmBalanceDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cantoEVM' }, + name: { kind: 'Name', value: 'cronosEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -7787,22 +8970,22 @@ export const GetCantoEvmBalanceDocument = { }, ], } as unknown as DocumentNode< - GetCantoEvmBalanceQuery, - GetCantoEvmBalanceQueryVariables + GetCronosEvmBalanceQuery, + GetCronosEvmBalanceQueryVariables >; -export const CantoEvmeip1559GasFeesDocument = { +export const CronosEvmeip1559GasFeesDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'CantoEVMEIP1559GasFees' }, + name: { kind: 'Name', value: 'CronosEVMEIP1559GasFees' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cantoEVM' }, + name: { kind: 'Name', value: 'cronosEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -7895,16 +9078,16 @@ export const CantoEvmeip1559GasFeesDocument = { }, ], } as unknown as DocumentNode< - CantoEvmeip1559GasFeesQuery, - CantoEvmeip1559GasFeesQueryVariables + CronosEvmeip1559GasFeesQuery, + CronosEvmeip1559GasFeesQueryVariables >; -export const GetCantoEvmTransactionsDocument = { +export const GetCronosEvmTransactionsDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetCantoEVMTransactions' }, + name: { kind: 'Name', value: 'GetCronosEVMTransactions' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -7934,7 +9117,7 @@ export const GetCantoEvmTransactionsDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cantoEVM' }, + name: { kind: 'Name', value: 'cronosEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -8187,22 +9370,22 @@ export const GetCantoEvmTransactionsDocument = { }, ], } as unknown as DocumentNode< - GetCantoEvmTransactionsQuery, - GetCantoEvmTransactionsQueryVariables + GetCronosEvmTransactionsQuery, + GetCronosEvmTransactionsQueryVariables >; -export const GetCantoEvmStatusDocument = { +export const GetCronosEvmStatusDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetCantoEVMStatus' }, + name: { kind: 'Name', value: 'GetCronosEVMStatus' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cantoEVM' }, + name: { kind: 'Name', value: 'cronosEVM' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -8227,16 +9410,16 @@ export const GetCantoEvmStatusDocument = { }, ], } as unknown as DocumentNode< - GetCantoEvmStatusQuery, - GetCantoEvmStatusQueryVariables + GetCronosEvmStatusQuery, + GetCronosEvmStatusQueryVariables >; -export const GetCronosEvmBalanceDocument = { +export const GetEthereumBalanceDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetCronosEVMBalance' }, + name: { kind: 'Name', value: 'GetEthereumBalance' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -8258,7 +9441,7 @@ export const GetCronosEvmBalanceDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cronosEVM' }, + name: { kind: 'Name', value: 'ethereum' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -8363,22 +9546,22 @@ export const GetCronosEvmBalanceDocument = { }, ], } as unknown as DocumentNode< - GetCronosEvmBalanceQuery, - GetCronosEvmBalanceQueryVariables + GetEthereumBalanceQuery, + GetEthereumBalanceQueryVariables >; -export const CronosEvmeip1559GasFeesDocument = { +export const EthereumEip1559GasFeesDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'CronosEVMEIP1559GasFees' }, + name: { kind: 'Name', value: 'EthereumEIP1559GasFees' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cronosEVM' }, + name: { kind: 'Name', value: 'ethereum' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -8471,16 +9654,16 @@ export const CronosEvmeip1559GasFeesDocument = { }, ], } as unknown as DocumentNode< - CronosEvmeip1559GasFeesQuery, - CronosEvmeip1559GasFeesQueryVariables + EthereumEip1559GasFeesQuery, + EthereumEip1559GasFeesQueryVariables >; -export const GetCronosEvmTransactionsDocument = { +export const GetEthereumTransactionsDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetCronosEVMTransactions' }, + name: { kind: 'Name', value: 'GetEthereumTransactions' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -8510,7 +9693,7 @@ export const GetCronosEvmTransactionsDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cronosEVM' }, + name: { kind: 'Name', value: 'ethereum' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -8763,22 +9946,22 @@ export const GetCronosEvmTransactionsDocument = { }, ], } as unknown as DocumentNode< - GetCronosEvmTransactionsQuery, - GetCronosEvmTransactionsQueryVariables + GetEthereumTransactionsQuery, + GetEthereumTransactionsQueryVariables >; -export const GetCronosEvmStatusDocument = { +export const GetEthereumStatusDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetCronosEVMStatus' }, + name: { kind: 'Name', value: 'GetEthereumStatus' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'cronosEVM' }, + name: { kind: 'Name', value: 'ethereum' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -8803,16 +9986,16 @@ export const GetCronosEvmStatusDocument = { }, ], } as unknown as DocumentNode< - GetCronosEvmStatusQuery, - GetCronosEvmStatusQueryVariables + GetEthereumStatusQuery, + GetEthereumStatusQueryVariables >; -export const GetEthereumBalanceDocument = { +export const GetFantomBalanceDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetEthereumBalance' }, + name: { kind: 'Name', value: 'GetFantomBalance' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -8834,7 +10017,7 @@ export const GetEthereumBalanceDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'ethereum' }, + name: { kind: 'Name', value: 'fantom' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -8939,22 +10122,22 @@ export const GetEthereumBalanceDocument = { }, ], } as unknown as DocumentNode< - GetEthereumBalanceQuery, - GetEthereumBalanceQueryVariables + GetFantomBalanceQuery, + GetFantomBalanceQueryVariables >; -export const EthereumEip1559GasFeesDocument = { +export const FantomEip1559GasFeesDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'EthereumEIP1559GasFees' }, + name: { kind: 'Name', value: 'FantomEIP1559GasFees' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'ethereum' }, + name: { kind: 'Name', value: 'fantom' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -9047,16 +10230,16 @@ export const EthereumEip1559GasFeesDocument = { }, ], } as unknown as DocumentNode< - EthereumEip1559GasFeesQuery, - EthereumEip1559GasFeesQueryVariables + FantomEip1559GasFeesQuery, + FantomEip1559GasFeesQueryVariables >; -export const GetEthereumTransactionsDocument = { +export const GetFantomTransactionsDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetEthereumTransactions' }, + name: { kind: 'Name', value: 'GetFantomTransactions' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -9086,7 +10269,7 @@ export const GetEthereumTransactionsDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'ethereum' }, + name: { kind: 'Name', value: 'fantom' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -9339,22 +10522,22 @@ export const GetEthereumTransactionsDocument = { }, ], } as unknown as DocumentNode< - GetEthereumTransactionsQuery, - GetEthereumTransactionsQueryVariables + GetFantomTransactionsQuery, + GetFantomTransactionsQueryVariables >; -export const GetEthereumStatusDocument = { +export const GetFantomStatusDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetEthereumStatus' }, + name: { kind: 'Name', value: 'GetFantomStatus' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'ethereum' }, + name: { kind: 'Name', value: 'fantom' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -9379,16 +10562,16 @@ export const GetEthereumStatusDocument = { }, ], } as unknown as DocumentNode< - GetEthereumStatusQuery, - GetEthereumStatusQueryVariables + GetFantomStatusQuery, + GetFantomStatusQueryVariables >; -export const GetFantomBalanceDocument = { +export const GetGnosisBalanceDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetFantomBalance' }, + name: { kind: 'Name', value: 'GetGnosisBalance' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -9410,7 +10593,7 @@ export const GetFantomBalanceDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'fantom' }, + name: { kind: 'Name', value: 'gnosis' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -9515,22 +10698,22 @@ export const GetFantomBalanceDocument = { }, ], } as unknown as DocumentNode< - GetFantomBalanceQuery, - GetFantomBalanceQueryVariables + GetGnosisBalanceQuery, + GetGnosisBalanceQueryVariables >; -export const FantomEip1559GasFeesDocument = { +export const GnosisEip1559GasFeesDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'FantomEIP1559GasFees' }, + name: { kind: 'Name', value: 'GnosisEIP1559GasFees' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'fantom' }, + name: { kind: 'Name', value: 'gnosis' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -9623,16 +10806,16 @@ export const FantomEip1559GasFeesDocument = { }, ], } as unknown as DocumentNode< - FantomEip1559GasFeesQuery, - FantomEip1559GasFeesQueryVariables + GnosisEip1559GasFeesQuery, + GnosisEip1559GasFeesQueryVariables >; -export const GetFantomTransactionsDocument = { +export const GetGnosisTransactionsDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetFantomTransactions' }, + name: { kind: 'Name', value: 'GetGnosisTransactions' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -9662,7 +10845,7 @@ export const GetFantomTransactionsDocument = { selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'fantom' }, + name: { kind: 'Name', value: 'gnosis' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -9915,22 +11098,22 @@ export const GetFantomTransactionsDocument = { }, ], } as unknown as DocumentNode< - GetFantomTransactionsQuery, - GetFantomTransactionsQueryVariables + GetGnosisTransactionsQuery, + GetGnosisTransactionsQueryVariables >; -export const GetFantomStatusDocument = { +export const GetGnosisStatusDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetFantomStatus' }, + name: { kind: 'Name', value: 'GetGnosisStatus' }, selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', - name: { kind: 'Name', value: 'fantom' }, + name: { kind: 'Name', value: 'gnosis' }, selectionSet: { kind: 'SelectionSet', selections: [ @@ -9955,8 +11138,8 @@ export const GetFantomStatusDocument = { }, ], } as unknown as DocumentNode< - GetFantomStatusQuery, - GetFantomStatusQueryVariables + GetGnosisStatusQuery, + GetGnosisStatusQueryVariables >; export const GetOptimismBalanceDocument = { kind: 'Document', @@ -11620,104 +12803,3 @@ export const GetSmartChainStatusDocument = { GetSmartChainStatusQuery, GetSmartChainStatusQueryVariables >; -export const GetCryptoAssetsDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetCryptoAssets' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'input' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'ListType', - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'CryptoAssetArgs' }, - }, - }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'assets' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'cryptoAssets' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'input' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'input' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'chain' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'contract' }, - }, - { kind: 'Field', name: { kind: 'Name', value: 'id' } }, - { kind: 'Field', name: { kind: 'Name', value: 'name' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'symbol' }, - }, - { kind: 'Field', name: { kind: 'Name', value: 'image' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'decimals' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'price' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'amount' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'scalingFactor' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - GetCryptoAssetsQuery, - GetCryptoAssetsQueryVariables ->; diff --git a/packages/evm/src/manifests.ts b/packages/evm/src/manifests.ts index 0f29c582..6e750305 100644 --- a/packages/evm/src/manifests.ts +++ b/packages/evm/src/manifests.ts @@ -12,6 +12,7 @@ export enum EVMChains { optimism = 'optimism', klaytn = 'klaytn', cronos = 'cronos', + gnosis = 'gnosis', } export const EVM_MANIFESTS: { @@ -192,7 +193,7 @@ export const EVM_MANIFESTS: { description: '', rpcURL: 'https://cronoscan-rpc.xdefiservices.com', chainSymbol: 'CRO', - blockExplorerURL: 'https://cronoscan.com/', + blockExplorerURL: 'https://cronoscan.com', chainId: '25', chain: 'cronos', decimals: 18, @@ -204,4 +205,21 @@ export const EVM_MANIFESTS: { multicallContractAddress: '0xcA11bde05977b3631167028862bE2a173976CA11', maxGapAmount: 0, }, + [EVMChains.gnosis]: { + name: 'Gnosis', + description: '', + rpcURL: 'https://rpc-proxy.xdefi.services/gnosis', + chainSymbol: 'XDAI', + blockExplorerURL: 'https://gnosisscan.io', + chainId: '100', + chain: 'gnosis', + decimals: 18, + feeGasStep: { + high: 1.5, + medium: 1.25, + low: 1, + }, + multicallContractAddress: '0xcA11bde05977b3631167028862bE2a173976CA11', + maxGapAmount: 0, + }, }; diff --git a/packages/litecoin/.eslintignore b/packages/litecoin/.eslintignore index bef04218..b7a4f3d7 100644 --- a/packages/litecoin/.eslintignore +++ b/packages/litecoin/.eslintignore @@ -1,3 +1,4 @@ .eslintrc.js webpack* -jest-setup-file.ts \ No newline at end of file +jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/litecoin/src/gql/graphql.ts b/packages/litecoin/src/gql/graphql.ts index 3364ea48..66106106 100644 --- a/packages/litecoin/src/gql/graphql.ts +++ b/packages/litecoin/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinBalanceQueryVariables = Exact<{ diff --git a/packages/solana/.eslintignore b/packages/solana/.eslintignore index f1a15b1f..358bb9e4 100644 --- a/packages/solana/.eslintignore +++ b/packages/solana/.eslintignore @@ -1,2 +1,3 @@ .eslintrc.cjs -jest-setup-file.ts \ No newline at end of file +jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/solana/src/gql/graphql.ts b/packages/solana/src/gql/graphql.ts index 18d996c3..cb68670c 100644 --- a/packages/solana/src/gql/graphql.ts +++ b/packages/solana/src/gql/graphql.ts @@ -2,15 +2,9 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = Omit & { - [SubKey in K]?: Maybe; -}; -export type MakeMaybe = Omit & { - [SubKey in K]: Maybe; -}; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -42,6 +36,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -180,7 +186,7 @@ export enum AddressChain { Umee = 'Umee', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync', + zkSync = 'zkSync' } /** Portfolio by wallet address */ @@ -188,12 +194,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +265,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +284,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -303,12 +318,14 @@ export type Arbitrum = { version: Array; }; + export type ArbitrumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ArbitrumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -316,16 +333,19 @@ export type ArbitrumBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type ArbitrumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type ArbitrumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type ArbitrumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -353,6 +373,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +516,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -581,7 +603,11 @@ export type AssetHistory = { export enum AssetInternalType { CRYPTOCURRENCY = 'CRYPTOCURRENCY', LP_TOKEN = 'LP_TOKEN', - TOKEN = 'TOKEN', + TOKEN = 'TOKEN' +} + +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP' } export type AssetTokenContractType = { @@ -618,6 +644,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -700,6 +727,7 @@ export type AssetType = { trending?: Maybe>; }; + export type AssetTypeAllAssetsArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -707,6 +735,7 @@ export type AssetTypeAllAssetsArgs = { page: ConnectionArgs; }; + export type AssetTypeCompositeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -714,10 +743,12 @@ export type AssetTypeCompositeTokensArgs = { page: ConnectionArgs; }; + export type AssetTypeCryptoAssetsArgs = { input: Array; }; + export type AssetTypeCryptoCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -725,11 +756,13 @@ export type AssetTypeCryptoCurrenciesArgs = { page: ConnectionArgs; }; + export type AssetTypeDappsArgs = { address: Scalars['String']; chain: Scalars['String']; }; + export type AssetTypeFiatCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -737,6 +770,7 @@ export type AssetTypeFiatCurrenciesArgs = { page: ConnectionArgs; }; + export type AssetTypeLpTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -744,15 +778,18 @@ export type AssetTypeLpTokensArgs = { page: ConnectionArgs; }; + export type AssetTypeNftsV0Args = { keys: Array; }; + export type AssetTypeSearchArgs = { filter?: InputMaybe; page: ConnectionArgs; }; + export type AssetTypeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -760,6 +797,7 @@ export type AssetTypeTokensArgs = { page: ConnectionArgs; }; + export type AssetTypeTokensV0Args = { input: Array; }; @@ -814,12 +852,14 @@ export type Aurora = { version: Array; }; + export type AuroraActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type AuroraBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -827,16 +867,19 @@ export type AuroraBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type AuroraLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type AuroraNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type AuroraTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -862,12 +905,14 @@ export type Avalanche = { version: Array; }; + export type AvalancheActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type AvalancheBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -875,16 +920,19 @@ export type AvalancheBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type AvalancheLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type AvalancheNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type AvalancheTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -913,9 +961,48 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -937,10 +1024,12 @@ export type Binance = { transactions: BinanceTransactionConnection; }; + export type BinanceBalancesArgs = { address: Scalars['String']; }; + export type BinanceTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -966,12 +1055,14 @@ export type BinanceSmartChain = { version: Array; }; + export type BinanceSmartChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type BinanceSmartChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -979,16 +1070,19 @@ export type BinanceSmartChainBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type BinanceSmartChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type BinanceSmartChainNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type BinanceSmartChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1031,6 +1125,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,23 +1144,35 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; + +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; + export type BitcoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type BitcoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type BitcoinChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type BitcoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1073,23 +1181,27 @@ export type BitcoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type BitcoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type BitcoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type BitcoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type BitcoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1097,6 +1209,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,18 +1227,29 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; + +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; + export type BitcoinChainTestNetBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type BitcoinChainTestNetGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type BitcoinChainTestNetTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1133,23 +1258,27 @@ export type BitcoinChainTestNetTransactionsArgs = { pageSize: Scalars['Int']; }; + export type BitcoinChainTestNetTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type BitcoinChainTestNetTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type BitcoinChainTestNetUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type BitcoinChainTestNetUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1157,6 +1286,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,18 +1304,29 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; + +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; + export type BitcoincashChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type BitcoincashChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type BitcoincashChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1193,23 +1335,27 @@ export type BitcoincashChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type BitcoincashChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type BitcoincashChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type BitcoincashChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type BitcoincashChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1224,9 +1370,48 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1258,7 +1443,7 @@ export type BridgeTokenInput = { export enum CacheControlScope { PRIVATE = 'PRIVATE', - PUBLIC = 'PUBLIC', + PUBLIC = 'PUBLIC' } export type CantoEvm = { @@ -1278,12 +1463,14 @@ export type CantoEvm = { version: Array; }; + export type CantoEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type CantoEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1291,16 +1478,19 @@ export type CantoEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type CantoEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type CantoEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type CantoEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1311,9 +1501,48 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1324,26 +1553,15 @@ export enum Chain { FANTOM = 'FANTOM', HARMONY = 'HARMONY', OPTIMISM = 'OPTIMISM', - POLYGON = 'POLYGON', + POLYGON = 'POLYGON' } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1406,6 +1624,7 @@ export type CosmosBalanceChain = { version: Array; }; + export type CosmosBalanceChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1413,21 +1632,33 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; + +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type CosmosBasedChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1510,12 +1741,14 @@ export type CronosEvm = { version: Array; }; + export type CronosEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type CronosEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1523,16 +1756,19 @@ export type CronosEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type CronosEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type CronosEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type CronosEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1632,14 +1868,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1926,37 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ -export type DetailedActivityV0 = - | GasTankDepositActivityV0 - | GasTankWithdrawActivityV0 - | OffchainReceiveAssetActivityV0 - | OffchainSendAssetActivityV0 - | SwapAssetActivityV0 - | TokenApproveActivityV0 - | TokenRevokeActivityV0; +export type DetailedActivityV0 = DelegateStakeActivityV0 | DirectStakeActivityV0 | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,18 +1973,29 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; + +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type DogeChainBalancesArgs = { address: Scalars['String']; }; + export type DogeChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type DogeChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type DogeChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1728,23 +2004,27 @@ export type DogeChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type DogeChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type DogeChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type DogeChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type DogeChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1846,12 +2126,14 @@ export type Ethereum = { version: Array; }; + export type EthereumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type EthereumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1859,16 +2141,19 @@ export type EthereumBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type EthereumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type EthereumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type EthereumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1951,12 +2236,14 @@ export type Fantom = { version: Array; }; + export type FantomActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type FantomBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1964,16 +2251,19 @@ export type FantomBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type FantomLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type FantomNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type FantomTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1989,10 +2279,7 @@ export type Fee = { }; /** Represent possible fee details specific to chain */ -export type FeeDetailsV0 = - | EvmFeeDetailsV0 - | ThorChainFeeDetailsV0 - | TronFeeDetailsV0; +export type FeeDetailsV0 = EvmFeeDetailsV0 | ThorChainFeeDetailsV0 | TronFeeDetailsV0; export type FeeInputType = { feeRateTransaction: Scalars['Float']; @@ -2056,12 +2343,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2360,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,17 +2382,57 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; }; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + export type GnosisLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2129,12 +2450,15 @@ export type InvestingType = { pools: Array; }; + export type InvestingTypePoolsArgs = { filter?: InputMaybe; }; export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,19 +2466,30 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; + +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type JunoChainNftsArgs = { address: Scalars['String']; }; + export type JunoChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2195,13 +2530,54 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,18 +2594,29 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; + +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; + export type LitecoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type LitecoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type LitecoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -2238,23 +2625,27 @@ export type LitecoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type LitecoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type LitecoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type LitecoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type LitecoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -2276,9 +2667,48 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2305,17 +2735,20 @@ export type MayaChain = { version: Array; }; + export type MayaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type MayaChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; + export type MayaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2356,6 +2789,50 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2370,36 +2847,43 @@ export type Mutation = { upsertReferrer?: Maybe; }; + export type MutationAddCommentArgs = { address: Scalars['String']; comment: Scalars['String']; source: Scalars['String']; }; + export type MutationCreateReferrerArgs = { referrer: CreateReferrer; }; + export type MutationTransactionHashV2Args = { routeId: Scalars['String']; tradeId: Scalars['String']; transactionHash: Scalars['String']; }; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; + export type MutationTransactionsV2Args = { routeData: RouteInputTypeV2; }; + export type MutationTransactonHashArgs = { routeId: Scalars['String']; signedHash: Scalars['String']; tradeId: Scalars['Float']; }; + export type MutationUpsertReferrerArgs = { address: Scalars['String']; feeTier: Scalars['String']; @@ -2521,14 +3005,17 @@ export type NearChain = { version: Array; }; + export type NearChainBalancesArgs = { address: Scalars['String']; }; + export type NearChainNftsArgs = { address: Scalars['String']; }; + export type NearChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2593,7 +3080,7 @@ export enum NftChainType { Gnosis = 'Gnosis', Optimism = 'Optimism', Polygon = 'Polygon', - Solana = 'Solana', + Solana = 'Solana' } /** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ @@ -2624,11 +3111,50 @@ export type OffchainSendAssetActivityV0 = { to?: Maybe>; }; -export type OpBnb = { - __typename?: 'OpBNB'; - average24hFee?: Maybe; - fee?: Maybe; - name: Scalars['String']; +export type OpBnb = { + __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + fee?: Maybe; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2674,12 +3200,14 @@ export type Optimism = { version: Array; }; + export type OptimismActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type OptimismBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2687,16 +3215,19 @@ export type OptimismBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type OptimismLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type OptimismNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type OptimismTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2766,12 +3297,14 @@ export type Polygon = { version: Array; }; + export type PolygonActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type PolygonBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2779,16 +3312,19 @@ export type PolygonBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type PolygonLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type PolygonNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type PolygonTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2801,7 +3337,7 @@ export enum Pool { Aave = 'Aave', Benqi = 'Benqi', Bitswap = 'Bitswap', - IronBank = 'IronBank', + IronBank = 'IronBank' } export type PoolType = { @@ -2856,6 +3392,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3407,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -2902,7 +3438,7 @@ export enum PortfolioChainVariant { TerraClassic = 'TerraClassic', TomoChain = 'TomoChain', Tron = 'Tron', - Umee = 'Umee', + Umee = 'Umee' } export type PostRouteTypeV2 = { @@ -2915,7 +3451,7 @@ export enum PriceHistoryInterval { day = 'day', month = 'month', week = 'week', - year = 'year', + year = 'year' } /** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ @@ -3024,17 +3560,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,40 +3586,43 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; zkSync: ZkSync; }; + export type QueryChainsArgs = { filter?: InputMaybe; }; + export type QueryCompositeTokensArgs = { after?: InputMaybe; ids?: InputMaybe>; }; + export type QueryCryptoCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; symbols?: InputMaybe>; }; + export type QueryDappArgs = { app: DAppReputationInput; }; + export type QueryFiatCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; export type QueryReputationArgs = { address: Scalars['String']; @@ -3091,6 +3631,7 @@ export type QueryReputationArgs = { offest?: Scalars['Int']; }; + export type QueryReputationV2Args = { address: Scalars['String']; approved?: InputMaybe; @@ -3099,16 +3640,19 @@ export type QueryReputationV2Args = { first?: Scalars['Int']; }; + export type QueryTokensArgs = { after?: InputMaybe; filter?: InputMaybe; }; + export type QueryTrackWalletConnectArgs = { walletAddress: Scalars['String']; walletProvider: Scalars['String']; }; + export type QueryWalletInfoArgs = { address: Scalars['String']; }; @@ -3201,6 +3745,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3346,7 +3891,7 @@ export enum ReputationChains { Zilliqa = 'Zilliqa', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync', + zkSync = 'zkSync' } export type ReputationComment = { @@ -3369,6 +3914,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3565,6 +4111,7 @@ export type RoutingChainType = { tokens: Array; }; + export type RoutingChainTypeTokensArgs = { addresses?: InputMaybe>; srcToken?: InputMaybe; @@ -3647,10 +4194,12 @@ export type RoutingType = { trades?: Maybe>; }; + export type RoutingTypeChainArgs = { name: Scalars['String']; }; + export type RoutingTypeRouteArgs = { addresses: Array; amountSource?: InputMaybe; @@ -3660,15 +4209,18 @@ export type RoutingTypeRouteArgs = { srcToken: Scalars['String']; }; + export type RoutingTypeTokenArgs = { id: Scalars['String']; }; + export type RoutingTypeTokensArgs = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; + export type RoutingTypeTradesArgs = { routeId: Scalars['String']; }; @@ -3695,28 +4247,34 @@ export type RoutingTypeV2 = { tradesV2: Array; }; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; + export type RoutingTypeV2BridgeableTokensArgs = { bridgeToken?: InputMaybe; tokenId?: InputMaybe; }; + export type RoutingTypeV2ChainV2Args = { name: Scalars['String']; }; + export type RoutingTypeV2DailyVolumeArgs = { startDate?: Scalars['String']; }; + export type RoutingTypeV2IsAssetSwappableArgs = { address: Scalars['String']; chainName: Scalars['String']; }; + export type RoutingTypeV2RefuelArgs = { addresses: Array; amountSource?: InputMaybe; @@ -3726,11 +4284,13 @@ export type RoutingTypeV2RefuelArgs = { srcToken: Scalars['String']; }; + export type RoutingTypeV2RefuelInfoArgs = { destChain: Scalars['String']; srcChain: Scalars['String']; }; + export type RoutingTypeV2RouteV2Args = { addresses: Array; amountSource?: InputMaybe; @@ -3744,23 +4304,71 @@ export type RoutingTypeV2RouteV2Args = { srcToken: Scalars['String']; }; + export type RoutingTypeV2TokenV2Args = { id: Scalars['String']; }; + export type RoutingTypeV2TokensV2Args = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; + export type RoutingTypeV2TradeV2Args = { tradeId: Scalars['String']; }; + export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4399,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4445,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3859,32 +4468,38 @@ export type SolanaChain = { version: Array; }; + export type SolanaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type SolanaChainAssetHistoryBalancesV0Args = { address: Scalars['String']; minUntil?: InputMaybe; skipAssetServiceFiltering?: Scalars['Boolean']; }; + export type SolanaChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type SolanaChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type SolanaChainNftsArgs = { address: Scalars['String']; }; + export type SolanaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3924,8 +4539,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,19 +4558,30 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; + +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type StargazeChainNftsArgs = { address: Scalars['String']; }; + export type StargazeChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3964,6 +4600,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -3999,11 +4645,13 @@ export type TerraChain = { version: Array; }; + export type TerraChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type TerraChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; @@ -4022,17 +4670,20 @@ export type ThorChain = { version: Array; }; + export type ThorChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ThorChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; + export type ThorChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4126,20 +4777,19 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', - YEAR = 'YEAR', + YEAR = 'YEAR' } /** Unlimited or specific amount of asset approved to spend for spender address */ export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4147,7 +4797,7 @@ export enum TokenCategory { LST_TOKEN = 'LST_TOKEN', SHITCOIN = 'SHITCOIN', STABLECOIN = 'STABLECOIN', - TRENDING_TOKEN = 'TRENDING_TOKEN', + TRENDING_TOKEN = 'TRENDING_TOKEN' } export type TokenContractType = { @@ -4174,8 +4824,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4249,7 +4899,7 @@ export enum TransactionStatus { /** Transaction was sent and is in the mempool (or equivalent for the chain) */ PENDING = 'PENDING', /** Transaction was included in a block and successfully executed */ - SUCCESS = 'SUCCESS', + SUCCESS = 'SUCCESS' } /** Represents the status of a transaction with optional details */ @@ -4265,7 +4915,7 @@ export enum TransactionType { STAKE = 'STAKE', SWAP = 'SWAP', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW', + WITHDRAW = 'WITHDRAW' } export type TrendingCoingeckoType = { @@ -4289,7 +4939,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4310,12 +4960,14 @@ export type Tron = { version: Array; }; + export type TronActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type TronBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4323,11 +4975,13 @@ export type TronBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type TronNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type TronTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4398,58 +5052,72 @@ export type TxClassifier = { getBlockchairTxsByQuery: Scalars['String']; }; + export type TxClassifierAnalyzeEvmTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; + export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { payload: BlowfishSolanaTxPayload; }; + export type TxClassifierAnalyzeTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; + export type TxClassifierAnalyzeTxV1HexagateArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierAnalyzeTxV2HexagateArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierDecodeTransactionV2Args = { payload: EvmTransactionPayload; }; + export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3Args = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3TenderlyArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { payload: Array; }; + export type TxClassifierExplainTransactionV4TenderlyArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV5Args = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierGetBlockchairTxsByQueryArgs = { chain: TxClassifierChains; limit: Scalars['Int']; @@ -4471,7 +5139,7 @@ export enum TxClassifierChains { linea = 'linea', optimism = 'optimism', polygon = 'polygon', - solana = 'solana', + solana = 'solana' } export enum TxClassifierTxType { @@ -4483,7 +5151,7 @@ export enum TxClassifierTxType { SWAP = 'SWAP', TRANSFER = 'TRANSFER', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW', + WITHDRAW = 'WITHDRAW' } export type TxSecurityIssue = { @@ -4543,6 +5211,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5245,28 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5333,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,50 +5411,111 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type GetSolanaBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; -export type GetSolanaBalanceQuery = { - __typename?: 'Query'; - solana: { - __typename?: 'SolanaChain'; - balances: Array<{ - __typename?: 'Balance'; - address: string; - amount: { __typename?: 'Amount'; value: string }; - asset: { - __typename?: 'CryptoAsset'; - chain?: string | null; - contract?: string | null; - decimals?: number | null; - id?: string | null; - name?: string | null; - image?: string | null; - symbol?: string | null; - price?: { - __typename?: 'AssetAmountType'; - amount: string; - dayPriceChange?: string | null; - } | null; - }; - }>; - }; -}; + +export type GetSolanaBalanceQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', balances: Array<{ __typename?: 'Balance', address: string, amount: { __typename?: 'Amount', value: string }, asset: { __typename?: 'CryptoAsset', chain?: string | null, contract?: string | null, decimals?: number | null, id?: string | null, name?: string | null, image?: string | null, symbol?: string | null, price?: { __typename?: 'AssetAmountType', amount: string, dayPriceChange?: string | null } | null } }> } }; export type GetSolanaTransactionsQueryVariables = Exact<{ address: Scalars['String']; @@ -4757,600 +5523,21 @@ export type GetSolanaTransactionsQueryVariables = Exact<{ after?: InputMaybe; }>; -export type GetSolanaTransactionsQuery = { - __typename?: 'Query'; - solana: { - __typename?: 'SolanaChain'; - transactions: { - __typename?: 'SolanaTransactionConnection'; - pageInfo: { - __typename?: 'PageInfo'; - endCursor?: string | null; - hasNextPage: boolean; - }; - edges: Array<{ - __typename?: 'SolanaTransactionEdge'; - node: { - __typename?: 'SolanaTransaction'; - hash: string; - slot: number; - status: string; - timestamp?: any | null; - signers: Array; - fee: { - __typename?: 'Fee'; - payer: string; - amount: { __typename?: 'Amount'; value: string }; - }; - transfers: Array<{ - __typename?: 'AssetTransfer'; - fromAddress?: string | null; - toAddress?: string | null; - amount: { __typename?: 'Amount'; value: string }; - asset: { - __typename?: 'CryptoAsset'; - chain?: string | null; - contract?: string | null; - decimals?: number | null; - id?: string | null; - image?: string | null; - name?: string | null; - symbol?: string | null; - price?: { __typename?: 'AssetAmountType'; amount: string } | null; - }; - }>; - }; - }>; - }; - }; -}; - -export type GetSolanaStatusQueryVariables = Exact<{ [key: string]: never }>; - -export type GetSolanaStatusQuery = { - __typename?: 'Query'; - solana: { - __typename?: 'SolanaChain'; - status: { __typename?: 'SolanaStatus'; lastBlock: number }; - }; -}; -export type GetSolanaFeeQueryVariables = Exact<{ [key: string]: never }>; +export type GetSolanaTransactionsQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', transactions: { __typename?: 'SolanaTransactionConnection', pageInfo: { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage: boolean }, edges: Array<{ __typename?: 'SolanaTransactionEdge', node: { __typename?: 'SolanaTransaction', hash: string, slot: number, status: string, timestamp?: any | null, signers: Array, fee: { __typename?: 'Fee', payer: string, amount: { __typename?: 'Amount', value: string } }, transfers: Array<{ __typename?: 'AssetTransfer', fromAddress?: string | null, toAddress?: string | null, amount: { __typename?: 'Amount', value: string }, asset: { __typename?: 'CryptoAsset', chain?: string | null, contract?: string | null, decimals?: number | null, id?: string | null, image?: string | null, name?: string | null, symbol?: string | null, price?: { __typename?: 'AssetAmountType', amount: string } | null } }> } }> } } }; -export type GetSolanaFeeQuery = { - __typename?: 'Query'; - solana: { - __typename?: 'SolanaChain'; - fee?: { - __typename?: 'DefaultGasFee'; - high?: number | null; - low?: number | null; - medium?: number | null; - } | null; - }; -}; - -export const GetSolanaBalanceDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetSolanaBalance' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'solana' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'balances' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'address' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'address' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'amount' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'asset' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'chain' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'contract' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'decimals' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'id' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'name' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'image' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'price' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'amount' }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'dayPriceChange', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'symbol' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - GetSolanaBalanceQuery, - GetSolanaBalanceQueryVariables ->; -export const GetSolanaTransactionsDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetSolanaTransactions' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'first' }, - }, - type: { - kind: 'NonNullType', - type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, - }, - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'after' }, - }, - type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'solana' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'transactions' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'address' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'first' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'first' }, - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'after' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'after' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'pageInfo' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'endCursor' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'hasNextPage' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'edges' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'node' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'fee' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'amount', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'value', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'payer', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'hash' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'slot' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'status' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'timestamp' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'transfers' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'amount', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'value', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'asset', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'chain', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'contract', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'decimals', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'id', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'image', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'name', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'price', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'amount', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'symbol', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'fromAddress', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'toAddress', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'signers' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - GetSolanaTransactionsQuery, - GetSolanaTransactionsQueryVariables ->; -export const GetSolanaStatusDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetSolanaStatus' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'solana' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'status' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'lastBlock' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - GetSolanaStatusQuery, - GetSolanaStatusQueryVariables ->; -export const GetSolanaFeeDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetSolanaFee' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'solana' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'fee' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'high' } }, - { kind: 'Field', name: { kind: 'Name', value: 'low' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'medium' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; +export type GetSolanaStatusQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetSolanaStatusQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', status: { __typename?: 'SolanaStatus', lastBlock: number } } }; + +export type GetSolanaFeeQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetSolanaFeeQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', fee?: { __typename?: 'DefaultGasFee', high?: number | null, low?: number | null, medium?: number | null } | null } }; + + +export const GetSolanaBalanceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaBalance"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balances"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chain"}},{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"dayPriceChange"}}]}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetSolanaTransactionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaTransactions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"payer"}}]}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"slot"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"transfers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chain"}},{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fromAddress"}},{"kind":"Field","name":{"kind":"Name","value":"toAddress"}}]}},{"kind":"Field","name":{"kind":"Name","value":"signers"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetSolanaStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaStatus"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastBlock"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetSolanaFeeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaFee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"high"}},{"kind":"Field","name":{"kind":"Name","value":"low"}},{"kind":"Field","name":{"kind":"Name","value":"medium"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/solana/src/gql/index.ts b/packages/solana/src/gql/index.ts index aa66c634..b37261ed 100644 --- a/packages/solana/src/gql/index.ts +++ b/packages/solana/src/gql/index.ts @@ -1,3 +1,3 @@ -export * from './fragment-masking'; -export * from './gql'; -export * from './graphql'; +export * from "./fragment-masking"; +export * from "./gql"; +export * from "./graphql"; diff --git a/packages/thor/.eslintignore b/packages/thor/.eslintignore index 35f5038c..2c8fb98c 100644 --- a/packages/thor/.eslintignore +++ b/packages/thor/.eslintignore @@ -2,3 +2,4 @@ dist node_modules jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/thor/src/gql/graphql.ts b/packages/thor/src/gql/graphql.ts index 7e2c85b6..93391f09 100644 --- a/packages/thor/src/gql/graphql.ts +++ b/packages/thor/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type GetMayachainBalancesQueryVariables = Exact<{ diff --git a/packages/tron/.eslintignore b/packages/tron/.eslintignore index f1a15b1f..358bb9e4 100644 --- a/packages/tron/.eslintignore +++ b/packages/tron/.eslintignore @@ -1,2 +1,3 @@ .eslintrc.cjs -jest-setup-file.ts \ No newline at end of file +jest-setup-file.ts +src/gql/**/*.ts \ No newline at end of file diff --git a/packages/tron/src/gql/graphql.ts b/packages/tron/src/gql/graphql.ts index 0426be8e..2313377b 100644 --- a/packages/tron/src/gql/graphql.ts +++ b/packages/tron/src/gql/graphql.ts @@ -42,6 +42,18 @@ export type Scalars = { LocalDateTime: any; }; +export type AccountPortfolioFiat = { + __typename?: 'AccountPortfolioFiat'; + addresses: Array; + /** Provide sum of all addresses with aligned dates */ + sum?: Maybe; +}; + +/** Represent user Account that holds multiple addresses */ +export type AccountPortfolioRequest = { + addresses: Array; +}; + export enum AddressChain { /** Legacy, use "Arbitrum" instead */ ARBITRUM = 'ARBITRUM', @@ -188,12 +200,20 @@ export type AddressPortfolioFiat = { __typename?: 'AddressPortfolioFiat'; /** wallet address */ address: Scalars['String']; + /** chain */ + chain: Scalars['String']; /** errors if there was some issue with fetching data */ - errors: Array; - /** granularity of data (NOTE: experimental, can be removed) */ - granularity?: Maybe; - /** historical balances USD at specific datetime */ + errors?: Maybe>; + /** historical balances sum of asset in USD at specific datetime */ historicalBalanceSum: Array; + /** last balance value from `historical_balance_sum` */ + lastBalance?: Maybe; + sourceMetadata?: Maybe; +}; + +export type AddressPortfolioRequest = { + address: Scalars['String']; + chain: PortfolioChainVariant; }; export type AddressRouteCheckTypeV2 = { @@ -251,8 +271,10 @@ export type AddressV0Args = { export type AllAssetsFilter = { assetTypes?: InputMaybe>; + chains?: InputMaybe>; ids?: InputMaybe>; priceHistoryInterval?: InputMaybe; + sortBy?: InputMaybe; }; export type AllAssetsResponse = { @@ -268,7 +290,6 @@ export type Amount = { value: Scalars['String']; }; -/** Represent fiat amount in USD */ export type AmountFiat = { __typename?: 'AmountFiat'; amount: Scalars['String']; @@ -353,6 +374,7 @@ export type AssetAllAssetsType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -495,6 +517,7 @@ export type AssetCryptoCurrencyType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; scalingFactor?: Maybe; /** The symbol that identifies token */ @@ -584,6 +607,10 @@ export enum AssetInternalType { TOKEN = 'TOKEN', } +export enum AssetSortBy { + MARKET_CAP = 'MARKET_CAP', +} + export type AssetTokenContractType = { __typename?: 'AssetTokenContractType'; address: Scalars['String']; @@ -618,6 +645,7 @@ export type AssetTokenType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** The symbol that identifies token */ symbol: Scalars['String']; @@ -913,9 +941,44 @@ export type BalanceAtHeight = { export type Base = { __typename?: 'Base'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BaseActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BaseBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BaseNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BaseTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Base onchain activity */ @@ -1031,6 +1094,8 @@ export type BinanceTransactionEdge = { export type BitcoinChain = { __typename?: 'BitcoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1048,6 +1113,12 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; +export type BitcoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; @@ -1097,6 +1168,8 @@ export type BitcoinChainUnspentTxOutputsV5Args = { export type BitcoinChainTestNet = { __typename?: 'BitcoinChainTestNet'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1113,6 +1186,12 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; +export type BitcoinChainTestNetActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; @@ -1157,6 +1236,8 @@ export type BitcoinChainTestNetUnspentTxOutputsV5Args = { export type BitcoincashChain = { __typename?: 'BitcoincashChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1173,6 +1254,12 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; +export type BitcoincashChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; @@ -1224,9 +1311,44 @@ export type BitcoincashChainTestNet = { export type Blast = { __typename?: 'Blast'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type BlastActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type BlastBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type BlastNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type BlastTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** Transaction object with necessary fields for risk analysis by Blowfish. */ @@ -1311,9 +1433,44 @@ export type CantoEvmTransactionsArgs = { export type Celo = { __typename?: 'Celo'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type CeloActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type CeloBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type CeloNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type CeloTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export enum Chain { @@ -1327,23 +1484,12 @@ export enum Chain { POLYGON = 'POLYGON', } -export type ChainPortfolio = { - __typename?: 'ChainPortfolio'; - chain: PortfolioChainVariant; - portfolioByAddr: Array; -}; - export type ChainType = { __typename?: 'ChainType'; fee: FeeType; name: Scalars['String']; }; -export type ChainedAddresses = { - addresses: Array; - chain: PortfolioChainVariant; -}; - export type ClaimStatus = { __typename?: 'ClaimStatus'; amountUsd: Scalars['Float']; @@ -1413,16 +1559,25 @@ export type CosmosBalanceChainBalancesArgs = { export type CosmosBasedChain = { __typename?: 'CosmosBasedChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee: DefaultGasFee; /** Native (always present) and token balances for address */ balances: Array; fee?: Maybe; name: Scalars['String']; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type CosmosBasedChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1632,14 +1787,24 @@ export type DAppReputation = { chains?: Maybe>; logo?: Maybe; name?: Maybe; + riskScore?: Maybe; + sources?: Maybe>; status: Scalars['String']; url: Scalars['String']; + warnings?: Maybe>; }; export type DAppReputationInput = { url: Scalars['String']; }; +export type DAppReputationWarning = { + __typename?: 'DAppReputationWarning'; + kind: Scalars['String']; + message: Scalars['String']; + severity: Scalars['String']; +}; + export type DappsType = { __typename?: 'DappsType'; /** icon url contract */ @@ -1680,18 +1845,48 @@ export type DefiProtocolType = { symbol: Scalars['String']; }; +/** Delegate asset to validator that will stake on behalf of the user */ +export type DelegateStakeActivityV0 = { + __typename?: 'DelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + /** Detailed activity represent more details about transaction */ export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 - | TokenRevokeActivityV0; + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; + +/** Stake by creating own node */ +export type DirectStakeActivityV0 = { + __typename?: 'DirectStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + +/** Reverse of [`DirectStakeActivityV0`] */ +export type DirectUnstakeActivityV0 = { + __typename?: 'DirectUnstakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; export type DogeChain = { __typename?: 'DogeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -1708,6 +1903,12 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; +export type DogeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; @@ -2056,12 +2257,6 @@ export type FiatCurrencyType = { symbol: Scalars['String']; }; -export enum FiatGranularity { - DAY = 'DAY', - FIVE_MINUTE = 'FIVE_MINUTE', - HOUR = 'HOUR', -} - export type FilterArgs = { chain?: InputMaybe; pool?: InputMaybe; @@ -2079,18 +2274,18 @@ export type FloorPrice = { export type GasTankDepositActivityV0 = { __typename?: 'GasTankDepositActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; /** Represents funds withdrawal action from gas tank to user with specified amount and asset */ export type GasTankWithdrawActivityV0 = { __typename?: 'GasTankWithdrawActivityV0'; /** amount of asset used in gas tank action */ - amount: Scalars['IntegerString']; + amount?: Maybe; /** asset used in gas tank action */ - asset: AssetV0; + asset?: Maybe; }; export type GetTokensArgs = { @@ -2101,10 +2296,32 @@ export type GetTokensArgs = { export type Gnosis = { __typename?: 'Gnosis'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; legacyNFTs: Array; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type GnosisActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type GnosisBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; }; export type GnosisLegacyNfTsArgs = { @@ -2112,6 +2329,19 @@ export type GnosisLegacyNfTsArgs = { tokenId?: InputMaybe; }; +export type GnosisNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type GnosisTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type ImageType = { __typename?: 'ImageType'; data: Scalars['String']; @@ -2135,6 +2365,8 @@ export type InvestingTypePoolsArgs = { export type JunoChain = { __typename?: 'JunoChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -2142,10 +2374,17 @@ export type JunoChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type JunoChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -2195,13 +2434,50 @@ export type LeaderboardEntry = { export type Linea = { __typename?: 'Linea'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type LineaActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type LineaBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type LineaNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type LineaTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type LitecoinChain = { __typename?: 'LitecoinChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; balances: Array; broadcastTransaction: Scalars['String']; @@ -2218,6 +2494,12 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; +export type LitecoinChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; @@ -2276,9 +2558,44 @@ export type Manta = { export type Mantle = { __typename?: 'Mantle'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type MantleActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type MantleBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type MantleNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type MantleTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type Marketplace = { @@ -2356,6 +2673,46 @@ export type MediaV2 = { url: Scalars['String']; }; +export type Mode = { + __typename?: 'Mode'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ModeActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ModeBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ModeNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ModeTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type Mutation = { __typename?: 'Mutation'; addComment: Reputation; @@ -2626,9 +2983,44 @@ export type OffchainSendAssetActivityV0 = { export type OpBnb = { __typename?: 'OpBNB'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type OpBnbActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type OpBnbBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type OpBnbNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type OpBnbTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; /** A both end inclusive range selector for block */ @@ -2856,6 +3248,7 @@ export enum PortfolioChainVariant { Cosmos = 'Cosmos', Crescent = 'Crescent', Cronos = 'Cronos', + CronosPos = 'CronosPos', Cudos = 'Cudos', Desmos = 'Desmos', Dogecoin = 'Dogecoin', @@ -2870,7 +3263,6 @@ export enum PortfolioChainVariant { JUNO = 'JUNO', Kava = 'Kava', KiChain = 'KiChain', - Klaytn = 'Klaytn', Konstellation = 'Konstellation', Kujira = 'Kujira', LikeCoin = 'LikeCoin', @@ -3024,17 +3416,18 @@ export type Query = { mantle: Mantle; mars: CosmosBasedChain; mayachain: MayaChain; + mode: Mode; near: NearChain; opBNB: OpBnb; optimism: Optimism; osmosis: CosmosBasedChain; polygon: Polygon; - portfolio: Array; quasar: CosmosBasedChain; reputation: Reputation; reputationV2: ReputationV2; routing: RoutingType; routingV2?: Maybe; + scroll: Scroll; sei: CosmosBalanceChain; solana: SolanaChain; stargaze: StargazeChain; @@ -3049,6 +3442,8 @@ export type Query = { trackWalletConnect?: Maybe; tron: Tron; txClassifier: TxClassifier; + /** Namespace for portfolio related queries */ + userPortfolio: UserPortfolio; /** Fetch wallet information */ walletInfo: WalletInfo; zetachain: ZetaChain; @@ -3079,11 +3474,6 @@ export type QueryFiatCurrenciesArgs = { ids?: InputMaybe>; }; -export type QueryPortfolioArgs = { - timePeriod: TimePeriod; - wallets: Array; -}; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3201,6 +3591,7 @@ export type Reputation = { commentsLimit: Scalars['Int']; commentsOffset: Scalars['Int']; commentsTotal: Scalars['Int']; + flagged: Scalars['Boolean']; location: Scalars['String']; }; @@ -3369,6 +3760,7 @@ export type ReputationV2 = { address: Scalars['String']; chain: ReputationChains; comments: Array; + flagged: Scalars['Boolean']; pageInfo: PageInfo; }; @@ -3761,6 +4153,46 @@ export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; +export type Scroll = { + __typename?: 'Scroll'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; + name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ScrollActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ScrollBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ScrollNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ScrollTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; +}; + export type SearchFilter = { name?: InputMaybe; symbol?: InputMaybe; @@ -3791,6 +4223,7 @@ export type SearchType = AssetBaseType & { /** Known name that identifies token */ name?: Maybe; price?: Maybe; + /** Get price history by day, week, month, year. Limit 20. */ priceHistory: PriceHistoryType; /** Only for "CRYPTOCURRENCY" type */ scalingFactor?: Maybe; @@ -3836,7 +4269,7 @@ export type SendAssetActivityV0 = { /** Keep information about smart contract/program */ export type SmartContractV0 = { __typename?: 'SmartContractV0'; - contract: AddressV0; + contract?: Maybe; name?: Maybe; }; @@ -3924,8 +4357,18 @@ export type SolanaTransactionEdge = { node: SolanaTransaction; }; +export type SourceMetadata = { + __typename?: 'SourceMetadata'; + /** indicates if historical balance sum was cached data */ + historicalBalanceSumCached: Scalars['Boolean']; + /** indicates if historical balance sum was prefetched data or last available */ + historicalBalanceSumPrefetchedPulsar: Scalars['Boolean']; +}; + export type StargazeChain = { __typename?: 'StargazeChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; /** Native (always present) and token balances for address */ balances: Array; @@ -3933,10 +4376,17 @@ export type StargazeChain = { name: Scalars['String']; nfts: Array; status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31. */ transactions: CosmosLikeTransactionConnection; version: Array; }; +export type StargazeChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -3964,6 +4414,16 @@ export type Statusv2 = { blockchairHealth: ProviderHealth; }; +/** Represents sum of few addresses. Valid only in context */ +export type SumPortfolioFiat = { + __typename?: 'SumPortfolioFiat'; + /** first available balance from `spark_line` */ + firstBalance?: Maybe; + /** last available balance from `spark_line` */ + lastBalance?: Maybe; + sparkLine: Array; +}; + export type SwapAssetActivityV0 = { __typename?: 'SwapAssetActivityV0'; /** Place where swap was executed */ @@ -4126,7 +4586,6 @@ export type TimeFrameItem = { /** Chronoscales */ export enum TimePeriod { - ALL = 'ALL', DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', @@ -4137,9 +4596,9 @@ export enum TimePeriod { export type TokenApproveActivityV0 = { __typename?: 'TokenApproveActivityV0'; amount?: Maybe; - asset: AssetV0; - spender: AddressV0; - unlimited: Scalars['Boolean']; + asset?: Maybe; + spender?: Maybe; + unlimited?: Maybe; }; export enum TokenCategory { @@ -4174,8 +4633,8 @@ export type TokenResponse = { /** Approval revocation of asset to use for spender address */ export type TokenRevokeActivityV0 = { __typename?: 'TokenRevokeActivityV0'; - asset: AssetV0; - spender: AddressV0; + asset?: Maybe; + spender?: Maybe; }; export type TokenType = { @@ -4289,7 +4748,7 @@ export type TrendingTokensType = { chains: Array; icon?: Maybe; name: Scalars['String']; - price: AssetAmountType; + price?: Maybe; symbol: Scalars['String']; type: AssetInternalType; }; @@ -4543,6 +5002,14 @@ export type UtxoTransactionV2Edge = { node: UtxoTransactionV2; }; +/** Start undelegating asset from validator. Reverse of [`DelegateStakeActivityV0`] */ +export type UndelegateStakeActivityV0 = { + __typename?: 'UndelegateStakeActivityV0'; + amount?: Maybe; + asset?: Maybe; + validator?: Maybe; +}; + export type UnspentTransactionOutputV4 = { __typename?: 'UnspentTransactionOutputV4'; address?: Maybe; @@ -4569,6 +5036,26 @@ export type UnspentTransactionOutputV5 = { value: Amount; }; +export type UserPortfolio = { + __typename?: 'UserPortfolio'; + /** Historical sum of assets for specific address and chain in fiat */ + addressHistory?: Maybe; + /** Represents user's wallet portfolio, that is build from multiple accounts */ + walletHistory?: Maybe; +}; + +export type UserPortfolioAddressHistoryArgs = { + address: Scalars['String']; + chain: PortfolioChainVariant; + timePeriod: TimePeriod; +}; + +export type UserPortfolioWalletHistoryArgs = { + accounts: Array; + maxAggregationTimeout?: InputMaybe; + timePeriod: TimePeriod; +}; + export type UtxotransactionByHashV5 = { __typename?: 'UtxotransactionByHashV5'; /** (numeric, optional) the block number in which this transaction is mined. */ @@ -4635,6 +5122,13 @@ export type UtxovoutV2 = { value: Scalars['String']; }; +export type ValidatorV0 = { + __typename?: 'ValidatorV0'; + address?: Maybe; + chain?: Maybe; + id?: Maybe; +}; + export type Version = { __typename?: 'Version'; /** date of compilation */ @@ -4706,18 +5200,95 @@ export type WalletInfo = { isReferrer: Scalars['Boolean']; }; +export type WalletPortfolioFiat = { + __typename?: 'WalletPortfolioFiat'; + accounts: Array; + /** Provide sum of all accounts with aligned dates */ + sum?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; average24hFee?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZetaChainActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZetaChainBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZetaChainNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZetaChainTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type ZkSync = { __typename?: 'ZkSync'; + /** activity history for address in descending order */ + activityHistoryV0?: Maybe; + /** Native (always present) and token balances for address */ + balances: Array; fee?: Maybe; feeHistory: DefaultGasFee; name: Scalars['String']; + nfts: Array; + status: Status; + /** @deprecated Please use activity history. This endpoint will be removed after 2024-07-31 */ + transactions: EvmTransactionV2Connection; + version: Array; +}; + +export type ZkSyncActivityHistoryV0Args = { + address: Scalars['String']; + after?: InputMaybe; + first?: Scalars['Int']; +}; + +export type ZkSyncBalancesArgs = { + address: Scalars['String']; + after?: InputMaybe; + first?: InputMaybe; + tokenAddresses?: InputMaybe>; +}; + +export type ZkSyncNftsArgs = { + address: Scalars['String']; + first?: InputMaybe; +}; + +export type ZkSyncTransactionsArgs = { + address: Scalars['String']; + after?: InputMaybe; + blockRange?: InputMaybe; + dateRange?: InputMaybe; + first?: InputMaybe; }; export type GetTronBalanceQueryVariables = Exact<{ From d80bd38623189ab920ef6d5b74919bc150ab7237 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 19 Jul 2024 12:00:09 +0000 Subject: [PATCH 067/176] Version packages --- .changeset/breezy-turtles-tap.md | 15 --------------- .changeset/moody-rings-fail.md | 5 ----- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 8 ++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 ++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 ++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 9 +++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 ++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- 24 files changed, 98 insertions(+), 31 deletions(-) delete mode 100644 .changeset/breezy-turtles-tap.md delete mode 100644 .changeset/moody-rings-fail.md diff --git a/.changeset/breezy-turtles-tap.md b/.changeset/breezy-turtles-tap.md deleted file mode 100644 index 09b7d3ed..00000000 --- a/.changeset/breezy-turtles-tap.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-evm': patch ---- - -Feat: add generic files to .eslintignore diff --git a/.changeset/moody-rings-fail.md b/.changeset/moody-rings-fail.md deleted file mode 100644 index ac0e66a8..00000000 --- a/.changeset/moody-rings-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -Feat: add Gnosis chain support diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 5181f3f8..47fe3ccb 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.18 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.17 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 79c22786..633e35bb 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.17", + "version": "2.0.18", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index cac0788a..71b6d163 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.0.24 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.23 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 983849e1..bca4518e 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.23", + "version": "2.0.24", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 43e08ebd..6c4fb32f 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.24 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.23 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 17d85c66..ec2e0a6a 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.23", + "version": "2.0.24", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index f6c3f7d7..9399465b 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.23 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore + ## 2.0.22 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 75381892..e9a5dd01 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.22", + "version": "2.0.23", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 7563ea3a..f536f04f 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.27 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.26 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index f26f887c..646d4e63 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.26", + "version": "2.0.27", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 9b5d69fc..db357484 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.0.23 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.22 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index aa53c4d2..5d4a54a2 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.22", + "version": "2.0.23", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 857b2547..32b6ae23 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-evm +## 2.0.37 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- 5b9f95cb: Feat: add Gnosis chain support +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.36 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 28edc8b0..9e7958bd 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.36", + "version": "2.0.37", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 43314e72..678d4cf1 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.0.21 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.20 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index c43b81ba..723ef06e 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.20", + "version": "2.0.21", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 82c82cc6..5baf249e 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.25 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.24 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 9e2a1c87..ac2fed36 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.24", + "version": "2.0.25", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 30789374..5d865cba 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.0.26 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.25 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index a2899d4e..92c4b4ba 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.25", + "version": "2.0.26", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index ca1f9585..d75abb2f 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.25 + +### Patch Changes + +- 5b9f95cb: Feat: add generic files to .eslintignore +- Updated dependencies [5b9f95cb] + - @xdefi-tech/chains-core@2.0.23 + ## 2.0.24 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 42e8c061..e287848c 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.24", + "version": "2.0.25", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 117049c4f7d927f53eb93ed0d8fa74151ca2937a Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:18:00 +0100 Subject: [PATCH 068/176] chore: added default usage of fee service for evm estimateFees (#285) --- .changeset/little-roses-look.md | 6 ++++++ packages/core/src/core/datasource/base.data-source.ts | 9 ++++++--- packages/evm/src/chain.provider.ts | 5 ++--- .../evm/src/datasource/indexer/indexer.data-source.ts | 10 +++++----- 4 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 .changeset/little-roses-look.md diff --git a/.changeset/little-roses-look.md b/.changeset/little-roses-look.md new file mode 100644 index 00000000..bfe10ed7 --- /dev/null +++ b/.changeset/little-roses-look.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-evm': patch +--- + +added default usage of fee service for evm estimateFees diff --git a/packages/core/src/core/datasource/base.data-source.ts b/packages/core/src/core/datasource/base.data-source.ts index a2b98313..8c613a63 100644 --- a/packages/core/src/core/datasource/base.data-source.ts +++ b/packages/core/src/core/datasource/base.data-source.ts @@ -3,7 +3,6 @@ import { Observable } from 'rxjs'; import { Manifest } from '../chain'; import { Coin, FeeOptions, GasFeeSpeed, Msg, Transaction, TransactionData } from '../../core'; import { FeeData } from '../interfaces'; -import { NfTv3 } from '../../common/graphql'; export interface BalanceFilter { address: string; @@ -15,6 +14,10 @@ export interface TransactionsFilter { afterBlock?: number | string; } +export interface FeeParams { + useFeeService: boolean; +} + export interface Balance { asset: { chain: string; @@ -53,9 +56,9 @@ export abstract class DataSource { abstract subscribeTransactions(filter: TransactionsFilter): Promise>; - abstract estimateFee(msgs: Msg[], speed: GasFeeSpeed): Promise; + abstract estimateFee(msgs: Msg[], speed: GasFeeSpeed, options?: FeeParams): Promise; - abstract gasFeeOptions(options?: { useFeeService: boolean }): Promise; + abstract gasFeeOptions(options?: FeeParams): Promise; async getNonce(_address: string): Promise { return 0; diff --git a/packages/evm/src/chain.provider.ts b/packages/evm/src/chain.provider.ts index 537224da..5d8011ab 100644 --- a/packages/evm/src/chain.provider.ts +++ b/packages/evm/src/chain.provider.ts @@ -6,6 +6,7 @@ import { DataSource, FeeData, FeeOptions, + FeeParams, GasFeeSpeed, Msg, MsgData, @@ -94,9 +95,7 @@ export class EvmProvider extends Chain.Provider { ); } - async gasFeeOptions(options?: { - useFeeService: boolean; - }): Promise { + async gasFeeOptions(options?: FeeParams): Promise { return this.dataSource.gasFeeOptions(options); } diff --git a/packages/evm/src/datasource/indexer/indexer.data-source.ts b/packages/evm/src/datasource/indexer/indexer.data-source.ts index c5e0832c..081e91d1 100644 --- a/packages/evm/src/datasource/indexer/indexer.data-source.ts +++ b/packages/evm/src/datasource/indexer/indexer.data-source.ts @@ -3,6 +3,7 @@ import { DataSource, Coin, FeeOptions, + FeeParams, GasFeeSpeed, Transaction, Injectable, @@ -195,9 +196,10 @@ export class IndexerDataSource extends DataSource { async estimateFee( msgs: ChainMsg[], - speed: GasFeeSpeed = GasFeeSpeed.medium + speed: GasFeeSpeed = GasFeeSpeed.medium, + options: FeeParams = { useFeeService: true } ): Promise { - const fee = await this.gasFeeOptions(); + const fee = await this.gasFeeOptions(options); if (!fee) { throw new Error(`Cannot estimate fee for chain ${this.manifest.chain}`); } @@ -304,9 +306,7 @@ export class IndexerDataSource extends DataSource { return feeData; } - async gasFeeOptions(options?: { - useFeeService: boolean; - }): Promise { + async gasFeeOptions(options?: FeeParams): Promise { if (options?.useFeeService) { return this._getFeeOptionsByFeeService(); } From 0e10f4f5e1ae85a3a10c48d68bb410a3abc70a21 Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 22 Jul 2024 17:20:31 +0000 Subject: [PATCH 069/176] Version packages --- .changeset/little-roses-look.md | 6 ------ packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 .changeset/little-roses-look.md diff --git a/.changeset/little-roses-look.md b/.changeset/little-roses-look.md deleted file mode 100644 index bfe10ed7..00000000 --- a/.changeset/little-roses-look.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-evm': patch ---- - -added default usage of fee service for evm estimateFees diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 9399465b..5ba77e6f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.24 + +### Patch Changes + +- 571b0456: added default usage of fee service for evm estimateFees + ## 2.0.23 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index e9a5dd01..a92b36f0 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.23", + "version": "2.0.24", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 32b6ae23..1720b9de 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.38 + +### Patch Changes + +- 571b0456: added default usage of fee service for evm estimateFees +- Updated dependencies [571b0456] + - @xdefi-tech/chains-core@2.0.24 + ## 2.0.37 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 9e7958bd..5b5d4096 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.37", + "version": "2.0.38", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From a1f83c335ddfd8148028902573f6a03a203879cc Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:18:08 +0700 Subject: [PATCH 070/176] feat: add sign mode for cosmos chains (#288) --- .changeset/mean-clocks-cheat.md | 5 + packages/cosmos/src/msg.ts | 5 + .../src/signers/private-key.signer.spec.ts | 95 ++++++++++++++++++- .../cosmos/src/signers/private-key.signer.ts | 58 +++++++---- .../src/signers/seed-phrase.signer.spec.ts | 13 ++- .../cosmos/src/signers/seed-phrase.signer.ts | 56 +++++++---- 6 files changed, 190 insertions(+), 42 deletions(-) create mode 100644 .changeset/mean-clocks-cheat.md diff --git a/.changeset/mean-clocks-cheat.md b/.changeset/mean-clocks-cheat.md new file mode 100644 index 00000000..775ee2a7 --- /dev/null +++ b/.changeset/mean-clocks-cheat.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +feat: add signing mode for the sign method diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 9945b7c7..38241a19 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -67,6 +67,11 @@ export enum CosmosChainType { Terra = 2, } +export enum CosmosSignMode { + SIGN_DIRECT = 0, + SIGN_AMINO = 1, +} + export class ChainMsg extends BasMsg { declare signedTransaction: StdTx | undefined; declare provider: CosmosProvider; diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index c6b3f258..9a699e90 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -6,7 +6,7 @@ import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { COSMOS_MANIFESTS } from '../manifests'; -import { ChainMsg, MsgBody } from '../msg'; +import { ChainMsg, CosmosChainType, CosmosSignMode, MsgBody } from '../msg'; import { PrivateKeySigner } from './private-key.signer'; @@ -110,9 +110,18 @@ describe('private-key.signer', () => { ); }); - it('should sign a transaction using a private key', async () => { + it('should sign direct a transaction using a private key', async () => { await cosmosSigner.sign(message); + expect(message.signedTransaction).toBeTruthy(); + }); + it('should sign amimo a transaction using a private key', async () => { + await cosmosSigner.sign( + message, + '', + CosmosChainType.Cosmos, + CosmosSignMode.SIGN_AMINO + ); expect(message.signedTransaction).toBeTruthy(); }); @@ -164,4 +173,86 @@ describe('private-key.signer', () => { ); expect(result).toBe(false); }); + + it('Should create msg adn sign it with direct mode', async () => { + const chainMsg = provider.createMsg(txInput); + + const txData = await chainMsg.buildTx(); + + // Check tx msgs before signinng + const expectedMsg = { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: { + fromAddress: txInput.from, + toAddress: txInput.to, + amount: [ + { + denom: 'uatom', + amount: '1', // txInput * 10 ** decimals + }, + ], + }, + }; + expect(txData.msgs[0]).toEqual(expectedMsg); + + // Check tx fee info before signing + const expectedFee = { + amount: [{ denom: 'uatom', amount: '2500' }], + gas: '200000', + }; + expect(txData.fee).toEqual(expectedFee); + + // Sign msg with direct sign mode + const signer = new PrivateKeySigner(privateKeys.cosmos); + await signer.sign( + chainMsg, + '', + CosmosChainType.Cosmos, + CosmosSignMode.SIGN_DIRECT + ); + expect(chainMsg.signedTransaction).toEqual( + 'Co0BCooBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmoKLWNvc21vczFnNnF1NmhtNHYzczN2cTc0MzhqZWhuOWZ6eGc5cDcyMHllc3EycRItY29zbW9zMWc2cXU2aG00djNzM3ZxNzQzOGplaG45Znp4ZzlwNzIweWVzcTJxGgoKBXVhdG9tEgExEmcKUApGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQPdo5siwfjiwtEdo7xFF/gLRhqmnxDnYeNFdvTwnM+h7hIECgIIARgBEhMKDQoFdWF0b20SBDI1MDAQwJoMGkDMqz7SD1+2tvYlImP5HGOLF0/wjqpDAyMODMKnmh8bmkjdarqIGVnN+FgLzEaKHUpIc1c6n8iwCkh/a8SW1yfr' + ); + }); + + it('Should create msg adn sign it with animo mode', async () => { + const chainMsg = provider.createMsg(txInput); + + const txData = await chainMsg.buildTx(); + + // Check tx msgs before signinng + const expectedMsg = { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: { + fromAddress: txInput.from, + toAddress: txInput.to, + amount: [ + { + denom: 'uatom', + amount: '1', // txInput * 10 ** decimals + }, + ], + }, + }; + expect(txData.msgs[0]).toEqual(expectedMsg); + + // Check tx fee info before signing + const expectedFee = { + amount: [{ denom: 'uatom', amount: '2500' }], + gas: '200000', + }; + expect(txData.fee).toEqual(expectedFee); + + // Sign msg with amino sign mode + const signer = new PrivateKeySigner(privateKeys.cosmos); + await signer.sign( + chainMsg, + '', + CosmosChainType.Cosmos, + CosmosSignMode.SIGN_AMINO + ); + expect(chainMsg.signedTransaction).toEqual( + 'Co0BCooBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmoKLWNvc21vczFnNnF1NmhtNHYzczN2cTc0MzhqZWhuOWZ6eGc5cDcyMHllc3EycRItY29zbW9zMWc2cXU2aG00djNzM3ZxNzQzOGplaG45Znp4ZzlwNzIweWVzcTJxGgoKBXVhdG9tEgExEmcKUApGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQPdo5siwfjiwtEdo7xFF/gLRhqmnxDnYeNFdvTwnM+h7hIECgIIfxgBEhMKDQoFdWF0b20SBDI1MDAQwJoMGkCMICf5+o/tooHugIHu8JFVWQ1Gj8EjJVKWHdZOJSEuBWyh+Wt/k8b4A0EWzhwI8B4nHvGEPGjmLWVI6USX1wQs' + ); + }); }); diff --git a/packages/cosmos/src/signers/private-key.signer.ts b/packages/cosmos/src/signers/private-key.signer.ts index 876001cb..a91f870d 100644 --- a/packages/cosmos/src/signers/private-key.signer.ts +++ b/packages/cosmos/src/signers/private-key.signer.ts @@ -12,8 +12,9 @@ import { Wallet } from 'ethers'; import { RawKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; +import { Secp256k1Wallet } from '@cosmjs/amino'; -import { ChainMsg, CosmosChainType } from '../msg'; +import { ChainMsg, CosmosChainType, CosmosSignMode } from '../msg'; import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) @@ -61,31 +62,20 @@ export class PrivateKeySigner extends Signer.Provider { async sign( msg: ChainMsg, _derivation?: string, - chainType?: CosmosChainType + chainType?: CosmosChainType, + signMode?: CosmosSignMode ): Promise { - const txData = await msg.buildTx(); if (chainType === CosmosChainType.Cosmos || !chainType) { - const wallet = await DirectSecp256k1Wallet.fromKey( - fromHex(this.key), - msg.provider.manifest.prefix - ); - const [{ address: senderAddress }] = await wallet.getAccounts(); - const client = await SigningStargateClient.connectWithSigner( - msg.provider.manifest.rpcURL, - wallet, - STARGATE_CLIENT_OPTIONS - ); - const signedTx = await client.sign( - senderAddress, - txData.msgs, - txData.fee, - txData.memo - ); + const signedTx = + signMode === CosmosSignMode.SIGN_DIRECT || !signMode + ? await this.signDirect(msg) + : await this.signAmino(msg); const txBytes = TxRaw.encode(signedTx as TxRaw).finish(); const rawTx = Buffer.from(txBytes).toString('base64'); msg.sign(rawTx); return; } else if (chainType === CosmosChainType.Terra) { + const txData = await msg.buildTx(); const clientOptions: Record = {}; clientOptions[msg.provider.manifest.chainId] = { chainID: msg.provider.manifest.chainId, @@ -110,6 +100,36 @@ export class PrivateKeySigner extends Signer.Provider { } } + async signDirect(msg: ChainMsg) { + const txData = await msg.buildTx(); + const wallet = await await DirectSecp256k1Wallet.fromKey( + fromHex(this.key), + msg.provider.manifest.prefix + ); + const [{ address: senderAddress }] = await wallet.getAccounts(); + const client = await SigningStargateClient.connectWithSigner( + msg.provider.manifest.rpcURL, + wallet, + STARGATE_CLIENT_OPTIONS + ); + return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); + } + + async signAmino(msg: ChainMsg) { + const txData = await msg.buildTx(); + const wallet = await Secp256k1Wallet.fromKey( + fromHex(this.key), + msg.provider.manifest.prefix + ); + const [{ address: senderAddress }] = await wallet.getAccounts(); + const client = await SigningStargateClient.connectWithSigner( + msg.provider.manifest.rpcURL, + wallet, + STARGATE_CLIENT_OPTIONS + ); + return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); + } + async verifyMessage( signer: string, data: Uint8Array | string, diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index e278b7cd..90d5f03c 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -5,7 +5,7 @@ import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { COSMOS_MANIFESTS, CosmosHubChains } from '../manifests'; -import { ChainMsg, MsgBody } from '../msg'; +import { ChainMsg, CosmosChainType, CosmosSignMode, MsgBody } from '../msg'; import SeedPhraseSigner from './seed-phrase.signer'; @@ -103,9 +103,18 @@ describe('seed-phrase.signer', () => { ); }); - it('should sign a transaction using a seed phrase', async () => { + it('should sign direct a transaction using a seed phrase', async () => { await signer.sign(message, derivations.cosmos); + expect(message.signedTransaction).toBeTruthy(); + }); + it('should sign amino a transaction using a seed phrase', async () => { + await signer.sign( + message, + derivations.cosmos, + CosmosChainType.Cosmos, + CosmosSignMode.SIGN_AMINO + ); expect(message.signedTransaction).toBeTruthy(); }); }); diff --git a/packages/cosmos/src/signers/seed-phrase.signer.ts b/packages/cosmos/src/signers/seed-phrase.signer.ts index 8963a66a..b1a372c5 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.ts @@ -11,8 +11,9 @@ import { Wallet } from 'ethers'; import { MnemonicKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; +import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'; -import { ChainMsg, CosmosChainType } from '../msg'; +import { ChainMsg, CosmosChainType, CosmosSignMode } from '../msg'; import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) @@ -63,31 +64,20 @@ export class SeedPhraseSigner extends Signer.Provider { async sign( msg: ChainMsg, derivation: string, - chainType?: CosmosChainType + chainType?: CosmosChainType, + signMode?: CosmosSignMode ): Promise { - const txData = await msg.buildTx(); if (chainType === CosmosChainType.Cosmos || !chainType) { - const wallet = await Secp256k1HdWallet.fromMnemonic(this.key, { - prefix: msg.provider.manifest.prefix, - }); - const [{ address: senderAddress }] = await wallet.getAccounts(); - const client = await SigningStargateClient.connectWithSigner( - msg.provider.manifest.rpcURL, - wallet, - STARGATE_CLIENT_OPTIONS - ); - - const signedTx = await client.sign( - senderAddress, - txData.msgs, - txData.fee, - txData.memo - ); + const signedTx = + signMode === CosmosSignMode.SIGN_DIRECT || !signMode + ? await this.signDirect(msg) + : await this.signAmino(msg); const txBytes = TxRaw.encode(signedTx as TxRaw).finish(); const rawTx = Buffer.from(txBytes).toString('base64'); msg.sign(rawTx); return; } else if (chainType === CosmosChainType.Terra) { + const txData = await msg.buildTx(); const clientOptions: Record = {}; clientOptions[msg.provider.manifest.chainId] = { chainID: msg.provider.manifest.chainId, @@ -118,6 +108,34 @@ export class SeedPhraseSigner extends Signer.Provider { } } + async signDirect(msg: ChainMsg) { + const txData = await msg.buildTx(); + const wallet = await DirectSecp256k1HdWallet.fromMnemonic(this.key, { + prefix: msg.provider.manifest.prefix, + }); + const [{ address: senderAddress }] = await wallet.getAccounts(); + const client = await SigningStargateClient.connectWithSigner( + msg.provider.manifest.rpcURL, + wallet, + STARGATE_CLIENT_OPTIONS + ); + return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); + } + + async signAmino(msg: ChainMsg) { + const txData = await msg.buildTx(); + const wallet = await Secp256k1HdWallet.fromMnemonic(this.key, { + prefix: msg.provider.manifest.prefix, + }); + const [{ address: senderAddress }] = await wallet.getAccounts(); + const client = await SigningStargateClient.connectWithSigner( + msg.provider.manifest.rpcURL, + wallet, + STARGATE_CLIENT_OPTIONS + ); + return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); + } + async verifyMessage( signer: string, data: Uint8Array | string, From e3e48b267b7d3e5ef407bd73cdfd4665a23b6b94 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 26 Jul 2024 11:20:35 +0000 Subject: [PATCH 071/176] Version packages --- .changeset/mean-clocks-cheat.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/mean-clocks-cheat.md diff --git a/.changeset/mean-clocks-cheat.md b/.changeset/mean-clocks-cheat.md deleted file mode 100644 index 775ee2a7..00000000 --- a/.changeset/mean-clocks-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -feat: add signing mode for the sign method diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index f536f04f..f02596fc 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.28 + +### Patch Changes + +- 7ff10296: feat: add signing mode for the sign method + ## 2.0.27 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 646d4e63..89141423 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.27", + "version": "2.0.28", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 5599865f82143194cb8df7e94632768db91fd5d2 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:22:37 +0300 Subject: [PATCH 072/176] fix: getTransaction method for cosmos chains (#289) --- .changeset/mean-radios-jump.md | 5 +++++ packages/cosmos/src/chain.provider.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/mean-radios-jump.md diff --git a/.changeset/mean-radios-jump.md b/.changeset/mean-radios-jump.md new file mode 100644 index 00000000..39651f82 --- /dev/null +++ b/.changeset/mean-radios-jump.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +Fix: getTransaction method for cosmos chains diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index 9ff0bfd2..d4a4dfd3 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -202,7 +202,9 @@ export class CosmosProvider extends Chain.Provider { if (tx.tx_response.code) { result.status = TransactionStatus.failure; } else { - const { data } = await this.lcdAxiosClient.get('/blocks/latest'); + const { data } = await this.lcdAxiosClient.get( + '/cosmos/base/tendermint/v1beta1/blocks/latest' + ); if (tx.tx_response.height <= data.block.header.height) { result.status = TransactionStatus.success; result.data = tx.tx_response.data; From 10f96146531277a9931b636ce32bca828f320cc8 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 26 Jul 2024 12:25:06 +0000 Subject: [PATCH 073/176] Version packages --- .changeset/mean-radios-jump.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/mean-radios-jump.md diff --git a/.changeset/mean-radios-jump.md b/.changeset/mean-radios-jump.md deleted file mode 100644 index 39651f82..00000000 --- a/.changeset/mean-radios-jump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -Fix: getTransaction method for cosmos chains diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index f02596fc..c700f681 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.29 + +### Patch Changes + +- 25af39fe: Fix: getTransaction method for cosmos chains + ## 2.0.28 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 89141423..758caf6c 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.28", + "version": "2.0.29", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 4772052d0cbb3860945852aeb8e336d923fdea90 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:29:36 +0300 Subject: [PATCH 074/176] feat: update tron dataProviderUrl (#290) --- .changeset/hip-walls-help.md | 5 +++++ packages/tron/src/manifests.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/hip-walls-help.md diff --git a/.changeset/hip-walls-help.md b/.changeset/hip-walls-help.md new file mode 100644 index 00000000..19176ced --- /dev/null +++ b/.changeset/hip-walls-help.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-tron': patch +--- + +Feat: change dataProviderURL diff --git a/packages/tron/src/manifests.ts b/packages/tron/src/manifests.ts index 7b173e24..aaa0e2c9 100644 --- a/packages/tron/src/manifests.ts +++ b/packages/tron/src/manifests.ts @@ -8,11 +8,11 @@ export interface TronManifest extends Chain.Manifest { export const TRON_MANIFEST: TronManifest = { name: 'Tron', description: '', - rpcURL: 'https://api.trongrid.io', + rpcURL: 'https://rpc-proxy.xdefi.services/trongrid/rpc/mainnet', chainSymbol: 'TRX', blockExplorerURL: 'https://tronscan.org', dataProviderType: 'trongrid', - dataProviderURL: 'https://api.trongrid.io', + dataProviderURL: 'https://rpc-proxy.xdefi.services/trongrid/rpc/mainnet', chainId: '0x2b6653dc', chain: 'tron', decimals: 16, From 03b907818269d3e7ac2e1612e1778fa9772cc748 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 26 Jul 2024 14:32:02 +0000 Subject: [PATCH 075/176] Version packages --- .changeset/hip-walls-help.md | 5 ----- packages/tron/CHANGELOG.md | 6 ++++++ packages/tron/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/hip-walls-help.md diff --git a/.changeset/hip-walls-help.md b/.changeset/hip-walls-help.md deleted file mode 100644 index 19176ced..00000000 --- a/.changeset/hip-walls-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-tron': patch ---- - -Feat: change dataProviderURL diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index d75abb2f..39b1638f 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-tron +## 2.0.26 + +### Patch Changes + +- 38794f73: Feat: change dataProviderURL + ## 2.0.25 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index e287848c..d24b85da 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.25", + "version": "2.0.26", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From eb56876354ca272658cc3fd1cdac5da66835660e Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:23:23 +0300 Subject: [PATCH 076/176] feat: add sei chain (#283) --- .changeset/four-toys-help.md | 5 + examples/react/package.json | 2 +- .../src/datasource/indexer/gql/sei.graphql | 42 + .../indexer/queries/balances.query.ts | 5 + .../datasource/indexer/queries/fees.query.ts | 5 + packages/cosmos/src/gql/gql.ts | 8 + packages/cosmos/src/gql/graphql.ts | 273 +++++ packages/cosmos/src/manifests.ts | 20 + packages/solana/src/gql/graphql.ts | 940 ++++++++++++------ packages/solana/src/gql/index.ts | 5 +- 10 files changed, 1023 insertions(+), 282 deletions(-) create mode 100644 .changeset/four-toys-help.md create mode 100644 packages/cosmos/src/datasource/indexer/gql/sei.graphql diff --git a/.changeset/four-toys-help.md b/.changeset/four-toys-help.md new file mode 100644 index 00000000..427cb21c --- /dev/null +++ b/.changeset/four-toys-help.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +Feat: add Sei mainnet chain diff --git a/examples/react/package.json b/examples/react/package.json index 0082622c..f9ea018d 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -3,7 +3,7 @@ "version": "0.2.2", "private": true, "scripts": { - "dev": "ANALYZE=true next dev", + "dev": "next dev", "start": "ANALYZE=true next start", "clean": "rimraf .next .turbo node_modules" }, diff --git a/packages/cosmos/src/datasource/indexer/gql/sei.graphql b/packages/cosmos/src/datasource/indexer/gql/sei.graphql new file mode 100644 index 00000000..85bb3dd7 --- /dev/null +++ b/packages/cosmos/src/datasource/indexer/gql/sei.graphql @@ -0,0 +1,42 @@ +query SeiBalance($address: String!) { + sei { + balances(address: $address) { + address + amount { + value + } + asset { + chain + contract + decimals + id + image + name + price { + amount + scalingFactor + dayPriceChange + } + symbol + } + } + } +} + +query GetSeiFees { + sei { + fee { + high + low + medium + } + } +} + +query GetSeiStatus { + sei { + status { + lastBlock + } + } +} \ No newline at end of file diff --git a/packages/cosmos/src/datasource/indexer/queries/balances.query.ts b/packages/cosmos/src/datasource/indexer/queries/balances.query.ts index 820fc7d7..392a6208 100644 --- a/packages/cosmos/src/datasource/indexer/queries/balances.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/balances.query.ts @@ -14,6 +14,7 @@ import { StrideBalanceDocument, MarsBalanceDocument, TerraBalanceDocument, + SeiBalanceDocument, Balance, } from '../../../gql/graphql'; import { CosmosHubChains } from '../../../manifests'; @@ -82,6 +83,10 @@ const getChainParams = (chain: string): CosmosChainParams => { params.query = TerraBalanceDocument; params.queryName = 'terra'; break; + case CosmosHubChains.sei: + params.query = SeiBalanceDocument; + params.queryName = 'sei'; + break; } return params; diff --git a/packages/cosmos/src/datasource/indexer/queries/fees.query.ts b/packages/cosmos/src/datasource/indexer/queries/fees.query.ts index 6343f4a2..8ffc6ecc 100644 --- a/packages/cosmos/src/datasource/indexer/queries/fees.query.ts +++ b/packages/cosmos/src/datasource/indexer/queries/fees.query.ts @@ -14,6 +14,7 @@ import { GetStrideFeesDocument, GetMarsFeesDocument, GetTerraFeesDocument, + GetSeiFeesDocument, DefaultGasFee, } from '../../../gql/graphql'; import { CosmosHubChains } from '../../../manifests'; @@ -82,6 +83,10 @@ const getChainParams = (chain: string): CosmosChainParams => { params.query = GetTerraFeesDocument; params.queryName = 'terra'; break; + case CosmosHubChains.sei: + params.query = GetSeiFeesDocument; + params.queryName = 'sei'; + break; } return params; diff --git a/packages/cosmos/src/gql/gql.ts b/packages/cosmos/src/gql/gql.ts index 41ae1e5f..5d545907 100644 --- a/packages/cosmos/src/gql/gql.ts +++ b/packages/cosmos/src/gql/gql.ts @@ -17,6 +17,8 @@ const documents = { types.GetAssetsWithFilterDocument, 'query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}': types.CosmosBalanceDocument, + 'query SeiBalance($address: String!) {\n sei {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSeiFees {\n sei {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSeiStatus {\n sei {\n status {\n lastBlock\n }\n }\n}': + types.SeiBalanceDocument, 'query TerraBalance($address: String!) {\n terra {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetTerraFees {\n terra {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetTerraStatus {\n terra {\n status {\n lastBlock\n }\n }\n}': types.TerraBalanceDocument, }; @@ -47,6 +49,12 @@ export function gql( export function gql( source: 'query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}' ): typeof documents['query CosmosBalance($address: String!) {\n cosmos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCosmosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cosmos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCosmosFees {\n cosmos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCosmosStatus {\n cosmos {\n status {\n lastBlock\n }\n }\n}\n\nquery OsmosisBalance($address: String!) {\n osmosis {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetOsmosisTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n osmosis {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetOsmosisFees {\n osmosis {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetOsmosisStatus {\n osmosis {\n status {\n lastBlock\n }\n }\n}\n\nquery AxelarBalance($address: String!) {\n axelar {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAxelarTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n axelar {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAxelarFees {\n axelar {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAxelarStatus {\n axelar {\n status {\n lastBlock\n }\n }\n}\n\nquery CrescentBalance($address: String!) {\n crescent {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCrescentTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n crescent {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCrescentFees {\n crescent {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCrescentStatus {\n crescent {\n status {\n lastBlock\n }\n }\n}\n\nquery KavaBalance($address: String!) {\n kava {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKavaTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kava {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKavaFees {\n kava {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKavaStatus {\n kava {\n status {\n lastBlock\n }\n }\n}\n\nquery AkashBalance($address: String!) {\n akash {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetAkashTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n akash {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetAkashFees {\n akash {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetAkashStatus {\n akash {\n status {\n lastBlock\n }\n }\n}\n\nquery CronosBalance($address: String!) {\n cronos {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetCronosTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n cronos {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetCronosFees {\n cronos {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetCronosStatus {\n cronos {\n status {\n lastBlock\n }\n }\n}\n\nquery KujiraBalance($address: String!) {\n kujira {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetKujiraTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n kujira {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetKujiraFees {\n kujira {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetKujiraStatus {\n kujira {\n status {\n lastBlock\n }\n }\n}\n\nquery StrideBalance($address: String!) {\n stride {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStrideTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stride {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStrideFees {\n stride {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStrideStatus {\n stride {\n status {\n lastBlock\n }\n }\n}\n\nquery MarsBalance($address: String!) {\n mars {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMarsTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n mars {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetMarsFees {\n mars {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetMarsStatus {\n mars {\n status {\n lastBlock\n }\n }\n}\n\nquery JunoBalance($address: String!) {\n juno {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetJunoTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n juno {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetJunoFees {\n juno {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetJunoStatus {\n juno {\n status {\n lastBlock\n }\n }\n}\n\nquery StargazeBalance($address: String!) {\n stargaze {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetStargazeTransactions($address: String!, $blockRange: OptBlockRange!, $first: Int!, $after: String) {\n stargaze {\n transactions(\n address: $address\n blockRange: $blockRange\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n blockHeight\n blockIndex\n hash\n status\n transfers {\n amount {\n value\n }\n asset {\n chain\n contract\n name\n symbol\n image\n decimals\n }\n fromAddress\n toAddress\n }\n timestamp\n fee {\n amount {\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n symbol\n price {\n amount\n }\n }\n }\n payer\n }\n signers\n }\n }\n }\n }\n}\n\nquery GetStargazeFees {\n stargaze {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetStargazeStatus {\n stargaze {\n status {\n lastBlock\n }\n }\n}']; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql( + source: 'query SeiBalance($address: String!) {\n sei {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSeiFees {\n sei {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSeiStatus {\n sei {\n status {\n lastBlock\n }\n }\n}' +): typeof documents['query SeiBalance($address: String!) {\n sei {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n scalingFactor\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetSeiFees {\n sei {\n fee {\n high\n low\n medium\n }\n }\n}\n\nquery GetSeiStatus {\n sei {\n status {\n lastBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/cosmos/src/gql/graphql.ts b/packages/cosmos/src/gql/graphql.ts index 9f96e7ee..1b0a23eb 100644 --- a/packages/cosmos/src/gql/graphql.ts +++ b/packages/cosmos/src/gql/graphql.ts @@ -6867,6 +6867,63 @@ export type GetStargazeStatusQuery = { }; }; +export type SeiBalanceQueryVariables = Exact<{ + address: Scalars['String']; +}>; + +export type SeiBalanceQuery = { + __typename?: 'Query'; + sei: { + __typename?: 'CosmosBalanceChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + scalingFactor: number; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetSeiFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetSeiFeesQuery = { + __typename?: 'Query'; + sei: { + __typename?: 'CosmosBalanceChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export type GetSeiStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetSeiStatusQuery = { + __typename?: 'Query'; + sei: { + __typename?: 'CosmosBalanceChain'; + status: { __typename?: 'Status'; lastBlock: number }; + }; +}; + export type TerraBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; @@ -14590,6 +14647,222 @@ export const GetStargazeStatusDocument = { GetStargazeStatusQuery, GetStargazeStatusQueryVariables >; +export const SeiBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'SeiBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'sei' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'scalingFactor', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetSeiFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSeiFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'sei' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const GetSeiStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSeiStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'sei' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; export const TerraBalanceDocument = { kind: 'Document', definitions: [ diff --git a/packages/cosmos/src/manifests.ts b/packages/cosmos/src/manifests.ts index 9e7a8049..1925f281 100644 --- a/packages/cosmos/src/manifests.ts +++ b/packages/cosmos/src/manifests.ts @@ -14,6 +14,7 @@ export enum CosmosHubChains { stride = 'stride', mars = 'mars', terra = 'terra', + sei = 'sei', } export interface CosmosManifest extends Chain.Manifest { @@ -273,4 +274,23 @@ export const COSMOS_MANIFESTS: { }, maxGapAmount: 0, }, + [CosmosHubChains.sei]: { + name: 'Sei', + description: 'mainnet', + rpcURL: 'https://rpc-proxy.xdefi.services/sei/rpc/mainnet', + lcdURL: 'https://rpc-proxy.xdefi.services/sei/lcd/mainnet', + chainSymbol: 'SEI', + blockExplorerURL: 'https://www.mintscan.io/sei', + chainId: 'pacific-1', + chain: 'sei', + denom: 'usei', + decimals: 6, + prefix: 'sei', + feeGasStep: { + high: 0.1, + medium: 0.1, + low: 0.1, + }, + maxGapAmount: 0, + }, }; diff --git a/packages/solana/src/gql/graphql.ts b/packages/solana/src/gql/graphql.ts index cb68670c..32c2924e 100644 --- a/packages/solana/src/gql/graphql.ts +++ b/packages/solana/src/gql/graphql.ts @@ -2,9 +2,15 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -186,7 +192,7 @@ export enum AddressChain { Umee = 'Umee', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync' + zkSync = 'zkSync', } /** Portfolio by wallet address */ @@ -318,14 +324,12 @@ export type Arbitrum = { version: Array; }; - export type ArbitrumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ArbitrumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -333,19 +337,16 @@ export type ArbitrumBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ArbitrumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type ArbitrumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ArbitrumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -603,11 +604,11 @@ export type AssetHistory = { export enum AssetInternalType { CRYPTOCURRENCY = 'CRYPTOCURRENCY', LP_TOKEN = 'LP_TOKEN', - TOKEN = 'TOKEN' + TOKEN = 'TOKEN', } export enum AssetSortBy { - MARKET_CAP = 'MARKET_CAP' + MARKET_CAP = 'MARKET_CAP', } export type AssetTokenContractType = { @@ -727,7 +728,6 @@ export type AssetType = { trending?: Maybe>; }; - export type AssetTypeAllAssetsArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -735,7 +735,6 @@ export type AssetTypeAllAssetsArgs = { page: ConnectionArgs; }; - export type AssetTypeCompositeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -743,12 +742,10 @@ export type AssetTypeCompositeTokensArgs = { page: ConnectionArgs; }; - export type AssetTypeCryptoAssetsArgs = { input: Array; }; - export type AssetTypeCryptoCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -756,13 +753,11 @@ export type AssetTypeCryptoCurrenciesArgs = { page: ConnectionArgs; }; - export type AssetTypeDappsArgs = { address: Scalars['String']; chain: Scalars['String']; }; - export type AssetTypeFiatCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -770,7 +765,6 @@ export type AssetTypeFiatCurrenciesArgs = { page: ConnectionArgs; }; - export type AssetTypeLpTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -778,18 +772,15 @@ export type AssetTypeLpTokensArgs = { page: ConnectionArgs; }; - export type AssetTypeNftsV0Args = { keys: Array; }; - export type AssetTypeSearchArgs = { filter?: InputMaybe; page: ConnectionArgs; }; - export type AssetTypeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -797,7 +788,6 @@ export type AssetTypeTokensArgs = { page: ConnectionArgs; }; - export type AssetTypeTokensV0Args = { input: Array; }; @@ -852,14 +842,12 @@ export type Aurora = { version: Array; }; - export type AuroraActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type AuroraBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -867,19 +855,16 @@ export type AuroraBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type AuroraLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type AuroraNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type AuroraTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -905,14 +890,12 @@ export type Avalanche = { version: Array; }; - export type AvalancheActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type AvalancheBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -920,19 +903,16 @@ export type AvalancheBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type AvalancheLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type AvalancheNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type AvalancheTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -975,14 +955,12 @@ export type Base = { version: Array; }; - export type BaseActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BaseBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -990,13 +968,11 @@ export type BaseBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type BaseNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type BaseTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1024,12 +1000,10 @@ export type Binance = { transactions: BinanceTransactionConnection; }; - export type BinanceBalancesArgs = { address: Scalars['String']; }; - export type BinanceTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1055,14 +1029,12 @@ export type BinanceSmartChain = { version: Array; }; - export type BinanceSmartChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BinanceSmartChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1070,19 +1042,16 @@ export type BinanceSmartChainBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type BinanceSmartChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type BinanceSmartChainNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type BinanceSmartChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1144,35 +1113,29 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; - export type BitcoinChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; - export type BitcoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type BitcoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type BitcoinChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type BitcoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1181,27 +1144,23 @@ export type BitcoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type BitcoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type BitcoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type BitcoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type BitcoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1227,29 +1186,24 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; - export type BitcoinChainTestNetActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; - export type BitcoinChainTestNetBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type BitcoinChainTestNetGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type BitcoinChainTestNetTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1258,27 +1212,23 @@ export type BitcoinChainTestNetTransactionsArgs = { pageSize: Scalars['Int']; }; - export type BitcoinChainTestNetTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type BitcoinChainTestNetTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type BitcoinChainTestNetUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type BitcoinChainTestNetUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1304,29 +1254,24 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; - export type BitcoincashChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; - export type BitcoincashChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type BitcoincashChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type BitcoincashChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1335,27 +1280,23 @@ export type BitcoincashChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type BitcoincashChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type BitcoincashChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type BitcoincashChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type BitcoincashChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1384,14 +1325,12 @@ export type Blast = { version: Array; }; - export type BlastActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BlastBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1399,13 +1338,11 @@ export type BlastBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type BlastNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type BlastTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1443,7 +1380,7 @@ export type BridgeTokenInput = { export enum CacheControlScope { PRIVATE = 'PRIVATE', - PUBLIC = 'PUBLIC' + PUBLIC = 'PUBLIC', } export type CantoEvm = { @@ -1463,14 +1400,12 @@ export type CantoEvm = { version: Array; }; - export type CantoEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CantoEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1478,19 +1413,16 @@ export type CantoEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type CantoEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type CantoEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type CantoEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1515,14 +1447,12 @@ export type Celo = { version: Array; }; - export type CeloActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CeloBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1530,13 +1460,11 @@ export type CeloBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type CeloNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type CeloTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1553,7 +1481,7 @@ export enum Chain { FANTOM = 'FANTOM', HARMONY = 'HARMONY', OPTIMISM = 'OPTIMISM', - POLYGON = 'POLYGON' + POLYGON = 'POLYGON', } export type ChainType = { @@ -1624,7 +1552,6 @@ export type CosmosBalanceChain = { version: Array; }; - export type CosmosBalanceChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1645,20 +1572,17 @@ export type CosmosBasedChain = { version: Array; }; - export type CosmosBasedChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type CosmosBasedChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1741,14 +1665,12 @@ export type CronosEvm = { version: Array; }; - export type CronosEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CronosEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1756,19 +1678,16 @@ export type CronosEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type CronosEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type CronosEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type CronosEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1935,7 +1854,18 @@ export type DelegateStakeActivityV0 = { }; /** Detailed activity represent more details about transaction */ -export type DetailedActivityV0 = DelegateStakeActivityV0 | DirectStakeActivityV0 | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 | UndelegateStakeActivityV0; +export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -1973,29 +1903,24 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; - export type DogeChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type DogeChainBalancesArgs = { address: Scalars['String']; }; - export type DogeChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type DogeChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type DogeChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -2004,27 +1929,23 @@ export type DogeChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type DogeChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type DogeChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type DogeChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type DogeChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -2126,14 +2047,12 @@ export type Ethereum = { version: Array; }; - export type EthereumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type EthereumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2141,19 +2060,16 @@ export type EthereumBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type EthereumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type EthereumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type EthereumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2236,14 +2152,12 @@ export type Fantom = { version: Array; }; - export type FantomActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type FantomBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2251,19 +2165,16 @@ export type FantomBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type FantomLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type FantomNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type FantomTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2279,7 +2190,10 @@ export type Fee = { }; /** Represent possible fee details specific to chain */ -export type FeeDetailsV0 = EvmFeeDetailsV0 | ThorChainFeeDetailsV0 | TronFeeDetailsV0; +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; export type FeeInputType = { feeRateTransaction: Scalars['Float']; @@ -2397,14 +2311,12 @@ export type Gnosis = { version: Array; }; - export type GnosisActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type GnosisBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2412,19 +2324,16 @@ export type GnosisBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type GnosisLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type GnosisNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type GnosisTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2450,7 +2359,6 @@ export type InvestingType = { pools: Array; }; - export type InvestingTypePoolsArgs = { filter?: InputMaybe; }; @@ -2471,25 +2379,21 @@ export type JunoChain = { version: Array; }; - export type JunoChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type JunoChainNftsArgs = { address: Scalars['String']; }; - export type JunoChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2544,14 +2448,12 @@ export type Linea = { version: Array; }; - export type LineaActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type LineaBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2559,13 +2461,11 @@ export type LineaBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type LineaNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type LineaTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2594,29 +2494,24 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; - export type LitecoinChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; - export type LitecoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type LitecoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type LitecoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -2625,27 +2520,23 @@ export type LitecoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type LitecoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type LitecoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type LitecoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type LitecoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -2681,14 +2572,12 @@ export type Mantle = { version: Array; }; - export type MantleActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type MantleBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2696,13 +2585,11 @@ export type MantleBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type MantleNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type MantleTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2735,20 +2622,17 @@ export type MayaChain = { version: Array; }; - export type MayaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type MayaChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; - export type MayaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2803,14 +2687,12 @@ export type Mode = { version: Array; }; - export type ModeActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ModeBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2818,13 +2700,11 @@ export type ModeBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ModeNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ModeTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2847,43 +2727,36 @@ export type Mutation = { upsertReferrer?: Maybe; }; - export type MutationAddCommentArgs = { address: Scalars['String']; comment: Scalars['String']; source: Scalars['String']; }; - export type MutationCreateReferrerArgs = { referrer: CreateReferrer; }; - export type MutationTransactionHashV2Args = { routeId: Scalars['String']; tradeId: Scalars['String']; transactionHash: Scalars['String']; }; - export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; - export type MutationTransactionsV2Args = { routeData: RouteInputTypeV2; }; - export type MutationTransactonHashArgs = { routeId: Scalars['String']; signedHash: Scalars['String']; tradeId: Scalars['Float']; }; - export type MutationUpsertReferrerArgs = { address: Scalars['String']; feeTier: Scalars['String']; @@ -3005,17 +2878,14 @@ export type NearChain = { version: Array; }; - export type NearChainBalancesArgs = { address: Scalars['String']; }; - export type NearChainNftsArgs = { address: Scalars['String']; }; - export type NearChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3080,7 +2950,7 @@ export enum NftChainType { Gnosis = 'Gnosis', Optimism = 'Optimism', Polygon = 'Polygon', - Solana = 'Solana' + Solana = 'Solana', } /** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ @@ -3127,14 +2997,12 @@ export type OpBnb = { version: Array; }; - export type OpBnbActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type OpBnbBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3142,13 +3010,11 @@ export type OpBnbBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type OpBnbNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type OpBnbTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3200,14 +3066,12 @@ export type Optimism = { version: Array; }; - export type OptimismActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type OptimismBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3215,19 +3079,16 @@ export type OptimismBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type OptimismLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type OptimismNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type OptimismTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3297,14 +3158,12 @@ export type Polygon = { version: Array; }; - export type PolygonActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type PolygonBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3312,19 +3171,16 @@ export type PolygonBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type PolygonLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type PolygonNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type PolygonTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3337,7 +3193,7 @@ export enum Pool { Aave = 'Aave', Benqi = 'Benqi', Bitswap = 'Bitswap', - IronBank = 'IronBank' + IronBank = 'IronBank', } export type PoolType = { @@ -3438,7 +3294,7 @@ export enum PortfolioChainVariant { TerraClassic = 'TerraClassic', TomoChain = 'TomoChain', Tron = 'Tron', - Umee = 'Umee' + Umee = 'Umee', } export type PostRouteTypeV2 = { @@ -3451,7 +3307,7 @@ export enum PriceHistoryInterval { day = 'day', month = 'month', week = 'week', - year = 'year' + year = 'year', } /** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ @@ -3594,36 +3450,30 @@ export type Query = { zkSync: ZkSync; }; - export type QueryChainsArgs = { filter?: InputMaybe; }; - export type QueryCompositeTokensArgs = { after?: InputMaybe; ids?: InputMaybe>; }; - export type QueryCryptoCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; symbols?: InputMaybe>; }; - export type QueryDappArgs = { app: DAppReputationInput; }; - export type QueryFiatCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; }; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3631,7 +3481,6 @@ export type QueryReputationArgs = { offest?: Scalars['Int']; }; - export type QueryReputationV2Args = { address: Scalars['String']; approved?: InputMaybe; @@ -3640,19 +3489,16 @@ export type QueryReputationV2Args = { first?: Scalars['Int']; }; - export type QueryTokensArgs = { after?: InputMaybe; filter?: InputMaybe; }; - export type QueryTrackWalletConnectArgs = { walletAddress: Scalars['String']; walletProvider: Scalars['String']; }; - export type QueryWalletInfoArgs = { address: Scalars['String']; }; @@ -3891,7 +3737,7 @@ export enum ReputationChains { Zilliqa = 'Zilliqa', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync' + zkSync = 'zkSync', } export type ReputationComment = { @@ -4111,7 +3957,6 @@ export type RoutingChainType = { tokens: Array; }; - export type RoutingChainTypeTokensArgs = { addresses?: InputMaybe>; srcToken?: InputMaybe; @@ -4194,12 +4039,10 @@ export type RoutingType = { trades?: Maybe>; }; - export type RoutingTypeChainArgs = { name: Scalars['String']; }; - export type RoutingTypeRouteArgs = { addresses: Array; amountSource?: InputMaybe; @@ -4209,18 +4052,15 @@ export type RoutingTypeRouteArgs = { srcToken: Scalars['String']; }; - export type RoutingTypeTokenArgs = { id: Scalars['String']; }; - export type RoutingTypeTokensArgs = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; - export type RoutingTypeTradesArgs = { routeId: Scalars['String']; }; @@ -4247,34 +4087,28 @@ export type RoutingTypeV2 = { tradesV2: Array; }; - export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; - export type RoutingTypeV2BridgeableTokensArgs = { bridgeToken?: InputMaybe; tokenId?: InputMaybe; }; - export type RoutingTypeV2ChainV2Args = { name: Scalars['String']; }; - export type RoutingTypeV2DailyVolumeArgs = { startDate?: Scalars['String']; }; - export type RoutingTypeV2IsAssetSwappableArgs = { address: Scalars['String']; chainName: Scalars['String']; }; - export type RoutingTypeV2RefuelArgs = { addresses: Array; amountSource?: InputMaybe; @@ -4284,13 +4118,11 @@ export type RoutingTypeV2RefuelArgs = { srcToken: Scalars['String']; }; - export type RoutingTypeV2RefuelInfoArgs = { destChain: Scalars['String']; srcChain: Scalars['String']; }; - export type RoutingTypeV2RouteV2Args = { addresses: Array; amountSource?: InputMaybe; @@ -4304,23 +4136,19 @@ export type RoutingTypeV2RouteV2Args = { srcToken: Scalars['String']; }; - export type RoutingTypeV2TokenV2Args = { id: Scalars['String']; }; - export type RoutingTypeV2TokensV2Args = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; - export type RoutingTypeV2TradeV2Args = { tradeId: Scalars['String']; }; - export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; @@ -4339,14 +4167,12 @@ export type Scroll = { version: Array; }; - export type ScrollActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ScrollBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4354,13 +4180,11 @@ export type ScrollBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ScrollNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ScrollTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4468,38 +4292,32 @@ export type SolanaChain = { version: Array; }; - export type SolanaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type SolanaChainAssetHistoryBalancesV0Args = { address: Scalars['String']; minUntil?: InputMaybe; skipAssetServiceFiltering?: Scalars['Boolean']; }; - export type SolanaChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type SolanaChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type SolanaChainNftsArgs = { address: Scalars['String']; }; - export type SolanaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4563,25 +4381,21 @@ export type StargazeChain = { version: Array; }; - export type StargazeChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type StargazeChainNftsArgs = { address: Scalars['String']; }; - export type StargazeChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4645,13 +4459,11 @@ export type TerraChain = { version: Array; }; - export type TerraChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type TerraChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; @@ -4670,20 +4482,17 @@ export type ThorChain = { version: Array; }; - export type ThorChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ThorChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; - export type ThorChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4780,7 +4589,7 @@ export enum TimePeriod { DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', - YEAR = 'YEAR' + YEAR = 'YEAR', } /** Unlimited or specific amount of asset approved to spend for spender address */ @@ -4797,7 +4606,7 @@ export enum TokenCategory { LST_TOKEN = 'LST_TOKEN', SHITCOIN = 'SHITCOIN', STABLECOIN = 'STABLECOIN', - TRENDING_TOKEN = 'TRENDING_TOKEN' + TRENDING_TOKEN = 'TRENDING_TOKEN', } export type TokenContractType = { @@ -4899,7 +4708,7 @@ export enum TransactionStatus { /** Transaction was sent and is in the mempool (or equivalent for the chain) */ PENDING = 'PENDING', /** Transaction was included in a block and successfully executed */ - SUCCESS = 'SUCCESS' + SUCCESS = 'SUCCESS', } /** Represents the status of a transaction with optional details */ @@ -4915,7 +4724,7 @@ export enum TransactionType { STAKE = 'STAKE', SWAP = 'SWAP', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW' + WITHDRAW = 'WITHDRAW', } export type TrendingCoingeckoType = { @@ -4960,14 +4769,12 @@ export type Tron = { version: Array; }; - export type TronActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type TronBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4975,13 +4782,11 @@ export type TronBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type TronNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type TronTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5052,72 +4857,58 @@ export type TxClassifier = { getBlockchairTxsByQuery: Scalars['String']; }; - export type TxClassifierAnalyzeEvmTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; - export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { payload: BlowfishSolanaTxPayload; }; - export type TxClassifierAnalyzeTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; - export type TxClassifierAnalyzeTxV1HexagateArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierAnalyzeTxV2HexagateArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierDecodeTransactionV2Args = { payload: EvmTransactionPayload; }; - export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3Args = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3TenderlyArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { payload: Array; }; - export type TxClassifierExplainTransactionV4TenderlyArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV5Args = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierGetBlockchairTxsByQueryArgs = { chain: TxClassifierChains; limit: Scalars['Int']; @@ -5139,7 +4930,7 @@ export enum TxClassifierChains { linea = 'linea', optimism = 'optimism', polygon = 'polygon', - solana = 'solana' + solana = 'solana', } export enum TxClassifierTxType { @@ -5151,7 +4942,7 @@ export enum TxClassifierTxType { SWAP = 'SWAP', TRANSFER = 'TRANSFER', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW' + WITHDRAW = 'WITHDRAW', } export type TxSecurityIssue = { @@ -5253,14 +5044,12 @@ export type UserPortfolio = { walletHistory?: Maybe; }; - export type UserPortfolioAddressHistoryArgs = { address: Scalars['String']; chain: PortfolioChainVariant; timePeriod: TimePeriod; }; - export type UserPortfolioWalletHistoryArgs = { accounts: Array; maxAggregationTimeout?: InputMaybe; @@ -5434,14 +5223,12 @@ export type ZetaChain = { version: Array; }; - export type ZetaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ZetaChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5449,13 +5236,11 @@ export type ZetaChainBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ZetaChainNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ZetaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5480,14 +5265,12 @@ export type ZkSync = { version: Array; }; - export type ZkSyncActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ZkSyncBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5495,13 +5278,11 @@ export type ZkSyncBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ZkSyncNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ZkSyncTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5514,8 +5295,32 @@ export type GetSolanaBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; - -export type GetSolanaBalanceQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', balances: Array<{ __typename?: 'Balance', address: string, amount: { __typename?: 'Amount', value: string }, asset: { __typename?: 'CryptoAsset', chain?: string | null, contract?: string | null, decimals?: number | null, id?: string | null, name?: string | null, image?: string | null, symbol?: string | null, price?: { __typename?: 'AssetAmountType', amount: string, dayPriceChange?: string | null } | null } }> } }; +export type GetSolanaBalanceQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + name?: string | null; + image?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; export type GetSolanaTransactionsQueryVariables = Exact<{ address: Scalars['String']; @@ -5523,21 +5328,600 @@ export type GetSolanaTransactionsQueryVariables = Exact<{ after?: InputMaybe; }>; +export type GetSolanaTransactionsQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + transactions: { + __typename?: 'SolanaTransactionConnection'; + pageInfo: { + __typename?: 'PageInfo'; + endCursor?: string | null; + hasNextPage: boolean; + }; + edges: Array<{ + __typename?: 'SolanaTransactionEdge'; + node: { + __typename?: 'SolanaTransaction'; + hash: string; + slot: number; + status: string; + timestamp?: any | null; + signers: Array; + fee: { + __typename?: 'Fee'; + payer: string; + amount: { __typename?: 'Amount'; value: string }; + }; + transfers: Array<{ + __typename?: 'AssetTransfer'; + fromAddress?: string | null; + toAddress?: string | null; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { __typename?: 'AssetAmountType'; amount: string } | null; + }; + }>; + }; + }>; + }; + }; +}; + +export type GetSolanaStatusQueryVariables = Exact<{ [key: string]: never }>; + +export type GetSolanaStatusQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + status: { __typename?: 'SolanaStatus'; lastBlock: number }; + }; +}; -export type GetSolanaTransactionsQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', transactions: { __typename?: 'SolanaTransactionConnection', pageInfo: { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage: boolean }, edges: Array<{ __typename?: 'SolanaTransactionEdge', node: { __typename?: 'SolanaTransaction', hash: string, slot: number, status: string, timestamp?: any | null, signers: Array, fee: { __typename?: 'Fee', payer: string, amount: { __typename?: 'Amount', value: string } }, transfers: Array<{ __typename?: 'AssetTransfer', fromAddress?: string | null, toAddress?: string | null, amount: { __typename?: 'Amount', value: string }, asset: { __typename?: 'CryptoAsset', chain?: string | null, contract?: string | null, decimals?: number | null, id?: string | null, image?: string | null, name?: string | null, symbol?: string | null, price?: { __typename?: 'AssetAmountType', amount: string } | null } }> } }> } } }; - -export type GetSolanaStatusQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetSolanaStatusQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', status: { __typename?: 'SolanaStatus', lastBlock: number } } }; - -export type GetSolanaFeeQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetSolanaFeeQuery = { __typename?: 'Query', solana: { __typename?: 'SolanaChain', fee?: { __typename?: 'DefaultGasFee', high?: number | null, low?: number | null, medium?: number | null } | null } }; - +export type GetSolanaFeeQueryVariables = Exact<{ [key: string]: never }>; -export const GetSolanaBalanceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaBalance"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balances"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chain"}},{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"dayPriceChange"}}]}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetSolanaTransactionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaTransactions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"payer"}}]}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"slot"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"transfers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chain"}},{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fromAddress"}},{"kind":"Field","name":{"kind":"Name","value":"toAddress"}}]}},{"kind":"Field","name":{"kind":"Name","value":"signers"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetSolanaStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaStatus"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastBlock"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetSolanaFeeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSolanaFee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solana"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"high"}},{"kind":"Field","name":{"kind":"Name","value":"low"}},{"kind":"Field","name":{"kind":"Name","value":"medium"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export type GetSolanaFeeQuery = { + __typename?: 'Query'; + solana: { + __typename?: 'SolanaChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; + +export const GetSolanaBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSolanaBalanceQuery, + GetSolanaBalanceQueryVariables +>; +export const GetSolanaTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactions' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'first' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'after' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'after' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'pageInfo' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'endCursor' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hasNextPage' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'payer', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'slot' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transfers' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'value', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'asset', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'chain', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'contract', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'decimals', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'id', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'image', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'name', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'price', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'amount', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'symbol', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'fromAddress', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'toAddress', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'signers' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSolanaTransactionsQuery, + GetSolanaTransactionsQueryVariables +>; +export const GetSolanaStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'lastBlock' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetSolanaStatusQuery, + GetSolanaStatusQueryVariables +>; +export const GetSolanaFeeDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetSolanaFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'solana' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; diff --git a/packages/solana/src/gql/index.ts b/packages/solana/src/gql/index.ts index b37261ed..c682b1e2 100644 --- a/packages/solana/src/gql/index.ts +++ b/packages/solana/src/gql/index.ts @@ -1,3 +1,2 @@ -export * from "./fragment-masking"; -export * from "./gql"; -export * from "./graphql"; +export * from './fragment-masking'; +export * from './gql'; From c26f2f7eddf00a2bdd384219a78d75125d5eeb49 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 26 Jul 2024 15:26:02 +0000 Subject: [PATCH 077/176] Version packages --- .changeset/four-toys-help.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/four-toys-help.md diff --git a/.changeset/four-toys-help.md b/.changeset/four-toys-help.md deleted file mode 100644 index 427cb21c..00000000 --- a/.changeset/four-toys-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -Feat: add Sei mainnet chain diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index c700f681..7a171f93 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.30 + +### Patch Changes + +- 918ccee9: Feat: add Sei mainnet chain + ## 2.0.29 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 758caf6c..6da18fa5 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.29", + "version": "2.0.30", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From beb7ca487beea684e73d0d7caf72b2194e866618 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:29:41 +0300 Subject: [PATCH 078/176] feat: add getThorChainID to get thor chain id dynamically (#287) --- .changeset/purple-apes-fail.md | 5 +++++ packages/thor/src/chain.provider.ts | 3 ++- packages/thor/src/utils.ts | 28 ++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .changeset/purple-apes-fail.md diff --git a/.changeset/purple-apes-fail.md b/.changeset/purple-apes-fail.md new file mode 100644 index 00000000..079181e1 --- /dev/null +++ b/.changeset/purple-apes-fail.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-thor': patch +--- + +Feat: add getThorChainID function to get chain ID dynamically diff --git a/packages/thor/src/chain.provider.ts b/packages/thor/src/chain.provider.ts index 2b3c5567..fb9ec660 100644 --- a/packages/thor/src/chain.provider.ts +++ b/packages/thor/src/chain.provider.ts @@ -21,7 +21,7 @@ import { ChainMsg, MsgBody } from './msg'; import { ThorManifest } from './manifests'; import { AccountInfo } from './types'; import { ChainDataSource, IndexerDataSource } from './datasource'; -import { assetFromString } from './utils'; +import { assetFromString, getThorChainID } from './utils'; @ChainDecorator('ThorProvider', { deps: [], @@ -153,6 +153,7 @@ export class ThorProvider extends Chain.Provider { static get staticUtils() { return { assetFromString, + getThorChainID, }; } } diff --git a/packages/thor/src/utils.ts b/packages/thor/src/utils.ts index ab503ac3..8a86388e 100644 --- a/packages/thor/src/utils.ts +++ b/packages/thor/src/utils.ts @@ -1,3 +1,5 @@ +import axios from 'axios'; + import { common } from './proto'; export const SYNTH_DELIMITER = '/'; @@ -26,3 +28,29 @@ export const assetFromString = (s: string): common.IAsset | null => { return { chain, symbol, ticker, synth: isSynth }; }; + +/** + * Get the chain ID of the THORChain network from the given RPC URL. + * If there is an error, it will return the default chain ID. + * + * @param {string} rpcUrl - RPC URL + * @param {string} defaultChainId - Default chain ID to return if there is an error + */ +export const getThorChainID = async ( + rpcUrl: string, + defaultChainId = 'thorchain-mainnet-v1' +): Promise => { + try { + const restAxiosInstance = axios.create({ + baseURL: rpcUrl, + }); + const { data } = await restAxiosInstance.get('/status'); + return data?.result?.network; + } catch (err) { + console.error( + 'Error while getting thor chain id, returning "thorchain-mainnet-v1" by default.' + ); + console.error(err); + return defaultChainId; + } +}; From c669820839ce160f3ef2794cdb6bd4d9d4cde1c0 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 30 Jul 2024 08:32:10 +0000 Subject: [PATCH 079/176] Version packages --- .changeset/purple-apes-fail.md | 5 ----- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/purple-apes-fail.md diff --git a/.changeset/purple-apes-fail.md b/.changeset/purple-apes-fail.md deleted file mode 100644 index 079181e1..00000000 --- a/.changeset/purple-apes-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch ---- - -Feat: add getThorChainID function to get chain ID dynamically diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 5d865cba..8d7e29dd 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.0.27 + +### Patch Changes + +- 30a0bf9e: Feat: add getThorChainID function to get chain ID dynamically + ## 2.0.26 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 92c4b4ba..97df3a7d 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.26", + "version": "2.0.27", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 69068a24fc23986099d433e5f0526a42ba01a73f Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:12:08 +0700 Subject: [PATCH 080/176] feat: add sign raw transfer from sign doc (#291) * feat: add sign raw transfer from sign doc * chore: fix btc failed test * feat: add sign raw for ledger signer * chore: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/lucky-garlics-heal.md | 5 + .../bitcoin/src/signers/ledger.signer.spec.ts | 20 +++ packages/cosmos/src/msg.ts | 54 ++++++ .../cosmos/src/signers/ledger.signer.spec.ts | 47 ++++- packages/cosmos/src/signers/ledger.signer.ts | 22 ++- .../src/signers/private-key.signer.spec.ts | 161 ++++++++++++++++++ .../cosmos/src/signers/private-key.signer.ts | 54 +++++- .../src/signers/seed-phrase.signer.spec.ts | 109 ++++++++++++ .../cosmos/src/signers/seed-phrase.signer.ts | 52 +++++- packages/cosmos/src/utils.ts | 2 +- 10 files changed, 518 insertions(+), 8 deletions(-) create mode 100644 .changeset/lucky-garlics-heal.md diff --git a/.changeset/lucky-garlics-heal.md b/.changeset/lucky-garlics-heal.md new file mode 100644 index 00000000..a6c1cc6b --- /dev/null +++ b/.changeset/lucky-garlics-heal.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +feat: add methods to sign transaction from sign doc diff --git a/packages/bitcoin/src/signers/ledger.signer.spec.ts b/packages/bitcoin/src/signers/ledger.signer.spec.ts index 80bdb9de..9bd5bb47 100644 --- a/packages/bitcoin/src/signers/ledger.signer.spec.ts +++ b/packages/bitcoin/src/signers/ledger.signer.spec.ts @@ -64,6 +64,26 @@ jest.mock('../datasource/indexer/queries/fees.query', () => ({ }), })); +jest.mock('../datasource/indexer/queries/scanUTXOs.query', () => ({ + scanUTXOs: () => { + return [ + { + oTxHash: + 'e4b7161d1b26d3eee736adc70c42f7c47c901ac3bede07de2c0e002d3ead6afb', + oIndex: 0, + oTxHex: + '0200000000010109e9e018877c28b71477cb885c040920169c66a2b21c3454412dd76d5d6c192a0000000000ffffffff02d0070000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a538e71000000000000160014d52ed37779898f360848ae49bb0ee089b6d36d2c024830450221009ecbf782d2a671cc369af031fd66fb83a291cbb1ec0b8ba3fe30970c437834a502203a91029d6a4a480e35a1eef9a69131cfa0159d02767fb8fe179363d23c6f66f70121022a6b486ca1b607a767fb1bf9432fa0b5031d9d1ece37ae02bc31d749d5ae65d500000000', + address: 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw', + scriptHex: '00144e209aaf99f4b08cb5b583f4e87b546b00ea5a53', + isCoinbase: null, + value: { + value: '2000', + }, + }, + ]; + }, +})); + describe('ledger.signer', () => { let signer: LedgerSigner; let derivationPath: string; diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 38241a19..f572d131 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -21,6 +21,7 @@ import { MessageComposer as MessageComposerIbc } from 'osmojs/ibc/applications/t import { AminoConverter as AminoConverterIbc } from 'osmojs/ibc/applications/transfer/v1/tx.amino'; import Long from 'long'; import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; +import { StdSignature } from '@cosmjs/amino'; import type { CosmosProvider } from './chain.provider'; @@ -61,6 +62,59 @@ export interface TxData { nftId?: string; } +export interface StdFee { + readonly amount: readonly AminoCoin[]; + readonly gas: string; + readonly payer?: string; + readonly granter?: string; + + // XXX: "feePayer" should be "payer". But, it maybe from ethermint team's mistake. + // That means this part is not standard. + readonly feePayer?: string; +} + +export interface AminoMsgSend { + readonly type: string; + readonly value: any; +} + +export interface AminoSignDoc { + readonly chain_id: string; + readonly account_number: string; + readonly sequence: string; + // Should be nullable + readonly timeout_height?: string; + readonly fee: StdFee; + readonly msgs: readonly AminoMsgSend[]; + readonly memo: string; +} + +export interface DirectSignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes?: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes?: Uint8Array; + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chainId?: string; + /** account_number is the account number of the account in state */ + accountNumber?: string; +} + +export interface SignMsgSendResponse { + signed: any; + signature: StdSignature; +} + export enum CosmosChainType { Cosmos = 0, Ethermint = 1, diff --git a/packages/cosmos/src/signers/ledger.signer.spec.ts b/packages/cosmos/src/signers/ledger.signer.spec.ts index c045d0c0..38f4422a 100644 --- a/packages/cosmos/src/signers/ledger.signer.spec.ts +++ b/packages/cosmos/src/signers/ledger.signer.spec.ts @@ -38,10 +38,15 @@ jest.mock('@cosmjs/ledger-amino/build/ledgersigner', () => { address: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', }, ]), - sign: jest.fn().mockResolvedValue({ - bodyBytes: [], - authInfoBytes: [], - signatures: [], + signAmino: jest.fn().mockResolvedValue({ + signed: {}, + signature: { + pub_key: { + value: 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu', + }, + signature: + 'y77g4nQrMCxTH8ICyffz0w2sjXUjisSANkbwy1i+AsBjoZNTIhqJs9l03p2pG/MVavW8ZTx0IQ26ItLRLCrAkQ==', + }, }), })), }; @@ -144,4 +149,38 @@ describe('cosmos::ledger.signer', () => { ); expect(result).toBe(false); }); + + it('Should sign raw tx', async () => { + const signDoc = { + chain_id: 'cosmoshub-4', + account_number: '1895821', + sequence: '0', + fee: { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + msgs: [ + { + type: 'cosmos-sdk/MsgSend', + value: { + from_address: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to_address: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: [{ denom: 'uatom', amount: '1000000' }], + }, + }, + ], + memo: '', + }; + const signedTx = await signer.signRawTransaction( + signDoc, + derivationPath, + 'cosmos' + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.signature).toEqual( + 'y77g4nQrMCxTH8ICyffz0w2sjXUjisSANkbwy1i+AsBjoZNTIhqJs9l03p2pG/MVavW8ZTx0IQ26ItLRLCrAkQ==' + ); + }); }); diff --git a/packages/cosmos/src/signers/ledger.signer.ts b/packages/cosmos/src/signers/ledger.signer.ts index 771ed31c..4e2e8467 100644 --- a/packages/cosmos/src/signers/ledger.signer.ts +++ b/packages/cosmos/src/signers/ledger.signer.ts @@ -6,8 +6,9 @@ import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SigningStargateClient } from '@cosmjs/stargate'; import { bech32 } from 'bech32'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; +import { CosmosProvider } from 'src/chain.provider'; -import { ChainMsg } from '../msg'; +import { AminoSignDoc, ChainMsg } from '../msg'; import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.LEDGER) @@ -67,6 +68,25 @@ export class LedgerSigner extends Signer.Provider { msg.sign(rawTx); } + async signRawTransaction( + signDoc: AminoSignDoc, + derivation: string, + prefix: string + ) { + if (!derivation.startsWith('m/')) { + derivation = 'm/' + derivation; + } + + const hdPath = stringToPath(derivation); + const app = new LedgerApp(this.transport as Transport, { + testModeAllowed: true, + hdPaths: [hdPath], + prefix, + }); + const [{ address: senderAddress }] = await app.getAccounts(); + return app.signAmino(senderAddress, signDoc); + } + async verifyMessage( signer: string, data: Uint8Array | string, diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index 9a699e90..77997a81 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -255,4 +255,165 @@ describe('private-key.signer', () => { 'Co0BCooBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmoKLWNvc21vczFnNnF1NmhtNHYzczN2cTc0MzhqZWhuOWZ6eGc5cDcyMHllc3EycRItY29zbW9zMWc2cXU2aG00djNzM3ZxNzQzOGplaG45Znp4ZzlwNzIweWVzcTJxGgoKBXVhdG9tEgExEmcKUApGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQPdo5siwfjiwtEdo7xFF/gLRhqmnxDnYeNFdvTwnM+h7hIECgIIfxgBEhMKDQoFdWF0b20SBDI1MDAQwJoMGkCMICf5+o/tooHugIHu8JFVWQ1Gj8EjJVKWHdZOJSEuBWyh+Wt/k8b4A0EWzhwI8B4nHvGEPGjmLWVI6USX1wQs' ); }); + + it('Should sign raw tx with amino mode', async () => { + const signDoc = { + chain_id: 'cosmoshub-4', + account_number: '1895821', + sequence: '0', + fee: { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + msgs: [ + { + type: 'cosmos-sdk/MsgSend', + value: { + from_address: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to_address: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: [{ denom: 'uatom', amount: '1000000' }], + }, + }, + ], + memo: '', + }; + + const signer = new PrivateKeySigner(privateKeys.cosmos); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_AMINO + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.signature).toEqual( + 'y77g4nQrMCxTH8ICyffz0w2sjXUjisSANkbwy1i+AsBjoZNTIhqJs9l03p2pG/MVavW8ZTx0IQ26ItLRLCrAkQ==' + ); + }); + + it('Should sign raw tx with direct mode', async () => { + const signDoc = { + chainId: 'cosmoshub-4', + accountNumber: '1895821', + bodyBytes: new Uint8Array( + Buffer.from( + '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', + 'hex' + ) + ), + authInfoBytes: new Uint8Array( + Buffer.from( + '0a4e0a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103dda39b22c1f8e2c2d11da3bc4517f80b461aa69f10e761e34576f4f09ccfa1ee12040a02087f12130a0d0a057561746f6d12043130303010c09a0c', + 'hex' + ) + ), + }; + const signer = new PrivateKeySigner(privateKeys.cosmos); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_DIRECT + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.signature).toEqual( + 'i3STDg7CxEgl4svgXmhyKePzBoPtqdL3WHrkeHqI/HAMp18EUE+mh9LzTfoFYGlk7O+E+jhXtECISzUakZJ83Q==' + ); + }); + + it('Should sign arbitrary message', async () => { + const signDoc = { + chain_id: 'cosmoshub-4', + account_number: '1895821', + sequence: '0', + fee: { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + msgs: [ + { + type: 'sign/msgSignData', + value: { + signer: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + data: 'SGVsbG8=', // echo -n "Hello" | base64 + }, + }, + ], + memo: '', + }; + + const signer = new PrivateKeySigner(privateKeys.cosmos); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_AMINO + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.pub_key.type).toEqual( + 'tendermint/PubKeySecp256k1' + ); + expect(signedTx.signature.signature).toEqual( + 'gzgi+GKdyLOhRHQRBQol0zOcl/J0idmL2MMIrE2f+AU7txWSpdX3irnPHa73BXokYh0mkxB2/o4iZzsr3kiWmQ==' + ); + }); + + it('Should sign doc direct aux with sign amino mode', async () => { + // const signDoc = SignDocDirectAux.fromPartial({ + // chainId: 'cosmoshub-4', + // accountNumber: 1895821n, + // bodyBytes: new Uint8Array( + // Buffer.from( + // '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', + // 'hex' + // ) + // ), + // publicKey: { + // value: Buffer.from('A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu==', 'base64'), + // typeUrl: '/cosmos.crypto.secp256k1.PubKey', + // }, + // sequence: 0n, + // }); + // console.log('🚀 ~ it ~ signDoc:', SignDocDirectAux.toAminoMsg(signDoc)); + const signDoc = { + chain_id: 'cosmoshub-4', + account_number: '1895821', + sequence: '0', + fee: { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + msgs: [ + { + type: 'cosmos-sdk/SignDocDirectAux', + value: { + body_bytes: + 'CjIKHC9jb3Ntb3MuYmFuay52MWJldGExLk1zZ1NlbmQSEhoQCgV1YXRvbRIHMTAwMDAwMA==', + pub_key: { + type: 'tendermint/PubKeySecp256k1', + value: 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu', + }, + chain_id: 'cosmoshub-4', + account_number: '1895821', + }, + }, + ], + memo: '', + }; + const signer = new PrivateKeySigner(privateKeys.cosmos); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_AMINO + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.signature).toEqual( + '7WG+1gvdV0dN/l1ntIK67im1H4wp+8kgACuCQ64cM1MgmXCiM7Q0+C3RZot7uFU6grNiJExtYEw9zakIxqsXwg==' + ); + }); }); diff --git a/packages/cosmos/src/signers/private-key.signer.ts b/packages/cosmos/src/signers/private-key.signer.ts index a91f870d..ed9452df 100644 --- a/packages/cosmos/src/signers/private-key.signer.ts +++ b/packages/cosmos/src/signers/private-key.signer.ts @@ -13,8 +13,17 @@ import { RawKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { Secp256k1Wallet } from '@cosmjs/amino'; +import { CosmosProvider } from 'src/chain.provider'; +import { SignDoc } from 'osmojs/cosmos/tx/v1beta1/tx'; -import { ChainMsg, CosmosChainType, CosmosSignMode } from '../msg'; +import { + AminoSignDoc, + ChainMsg, + CosmosChainType, + CosmosSignMode, + DirectSignDoc, + SignMsgSendResponse, +} from '../msg'; import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.PRIVATE_KEY) @@ -130,6 +139,49 @@ export class PrivateKeySigner extends Signer.Provider { return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); } + async signAminoRawTransaction( + signDoc: AminoSignDoc, + provider: CosmosProvider + ): Promise { + const wallet = await Secp256k1Wallet.fromKey( + fromHex(this.key), + provider.manifest.prefix + ); + const [{ address: senderAddress }] = await wallet.getAccounts(); + return wallet.signAmino(senderAddress, signDoc); + } + + async signDirectRawTransaction( + signDoc: DirectSignDoc, + provider: CosmosProvider + ): Promise { + const wallet = await DirectSecp256k1Wallet.fromKey( + fromHex(this.key), + provider.manifest.prefix + ); + const [{ address: senderAddress }] = await wallet.getAccounts(); + + const newSignDoc = SignDoc.fromPartial({ + bodyBytes: signDoc.bodyBytes, + authInfoBytes: signDoc.authInfoBytes, + chainId: signDoc.chainId, + accountNumber: signDoc.accountNumber + ? BigInt(signDoc.accountNumber) + : undefined, + }); + return await wallet.signDirect(senderAddress, newSignDoc); + } + + async signRawTransaction( + signDoc: AminoSignDoc | DirectSignDoc, + provider: CosmosProvider, + signMode: CosmosSignMode + ): Promise { + return signMode === CosmosSignMode.SIGN_AMINO + ? this.signAminoRawTransaction(signDoc as AminoSignDoc, provider) + : this.signDirectRawTransaction(signDoc as DirectSignDoc, provider); + } + async verifyMessage( signer: string, data: Uint8Array | string, diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index 90d5f03c..e8aafe40 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -25,12 +25,16 @@ jest.mock('@cosmjs/stargate/build/signingstargateclient', () => { }); jest.mock('cosmjs-types/cosmos/tx/v1beta1/tx', () => { + const originalModule = jest.requireActual( + 'cosmjs-types/cosmos/tx/v1beta1/tx' + ); return { TxRaw: { encode: jest.fn().mockImplementation(() => { return { finish: jest.fn().mockReturnValue([1, 1, 1]) }; }), }, + SignDoc: originalModule.SignDoc, }; }); @@ -117,6 +121,111 @@ describe('seed-phrase.signer', () => { ); expect(message.signedTransaction).toBeTruthy(); }); + + it('Should sign raw tx with amino mode', async () => { + const signDoc = { + chain_id: 'cosmoshub-4', + account_number: '1895821', + sequence: '0', + fee: { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + msgs: [ + { + type: 'cosmos-sdk/MsgSend', + value: { + from_address: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + to_address: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + amount: [{ denom: 'uatom', amount: '1000000' }], + }, + }, + ], + memo: '', + }; + + const signer = new SeedPhraseSigner(mnemonic); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_AMINO + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.signature).toEqual( + 'y77g4nQrMCxTH8ICyffz0w2sjXUjisSANkbwy1i+AsBjoZNTIhqJs9l03p2pG/MVavW8ZTx0IQ26ItLRLCrAkQ==' + ); + }); + + it('Should sign raw tx with direct mode', async () => { + const signDoc = { + chainId: 'cosmoshub-4', + accountNumber: '1895821', + bodyBytes: new Uint8Array( + Buffer.from( + '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', + 'hex' + ) + ), + authInfoBytes: new Uint8Array( + Buffer.from( + '0a4e0a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103dda39b22c1f8e2c2d11da3bc4517f80b461aa69f10e761e34576f4f09ccfa1ee12040a02087f12130a0d0a057561746f6d12043130303010c09a0c', + 'hex' + ) + ), + }; + const signer = new SeedPhraseSigner(mnemonic); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_DIRECT + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.signature).toEqual( + 'i3STDg7CxEgl4svgXmhyKePzBoPtqdL3WHrkeHqI/HAMp18EUE+mh9LzTfoFYGlk7O+E+jhXtECISzUakZJ83Q==' + ); + }); + + it('sign arbitrary message', async () => { + const signDoc = { + chain_id: 'cosmoshub-4', + account_number: '1895821', + sequence: '0', + fee: { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + msgs: [ + { + type: 'sign/msgSignData', + value: { + signer: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', + data: 'SGVsbG8=', // echo -n "Hello" | base64 + }, + }, + ], + memo: '', + }; + + const signer = new SeedPhraseSigner(mnemonic); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_AMINO + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.pub_key.type).toEqual( + 'tendermint/PubKeySecp256k1' + ); + expect(signedTx.signature.signature).toEqual( + 'gzgi+GKdyLOhRHQRBQol0zOcl/J0idmL2MMIrE2f+AU7txWSpdX3irnPHa73BXokYh0mkxB2/o4iZzsr3kiWmQ==' + ); + }); }); describe('seed-phase.addressGeneration', () => { diff --git a/packages/cosmos/src/signers/seed-phrase.signer.ts b/packages/cosmos/src/signers/seed-phrase.signer.ts index b1a372c5..e4ae289d 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.ts @@ -12,8 +12,17 @@ import { MnemonicKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'; +import { CosmosProvider } from 'src/chain.provider'; +import { SignDoc } from 'osmojs/cosmos/tx/v1beta1/tx'; -import { ChainMsg, CosmosChainType, CosmosSignMode } from '../msg'; +import { + AminoSignDoc, + ChainMsg, + CosmosChainType, + CosmosSignMode, + DirectSignDoc, + SignMsgSendResponse, +} from '../msg'; import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.SEED_PHRASE) @@ -136,6 +145,47 @@ export class SeedPhraseSigner extends Signer.Provider { return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); } + async signAminoRawTransaction( + signDoc: AminoSignDoc, + provider: CosmosProvider + ): Promise { + const wallet = await Secp256k1HdWallet.fromMnemonic(this.key, { + prefix: provider.manifest.prefix, + }); + const [{ address: senderAddress }] = await wallet.getAccounts(); + return wallet.signAmino(senderAddress, signDoc); + } + + async signDirectRawTransaction( + signDoc: DirectSignDoc, + provider: CosmosProvider + ): Promise { + const wallet = await DirectSecp256k1HdWallet.fromMnemonic(this.key, { + prefix: provider.manifest.prefix, + }); + const [{ address: senderAddress }] = await wallet.getAccounts(); + + const newSignDoc = SignDoc.fromPartial({ + bodyBytes: signDoc.bodyBytes, + authInfoBytes: signDoc.authInfoBytes, + chainId: signDoc.chainId, + accountNumber: signDoc.accountNumber + ? BigInt(signDoc.accountNumber) + : undefined, + }); + return await wallet.signDirect(senderAddress, newSignDoc); + } + + async signRawTransaction( + signDoc: AminoSignDoc | DirectSignDoc, + provider: CosmosProvider, + signMode: CosmosSignMode + ): Promise { + return signMode === CosmosSignMode.SIGN_AMINO + ? this.signAminoRawTransaction(signDoc as AminoSignDoc, provider) + : this.signDirectRawTransaction(signDoc as DirectSignDoc, provider); + } + async verifyMessage( signer: string, data: Uint8Array | string, diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index 1b2f0a6a..a5c643eb 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -13,7 +13,7 @@ import { wasmTypes } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/messages import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/aminomessages'; import { COSMOS_MANIFESTS, CosmosHubChains } from './manifests'; -import { MsgBody } from './msg'; +import { AminoMsgSend, MsgBody } from './msg'; export interface ChainAsset { denom: string; From fc06571c52536435c7aede6ecdb99b3300788eea Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 30 Jul 2024 09:14:37 +0000 Subject: [PATCH 081/176] Version packages --- .changeset/lucky-garlics-heal.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/lucky-garlics-heal.md diff --git a/.changeset/lucky-garlics-heal.md b/.changeset/lucky-garlics-heal.md deleted file mode 100644 index a6c1cc6b..00000000 --- a/.changeset/lucky-garlics-heal.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -feat: add methods to sign transaction from sign doc diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 7a171f93..94f4d11e 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.31 + +### Patch Changes + +- 5f2e1cf1: feat: add methods to sign transaction from sign doc + ## 2.0.30 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 6da18fa5..a56f1bf9 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.30", + "version": "2.0.31", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 15dcdc9bb01d4c992607d623a4b3e76668b3b336 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:51:17 +0700 Subject: [PATCH 082/176] chore: Add thor deposit example & update default value for the deposit msg denom (#269) * feat: thor deposit example * Add example of doing a deposit transaction for thor & update default deposit msg denom * chore: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/curvy-days-turn.md | 5 + examples/react/pages/thor-maya.tsx | 274 +++++++++++++++++++++++++++++ packages/thor/src/msg.ts | 4 +- 3 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 .changeset/curvy-days-turn.md create mode 100644 examples/react/pages/thor-maya.tsx diff --git a/.changeset/curvy-days-turn.md b/.changeset/curvy-days-turn.md new file mode 100644 index 00000000..51448fa6 --- /dev/null +++ b/.changeset/curvy-days-turn.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-thor': patch +--- + +chore: update denom default for deposit msg diff --git a/examples/react/pages/thor-maya.tsx b/examples/react/pages/thor-maya.tsx new file mode 100644 index 00000000..f989361d --- /dev/null +++ b/examples/react/pages/thor-maya.tsx @@ -0,0 +1,274 @@ +import React, { useCallback, useContext, useEffect, useState } from 'react'; +import { + Box, + Button, + Container, + TextField, + Typography, + Alert, + MenuItem, + Select, + FormControl, + InputLabel, +} from '@mui/material'; +import axios from 'axios'; +import { + ChainsContext, + initDefaultProviders, + restoreProviders, + saveProviders, +} from '../context/chains.context'; +import { GasFeeSpeed, MsgEncoding } from '@xdefi-tech/chains-core'; +import { + IndexerDataSource, + MsgType, + THORCHAIN_MANIFESTS, + ThorProvider, +} from '@xdefi-tech/chains-thor'; +import { PrivateKeySigner } from '@xdefi-tech/chains-thor/dist/signers/web'; + +const provider = new ThorProvider( + new IndexerDataSource(THORCHAIN_MANIFESTS.thorchain) +); + +const Thor = () => { + const chains = useContext(ChainsContext); + console.log('🚀 ~ Thor ~ chains:', chains); + const [thorProvider, setThorProvider] = useState(); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + const [success, setSuccess] = useState(null); + const [formErrors, setFormErrors] = useState({}); + + const validateForm = (values) => { + const errors: { [key: string]: string } = {}; + if (!values.sender) { + errors.sender = 'Sender address is required'; + } else if (!ThorProvider.verifyAddress(values.sender, 'thor')) { + errors.sender = 'Invalid sender address'; + } + + if (!values.recipient) { + errors.recipient = 'Recipient address is required'; + } else if (!ThorProvider.verifyAddress(values.recipient, 'thor')) { + errors.recipient = 'Invalid recipient address'; + } + + if (!values.amount) { + errors.amount = 'Amount is required'; + } else if (isNaN(values.amount) || Number(values.amount) <= 0) { + errors.amount = 'Amount must be a positive number'; + } + + if (!values.denom) { + errors.denom = 'Token denomination is required'; + } + + if (!values.privateKey) { + errors.privateKey = 'Private key is required'; + } else if (values.privateKey?.length != 64) { + errors.privateKey = 'Invalid private key'; + } + + return errors; + }; + useEffect(() => { + try { + const list = chains.getProviderList(); + if (list.length > 0) { + return; + } + + const restored = restoreProviders(); + if (!restored) { + initDefaultProviders(); + saveProviders(); + } + setThorProvider(chains.getProviderById('thor') as ThorProvider); + } catch (error) {} + }, [chains]); + + const onFinish = async (event) => { + event.preventDefault(); + setLoading(true); + setError(null); + setSuccess(null); + + const data = new FormData(event.currentTarget); + const values = { + sender: data.get('sender'), + recipient: data.get('recipient'), + amount: data.get('amount'), + denom: data.get('denom'), + publicKey: data.get('publicKey'), + privateKey: data.get('privateKey'), + memo: data.get('memo'), + }; + const errors = validateForm(values); + console.log('🚀 ~ onFinish ~ errors:', errors); + if (Object.keys(errors).length > 0) { + setFormErrors(errors); + setLoading(false); + return; + } else { + setFormErrors({}); + } + try { + const { sender, recipient, amount, denom, privateKey, memo } = values; + console.log( + '🚀 ~ onFinish ~ { sender, recipient, amount, denom, privateKey }:', + { sender, recipient, amount, denom, privateKey } + ); + const signer = new PrivateKeySigner(String(privateKey)); + // Create the deposit message + const msgBody = { + type: MsgType.MsgDeposit, + from: String(sender), + to: String(recipient), + amount: String(amount), + denom: String(denom), + memo: String(memo), + }; + const depositMsg = provider.createMsg(msgBody); + + const tx = await depositMsg.buildTx(); + console.log('🚀 ~ onFinish ~ tx:', tx); + const depositBody = depositMsg.buildDepositBody(); + console.log('🚀 ~ onFinish ~ depositBody:', depositBody); + await signer.sign(depositMsg); + console.log('🚀 ~ onFinish ~ depositMsg:', depositMsg.signedTransaction); + // const gasFee = await depositMsg.getFee(); + try { + const fee = await provider.estimateFee( + [depositMsg], + GasFeeSpeed.medium + ); + console.log('🚀 ~ onFinish ~ gasFee:', fee); + } catch (error) { + console.log('🚀 ~ onFinish ~ gasFee ~ error:', error); + } + + try { + // Broadcast the transaction + const transactions = await provider.broadcast([depositMsg]); + console.log('🚀 ~ onFinish ~ transactions:', transactions[0].data.hash); + } catch (error) { + console.log('🚀 ~ onFinish ~ transaction ~ error:', error); + } + + // notification.success({ + // message: 'Transaction Successful', + // description: `Transaction Hash: ${transactions[0]?.toData().hash}`, + // }); + } catch (error) { + // notification.error({ + // message: 'Transaction Failed', + // description: error.message, + // }); + } finally { + setLoading(false); + } + }; + + return ( + + + + Thor/Maya Deposit Transaction + +
+ + + + + + + + + {error && {error}} + {success && {success}} +
+
+ ); +}; + +export default Thor; diff --git a/packages/thor/src/msg.ts b/packages/thor/src/msg.ts index 65117968..43cac076 100644 --- a/packages/thor/src/msg.ts +++ b/packages/thor/src/msg.ts @@ -101,7 +101,9 @@ export class ChainMsg extends BasMsg { | cosmosclient.proto.cosmos.tx.v1beta1.TxBody | undefined { const messageData = this.toData(); - const denom = messageData.denom || this.provider.manifest.denom; + const denom = + messageData.denom || + `${this.provider.manifest.chain.toUpperCase()}.${this.provider.manifest.denom.toUpperCase()}`; // THOR.RUNE OR MAYA.CACAO const decimals = messageData.decimals || this.provider.manifest.decimals; const signer = bech32Buffer.decode(messageData.from).data; const memo = messageData.memo || ''; From d5e380c660754a3703d2b1530ba826c93df99811 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 30 Jul 2024 09:53:38 +0000 Subject: [PATCH 083/176] Version packages --- .changeset/curvy-days-turn.md | 5 ----- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/curvy-days-turn.md diff --git a/.changeset/curvy-days-turn.md b/.changeset/curvy-days-turn.md deleted file mode 100644 index 51448fa6..00000000 --- a/.changeset/curvy-days-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch ---- - -chore: update denom default for deposit msg diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 8d7e29dd..e0c16189 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.0.28 + +### Patch Changes + +- ab8cd4fa: chore: update denom default for deposit msg + ## 2.0.27 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 97df3a7d..636a3fd7 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.27", + "version": "2.0.28", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From d0bd102da4f469487ee832673ad8a0d891dfd5eb Mon Sep 17 00:00:00 2001 From: JamesNguyen5 <161576119+JamesNguyen5@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:16:01 +0700 Subject: [PATCH 084/176] chore: use protobuf for osmo types (remove osmojs dependency) (#277) * chore: use protobuf for osmojs * chore: use protobuf for osmojs * fix: added estimate fee for MsgSwapExactAmountIn * chore: add changeset * chore: rebase develop --------- Co-authored-by: Liam McAweeney --- .changeset/great-laws-fry.md | 5 + packages/cosmos/.eslintignore | 3 +- packages/cosmos/package.json | 5 +- packages/cosmos/proto/amino/amino.proto | 79 + .../cosmos/app/runtime/v1alpha1/module.proto | 50 + .../proto/cosmos/app/v1alpha1/config.proto | 55 + .../proto/cosmos/app/v1alpha1/module.proto | 91 + .../proto/cosmos/app/v1alpha1/query.proto | 22 + .../proto/cosmos/auth/module/v1/module.proto | 31 + .../proto/cosmos/auth/v1beta1/auth.proto | 58 + .../proto/cosmos/auth/v1beta1/genesis.proto | 18 + .../proto/cosmos/auth/v1beta1/query.proto | 236 + .../cosmos/proto/cosmos/auth/v1beta1/tx.proto | 43 + .../proto/cosmos/authz/module/v1/module.proto | 12 + .../proto/cosmos/authz/v1beta1/authz.proto | 48 + .../proto/cosmos/authz/v1beta1/event.proto | 27 + .../proto/cosmos/authz/v1beta1/genesis.proto | 14 + .../proto/cosmos/authz/v1beta1/query.proto | 82 + .../proto/cosmos/authz/v1beta1/tx.proto | 81 + .../proto/cosmos/autocli/v1/options.proto | 127 + .../proto/cosmos/autocli/v1/query.proto | 28 + .../proto/cosmos/bank/module/v1/module.proto | 20 + .../proto/cosmos/bank/v1beta1/authz.proto | 30 + .../proto/cosmos/bank/v1beta1/bank.proto | 124 + .../proto/cosmos/bank/v1beta1/genesis.proto | 52 + .../proto/cosmos/bank/v1beta1/query.proto | 348 + .../cosmos/proto/cosmos/bank/v1beta1/tx.proto | 122 + .../proto/cosmos/base/abci/v1beta1/abci.proto | 158 + .../proto/cosmos/base/kv/v1beta1/kv.proto | 17 + .../cosmos/base/node/v1beta1/query.proto | 22 + .../base/query/v1beta1/pagination.proto | 56 + .../base/reflection/v1beta1/reflection.proto | 44 + .../base/reflection/v2alpha1/reflection.proto | 218 + .../base/snapshots/v1beta1/snapshot.proto | 90 + .../base/store/v1beta1/commit_info.proto | 29 + .../cosmos/base/store/v1beta1/listening.proto | 34 + .../base/tendermint/v1beta1/query.proto | 208 + .../base/tendermint/v1beta1/types.proto | 52 + .../proto/cosmos/base/v1beta1/coin.proto | 48 + .../cosmos/capability/module/v1/module.proto | 16 + .../capability/v1beta1/capability.proto | 31 + .../cosmos/capability/v1beta1/genesis.proto | 27 + .../cosmos/consensus/module/v1/module.proto | 15 + .../proto/cosmos/consensus/v1/query.proto | 27 + .../cosmos/proto/cosmos/consensus/v1/tx.proto | 39 + .../cosmos/crisis/module/v1/module.proto | 18 + .../proto/cosmos/crisis/v1beta1/genesis.proto | 15 + .../proto/cosmos/crisis/v1beta1/tx.proto | 65 + .../proto/cosmos/crypto/ed25519/keys.proto | 39 + .../cosmos/proto/cosmos/crypto/hd/v1/hd.proto | 27 + .../cosmos/crypto/keyring/v1/record.proto | 48 + .../proto/cosmos/crypto/multisig/keys.proto | 30 + .../crypto/multisig/v1beta1/multisig.proto | 25 + .../proto/cosmos/crypto/secp256k1/keys.proto | 38 + .../proto/cosmos/crypto/secp256r1/keys.proto | 23 + .../distribution/module/v1/module.proto | 17 + .../distribution/v1beta1/distribution.proto | 194 + .../cosmos/distribution/v1beta1/genesis.proto | 155 + .../cosmos/distribution/v1beta1/query.proto | 256 + .../cosmos/distribution/v1beta1/tx.proto | 178 + .../cosmos/evidence/module/v1/module.proto | 12 + .../cosmos/evidence/v1beta1/evidence.proto | 32 + .../cosmos/evidence/v1beta1/genesis.proto | 12 + .../proto/cosmos/evidence/v1beta1/query.proto | 58 + .../proto/cosmos/evidence/v1beta1/tx.proto | 42 + .../cosmos/feegrant/module/v1/module.proto | 12 + .../cosmos/feegrant/v1beta1/feegrant.proto | 93 + .../cosmos/feegrant/v1beta1/genesis.proto | 14 + .../proto/cosmos/feegrant/v1beta1/query.proto | 84 + .../proto/cosmos/feegrant/v1beta1/tx.proto | 57 + .../cosmos/genutil/module/v1/module.proto | 12 + .../cosmos/genutil/v1beta1/genesis.proto | 18 + .../proto/cosmos/gov/module/v1/module.proto | 19 + .../cosmos/proto/cosmos/gov/v1/genesis.proto | 33 + packages/cosmos/proto/cosmos/gov/v1/gov.proto | 220 + .../cosmos/proto/cosmos/gov/v1/query.proto | 193 + packages/cosmos/proto/cosmos/gov/v1/tx.proto | 172 + .../proto/cosmos/gov/v1beta1/genesis.proto | 30 + .../cosmos/proto/cosmos/gov/v1beta1/gov.proto | 252 + .../proto/cosmos/gov/v1beta1/query.proto | 194 + .../cosmos/proto/cosmos/gov/v1beta1/tx.proto | 138 + .../proto/cosmos/group/module/v1/module.proto | 24 + .../cosmos/proto/cosmos/group/v1/events.proto | 81 + .../proto/cosmos/group/v1/genesis.proto | 39 + .../cosmos/proto/cosmos/group/v1/query.proto | 293 + .../cosmos/proto/cosmos/group/v1/tx.proto | 394 + .../cosmos/proto/cosmos/group/v1/types.proto | 333 + .../proto/cosmos/mint/module/v1/module.proto | 17 + .../proto/cosmos/mint/v1beta1/genesis.proto | 17 + .../proto/cosmos/mint/v1beta1/mint.proto | 59 + .../proto/cosmos/mint/v1beta1/query.proto | 65 + .../cosmos/proto/cosmos/mint/v1beta1/tx.proto | 43 + packages/cosmos/proto/cosmos/msg/v1/msg.proto | 30 + .../proto/cosmos/nft/module/v1/module.proto | 12 + .../proto/cosmos/nft/v1beta1/event.proto | 43 + .../proto/cosmos/nft/v1beta1/genesis.proto | 24 + .../cosmos/proto/cosmos/nft/v1beta1/nft.proto | 48 + .../proto/cosmos/nft/v1beta1/query.proto | 152 + .../cosmos/proto/cosmos/nft/v1beta1/tx.proto | 34 + .../cosmos/orm/module/v1alpha1/module.proto | 14 + .../cosmos/orm/query/v1alpha1/query.proto | 131 + packages/cosmos/proto/cosmos/orm/v1/orm.proto | 104 + .../proto/cosmos/orm/v1alpha1/schema.proto | 76 + .../cosmos/params/module/v1/module.proto | 12 + .../proto/cosmos/params/v1beta1/params.proto | 31 + .../proto/cosmos/params/v1beta1/query.proto | 63 + .../cosmos/proto/cosmos/query/v1/query.proto | 35 + .../cosmos/reflection/v1/reflection.proto | 27 + .../cosmos/slashing/module/v1/module.proto | 15 + .../cosmos/slashing/v1beta1/genesis.proto | 48 + .../proto/cosmos/slashing/v1beta1/query.proto | 66 + .../cosmos/slashing/v1beta1/slashing.proto | 59 + .../proto/cosmos/slashing/v1beta1/tx.proto | 68 + .../cosmos/staking/module/v1/module.proto | 20 + .../proto/cosmos/staking/v1beta1/authz.proto | 49 + .../cosmos/staking/v1beta1/genesis.proto | 53 + .../proto/cosmos/staking/v1beta1/query.proto | 387 + .../cosmos/staking/v1beta1/staking.proto | 405 + .../proto/cosmos/staking/v1beta1/tx.proto | 201 + .../proto/cosmos/tx/config/v1/config.proto | 20 + .../cosmos/tx/signing/v1beta1/signing.proto | 106 + .../proto/cosmos/tx/v1beta1/service.proto | 277 + .../cosmos/proto/cosmos/tx/v1beta1/tx.proto | 256 + .../cosmos/upgrade/module/v1/module.proto | 15 + .../proto/cosmos/upgrade/v1beta1/query.proto | 122 + .../proto/cosmos/upgrade/v1beta1/tx.proto | 62 + .../cosmos/upgrade/v1beta1/upgrade.proto | 98 + .../cosmos/vesting/module/v1/module.proto | 12 + .../proto/cosmos/vesting/v1beta1/tx.proto | 98 + .../cosmos/vesting/v1beta1/vesting.proto | 94 + .../cosmos/proto/cosmos_proto/cosmos.proto | 97 + packages/cosmos/proto/gogoproto/gogo.proto | 145 + .../cosmos/proto/google/api/annotations.proto | 31 + packages/cosmos/proto/google/api/http.proto | 375 + .../proto/ibc/applications/fee/v1/ack.proto | 15 + .../proto/ibc/applications/fee/v1/fee.proto | 61 + .../ibc/applications/fee/v1/genesis.proto | 60 + .../ibc/applications/fee/v1/metadata.proto | 14 + .../proto/ibc/applications/fee/v1/query.proto | 218 + .../proto/ibc/applications/fee/v1/tx.proto | 122 + .../controller/v1/controller.proto | 12 + .../controller/v1/query.proto | 42 + .../controller/v1/tx.proto | 82 + .../genesis/v1/genesis.proto | 47 + .../interchain_accounts/host/v1/host.proto | 25 + .../interchain_accounts/host/v1/query.proto | 25 + .../interchain_accounts/host/v1/tx.proto | 60 + .../interchain_accounts/v1/account.proto | 19 + .../interchain_accounts/v1/metadata.proto | 23 + .../interchain_accounts/v1/packet.proto | 31 + .../ibc/applications/transfer/v1/authz.proto | 34 + .../applications/transfer/v1/genesis.proto | 20 + .../ibc/applications/transfer/v1/query.proto | 121 + .../applications/transfer/v1/transfer.proto | 28 + .../ibc/applications/transfer/v1/tx.proto | 79 + .../ibc/applications/transfer/v2/packet.proto | 21 + .../proto/ibc/core/channel/v1/channel.proto | 187 + .../proto/ibc/core/channel/v1/genesis.proto | 30 + .../proto/ibc/core/channel/v1/query.proto | 459 ++ .../cosmos/proto/ibc/core/channel/v1/tx.proto | 469 ++ .../proto/ibc/core/channel/v1/upgrade.proto | 43 + .../proto/ibc/core/client/v1/client.proto | 113 + .../proto/ibc/core/client/v1/genesis.proto | 44 + .../proto/ibc/core/client/v1/query.proto | 242 + .../cosmos/proto/ibc/core/client/v1/tx.proto | 175 + .../ibc/core/commitment/v1/commitment.proto | 39 + .../ibc/core/connection/v1/connection.proto | 114 + .../ibc/core/connection/v1/genesis.proto | 17 + .../proto/ibc/core/connection/v1/query.proto | 152 + .../proto/ibc/core/connection/v1/tx.proto | 146 + .../proto/ibc/core/types/v1/genesis.proto | 20 + .../lightclients/localhost/v2/localhost.proto | 16 + .../solomachine/v2/solomachine.proto | 189 + .../solomachine/v3/solomachine.proto | 99 + .../tendermint/v1/tendermint.proto | 101 + .../ibc/lightclients/wasm/v1/genesis.proto | 20 + .../ibc/lightclients/wasm/v1/query.proto | 46 + .../proto/ibc/lightclients/wasm/v1/tx.proto | 66 + .../proto/ibc/lightclients/wasm/v1/wasm.proto | 43 + .../proto/osmosis/accum/v1beta1/accum.proto | 67 + .../concentratedliquidity/params.proto | 68 + .../poolmodel/concentrated/v1beta1/tx.proto | 30 + .../v1beta1/genesis.proto | 88 + .../concentratedliquidity/v1beta1/gov.proto | 61 + .../v1beta1/incentive_record.proto | 59 + .../concentratedliquidity/v1beta1/pool.proto | 70 + .../v1beta1/position.proto | 70 + .../concentratedliquidity/v1beta1/query.proto | 363 + .../concentratedliquidity/v1beta1/query.yml | 81 + .../v1beta1/tick_info.proto | 66 + .../concentratedliquidity/v1beta1/tx.proto | 238 + .../cosmwasmpool/v1beta1/genesis.proto | 18 + .../osmosis/cosmwasmpool/v1beta1/gov.proto | 74 + .../v1beta1/model/instantiate_msg.proto | 11 + .../v1beta1/model/module_query_msg.proto | 61 + .../v1beta1/model/module_sudo_msg.proto | 87 + .../cosmwasmpool/v1beta1/model/pool.proto | 36 + .../v1beta1/model/pool_query_msg.proto | 70 + .../v1beta1/model/transmuter_msgs.proto | 26 + .../cosmwasmpool/v1beta1/model/tx.proto | 24 + .../osmosis/cosmwasmpool/v1beta1/params.proto | 19 + .../osmosis/cosmwasmpool/v1beta1/query.proto | 62 + .../osmosis/cosmwasmpool/v1beta1/query.yml | 20 + .../osmosis/cosmwasmpool/v1beta1/tx.proto | 6 + .../v1beta1/downtime_duration.proto | 32 + .../downtimedetector/v1beta1/genesis.proto | 31 + .../downtimedetector/v1beta1/query.proto | 39 + .../downtimedetector/v1beta1/query.yml | 8 + .../osmosis/epochs/v1beta1/genesis.proto | 72 + .../proto/osmosis/epochs/v1beta1/query.proto | 30 + .../gamm/poolmodels/balancer/v1beta1/tx.proto | 36 + .../stableswap/v1beta1/stableswap_pool.proto | 82 + .../poolmodels/stableswap/v1beta1/tx.proto | 58 + .../osmosis/gamm/v1beta1/balancerPool.proto | 162 + .../proto/osmosis/gamm/v1beta1/genesis.proto | 29 + .../proto/osmosis/gamm/v1beta1/gov.proto | 115 + .../proto/osmosis/gamm/v1beta1/query.proto | 365 + .../proto/osmosis/gamm/v1beta1/shared.proto | 28 + .../proto/osmosis/gamm/v1beta1/tx.proto | 260 + .../cosmos/proto/osmosis/gamm/v2/query.proto | 38 + .../proto/osmosis/ibchooks/genesis.proto | 10 + .../proto/osmosis/ibchooks/params.proto | 13 + .../cosmos/proto/osmosis/ibchooks/tx.proto | 25 + .../ibcratelimit/v1beta1/genesis.proto | 15 + .../osmosis/ibcratelimit/v1beta1/params.proto | 12 + .../osmosis/ibcratelimit/v1beta1/query.proto | 27 + .../osmosis/ibcratelimit/v1beta1/query.yml | 10 + .../proto/osmosis/incentives/gauge.proto | 60 + .../proto/osmosis/incentives/genesis.proto | 34 + .../cosmos/proto/osmosis/incentives/gov.proto | 23 + .../proto/osmosis/incentives/group.proto | 75 + .../proto/osmosis/incentives/params.proto | 54 + .../proto/osmosis/incentives/query.proto | 239 + .../cosmos/proto/osmosis/incentives/tx.proto | 97 + .../cosmos/proto/osmosis/lockup/genesis.proto | 16 + .../cosmos/proto/osmosis/lockup/lock.proto | 115 + .../cosmos/proto/osmosis/lockup/params.proto | 11 + .../cosmos/proto/osmosis/lockup/query.proto | 336 + packages/cosmos/proto/osmosis/lockup/tx.proto | 115 + .../proto/osmosis/mint/v1beta1/genesis.proto | 21 + .../proto/osmosis/mint/v1beta1/mint.proto | 119 + .../proto/osmosis/mint/v1beta1/query.proto | 46 + .../poolincentives/v1beta1/genesis.proto | 37 + .../osmosis/poolincentives/v1beta1/gov.proto | 55 + .../poolincentives/v1beta1/incentives.proto | 64 + .../poolincentives/v1beta1/query.proto | 108 + .../poolincentives/v1beta1/shared.proto | 33 + .../osmosis/poolmanager/v1beta1/genesis.proto | 147 + .../osmosis/poolmanager/v1beta1/gov.proto | 20 + .../poolmanager/v1beta1/module_route.proto | 37 + .../osmosis/poolmanager/v1beta1/query.proto | 370 + .../osmosis/poolmanager/v1beta1/query.yml | 95 + .../poolmanager/v1beta1/swap_route.proto | 40 + .../poolmanager/v1beta1/tracked_volume.proto | 14 + .../osmosis/poolmanager/v1beta1/tx.proto | 152 + .../proto/osmosis/poolmanager/v2/query.proto | 44 + .../proto/osmosis/poolmanager/v2/query.yml | 10 + .../osmosis/protorev/v1beta1/genesis.proto | 72 + .../proto/osmosis/protorev/v1beta1/gov.proto | 38 + .../osmosis/protorev/v1beta1/params.proto | 15 + .../osmosis/protorev/v1beta1/protorev.proto | 218 + .../osmosis/protorev/v1beta1/query.proto | 343 + .../proto/osmosis/protorev/v1beta1/tx.proto | 170 + .../smartaccount/v1beta1/genesis.proto | 36 + .../osmosis/smartaccount/v1beta1/models.proto | 23 + .../osmosis/smartaccount/v1beta1/params.proto | 26 + .../osmosis/smartaccount/v1beta1/query.proto | 41 + .../osmosis/smartaccount/v1beta1/tx.proto | 52 + .../proto/osmosis/store/v1beta1/tree.proto | 20 + .../proto/osmosis/superfluid/genesis.proto | 27 + .../proto/osmosis/superfluid/params.proto | 21 + .../proto/osmosis/superfluid/query.proto | 334 + .../proto/osmosis/superfluid/superfluid.proto | 99 + .../cosmos/proto/osmosis/superfluid/tx.proto | 283 + .../osmosis/superfluid/v1beta1/gov.proto | 52 + .../v1beta1/authorityMetadata.proto | 17 + .../tokenfactory/v1beta1/genesis.proto | 32 + .../osmosis/tokenfactory/v1beta1/params.proto | 30 + .../osmosis/tokenfactory/v1beta1/query.proto | 111 + .../osmosis/tokenfactory/v1beta1/tx.proto | 149 + .../proto/osmosis/twap/v1beta1/genesis.proto | 29 + .../proto/osmosis/twap/v1beta1/query.proto | 124 + .../proto/osmosis/twap/v1beta1/query.yml | 34 + .../osmosis/twap/v1beta1/twap_record.proto | 97 + .../osmosis/txfees/v1beta1/feetoken.proto | 17 + .../osmosis/txfees/v1beta1/genesis.proto | 23 + .../proto/osmosis/txfees/v1beta1/gov.proto | 29 + .../proto/osmosis/txfees/v1beta1/params.proto | 14 + .../proto/osmosis/txfees/v1beta1/query.proto | 90 + .../proto/osmosis/txfees/v1beta1/tx.proto | 25 + .../osmosis/valsetpref/v1beta1/query.proto | 29 + .../osmosis/valsetpref/v1beta1/query.yml | 10 + .../osmosis/valsetpref/v1beta1/state.proto | 38 + .../proto/osmosis/valsetpref/v1beta1/tx.proto | 165 + .../cosmos/proto/tendermint/abci/types.proto | 444 ++ .../cosmos/proto/tendermint/crypto/keys.proto | 17 + .../proto/tendermint/crypto/proof.proto | 41 + .../proto/tendermint/libs/bits/types.proto | 9 + .../cosmos/proto/tendermint/p2p/types.proto | 34 + .../cosmos/proto/tendermint/types/block.proto | 15 + .../proto/tendermint/types/evidence.proto | 38 + .../proto/tendermint/types/params.proto | 77 + .../cosmos/proto/tendermint/types/types.proto | 157 + .../proto/tendermint/types/validator.proto | 25 + .../proto/tendermint/version/types.proto | 24 + packages/cosmos/proto/tx.proto | 30 + packages/cosmos/src/chain.provider.ts | 2 +- .../datasource/indexer/indexer.data-source.ts | 63 +- packages/cosmos/src/msg.ts | 18 +- .../cosmos/src/proto_export/amino/amino.ts | 9 + packages/cosmos/src/proto_export/binary.ts | 534 ++ .../cosmos/auth/module/v1/module.ts | 352 + .../proto_export/cosmos/auth/v1beta1/auth.ts | 786 ++ .../proto_export/cosmos/bank/v1beta1/authz.ts | 186 + .../proto_export/cosmos/bank/v1beta1/bank.ts | 1251 +++ .../cosmos/bank/v1beta1/tx.amino.ts | 29 + .../cosmos/bank/v1beta1/tx.registry.ts | 100 + .../proto_export/cosmos/bank/v1beta1/tx.ts | 1134 +++ .../proto_export/cosmos/base/v1beta1/coin.ts | 516 ++ .../cosmos/src/proto_export/cosmos/bundle.ts | 154 + .../cosmos/src/proto_export/cosmos/client.ts | 52 + .../cosmos/src/proto_export/cosmos/lcd.ts | 34 + .../src/proto_export/cosmos/msg/v1/msg.ts | 1 + .../src/proto_export/cosmos/rpc.query.ts | 37 + .../cosmos/src/proto_export/cosmos/rpc.tx.ts | 44 + .../proto_export/cosmos/upgrade/v1beta1/tx.ts | 529 ++ .../cosmos/upgrade/v1beta1/upgrade.ts | 810 ++ .../src/proto_export/cosmos_proto/bundle.ts | 5 + .../src/proto_export/cosmos_proto/cosmos.ts | 416 + .../src/proto_export/gogoproto/bundle.ts | 5 + .../cosmos/src/proto_export/gogoproto/gogo.ts | 1 + .../proto_export/google/api/annotations.ts | 1 + .../src/proto_export/google/api/http.ts | 1477 ++++ .../cosmos/src/proto_export/google/bundle.ts | 13 + .../src/proto_export/google/protobuf/any.ts | 427 + .../google/protobuf/descriptor.ts | 6947 +++++++++++++++++ .../proto_export/google/protobuf/duration.ts | 314 + .../proto_export/google/protobuf/timestamp.ts | 380 + packages/cosmos/src/proto_export/helpers.ts | 254 + .../ibc/applications/transfer/v1/transfer.ts | 331 + .../ibc/applications/transfer/v1/tx.amino.ts | 14 + .../applications/transfer/v1/tx.registry.ts | 57 + .../ibc/applications/transfer/v1/tx.ts | 717 ++ .../ibc/applications/transfer/v2/packet.ts | 233 + .../cosmos/src/proto_export/ibc/bundle.ts | 31 + .../cosmos/src/proto_export/ibc/client.ts | 56 + .../proto_export/ibc/core/client/v1/client.ts | 1294 +++ packages/cosmos/src/proto_export/ibc/lcd.ts | 153 + .../cosmos/src/proto_export/ibc/rpc.query.ts | 128 + .../cosmos/src/proto_export/ibc/rpc.tx.ts | 100 + .../cosmos/src/proto_export/osmosis/bundle.ts | 271 + .../cosmos/src/proto_export/osmosis/client.ts | 112 + .../osmosis/concentratedliquidity/params.ts | 426 + .../concentrated/v1beta1/tx.amino.ts | 11 + .../concentrated/v1beta1/tx.registry.ts | 44 + .../concentrated/v1beta1/tx.rpc.msg.ts | 36 + .../poolmodel/concentrated/v1beta1/tx.ts | 375 + .../concentratedliquidity/v1beta1/tx.amino.ts | 41 + .../v1beta1/tx.registry.ts | 158 + .../concentratedliquidity/v1beta1/tx.ts | 2574 ++++++ .../poolmodels/balancer/v1beta1/tx.amino.ts | 9 + .../balancer/v1beta1/tx.registry.ts | 44 + .../poolmodels/balancer/v1beta1/tx.rpc.msg.ts | 33 + .../gamm/poolmodels/balancer/v1beta1/tx.ts | 355 + .../stableswap/v1beta1/stableswap_pool.ts | 501 ++ .../poolmodels/stableswap/v1beta1/tx.amino.ts | 18 + .../stableswap/v1beta1/tx.registry.ts | 72 + .../stableswap/v1beta1/tx.rpc.msg.ts | 56 + .../gamm/poolmodels/stableswap/v1beta1/tx.ts | 759 ++ .../osmosis/gamm/v1beta1/balancerPool.ts | 968 +++ .../osmosis/gamm/v1beta1/tx.amino.ts | 53 + .../osmosis/gamm/v1beta1/tx.registry.ts | 189 + .../osmosis/gamm/v1beta1/tx.rpc.msg.ts | 161 + .../proto_export/osmosis/gamm/v1beta1/tx.ts | 2792 +++++++ .../proto_export/osmosis/ibchooks/genesis.ts | 115 + .../proto_export/osmosis/ibchooks/params.ts | 132 + .../proto_export/osmosis/ibchooks/tx.amino.ts | 9 + .../osmosis/ibchooks/tx.registry.ts | 38 + .../osmosis/ibchooks/tx.rpc.msg.ts | 34 + .../src/proto_export/osmosis/ibchooks/tx.ts | 309 + .../proto_export/osmosis/incentives/gauge.ts | 511 ++ .../osmosis/incentives/tx.amino.ts | 19 + .../osmosis/incentives/tx.registry.ts | 76 + .../osmosis/incentives/tx.rpc.msg.ts | 62 + .../src/proto_export/osmosis/incentives/tx.ts | 1035 +++ .../cosmos/src/proto_export/osmosis/lcd.ts | 58 + .../proto_export/osmosis/lockup/genesis.ts | 213 + .../src/proto_export/osmosis/lockup/lock.ts | 830 ++ .../src/proto_export/osmosis/lockup/params.ts | 131 + .../proto_export/osmosis/lockup/query.lcd.ts | 309 + .../osmosis/lockup/query.rpc.Query.ts | 945 +++ .../src/proto_export/osmosis/lockup/query.ts | 5596 +++++++++++++ .../proto_export/osmosis/lockup/tx.amino.ts | 41 + .../osmosis/lockup/tx.registry.ts | 140 + .../proto_export/osmosis/lockup/tx.rpc.msg.ts | 117 + .../src/proto_export/osmosis/lockup/tx.ts | 1820 +++++ .../osmosis/poolmanager/v1beta1/genesis.ts | 1429 ++++ .../poolmanager/v1beta1/module_route.ts | 206 + .../osmosis/poolmanager/v1beta1/swap_route.ts | 607 ++ .../osmosis/poolmanager/v1beta1/tx.amino.ts | 35 + .../poolmanager/v1beta1/tx.registry.ts | 129 + .../osmosis/poolmanager/v1beta1/tx.rpc.msg.ts | 114 + .../osmosis/poolmanager/v1beta1/tx.ts | 1888 +++++ .../osmosis/poolmanager/v2/query.lcd.ts | 31 + .../osmosis/poolmanager/v2/query.rpc.Query.ts | 93 + .../osmosis/poolmanager/v2/query.ts | 311 + .../osmosis/protorev/v1beta1/genesis.ts | 537 ++ .../osmosis/protorev/v1beta1/gov.ts | 384 + .../osmosis/protorev/v1beta1/params.ts | 142 + .../osmosis/protorev/v1beta1/protorev.ts | 2507 ++++++ .../osmosis/protorev/v1beta1/query.lcd.ts | 240 + .../protorev/v1beta1/query.rpc.Query.ts | 848 ++ .../osmosis/protorev/v1beta1/query.ts | 4602 +++++++++++ .../osmosis/protorev/v1beta1/tx.amino.ts | 41 + .../osmosis/protorev/v1beta1/tx.registry.ts | 146 + .../osmosis/protorev/v1beta1/tx.rpc.msg.ts | 147 + .../osmosis/protorev/v1beta1/tx.ts | 1676 ++++ .../src/proto_export/osmosis/rpc.query.ts | 43 + .../cosmos/src/proto_export/osmosis/rpc.tx.ts | 72 + .../osmosis/smartaccount/v1beta1/genesis.ts | 385 + .../osmosis/smartaccount/v1beta1/models.ts | 205 + .../osmosis/smartaccount/v1beta1/params.ts | 217 + .../osmosis/smartaccount/v1beta1/query.lcd.ts | 31 + .../smartaccount/v1beta1/query.rpc.Query.ts | 126 + .../osmosis/smartaccount/v1beta1/query.ts | 521 ++ .../osmosis/smartaccount/v1beta1/tx.amino.ts | 23 + .../smartaccount/v1beta1/tx.registry.ts | 83 + .../smartaccount/v1beta1/tx.rpc.msg.ts | 79 + .../osmosis/smartaccount/v1beta1/tx.ts | 1012 +++ .../osmosis/superfluid/superfluid.ts | 1423 ++++ .../osmosis/superfluid/tx.amino.ts | 67 + .../osmosis/superfluid/tx.registry.ts | 282 + .../osmosis/superfluid/tx.rpc.msg.ts | 237 + .../src/proto_export/osmosis/superfluid/tx.ts | 3582 +++++++++ .../osmosis/superfluid/v1beta1/gov.ts | 627 ++ .../tokenfactory/v1beta1/authorityMetadata.ts | 145 + .../osmosis/tokenfactory/v1beta1/genesis.ts | 333 + .../osmosis/tokenfactory/v1beta1/params.ts | 188 + .../osmosis/tokenfactory/v1beta1/query.lcd.ts | 76 + .../tokenfactory/v1beta1/query.rpc.Query.ts | 305 + .../osmosis/tokenfactory/v1beta1/query.ts | 1437 ++++ .../osmosis/tokenfactory/v1beta1/tx.amino.ts | 47 + .../tokenfactory/v1beta1/tx.registry.ts | 160 + .../tokenfactory/v1beta1/tx.rpc.msg.ts | 131 + .../osmosis/tokenfactory/v1beta1/tx.ts | 1958 +++++ .../osmosis/txfees/v1beta1/feetoken.ts | 157 + .../osmosis/txfees/v1beta1/genesis.ts | 176 + .../osmosis/txfees/v1beta1/gov.ts | 200 + .../osmosis/txfees/v1beta1/params.ts | 134 + .../osmosis/txfees/v1beta1/query.lcd.ts | 72 + .../osmosis/txfees/v1beta1/query.rpc.Query.ts | 266 + .../osmosis/txfees/v1beta1/query.ts | 1272 +++ .../osmosis/txfees/v1beta1/tx.amino.ts | 9 + .../osmosis/txfees/v1beta1/tx.registry.ts | 38 + .../osmosis/txfees/v1beta1/tx.rpc.msg.ts | 29 + .../proto_export/osmosis/txfees/v1beta1/tx.ts | 252 + .../osmosis/valsetpref/v1beta1/query.lcd.ts | 23 + .../valsetpref/v1beta1/query.rpc.Query.ts | 92 + .../osmosis/valsetpref/v1beta1/query.ts | 304 + .../osmosis/valsetpref/v1beta1/state.ts | 348 + .../osmosis/valsetpref/v1beta1/tx.amino.ts | 47 + .../osmosis/valsetpref/v1beta1/tx.registry.ts | 190 + .../osmosis/valsetpref/v1beta1/tx.rpc.msg.ts | 186 + .../osmosis/valsetpref/v1beta1/tx.ts | 1972 +++++ packages/cosmos/src/proto_export/registry.ts | 219 + packages/cosmos/src/proto_export/types.ts | 157 + packages/cosmos/src/proto_export/utf8.ts | 148 + packages/cosmos/src/proto_export/varint.ts | 488 ++ .../cosmos/src/signers/private-key.signer.ts | 5 +- .../cosmos/src/signers/seed-phrase.signer.ts | 5 +- packages/cosmos/src/utils.ts | 8 +- packages/unlink-all-packages.sh | 33 + yarn.lock | 27 +- 473 files changed, 104126 insertions(+), 71 deletions(-) create mode 100644 .changeset/great-laws-fry.md create mode 100644 packages/cosmos/proto/amino/amino.proto create mode 100644 packages/cosmos/proto/cosmos/app/runtime/v1alpha1/module.proto create mode 100644 packages/cosmos/proto/cosmos/app/v1alpha1/config.proto create mode 100644 packages/cosmos/proto/cosmos/app/v1alpha1/module.proto create mode 100644 packages/cosmos/proto/cosmos/app/v1alpha1/query.proto create mode 100644 packages/cosmos/proto/cosmos/auth/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/auth/v1beta1/auth.proto create mode 100644 packages/cosmos/proto/cosmos/auth/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/auth/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/auth/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/authz/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/authz/v1beta1/authz.proto create mode 100644 packages/cosmos/proto/cosmos/authz/v1beta1/event.proto create mode 100644 packages/cosmos/proto/cosmos/authz/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/authz/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/authz/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/autocli/v1/options.proto create mode 100644 packages/cosmos/proto/cosmos/autocli/v1/query.proto create mode 100644 packages/cosmos/proto/cosmos/bank/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/bank/v1beta1/authz.proto create mode 100644 packages/cosmos/proto/cosmos/bank/v1beta1/bank.proto create mode 100644 packages/cosmos/proto/cosmos/bank/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/bank/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/bank/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/base/abci/v1beta1/abci.proto create mode 100644 packages/cosmos/proto/cosmos/base/kv/v1beta1/kv.proto create mode 100644 packages/cosmos/proto/cosmos/base/node/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/base/query/v1beta1/pagination.proto create mode 100644 packages/cosmos/proto/cosmos/base/reflection/v1beta1/reflection.proto create mode 100644 packages/cosmos/proto/cosmos/base/reflection/v2alpha1/reflection.proto create mode 100644 packages/cosmos/proto/cosmos/base/snapshots/v1beta1/snapshot.proto create mode 100644 packages/cosmos/proto/cosmos/base/store/v1beta1/commit_info.proto create mode 100644 packages/cosmos/proto/cosmos/base/store/v1beta1/listening.proto create mode 100644 packages/cosmos/proto/cosmos/base/tendermint/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/base/tendermint/v1beta1/types.proto create mode 100644 packages/cosmos/proto/cosmos/base/v1beta1/coin.proto create mode 100644 packages/cosmos/proto/cosmos/capability/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/capability/v1beta1/capability.proto create mode 100644 packages/cosmos/proto/cosmos/capability/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/consensus/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/consensus/v1/query.proto create mode 100644 packages/cosmos/proto/cosmos/consensus/v1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/crisis/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/crisis/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/crisis/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/crypto/ed25519/keys.proto create mode 100644 packages/cosmos/proto/cosmos/crypto/hd/v1/hd.proto create mode 100644 packages/cosmos/proto/cosmos/crypto/keyring/v1/record.proto create mode 100644 packages/cosmos/proto/cosmos/crypto/multisig/keys.proto create mode 100644 packages/cosmos/proto/cosmos/crypto/multisig/v1beta1/multisig.proto create mode 100644 packages/cosmos/proto/cosmos/crypto/secp256k1/keys.proto create mode 100644 packages/cosmos/proto/cosmos/crypto/secp256r1/keys.proto create mode 100644 packages/cosmos/proto/cosmos/distribution/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/distribution/v1beta1/distribution.proto create mode 100644 packages/cosmos/proto/cosmos/distribution/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/distribution/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/distribution/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/evidence/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/evidence/v1beta1/evidence.proto create mode 100644 packages/cosmos/proto/cosmos/evidence/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/evidence/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/evidence/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/feegrant/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/feegrant/v1beta1/feegrant.proto create mode 100644 packages/cosmos/proto/cosmos/feegrant/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/feegrant/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/feegrant/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/genutil/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/genutil/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/gov/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1/gov.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1/query.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/gov/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/group/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/group/v1/events.proto create mode 100644 packages/cosmos/proto/cosmos/group/v1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/group/v1/query.proto create mode 100644 packages/cosmos/proto/cosmos/group/v1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/group/v1/types.proto create mode 100644 packages/cosmos/proto/cosmos/mint/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/mint/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/mint/v1beta1/mint.proto create mode 100644 packages/cosmos/proto/cosmos/mint/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/mint/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/msg/v1/msg.proto create mode 100644 packages/cosmos/proto/cosmos/nft/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/nft/v1beta1/event.proto create mode 100644 packages/cosmos/proto/cosmos/nft/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/nft/v1beta1/nft.proto create mode 100644 packages/cosmos/proto/cosmos/nft/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/nft/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/orm/module/v1alpha1/module.proto create mode 100644 packages/cosmos/proto/cosmos/orm/query/v1alpha1/query.proto create mode 100644 packages/cosmos/proto/cosmos/orm/v1/orm.proto create mode 100644 packages/cosmos/proto/cosmos/orm/v1alpha1/schema.proto create mode 100644 packages/cosmos/proto/cosmos/params/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/params/v1beta1/params.proto create mode 100644 packages/cosmos/proto/cosmos/params/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/query/v1/query.proto create mode 100644 packages/cosmos/proto/cosmos/reflection/v1/reflection.proto create mode 100644 packages/cosmos/proto/cosmos/slashing/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/slashing/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/slashing/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/slashing/v1beta1/slashing.proto create mode 100644 packages/cosmos/proto/cosmos/slashing/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/staking/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/staking/v1beta1/authz.proto create mode 100644 packages/cosmos/proto/cosmos/staking/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/cosmos/staking/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/staking/v1beta1/staking.proto create mode 100644 packages/cosmos/proto/cosmos/staking/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/tx/config/v1/config.proto create mode 100644 packages/cosmos/proto/cosmos/tx/signing/v1beta1/signing.proto create mode 100644 packages/cosmos/proto/cosmos/tx/v1beta1/service.proto create mode 100644 packages/cosmos/proto/cosmos/tx/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/upgrade/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/upgrade/v1beta1/query.proto create mode 100644 packages/cosmos/proto/cosmos/upgrade/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/upgrade/v1beta1/upgrade.proto create mode 100644 packages/cosmos/proto/cosmos/vesting/module/v1/module.proto create mode 100644 packages/cosmos/proto/cosmos/vesting/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/cosmos/vesting/v1beta1/vesting.proto create mode 100644 packages/cosmos/proto/cosmos_proto/cosmos.proto create mode 100644 packages/cosmos/proto/gogoproto/gogo.proto create mode 100644 packages/cosmos/proto/google/api/annotations.proto create mode 100644 packages/cosmos/proto/google/api/http.proto create mode 100644 packages/cosmos/proto/ibc/applications/fee/v1/ack.proto create mode 100644 packages/cosmos/proto/ibc/applications/fee/v1/fee.proto create mode 100644 packages/cosmos/proto/ibc/applications/fee/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/applications/fee/v1/metadata.proto create mode 100644 packages/cosmos/proto/ibc/applications/fee/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/applications/fee/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/host.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/v1/account.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/v1/metadata.proto create mode 100644 packages/cosmos/proto/ibc/applications/interchain_accounts/v1/packet.proto create mode 100644 packages/cosmos/proto/ibc/applications/transfer/v1/authz.proto create mode 100644 packages/cosmos/proto/ibc/applications/transfer/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/applications/transfer/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/applications/transfer/v1/transfer.proto create mode 100644 packages/cosmos/proto/ibc/applications/transfer/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/applications/transfer/v2/packet.proto create mode 100644 packages/cosmos/proto/ibc/core/channel/v1/channel.proto create mode 100644 packages/cosmos/proto/ibc/core/channel/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/core/channel/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/core/channel/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/core/channel/v1/upgrade.proto create mode 100644 packages/cosmos/proto/ibc/core/client/v1/client.proto create mode 100644 packages/cosmos/proto/ibc/core/client/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/core/client/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/core/client/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/core/commitment/v1/commitment.proto create mode 100644 packages/cosmos/proto/ibc/core/connection/v1/connection.proto create mode 100644 packages/cosmos/proto/ibc/core/connection/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/core/connection/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/core/connection/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/core/types/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/localhost/v2/localhost.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/solomachine/v2/solomachine.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/solomachine/v3/solomachine.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/tendermint/v1/tendermint.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/wasm/v1/genesis.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/wasm/v1/query.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/wasm/v1/tx.proto create mode 100644 packages/cosmos/proto/ibc/lightclients/wasm/v1/wasm.proto create mode 100644 packages/cosmos/proto/osmosis/accum/v1beta1/accum.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/params.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/pool.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/position.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.yml create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tick_info.proto create mode 100644 packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/params.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.yml create mode 100644 packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/downtimedetector/v1beta1/downtime_duration.proto create mode 100644 packages/cosmos/proto/osmosis/downtimedetector/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.yml create mode 100644 packages/cosmos/proto/osmosis/epochs/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/epochs/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/v1beta1/balancerPool.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/v1beta1/shared.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/gamm/v2/query.proto create mode 100644 packages/cosmos/proto/osmosis/ibchooks/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/ibchooks/params.proto create mode 100644 packages/cosmos/proto/osmosis/ibchooks/tx.proto create mode 100644 packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/params.proto create mode 100644 packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.yml create mode 100644 packages/cosmos/proto/osmosis/incentives/gauge.proto create mode 100644 packages/cosmos/proto/osmosis/incentives/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/incentives/gov.proto create mode 100644 packages/cosmos/proto/osmosis/incentives/group.proto create mode 100644 packages/cosmos/proto/osmosis/incentives/params.proto create mode 100644 packages/cosmos/proto/osmosis/incentives/query.proto create mode 100644 packages/cosmos/proto/osmosis/incentives/tx.proto create mode 100644 packages/cosmos/proto/osmosis/lockup/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/lockup/lock.proto create mode 100644 packages/cosmos/proto/osmosis/lockup/params.proto create mode 100644 packages/cosmos/proto/osmosis/lockup/query.proto create mode 100644 packages/cosmos/proto/osmosis/lockup/tx.proto create mode 100644 packages/cosmos/proto/osmosis/mint/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/mint/v1beta1/mint.proto create mode 100644 packages/cosmos/proto/osmosis/mint/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/poolincentives/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/poolincentives/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/poolincentives/v1beta1/incentives.proto create mode 100644 packages/cosmos/proto/osmosis/poolincentives/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/poolincentives/v1beta1/shared.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/module_route.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.yml create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/swap_route.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/tracked_volume.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v2/query.proto create mode 100644 packages/cosmos/proto/osmosis/poolmanager/v2/query.yml create mode 100644 packages/cosmos/proto/osmosis/protorev/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/protorev/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/protorev/v1beta1/params.proto create mode 100644 packages/cosmos/proto/osmosis/protorev/v1beta1/protorev.proto create mode 100644 packages/cosmos/proto/osmosis/protorev/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/protorev/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/smartaccount/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/smartaccount/v1beta1/models.proto create mode 100644 packages/cosmos/proto/osmosis/smartaccount/v1beta1/params.proto create mode 100644 packages/cosmos/proto/osmosis/smartaccount/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/smartaccount/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/store/v1beta1/tree.proto create mode 100644 packages/cosmos/proto/osmosis/superfluid/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/superfluid/params.proto create mode 100644 packages/cosmos/proto/osmosis/superfluid/query.proto create mode 100644 packages/cosmos/proto/osmosis/superfluid/superfluid.proto create mode 100644 packages/cosmos/proto/osmosis/superfluid/tx.proto create mode 100644 packages/cosmos/proto/osmosis/superfluid/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto create mode 100644 packages/cosmos/proto/osmosis/tokenfactory/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/tokenfactory/v1beta1/params.proto create mode 100644 packages/cosmos/proto/osmosis/tokenfactory/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/tokenfactory/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/twap/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/twap/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/twap/v1beta1/query.yml create mode 100644 packages/cosmos/proto/osmosis/twap/v1beta1/twap_record.proto create mode 100644 packages/cosmos/proto/osmosis/txfees/v1beta1/feetoken.proto create mode 100644 packages/cosmos/proto/osmosis/txfees/v1beta1/genesis.proto create mode 100644 packages/cosmos/proto/osmosis/txfees/v1beta1/gov.proto create mode 100644 packages/cosmos/proto/osmosis/txfees/v1beta1/params.proto create mode 100644 packages/cosmos/proto/osmosis/txfees/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/txfees/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.proto create mode 100644 packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.yml create mode 100644 packages/cosmos/proto/osmosis/valsetpref/v1beta1/state.proto create mode 100644 packages/cosmos/proto/osmosis/valsetpref/v1beta1/tx.proto create mode 100644 packages/cosmos/proto/tendermint/abci/types.proto create mode 100644 packages/cosmos/proto/tendermint/crypto/keys.proto create mode 100644 packages/cosmos/proto/tendermint/crypto/proof.proto create mode 100644 packages/cosmos/proto/tendermint/libs/bits/types.proto create mode 100644 packages/cosmos/proto/tendermint/p2p/types.proto create mode 100644 packages/cosmos/proto/tendermint/types/block.proto create mode 100644 packages/cosmos/proto/tendermint/types/evidence.proto create mode 100644 packages/cosmos/proto/tendermint/types/params.proto create mode 100644 packages/cosmos/proto/tendermint/types/types.proto create mode 100644 packages/cosmos/proto/tendermint/types/validator.proto create mode 100644 packages/cosmos/proto/tendermint/version/types.proto create mode 100644 packages/cosmos/proto/tx.proto create mode 100644 packages/cosmos/src/proto_export/amino/amino.ts create mode 100644 packages/cosmos/src/proto_export/binary.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/auth/module/v1/module.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/auth/v1beta1/auth.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/bank/v1beta1/authz.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/bank/v1beta1/bank.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/base/v1beta1/coin.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/bundle.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/client.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/lcd.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/msg/v1/msg.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/rpc.query.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/rpc.tx.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/upgrade.ts create mode 100644 packages/cosmos/src/proto_export/cosmos_proto/bundle.ts create mode 100644 packages/cosmos/src/proto_export/cosmos_proto/cosmos.ts create mode 100644 packages/cosmos/src/proto_export/gogoproto/bundle.ts create mode 100644 packages/cosmos/src/proto_export/gogoproto/gogo.ts create mode 100644 packages/cosmos/src/proto_export/google/api/annotations.ts create mode 100644 packages/cosmos/src/proto_export/google/api/http.ts create mode 100644 packages/cosmos/src/proto_export/google/bundle.ts create mode 100644 packages/cosmos/src/proto_export/google/protobuf/any.ts create mode 100644 packages/cosmos/src/proto_export/google/protobuf/descriptor.ts create mode 100644 packages/cosmos/src/proto_export/google/protobuf/duration.ts create mode 100644 packages/cosmos/src/proto_export/google/protobuf/timestamp.ts create mode 100644 packages/cosmos/src/proto_export/helpers.ts create mode 100644 packages/cosmos/src/proto_export/ibc/applications/transfer/v1/transfer.ts create mode 100644 packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.ts create mode 100644 packages/cosmos/src/proto_export/ibc/applications/transfer/v2/packet.ts create mode 100644 packages/cosmos/src/proto_export/ibc/bundle.ts create mode 100644 packages/cosmos/src/proto_export/ibc/client.ts create mode 100644 packages/cosmos/src/proto_export/ibc/core/client/v1/client.ts create mode 100644 packages/cosmos/src/proto_export/ibc/lcd.ts create mode 100644 packages/cosmos/src/proto_export/ibc/rpc.query.ts create mode 100644 packages/cosmos/src/proto_export/ibc/rpc.tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/bundle.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/client.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/params.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/balancerPool.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/ibchooks/genesis.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/ibchooks/params.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/ibchooks/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/ibchooks/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/ibchooks/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/ibchooks/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/incentives/gauge.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/incentives/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/incentives/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/incentives/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/incentives/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/genesis.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/lock.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/params.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/query.lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/query.rpc.Query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/lockup/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/genesis.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/module_route.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/swap_route.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.rpc.Query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/genesis.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/gov.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/params.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/protorev.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.rpc.Query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/rpc.query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/rpc.tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/genesis.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/models.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/params.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.rpc.Query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/superfluid/superfluid.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/superfluid/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/superfluid/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/superfluid/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/superfluid/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/superfluid/v1beta1/gov.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/authorityMetadata.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/genesis.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/params.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/feetoken.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/genesis.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/gov.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/params.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.rpc.Query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.lcd.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.rpc.Query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/state.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.amino.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.registry.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts create mode 100644 packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.ts create mode 100644 packages/cosmos/src/proto_export/registry.ts create mode 100644 packages/cosmos/src/proto_export/types.ts create mode 100644 packages/cosmos/src/proto_export/utf8.ts create mode 100644 packages/cosmos/src/proto_export/varint.ts create mode 100755 packages/unlink-all-packages.sh diff --git a/.changeset/great-laws-fry.md b/.changeset/great-laws-fry.md new file mode 100644 index 00000000..fb0c4885 --- /dev/null +++ b/.changeset/great-laws-fry.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +use protobuf for cosmos types (remove osmojs dependency) diff --git a/packages/cosmos/.eslintignore b/packages/cosmos/.eslintignore index 2c8fb98c..236722c4 100644 --- a/packages/cosmos/.eslintignore +++ b/packages/cosmos/.eslintignore @@ -2,4 +2,5 @@ dist node_modules jest-setup-file.ts -src/gql/**/*.ts \ No newline at end of file +src/gql/**/*.ts +src/proto_export \ No newline at end of file diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index a56f1bf9..8e4a8522 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -23,7 +23,7 @@ "jest-environment-jsdom": "27.5.1", "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", - "ts-proto": "^1.181.0", + "ts-proto": "^1.181.1", "tsup": "6.6.3", "typescript": "4.8.3" }, @@ -36,10 +36,12 @@ "@cosmjs/proto-signing": "0.32.3", "@cosmjs/stargate": "0.32.3", "@cosmjs/tendermint-rpc": "0.32.3", + "@cosmology/lcd": "^0.13.4", "@cosmos-client/core": "0.47.1", "@keplr-wallet/cosmos": "0.12.82", "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", + "@tanstack/react-query": "^5.51.1", "@terra-money/feather.js": "2.1.0-beta.3", "@terra-money/terra.proto": "5.3.0-beta.0", "@xdefi-tech/chains-core": "*", @@ -51,7 +53,6 @@ "ethers": "5.6.4", "lodash": "4.17.21", "os-browserify": "0.3.0", - "osmojs": "16.14.0", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", "rxjs": "7.8.0", diff --git a/packages/cosmos/proto/amino/amino.proto b/packages/cosmos/proto/amino/amino.proto new file mode 100644 index 00000000..e1cc6929 --- /dev/null +++ b/packages/cosmos/proto/amino/amino.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package amino; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; + +extend google.protobuf.MessageOptions { + // name is the string used when registering a concrete + // type into the Amino type registry, via the Amino codec's + // `RegisterConcrete()` method. This string MUST be at most 39 + // characters long, or else the message will be rejected by the + // Ledger hardware device. + string name = 11110001; + + // encoding describes the encoding format used by Amino for the given + // message. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the `encoding` + // one which operates on the field level. + string message_encoding = 11110002; +} + +extend google.protobuf.FieldOptions { + // encoding describes the encoding format used by Amino for + // the given field. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the + // `message_encoding` one which operates on the message level. + string encoding = 11110003; + + // field_name sets a different field name (i.e. key name) in + // the amino JSON object for the given field. + // + // Example: + // + // message Foo { + // string bar = 1 [(amino.field_name) = "baz"]; + // } + // + // Then the Amino encoding of Foo will be: + // `{"baz":"some value"}` + string field_name = 11110004; + + // dont_omitempty sets the field in the JSON object even if + // its value is empty, i.e. equal to the Golang zero value. To learn what + // the zero values are, see https://go.dev/ref/spec#The_zero_value. + // + // Fields default to `omitempty`, which is the default behavior when this + // annotation is unset. When set to true, then the field value in the + // JSON object will be set, i.e. not `undefined`. + // + // Example: + // + // message Foo { + // string bar = 1; + // string baz = 2 [(amino.dont_omitempty) = true]; + // } + // + // f := Foo{}; + // out := AminoJSONEncoder(&f); + // out == {"baz":""} + bool dont_omitempty = 11110005; +} diff --git a/packages/cosmos/proto/cosmos/app/runtime/v1alpha1/module.proto b/packages/cosmos/proto/cosmos/app/runtime/v1alpha1/module.proto new file mode 100644 index 00000000..4598ba44 --- /dev/null +++ b/packages/cosmos/proto/cosmos/app/runtime/v1alpha1/module.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package cosmos.app.runtime.v1alpha1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the runtime module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/runtime" + use_package: {name: "cosmos.app.v1alpha1"} + }; + + // app_name is the name of the app. + string app_name = 1; + + // begin_blockers specifies the module names of begin blockers + // to call in the order in which they should be called. If this is left empty + // no begin blocker will be registered. + repeated string begin_blockers = 2; + + // end_blockers specifies the module names of the end blockers + // to call in the order in which they should be called. If this is left empty + // no end blocker will be registered. + repeated string end_blockers = 3; + + // init_genesis specifies the module names of init genesis functions + // to call in the order in which they should be called. If this is left empty + // no init genesis function will be registered. + repeated string init_genesis = 4; + + // export_genesis specifies the order in which to export module genesis data. + // If this is left empty, the init_genesis order will be used for export genesis + // if it is specified. + repeated string export_genesis = 5; + + // override_store_keys is an optional list of overrides for the module store keys + // to be used in keeper construction. + repeated StoreKeyConfig override_store_keys = 6; +} + +// StoreKeyConfig may be supplied to override the default module store key, which +// is the module name. +message StoreKeyConfig { + // name of the module to override the store key of + string module_name = 1; + + // the kv store key to use instead of the module name. + string kv_store_key = 2; +} diff --git a/packages/cosmos/proto/cosmos/app/v1alpha1/config.proto b/packages/cosmos/proto/cosmos/app/v1alpha1/config.proto new file mode 100644 index 00000000..ee3e7065 --- /dev/null +++ b/packages/cosmos/proto/cosmos/app/v1alpha1/config.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/any.proto"; + +// Config represents the configuration for a Cosmos SDK ABCI app. +// It is intended that all state machine logic including the version of +// baseapp and tx handlers (and possibly even Tendermint) that an app needs +// can be described in a config object. For compatibility, the framework should +// allow a mixture of declarative and imperative app wiring, however, apps +// that strive for the maximum ease of maintainability should be able to describe +// their state machine with a config object alone. +message Config { + // modules are the module configurations for the app. + repeated ModuleConfig modules = 1; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is global (not module specific). + repeated GolangBinding golang_bindings = 2; +} + +// ModuleConfig is a module configuration for an app. +message ModuleConfig { + // name is the unique name of the module within the app. It should be a name + // that persists between different versions of a module so that modules + // can be smoothly upgraded to new versions. + // + // For example, for the module cosmos.bank.module.v1.Module, we may chose + // to simply name the module "bank" in the app. When we upgrade to + // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + // and the framework knows that the v2 module should receive all the same state + // that the v1 module had. Note: modules should provide info on which versions + // they can migrate from in the ModuleDescriptor.can_migration_from field. + string name = 1; + + // config is the config object for the module. Module config messages should + // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + google.protobuf.Any config = 2; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is module specific. + repeated GolangBinding golang_bindings = 3; +} + +// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +message GolangBinding { + // interface_type is the interface type which will be bound to a specific implementation type + string interface_type = 1; + + // implementation is the implementing type which will be supplied when an input of type interface is requested + string implementation = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/app/v1alpha1/module.proto b/packages/cosmos/proto/cosmos/app/v1alpha1/module.proto new file mode 100644 index 00000000..99085717 --- /dev/null +++ b/packages/cosmos/proto/cosmos/app/v1alpha1/module.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module indicates that this proto type is a config object for an app module + // and optionally provides other descriptive information about the module. + // It is recommended that a new module config object and go module is versioned + // for every state machine breaking version of a module. The recommended + // pattern for doing this is to put module config objects in a separate proto + // package from the API they expose. Ex: the cosmos.group.v1 API would be + // exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc. + ModuleDescriptor module = 57193479; +} + +// ModuleDescriptor describes an app module. +message ModuleDescriptor { + // go_import names the package that should be imported by an app to load the + // module in the runtime module registry. It is required to make debugging + // of configuration errors easier for users. + string go_import = 1; + + // use_package refers to a protobuf package that this module + // uses and exposes to the world. In an app, only one module should "use" + // or own a single protobuf package. It is assumed that the module uses + // all of the .proto files in a single package. + repeated PackageReference use_package = 2; + + // can_migrate_from defines which module versions this module can migrate + // state from. The framework will check that one module version is able to + // migrate from a previous module version before attempting to update its + // config. It is assumed that modules can transitively migrate from earlier + // versions. For instance if v3 declares it can migrate from v2, and v2 + // declares it can migrate from v1, the framework knows how to migrate + // from v1 to v3, assuming all 3 module versions are registered at runtime. + repeated MigrateFromInfo can_migrate_from = 3; +} + +// PackageReference is a reference to a protobuf package used by a module. +message PackageReference { + // name is the fully-qualified name of the package. + string name = 1; + + // revision is the optional revision of the package that is being used. + // Protobuf packages used in Cosmos should generally have a major version + // as the last part of the package name, ex. foo.bar.baz.v1. + // The revision of a package can be thought of as the minor version of a + // package which has additional backwards compatible definitions that weren't + // present in a previous version. + // + // A package should indicate its revision with a source code comment + // above the package declaration in one of its files containing the + // text "Revision N" where N is an integer revision. All packages start + // at revision 0 the first time they are released in a module. + // + // When a new version of a module is released and items are added to existing + // .proto files, these definitions should contain comments of the form + // "Since Revision N" where N is an integer revision. + // + // When the module runtime starts up, it will check the pinned proto + // image and panic if there are runtime protobuf definitions that are not + // in the pinned descriptor which do not have + // a "Since Revision N" comment or have a "Since Revision N" comment where + // N is <= to the revision specified here. This indicates that the protobuf + // files have been updated, but the pinned file descriptor hasn't. + // + // If there are items in the pinned file descriptor with a revision + // greater than the value indicated here, this will also cause a panic + // as it may mean that the pinned descriptor for a legacy module has been + // improperly updated or that there is some other versioning discrepancy. + // Runtime protobuf definitions will also be checked for compatibility + // with pinned file descriptors to make sure there are no incompatible changes. + // + // This behavior ensures that: + // * pinned proto images are up-to-date + // * protobuf files are carefully annotated with revision comments which + // are important good client UX + // * protobuf files are changed in backwards and forwards compatible ways + uint32 revision = 2; +} + +// MigrateFromInfo is information on a module version that a newer module +// can migrate from. +message MigrateFromInfo { + + // module is the fully-qualified protobuf name of the module config object + // for the previous module version, ex: "cosmos.group.module.v1.Module". + string module = 1; +} diff --git a/packages/cosmos/proto/cosmos/app/v1alpha1/query.proto b/packages/cosmos/proto/cosmos/app/v1alpha1/query.proto new file mode 100644 index 00000000..efec9c81 --- /dev/null +++ b/packages/cosmos/proto/cosmos/app/v1alpha1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "cosmos/app/v1alpha1/config.proto"; + +// Query is the app module query service. +service Query { + + // Config returns the current app config. + rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} +} + +// QueryConfigRequest is the Query/Config request type. +message QueryConfigRequest {} + +// QueryConfigRequest is the Query/Config response type. +message QueryConfigResponse { + + // config is the current app config. + Config config = 1; +} diff --git a/packages/cosmos/proto/cosmos/auth/module/v1/module.proto b/packages/cosmos/proto/cosmos/auth/module/v1/module.proto new file mode 100644 index 00000000..dbe46a15 --- /dev/null +++ b/packages/cosmos/proto/cosmos/auth/module/v1/module.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package cosmos.auth.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the auth module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth" + }; + + // bech32_prefix is the bech32 account prefix for the app. + string bech32_prefix = 1; + + // module_account_permissions are module account permissions. + repeated ModuleAccountPermission module_account_permissions = 2; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 3; +} + +// ModuleAccountPermission represents permissions for a module account. +message ModuleAccountPermission { + // account is the name of the module. + string account = 1; + + // permissions are the permissions this module has. Currently recognized + // values are minter, burner and staking. + repeated string permissions = 2; +} diff --git a/packages/cosmos/proto/cosmos/auth/v1beta1/auth.proto b/packages/cosmos/proto/cosmos/auth/v1beta1/auth.proto new file mode 100644 index 00000000..0578453c --- /dev/null +++ b/packages/cosmos/proto/cosmos/auth/v1beta1/auth.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// BaseAccount defines a base account type. It contains all the necessary fields +// for basic account functionality. Any custom account type should extend this +// type for additional functionality (e.g. vesting). +message BaseAccount { + option (amino.name) = "cosmos-sdk/BaseAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"]; + uint64 account_number = 3; + uint64 sequence = 4; +} + +// ModuleAccount defines an account for modules that holds coins on a pool. +message ModuleAccount { + option (amino.name) = "cosmos-sdk/ModuleAccount"; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.ModuleAccountI"; + + BaseAccount base_account = 1 [(gogoproto.embed) = true]; + string name = 2; + repeated string permissions = 3; +} + +// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +// +// Since: cosmos-sdk 0.47 +message ModuleCredential { + // module_name is the name of the module used for address derivation (passed into address.Module). + string module_name = 1; + // derivation_keys is for deriving a module account address (passed into address.Module) + // adding more keys creates sub-account addresses (passed into address.Derive) + repeated bytes derivation_keys = 2; +} + +// Params defines the parameters for the auth module. +message Params { + option (amino.name) = "cosmos-sdk/x/auth/Params"; + option (gogoproto.equal) = true; + + uint64 max_memo_characters = 1; + uint64 tx_sig_limit = 2; + uint64 tx_size_cost_per_byte = 3; + uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"]; + uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; +} diff --git a/packages/cosmos/proto/cosmos/auth/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/auth/v1beta1/genesis.proto new file mode 100644 index 00000000..d1aa66e4 --- /dev/null +++ b/packages/cosmos/proto/cosmos/auth/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/auth/v1beta1/auth.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// GenesisState defines the auth module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // accounts are the accounts present at genesis. + repeated google.protobuf.Any accounts = 2; +} diff --git a/packages/cosmos/proto/cosmos/auth/v1beta1/query.proto b/packages/cosmos/proto/cosmos/auth/v1beta1/query.proto new file mode 100644 index 00000000..804f2ff0 --- /dev/null +++ b/packages/cosmos/proto/cosmos/auth/v1beta1/query.proto @@ -0,0 +1,236 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Query defines the gRPC querier service. +service Query { + // Accounts returns all the existing accounts. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.43 + rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; + } + + // Account returns account details based on address. + rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + } + + // AccountAddressByID returns account address based on account number. + // + // Since: cosmos-sdk 0.46.2 + rpc AccountAddressByID(QueryAccountAddressByIDRequest) returns (QueryAccountAddressByIDResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; + } + + // Params queries all parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + } + + // ModuleAccounts returns all the existing module accounts. + // + // Since: cosmos-sdk 0.46 + rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; + } + + // ModuleAccountByName returns the module account info by module name + rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; + } + + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 + rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32"; + } + + // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 + rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}"; + } + + // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 + rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}"; + } + + // AccountInfo queries account info which is common to all account types. + // + // Since: cosmos-sdk 0.47 + rpc AccountInfo(QueryAccountInfoRequest) returns (QueryAccountInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/account_info/{address}"; + } +} + +// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsResponse { + // accounts are the existing accounts + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address defines the address to query for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountResponse is the response type for the Query/Account RPC method. +message QueryAccountResponse { + // account defines the account of the corresponding address. + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryModuleAccountsRequest {} + +// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryModuleAccountsResponse { + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; +} + +// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. +message QueryModuleAccountByNameRequest { + string name = 1; +} + +// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +message QueryModuleAccountByNameResponse { + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; +} + +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +message Bech32PrefixRequest {} + +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +message Bech32PrefixResponse { + string bech32_prefix = 1; +} + +// AddressBytesToStringRequest is the request type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressBytesToStringRequest { + bytes address_bytes = 1; +} + +// AddressBytesToStringResponse is the response type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressBytesToStringResponse { + string address_string = 1; +} + +// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressStringToBytesRequest { + string address_string = 1; +} + +// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressStringToBytesResponse { + bytes address_bytes = 1; +} + +// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDRequest { + // Deprecated, use account_id instead + // + // id is the account number of the address to be queried. This field + // should have been an uint64 (like all account numbers), and will be + // updated to uint64 in a future version of the auth query. + int64 id = 1 [deprecated = true]; + + // account_id is the account number of the address to be queried. + // + // Since: cosmos-sdk 0.47 + uint64 account_id = 2; +} + +// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDResponse { + string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountInfoRequest is the Query/AccountInfo request type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoRequest { + + // address is the account address string. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountInfoResponse is the Query/AccountInfo response type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoResponse { + + // info is the account info which is represented by BaseAccount. + BaseAccount info = 1; +} diff --git a/packages/cosmos/proto/cosmos/auth/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/auth/v1beta1/tx.proto new file mode 100644 index 00000000..1edee037 --- /dev/null +++ b/packages/cosmos/proto/cosmos/auth/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Msg defines the x/auth Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the x/auth module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/auth/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/auth parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/packages/cosmos/proto/cosmos/authz/module/v1/module.proto b/packages/cosmos/proto/cosmos/authz/module/v1/module.proto new file mode 100644 index 00000000..80058668 --- /dev/null +++ b/packages/cosmos/proto/cosmos/authz/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.authz.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the authz module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/authz" + }; +} diff --git a/packages/cosmos/proto/cosmos/authz/v1beta1/authz.proto b/packages/cosmos/proto/cosmos/authz/v1beta1/authz.proto new file mode 100644 index 00000000..3fee7364 --- /dev/null +++ b/packages/cosmos/proto/cosmos/authz/v1beta1/authz.proto @@ -0,0 +1,48 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +option (gogoproto.goproto_getters_all) = false; + +// GenericAuthorization gives the grantee unrestricted permissions to execute +// the provided method on behalf of the granter's account. +message GenericAuthorization { + option (amino.name) = "cosmos-sdk/GenericAuthorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + + // Msg, identified by it's type URL, to grant unrestricted permissions to execute + string msg = 1; +} + +// Grant gives permissions to execute +// the provide method with expiration time. +message Grant { + google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; + // time when the grant will expire and will be pruned. If null, then the grant + // doesn't have a time expiration (other conditions in `authorization` + // may apply to invalidate the grant) + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; +} + +// GrantAuthorization extends a grant with both the addresses of the grantee and granter. +// It is used in genesis.proto and query.proto +message GrantAuthorization { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; + google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true]; +} + +// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +message GrantQueueItem { + // msg_type_urls contains the list of TypeURL of a sdk.Msg. + repeated string msg_type_urls = 1; +} diff --git a/packages/cosmos/proto/cosmos/authz/v1beta1/event.proto b/packages/cosmos/proto/cosmos/authz/v1beta1/event.proto new file mode 100644 index 00000000..0476649a --- /dev/null +++ b/packages/cosmos/proto/cosmos/authz/v1beta1/event.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// EventGrant is emitted on Msg/Grant +message EventGrant { + // Msg type URL for which an autorization is granted + string msg_type_url = 2; + // Granter account address + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Grantee account address + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventRevoke is emitted on Msg/Revoke +message EventRevoke { + // Msg type URL for which an autorization is revoked + string msg_type_url = 2; + // Granter account address + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Grantee account address + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/packages/cosmos/proto/cosmos/authz/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/authz/v1beta1/genesis.proto new file mode 100644 index 00000000..9fefff45 --- /dev/null +++ b/packages/cosmos/proto/cosmos/authz/v1beta1/genesis.proto @@ -0,0 +1,14 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// GenesisState defines the authz module's genesis state. +message GenesisState { + repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/authz/v1beta1/query.proto b/packages/cosmos/proto/cosmos/authz/v1beta1/query.proto new file mode 100644 index 00000000..62154ac1 --- /dev/null +++ b/packages/cosmos/proto/cosmos/authz/v1beta1/query.proto @@ -0,0 +1,82 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// Query defines the gRPC querier service. +service Query { + // Returns list of `Authorization`, granted to the grantee by the granter. + rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants"; + } + + // GranterGrants returns list of `GrantAuthorization`, granted by granter. + // + // Since: cosmos-sdk 0.46 + rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}"; + } + + // GranteeGrants returns a list of `GrantAuthorization` by grantee. + // + // Since: cosmos-sdk 0.46 + rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}"; + } +} + +// QueryGrantsRequest is the request type for the Query/Grants RPC method. +message QueryGrantsRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Optional, msg_type_url, when set, will query only grants matching given msg type. + string msg_type_url = 3; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +message QueryGrantsResponse { + // authorizations is a list of grants granted for grantee by granter. + repeated Grant grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. +message QueryGranterGrantsRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. +message QueryGranterGrantsResponse { + // grants is a list of grants granted by the granter. + repeated GrantAuthorization grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +message QueryGranteeGrantsRequest { + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. +message QueryGranteeGrantsResponse { + // grants is a list of grants granted to the grantee. + repeated GrantAuthorization grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/cosmos/proto/cosmos/authz/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/authz/v1beta1/tx.proto new file mode 100644 index 00000000..69277c95 --- /dev/null +++ b/packages/cosmos/proto/cosmos/authz/v1beta1/tx.proto @@ -0,0 +1,81 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the authz Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Grant grants the provided authorization to the grantee on the granter's + // account with the provided expiration time. If there is already a grant + // for the given (granter, grantee, Authorization) triple, then the grant + // will be overwritten. + rpc Grant(MsgGrant) returns (MsgGrantResponse); + + // Exec attempts to execute the provided messages using + // authorizations granted to the grantee. Each message should have only + // one signer corresponding to the granter of the authorization. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // Revoke revokes any authorization corresponding to the provided method name on the + // granter's account that has been granted to the grantee. + rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); +} + +// MsgGrant is a request type for Grant method. It declares authorization to the grantee +// on behalf of the granter with the provided expiration time. +message MsgGrant { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrant"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgExecResponse defines the Msg/MsgExecResponse response type. +message MsgExecResponse { + repeated bytes results = 1; +} + +// MsgExec attempts to execute the provided messages using +// authorizations granted to the grantee. Each message should have only +// one signer corresponding to the granter of the authorization. +message MsgExec { + option (cosmos.msg.v1.signer) = "grantee"; + option (amino.name) = "cosmos-sdk/MsgExec"; + + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Execute Msg. + // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + // triple and validate it. + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; +} + +// MsgGrantResponse defines the Msg/MsgGrant response type. +message MsgGrantResponse {} + +// MsgRevoke revokes any authorization with the provided sdk.Msg type on the +// granter's account with that has been granted to the grantee. +message MsgRevoke { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevoke"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string msg_type_url = 3; +} + +// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +message MsgRevokeResponse {} diff --git a/packages/cosmos/proto/cosmos/autocli/v1/options.proto b/packages/cosmos/proto/cosmos/autocli/v1/options.proto new file mode 100644 index 00000000..55877512 --- /dev/null +++ b/packages/cosmos/proto/cosmos/autocli/v1/options.proto @@ -0,0 +1,127 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// ModuleOptions describes the CLI options for a Cosmos SDK module. +message ModuleOptions { + // tx describes the tx command for the module. + ServiceCommandDescriptor tx = 1; + + // query describes the tx command for the module. + ServiceCommandDescriptor query = 2; +} + +// ServiceCommandDescriptor describes a CLI command based on a protobuf service. +message ServiceCommandDescriptor { + + // service is the fully qualified name of the protobuf service to build + // the command from. It can be left empty if sub_commands are used instead + // which may be the case if a module provides multiple tx and/or query services. + string service = 1; + + // rpc_command_options are options for commands generated from rpc methods. + // If no options are specified for a given rpc method on the service, a + // command will be generated for that method with the default options. + repeated RpcCommandOptions rpc_command_options = 2; + + // sub_commands is a map of optional sub-commands for this command based on + // different protobuf services. The map key is used as the name of the + // sub-command. + map sub_commands = 3; +} + +// RpcCommandOptions specifies options for commands generated from protobuf +// rpc methods. +message RpcCommandOptions { + // rpc_method is short name of the protobuf rpc method that this command is + // generated from. + string rpc_method = 1; + + // use is the one-line usage method. It also allows specifying an alternate + // name for the command as the first word of the usage text. + // + // By default the name of an rpc command is the kebab-case short name of the + // rpc method. + string use = 2; + + // long is the long message shown in the 'help ' output. + string long = 3; + + // short is the short description shown in the 'help' output. + string short = 4; + + // example is examples of how to use the command. + string example = 5; + + // alias is an array of aliases that can be used instead of the first word in Use. + repeated string alias = 6; + + // suggest_for is an array of command names for which this command will be suggested - + // similar to aliases but only suggests. + repeated string suggest_for = 7; + + // deprecated defines, if this command is deprecated and should print this string when used. + string deprecated = 8; + + // version defines the version for this command. If this value is non-empty and the command does not + // define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + // will print content of the "Version" variable. A shorthand "v" flag will also be added if the + // command does not define one. + string version = 9; + + // flag_options are options for flags generated from rpc request fields. + // By default all request fields are configured as flags. They can + // also be configured as positional args instead using positional_args. + map flag_options = 10; + + // positional_args specifies positional arguments for the command. + repeated PositionalArgDescriptor positional_args = 11; + + // skip specifies whether to skip this rpc method when generating commands. + bool skip = 12; +} + +// FlagOptions are options for flags generated from rpc request fields. +// By default, all request fields are configured as flags based on the +// kebab-case name of the field. Fields can be turned into positional arguments +// instead by using RpcCommandOptions.positional_args. +message FlagOptions { + + // name is an alternate name to use for the field flag. + string name = 1; + + // shorthand is a one-letter abbreviated flag. + string shorthand = 2; + + // usage is the help message. + string usage = 3; + + // default_value is the default value as text. + string default_value = 4; + + // default value is the default value as text if the flag is used without any value. + string no_opt_default_value = 5; + + // deprecated is the usage text to show if this flag is deprecated. + string deprecated = 6; + + // shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. + string shorthand_deprecated = 7; + + // hidden hides the flag from help/usage text + bool hidden = 8; +} + +// PositionalArgDescriptor describes a positional argument. +message PositionalArgDescriptor { + // proto_field specifies the proto field to use as the positional arg. Any + // fields used as positional args will not have a flag generated. + string proto_field = 1; + + // varargs makes a positional parameter a varargs parameter. This can only be + // applied to last positional parameter and the proto_field must a repeated + // field. + bool varargs = 2; +} diff --git a/packages/cosmos/proto/cosmos/autocli/v1/query.proto b/packages/cosmos/proto/cosmos/autocli/v1/query.proto new file mode 100644 index 00000000..a998978e --- /dev/null +++ b/packages/cosmos/proto/cosmos/autocli/v1/query.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +import "cosmos/autocli/v1/options.proto"; +import "cosmos/query/v1/query.proto"; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// RemoteInfoService provides clients with the information they need +// to build dynamically CLI clients for remote chains. +service Query { + // AppOptions returns the autocli options for all of the modules in an app. + rpc AppOptions(AppOptionsRequest) returns (AppOptionsResponse) { + // NOTE: autocli options SHOULD NOT be part of consensus and module_query_safe + // should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// AppOptionsRequest is the RemoteInfoService/AppOptions request type. +message AppOptionsRequest {} + +// AppOptionsResponse is the RemoteInfoService/AppOptions response type. +message AppOptionsResponse { + // module_options is a map of module name to autocli module options. + map module_options = 1; +} diff --git a/packages/cosmos/proto/cosmos/bank/module/v1/module.proto b/packages/cosmos/proto/cosmos/bank/module/v1/module.proto new file mode 100644 index 00000000..51e3158b --- /dev/null +++ b/packages/cosmos/proto/cosmos/bank/module/v1/module.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.bank.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the bank module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/bank" + }; + + // blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. + // If left empty it defaults to the list of account names supplied in the auth module configuration as + // module_account_permissions + repeated string blocked_module_accounts_override = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/bank/v1beta1/authz.proto b/packages/cosmos/proto/cosmos/bank/v1beta1/authz.proto new file mode 100644 index 00000000..a8303536 --- /dev/null +++ b/packages/cosmos/proto/cosmos/bank/v1beta1/authz.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// SendAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account. +// +// Since: cosmos-sdk 0.43 +message SendAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/SendAuthorization"; + + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + // granter. If omitted, any recipient is allowed. + // + // Since: cosmos-sdk 0.47 + repeated string allow_list = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/packages/cosmos/proto/cosmos/bank/v1beta1/bank.proto b/packages/cosmos/proto/cosmos/bank/v1beta1/bank.proto new file mode 100644 index 00000000..f81bb923 --- /dev/null +++ b/packages/cosmos/proto/cosmos/bank/v1beta1/bank.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Params defines the parameters for the bank module. +message Params { + option (amino.name) = "cosmos-sdk/x/bank/Params"; + option (gogoproto.goproto_stringer) = false; + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + repeated SendEnabled send_enabled = 1 [deprecated = true]; + bool default_send_enabled = 2; +} + +// SendEnabled maps coin denom to a send_enabled status (whether a denom is +// sendable). +message SendEnabled { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + string denom = 1; + bool enabled = 2; +} + +// Input models transaction input. +message Input { + option (cosmos.msg.v1.signer) = "address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Output models transaction outputs. +message Output { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Supply represents a struct that passively keeps track of the total supply +// amounts in the network. +// This message is deprecated now that supply is indexed by denom. +message Supply { + option deprecated = true; + + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.bank.v1beta1.SupplyI"; + + repeated cosmos.base.v1beta1.Coin total = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// DenomUnit represents a struct that describes a given +// denomination unit of the basic token. +message DenomUnit { + // denom represents the string name of the given denom unit (e.g uatom). + string denom = 1; + // exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 10^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + uint32 exponent = 2; + // aliases is a list of string aliases for the given denom + repeated string aliases = 3; +} + +// Metadata represents a struct that describes +// a basic token. +message Metadata { + string description = 1; + // denom_units represents the list of DenomUnit's for a given coin + repeated DenomUnit denom_units = 2; + // base represents the base denom (should be the DenomUnit with exponent = 0). + string base = 3; + // display indicates the suggested denom that should be + // displayed in clients. + string display = 4; + // name defines the name of the token (eg: Cosmos Atom) + // + // Since: cosmos-sdk 0.43 + string name = 5; + // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + // + // Since: cosmos-sdk 0.43 + string symbol = 6; + // URI to a document (on or off-chain) that contains additional information. Optional. + // + // Since: cosmos-sdk 0.46 + string uri = 7 [(gogoproto.customname) = "URI"]; + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + // + // Since: cosmos-sdk 0.46 + string uri_hash = 8 [(gogoproto.customname) = "URIHash"]; +} diff --git a/packages/cosmos/proto/cosmos/bank/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/bank/v1beta1/genesis.proto new file mode 100644 index 00000000..34214cfb --- /dev/null +++ b/packages/cosmos/proto/cosmos/bank/v1beta1/genesis.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// GenesisState defines the bank module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // balances is an array containing the balances of all the accounts. + repeated Balance balances = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + repeated cosmos.base.v1beta1.Coin supply = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // denom_metadata defines the metadata of the different coins. + repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 + repeated SendEnabled send_enabled = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Balance defines an account address and balance pair used in the bank module's +// genesis state. +message Balance { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the balance holder. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // coins defines the different coins this balance holds. + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/packages/cosmos/proto/cosmos/bank/v1beta1/query.proto b/packages/cosmos/proto/cosmos/bank/v1beta1/query.proto new file mode 100644 index 00000000..7abc31ba --- /dev/null +++ b/packages/cosmos/proto/cosmos/bank/v1beta1/query.proto @@ -0,0 +1,348 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the balance of a single coin for a single account. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; + } + + // AllBalances queries the balance of all coins for a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; + } + + // SpendableBalances queries the spendable balance of all coins for a single + // account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; + } + + // SpendableBalanceByDenom queries the spendable balance of a single denom for + // a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.47 + rpc SpendableBalanceByDenom(QuerySpendableBalanceByDenomRequest) returns (QuerySpendableBalanceByDenomResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}/by_denom"; + } + + // TotalSupply queries the total supply of all coins. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; + } + + // SupplyOf queries the supply of a single coin. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom"; + } + + // Params queries the parameters of x/bank module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + } + + // DenomsMetadata queries the client metadata of a given coin denomination. + rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; + } + + // DenomsMetadata queries the client metadata for all registered coin + // denominations. + rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; + } + + // DenomOwners queries for all account addresses that own a particular token + // denomination. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + } + + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 + rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +message QueryBalanceRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +message QueryBalanceResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + +// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +message QueryAllBalancesRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC +// method. +message QueryAllBalancesResponse { + // balances is the balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySpendableBalancesRequest defines the gRPC request structure for querying +// an account's spendable balances. +// +// Since: cosmos-sdk 0.46 +message QuerySpendableBalancesRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query spendable balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QuerySpendableBalancesResponse defines the gRPC response structure for querying +// an account's spendable balances. +// +// Since: cosmos-sdk 0.46 +message QuerySpendableBalancesResponse { + // balances is the spendable balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + + +// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC +// method. +message QueryTotalSupplyRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // pagination defines an optional pagination for the request. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC +// method +message QueryTotalSupplyResponse { + // supply is the supply of the coins + repeated cosmos.base.v1beta1.Coin supply = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // pagination defines the pagination in the response. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +message QuerySupplyOfRequest { + // denom is the coin denom to query balances for. + string denom = 1; +} + +// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +message QuerySupplyOfResponse { + // amount is the supply of the coin. + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryParamsRequest defines the request type for querying x/bank parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/bank parameters. +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +message QueryDenomsMetadataRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC +// method. +message QueryDenomsMetadataResponse { + // metadata provides the client information for all the registered tokens. + repeated Metadata metadatas = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +message QueryDenomMetadataRequest { + // denom is the coin denom to query the metadata for. + string denom = 1; +} + +// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +// method. +message QueryDenomMetadataResponse { + // metadata describes and provides all the client information for the requested token. + Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +message QueryDenomOwnersRequest { + // denom defines the coin denomination to query all account holders for. + string denom = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +// +// Since: cosmos-sdk 0.46 +message DenomOwner { + // address defines the address that owns a particular denomination. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // balance is the balance of the denominated coin for an account. + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +// +// Since: cosmos-sdk 0.46 +message QueryDenomOwnersResponse { + repeated DenomOwner denom_owners = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledRequest { + // denoms is the specific denoms you want look up. Leave empty to get all entries. + repeated string denoms = 1; + // pagination defines an optional pagination for the request. This field is + // only read if the denoms field is empty. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledResponse { + repeated SendEnabled send_enabled = 1; + // pagination defines the pagination in the response. This field is only + // populated if the denoms field in the request is empty. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} diff --git a/packages/cosmos/proto/cosmos/bank/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/bank/v1beta1/tx.proto new file mode 100644 index 00000000..5d6926ef --- /dev/null +++ b/packages/cosmos/proto/cosmos/bank/v1beta1/tx.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Send defines a method for sending coins from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); + + // MultiSend defines a method for sending coins from some accounts to other accounts. + rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); + + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 + rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); +} + +// MsgSend represents a message to send coins from one account to another. +message MsgSend { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgSend"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} + +// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +message MsgMultiSend { + option (cosmos.msg.v1.signer) = "inputs"; + option (amino.name) = "cosmos-sdk/MsgMultiSend"; + + option (gogoproto.equal) = false; + + // Inputs, despite being `repeated`, only allows one sender input. This is + // checked in MsgMultiSend's ValidateBasic. + repeated Input inputs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Output outputs = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgMultiSendResponse defines the Msg/MultiSend response type. +message MsgMultiSendResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (amino.name) = "cosmos-sdk/x/bank/MsgUpdateParams"; + + // params defines the x/bank parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabled { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSetSendEnabled"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // send_enabled is the list of entries to add or update. + repeated SendEnabled send_enabled = 2; + + // use_default_for is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + repeated string use_default_for = 3; +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabledResponse {} diff --git a/packages/cosmos/proto/cosmos/base/abci/v1beta1/abci.proto b/packages/cosmos/proto/cosmos/base/abci/v1beta1/abci.proto new file mode 100644 index 00000000..ddaa6356 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/abci/v1beta1/abci.proto @@ -0,0 +1,158 @@ +syntax = "proto3"; +package cosmos.base.abci.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; + +// TxResponse defines a structure containing relevant tx data and metadata. The +// tags are stringified and the log is JSON decoded. +message TxResponse { + option (gogoproto.goproto_getters) = false; + // The block height + int64 height = 1; + // The transaction hash. + string txhash = 2 [(gogoproto.customname) = "TxHash"]; + // Namespace for the Code + string codespace = 3; + // Response code. + uint32 code = 4; + // Result bytes, if any. + string data = 5; + // The output of the application's logger (raw string). May be + // non-deterministic. + string raw_log = 6; + // The output of the application's logger (typed). May be non-deterministic. + repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; + // Additional information. May be non-deterministic. + string info = 8; + // Amount of gas requested for transaction. + int64 gas_wanted = 9; + // Amount of gas consumed by transaction. + int64 gas_used = 10; + // The request transaction bytes. + google.protobuf.Any tx = 11; + // Time of the previous block. For heights > 1, it's the weighted median of + // the timestamps of the valid votes in the block.LastCommit. For height == 1, + // it's genesis time. + string timestamp = 12; + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; +} + +// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +message ABCIMessageLog { + option (gogoproto.stringer) = true; + + uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"]; + string log = 2; + + // Events contains a slice of Event objects that were emitted during some + // execution. + repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; +} + +// StringEvent defines en Event object wrapper where all the attributes +// contain key/value pairs that are strings instead of raw bytes. +message StringEvent { + option (gogoproto.stringer) = true; + + string type = 1; + repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; +} + +// Attribute defines an attribute wrapper where the key and value are +// strings instead of raw bytes. +message Attribute { + string key = 1; + string value = 2; +} + +// GasInfo defines tx execution gas context. +message GasInfo { + // GasWanted is the maximum units of work we allow this tx to perform. + uint64 gas_wanted = 1; + + // GasUsed is the amount of gas actually consumed. + uint64 gas_used = 2; +} + +// Result is the union of ResponseFormat and ResponseCheckTx. +message Result { + option (gogoproto.goproto_getters) = false; + + // Data is any data returned from message or handler execution. It MUST be + // length prefixed in order to separate data from multiple message executions. + // Deprecated. This field is still populated, but prefer msg_response instead + // because it also contains the Msg response typeURL. + bytes data = 1 [deprecated = true]; + + // Log contains the log information from message or handler execution. + string log = 2; + + // Events contains a slice of Event objects that were emitted during message + // or handler execution. + repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; + + // msg_responses contains the Msg handler responses type packed in Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 4; +} + +// SimulationResponse defines the response generated when a transaction is +// successfully simulated. +message SimulationResponse { + GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Result result = 2; +} + +// MsgData defines the data returned in a Result object during message +// execution. +message MsgData { + option deprecated = true; + option (gogoproto.stringer) = true; + + string msg_type = 1; + bytes data = 2; +} + +// TxMsgData defines a list of MsgData. A transaction will have a MsgData object +// for each message. +message TxMsgData { + option (gogoproto.stringer) = true; + + // data field is deprecated and not populated. + repeated MsgData data = 1 [deprecated = true]; + + // msg_responses contains the Msg handler responses packed into Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 2; +} + +// SearchTxsResult defines a structure for querying txs pageable +message SearchTxsResult { + option (gogoproto.stringer) = true; + + // Count of all txs + uint64 total_count = 1; + // Count of txs in current page + uint64 count = 2; + // Index of current page, start from 1 + uint64 page_number = 3; + // Count of total pages + uint64 page_total = 4; + // Max count txs per page + uint64 limit = 5; + // List of txs in current page + repeated TxResponse txs = 6; +} diff --git a/packages/cosmos/proto/cosmos/base/kv/v1beta1/kv.proto b/packages/cosmos/proto/cosmos/base/kv/v1beta1/kv.proto new file mode 100644 index 00000000..4e9b8d28 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/kv/v1beta1/kv.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.base.kv.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/kv"; + +// Pairs defines a repeated slice of Pair objects. +message Pairs { + repeated Pair pairs = 1 [(gogoproto.nullable) = false]; +} + +// Pair defines a key/value bytes tuple. +message Pair { + bytes key = 1; + bytes value = 2; +} diff --git a/packages/cosmos/proto/cosmos/base/node/v1beta1/query.proto b/packages/cosmos/proto/cosmos/base/node/v1beta1/query.proto new file mode 100644 index 00000000..8070f7b9 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/node/v1beta1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.base.node.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/node"; + +// Service defines the gRPC querier service for node related queries. +service Service { + // Config queries for the operator configuration. + rpc Config(ConfigRequest) returns (ConfigResponse) { + option (google.api.http).get = "/cosmos/base/node/v1beta1/config"; + } +} + +// ConfigRequest defines the request structure for the Config gRPC query. +message ConfigRequest {} + +// ConfigResponse defines the response structure for the Config gRPC query. +message ConfigResponse { + string minimum_gas_price = 1; +} diff --git a/packages/cosmos/proto/cosmos/base/query/v1beta1/pagination.proto b/packages/cosmos/proto/cosmos/base/query/v1beta1/pagination.proto new file mode 100644 index 00000000..0a368144 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/query/v1beta1/pagination.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package cosmos.base.query.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +// PageRequest is to be embedded in gRPC request messages for efficient +// pagination. Ex: +// +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } +message PageRequest { + // key is a value returned in PageResponse.next_key to begin + // querying the next page most efficiently. Only one of offset or key + // should be set. + bytes key = 1; + + // offset is a numeric offset that can be used when key is unavailable. + // It is less efficient than using key. Only one of offset or key should + // be set. + uint64 offset = 2; + + // limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + uint64 limit = 3; + + // count_total is set to true to indicate that the result set should include + // a count of the total number of items available for pagination in UIs. + // count_total is only respected when offset is used. It is ignored when key + // is set. + bool count_total = 4; + + // reverse is set to true if results are to be returned in the descending order. + // + // Since: cosmos-sdk 0.43 + bool reverse = 5; +} + +// PageResponse is to be embedded in gRPC response messages where the +// corresponding request message has used PageRequest. +// +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } +message PageResponse { + // next_key is the key to be passed to PageRequest.key to + // query the next page most efficiently. It will be empty if + // there are no more results. + bytes next_key = 1; + + // total is total number of results available if PageRequest.count_total + // was set, its value is undefined otherwise + uint64 total = 2; +} diff --git a/packages/cosmos/proto/cosmos/base/reflection/v1beta1/reflection.proto b/packages/cosmos/proto/cosmos/base/reflection/v1beta1/reflection.proto new file mode 100644 index 00000000..22670e72 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/reflection/v1beta1/reflection.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package cosmos.base.reflection.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection"; + +// ReflectionService defines a service for interface reflection. +service ReflectionService { + // ListAllInterfaces lists all the interfaces registered in the interface + // registry. + rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces"; + }; + + // ListImplementations list all the concrete types that implement a given + // interface. + rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/" + "{interface_name}/implementations"; + }; +} + +// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. +message ListAllInterfacesRequest {} + +// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +message ListAllInterfacesResponse { + // interface_names is an array of all the registered interfaces. + repeated string interface_names = 1; +} + +// ListImplementationsRequest is the request type of the ListImplementations +// RPC. +message ListImplementationsRequest { + // interface_name defines the interface to query the implementations for. + string interface_name = 1; +} + +// ListImplementationsResponse is the response type of the ListImplementations +// RPC. +message ListImplementationsResponse { + repeated string implementation_message_names = 1; +} diff --git a/packages/cosmos/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/packages/cosmos/proto/cosmos/base/reflection/v2alpha1/reflection.proto new file mode 100644 index 00000000..d5b04855 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/reflection/v2alpha1/reflection.proto @@ -0,0 +1,218 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.base.reflection.v2alpha1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"; + +// AppDescriptor describes a cosmos-sdk based application +message AppDescriptor { + // AuthnDescriptor provides information on how to authenticate transactions on the application + // NOTE: experimental and subject to change in future releases. + AuthnDescriptor authn = 1; + // chain provides the chain descriptor + ChainDescriptor chain = 2; + // codec provides metadata information regarding codec related types + CodecDescriptor codec = 3; + // configuration provides metadata information regarding the sdk.Config type + ConfigurationDescriptor configuration = 4; + // query_services provides metadata information regarding the available queriable endpoints + QueryServicesDescriptor query_services = 5; + // tx provides metadata information regarding how to send transactions to the given application + TxDescriptor tx = 6; +} + +// TxDescriptor describes the accepted transaction type +message TxDescriptor { + // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + // it is not meant to support polymorphism of transaction types, it is supposed to be used by + // reflection clients to understand if they can handle a specific transaction type in an application. + string fullname = 1; + // msgs lists the accepted application messages (sdk.Msg) + repeated MsgDescriptor msgs = 2; +} + +// AuthnDescriptor provides information on how to sign transactions without relying +// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures +message AuthnDescriptor { + // sign_modes defines the supported signature algorithm + repeated SigningModeDescriptor sign_modes = 1; +} + +// SigningModeDescriptor provides information on a signing flow of the application +// NOTE(fdymylja): here we could go as far as providing an entire flow on how +// to sign a message given a SigningModeDescriptor, but it's better to think about +// this another time +message SigningModeDescriptor { + // name defines the unique name of the signing mode + string name = 1; + // number is the unique int32 identifier for the sign_mode enum + int32 number = 2; + // authn_info_provider_method_fullname defines the fullname of the method to call to get + // the metadata required to authenticate using the provided sign_modes + string authn_info_provider_method_fullname = 3; +} + +// ChainDescriptor describes chain information of the application +message ChainDescriptor { + // id is the chain id + string id = 1; +} + +// CodecDescriptor describes the registered interfaces and provides metadata information on the types +message CodecDescriptor { + // interfaces is a list of the registerted interfaces descriptors + repeated InterfaceDescriptor interfaces = 1; +} + +// InterfaceDescriptor describes the implementation of an interface +message InterfaceDescriptor { + // fullname is the name of the interface + string fullname = 1; + // interface_accepting_messages contains information regarding the proto messages which contain the interface as + // google.protobuf.Any field + repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2; + // interface_implementers is a list of the descriptors of the interface implementers + repeated InterfaceImplementerDescriptor interface_implementers = 3; +} + +// InterfaceImplementerDescriptor describes an interface implementer +message InterfaceImplementerDescriptor { + // fullname is the protobuf queryable name of the interface implementer + string fullname = 1; + // type_url defines the type URL used when marshalling the type as any + // this is required so we can provide type safe google.protobuf.Any marshalling and + // unmarshalling, making sure that we don't accept just 'any' type + // in our interface fields + string type_url = 2; +} + +// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains +// an interface represented as a google.protobuf.Any +message InterfaceAcceptingMessageDescriptor { + // fullname is the protobuf fullname of the type containing the interface + string fullname = 1; + // field_descriptor_names is a list of the protobuf name (not fullname) of the field + // which contains the interface as google.protobuf.Any (the interface is the same, but + // it can be in multiple fields of the same proto message) + repeated string field_descriptor_names = 2; +} + +// ConfigurationDescriptor contains metadata information on the sdk.Config +message ConfigurationDescriptor { + // bech32_account_address_prefix is the account address prefix + string bech32_account_address_prefix = 1; +} + +// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction +message MsgDescriptor { + // msg_type_url contains the TypeURL of a sdk.Msg. + string msg_type_url = 1; +} + +// ReflectionService defines a service for application reflection. +service ReflectionService { + // GetAuthnDescriptor returns information on how to authenticate transactions in the application + // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in + // future releases of the cosmos-sdk. + rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn"; + } + // GetChainDescriptor returns the description of the chain + rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain"; + }; + // GetCodecDescriptor returns the descriptor of the codec of the application + rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec"; + } + // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application + rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration"; + } + // GetQueryServicesDescriptor returns the available gRPC queryable services of the application + rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services"; + } + // GetTxDescriptor returns information on the used transaction object and available msgs that can be used + rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor"; + } +} + +// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC +message GetAuthnDescriptorRequest {} +// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC +message GetAuthnDescriptorResponse { + // authn describes how to authenticate to the application when sending transactions + AuthnDescriptor authn = 1; +} + +// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC +message GetChainDescriptorRequest {} +// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC +message GetChainDescriptorResponse { + // chain describes application chain information + ChainDescriptor chain = 1; +} + +// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC +message GetCodecDescriptorRequest {} +// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC +message GetCodecDescriptorResponse { + // codec describes the application codec such as registered interfaces and implementations + CodecDescriptor codec = 1; +} + +// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorRequest {} +// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorResponse { + // config describes the application's sdk.Config + ConfigurationDescriptor config = 1; +} + +// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorRequest {} +// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorResponse { + // queries provides information on the available queryable services + QueryServicesDescriptor queries = 1; +} + +// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC +message GetTxDescriptorRequest {} +// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC +message GetTxDescriptorResponse { + // tx provides information on msgs that can be forwarded to the application + // alongside the accepted transaction protobuf type + TxDescriptor tx = 1; +} + +// QueryServicesDescriptor contains the list of cosmos-sdk queriable services +message QueryServicesDescriptor { + // query_services is a list of cosmos-sdk QueryServiceDescriptor + repeated QueryServiceDescriptor query_services = 1; +} + +// QueryServiceDescriptor describes a cosmos-sdk queryable service +message QueryServiceDescriptor { + // fullname is the protobuf fullname of the service descriptor + string fullname = 1; + // is_module describes if this service is actually exposed by an application's module + bool is_module = 2; + // methods provides a list of query service methods + repeated QueryMethodDescriptor methods = 3; +} + +// QueryMethodDescriptor describes a queryable method of a query service +// no other info is provided beside method name and tendermint queryable path +// because it would be redundant with the grpc reflection service +message QueryMethodDescriptor { + // name is the protobuf name (not fullname) of the method + string name = 1; + // full_query_path is the path that can be used to query + // this method via tendermint abci.Query + string full_query_path = 2; +} diff --git a/packages/cosmos/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/packages/cosmos/proto/cosmos/base/snapshots/v1beta1/snapshot.proto new file mode 100644 index 00000000..e8f9c2e6 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/snapshots/v1beta1/snapshot.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; +package cosmos.base.snapshots.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types"; + +// Snapshot contains Tendermint state sync snapshot info. +message Snapshot { + uint64 height = 1; + uint32 format = 2; + uint32 chunks = 3; + bytes hash = 4; + Metadata metadata = 5 [(gogoproto.nullable) = false]; +} + +// Metadata contains SDK-specific snapshot metadata. +message Metadata { + repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes +} + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +// +// Since: cosmos-sdk 0.46 +message SnapshotItem { + // item is the specific type of snapshot item. + oneof item { + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + SnapshotExtensionMeta extension = 3; + SnapshotExtensionPayload extension_payload = 4; + SnapshotKVItem kv = 5 [deprecated = true, (gogoproto.customname) = "KV"]; + SnapshotSchema schema = 6 [deprecated = true]; + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +// +// Since: cosmos-sdk 0.46 +message SnapshotStoreItem { + string name = 1; +} + +// SnapshotIAVLItem is an exported IAVL node. +// +// Since: cosmos-sdk 0.46 +message SnapshotIAVLItem { + bytes key = 1; + bytes value = 2; + // version is block height + int64 version = 3; + // height is depth of the tree. + int32 height = 4; +} + +// SnapshotExtensionMeta contains metadata about an external snapshotter. +// +// Since: cosmos-sdk 0.46 +message SnapshotExtensionMeta { + string name = 1; + uint32 format = 2; +} + +// SnapshotExtensionPayload contains payloads of an external snapshotter. +// +// Since: cosmos-sdk 0.46 +message SnapshotExtensionPayload { + bytes payload = 1; +} + +// SnapshotKVItem is an exported Key/Value Pair +// +// Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +message SnapshotKVItem { + option deprecated = true; + + bytes key = 1; + bytes value = 2; +} + +// SnapshotSchema is an exported schema of smt store +// +// Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +message SnapshotSchema { + option deprecated = true; + + repeated bytes keys = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/base/store/v1beta1/commit_info.proto b/packages/cosmos/proto/cosmos/base/store/v1beta1/commit_info.proto new file mode 100644 index 00000000..b7b6a197 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/store/v1beta1/commit_info.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// CommitInfo defines commit information used by the multi-store when committing +// a version/height. +message CommitInfo { + int64 version = 1; + repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; +} + +// StoreInfo defines store-specific commit information. It contains a reference +// between a store name and the commit ID. +message StoreInfo { + string name = 1; + CommitID commit_id = 2 [(gogoproto.nullable) = false]; +} + +// CommitID defines the commitment information when a specific store is +// committed. +message CommitID { + option (gogoproto.goproto_stringer) = false; + + int64 version = 1; + bytes hash = 2; +} diff --git a/packages/cosmos/proto/cosmos/base/store/v1beta1/listening.proto b/packages/cosmos/proto/cosmos/base/store/v1beta1/listening.proto new file mode 100644 index 00000000..753f7c16 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/store/v1beta1/listening.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +import "tendermint/abci/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +// Deletes +// +// Since: cosmos-sdk 0.43 +message StoreKVPair { + string store_key = 1; // the store key for the KVStore this pair originates from + bool delete = 2; // true indicates a delete operation, false indicates a set operation + bytes key = 3; + bytes value = 4; +} + +// BlockMetadata contains all the abci event data of a block +// the file streamer dump them into files together with the state changes. +message BlockMetadata { + // DeliverTx encapulate deliver tx request and response. + message DeliverTx { + tendermint.abci.RequestDeliverTx request = 1; + tendermint.abci.ResponseDeliverTx response = 2; + } + tendermint.abci.RequestBeginBlock request_begin_block = 1; + tendermint.abci.ResponseBeginBlock response_begin_block = 2; + repeated DeliverTx deliver_txs = 3; + tendermint.abci.RequestEndBlock request_end_block = 4; + tendermint.abci.ResponseEndBlock response_end_block = 5; + tendermint.abci.ResponseCommit response_commit = 6; +} diff --git a/packages/cosmos/proto/cosmos/base/tendermint/v1beta1/query.proto b/packages/cosmos/proto/cosmos/base/tendermint/v1beta1/query.proto new file mode 100644 index 00000000..1f17b0a6 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -0,0 +1,208 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "tendermint/p2p/types.proto"; +import "tendermint/types/types.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/tendermint/v1beta1/types.proto"; +import "cosmos_proto/cosmos.proto"; +import "tendermint/types/block.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; + +// Service defines the gRPC querier service for tendermint queries. +service Service { + // GetNodeInfo queries the current node info. + rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; + } + + // GetSyncing queries node syncing. + rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; + } + + // GetLatestBlock returns the latest block. + rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; + } + + // GetBlockByHeight queries block for given height. + rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; + } + + // GetLatestValidatorSet queries latest validator-set. + rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; + } + + // GetValidatorSetByHeight queries validator-set at a given height. + rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; + } + + // ABCIQuery defines a query handler that supports ABCI queries directly to the + // application, bypassing Tendermint completely. The ABCI query must contain + // a valid and supported path, including app, custom, p2p, and store. + // + // Since: cosmos-sdk 0.46 + rpc ABCIQuery(ABCIQueryRequest) returns (ABCIQueryResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/abci_query"; + } +} + +// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +message GetValidatorSetByHeightRequest { + int64 height = 1; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +message GetValidatorSetByHeightResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +message GetLatestValidatorSetRequest { + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +message GetLatestValidatorSetResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// Validator is the type for the validator-set. +message Validator { + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +message GetBlockByHeightRequest { + int64 height = 1; +} + +// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +message GetBlockByHeightResponse { + .tendermint.types.BlockID block_id = 1; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; +} + +// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +message GetLatestBlockRequest {} + +// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +message GetLatestBlockResponse { + .tendermint.types.BlockID block_id = 1; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; +} + +// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +message GetSyncingRequest {} + +// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +message GetSyncingResponse { + bool syncing = 1; +} + +// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +message GetNodeInfoRequest {} + +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. +message GetNodeInfoResponse { + .tendermint.p2p.DefaultNodeInfo default_node_info = 1; + VersionInfo application_version = 2; +} + +// VersionInfo is the type for the GetNodeInfoResponse message. +message VersionInfo { + string name = 1; + string app_name = 2; + string version = 3; + string git_commit = 4; + string build_tags = 5; + string go_version = 6; + repeated Module build_deps = 7; + // Since: cosmos-sdk 0.43 + string cosmos_sdk_version = 8; +} + +// Module is the type for VersionInfo +message Module { + // module path + string path = 1; + // module version + string version = 2; + // checksum + string sum = 3; +} + +// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +message ABCIQueryRequest { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. +// +// Note: This type is a duplicate of the ResponseQuery proto type defined in +// Tendermint. +message ABCIQueryResponse { + uint32 code = 1; + // DEPRECATED: use "value" instead + reserved 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +// ProofOp defines an operation used for calculating Merkle root. The data could +// be arbitrary format, providing necessary data for example neighbouring node +// hash. +// +// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps. +// +// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/base/tendermint/v1beta1/types.proto b/packages/cosmos/proto/cosmos/base/tendermint/v1beta1/types.proto new file mode 100644 index 00000000..6506997b --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/tendermint/v1beta1/types.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; +import "tendermint/version/types.proto"; +import "google/protobuf/timestamp.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; + +// Block is tendermint type Block, with the Header proposer address +// field converted to bech32 string. +message Block { + Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.Data data = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.Commit last_commit = 4; +} + +// Header defines the structure of a Tendermint block header. +message Header { + // basic block info + .tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // prev block info + .tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // hashes of block data + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + + // proposer_address is the original block proposer address, formatted as a Bech32 string. + // In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + // for better UX. + string proposer_address = 14; // original proposer of the block +} diff --git a/packages/cosmos/proto/cosmos/base/v1beta1/coin.proto b/packages/cosmos/proto/cosmos/base/v1beta1/coin.proto new file mode 100644 index 00000000..69c96f67 --- /dev/null +++ b/packages/cosmos/proto/cosmos/base/v1beta1/coin.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.base.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; + +// Coin defines a token with a denomination and an amount. +// +// NOTE: The amount field is an Int which implements the custom method +// signatures required by gogoproto. +message Coin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// DecCoin defines a token with a denomination and a decimal amount. +// +// NOTE: The amount field is an Dec which implements the custom method +// signatures required by gogoproto. +message DecCoin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} + +// IntProto defines a Protobuf wrapper around an Int object. +message IntProto { + string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecProto defines a Protobuf wrapper around a Dec object. +message DecProto { + string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/cosmos/capability/module/v1/module.proto b/packages/cosmos/proto/cosmos/capability/module/v1/module.proto new file mode 100644 index 00000000..eabaadc1 --- /dev/null +++ b/packages/cosmos/proto/cosmos/capability/module/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package cosmos.capability.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the capability module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/capability" + }; + + // seal_keeper defines if keeper.Seal() will run on BeginBlock() to prevent further modules from creating a scoped + // keeper. For more details check x/capability/keeper.go. + bool seal_keeper = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/capability/v1beta1/capability.proto b/packages/cosmos/proto/cosmos/capability/v1beta1/capability.proto new file mode 100644 index 00000000..6f3595f1 --- /dev/null +++ b/packages/cosmos/proto/cosmos/capability/v1beta1/capability.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +// Capability defines an implementation of an object capability. The index +// provided to a Capability must be globally unique. +message Capability { + option (gogoproto.goproto_stringer) = false; + + uint64 index = 1; +} + +// Owner defines a single capability owner. An owner is defined by the name of +// capability and the module name. +message Owner { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + string module = 1; + string name = 2; +} + +// CapabilityOwners defines a set of owners of a single Capability. The set of +// owners must be unique. +message CapabilityOwners { + repeated Owner owners = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/capability/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/capability/v1beta1/genesis.proto new file mode 100644 index 00000000..f119244e --- /dev/null +++ b/packages/cosmos/proto/cosmos/capability/v1beta1/genesis.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/capability/v1beta1/capability.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +// GenesisOwners defines the capability owners with their corresponding index. +message GenesisOwners { + // index is the index of the capability owner. + uint64 index = 1; + + // index_owners are the owners at the given index. + CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// GenesisState defines the capability module's genesis state. +message GenesisState { + // index is the capability global index. + uint64 index = 1; + + // owners represents a map from index to owners of the capability index + // index key is string to allow amino marshalling. + repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/consensus/module/v1/module.proto b/packages/cosmos/proto/cosmos/consensus/module/v1/module.proto new file mode 100644 index 00000000..8e188cc7 --- /dev/null +++ b/packages/cosmos/proto/cosmos/consensus/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.consensus.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the consensus module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/consensus" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/packages/cosmos/proto/cosmos/consensus/v1/query.proto b/packages/cosmos/proto/cosmos/consensus/v1/query.proto new file mode 100644 index 00000000..cdcb07ba --- /dev/null +++ b/packages/cosmos/proto/cosmos/consensus/v1/query.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "google/api/annotations.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/consensus_param module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/consensus/v1/params"; + } +} + +// QueryParamsRequest defines the request type for querying x/consensus parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/consensus parameters. +message QueryParamsResponse { + // params are the tendermint consensus params stored in the consensus module. + // Please note that `params.version` is not populated in this response, it is + // tracked separately in the x/upgrade module. + tendermint.types.ConsensusParams params = 1; +} diff --git a/packages/cosmos/proto/cosmos/consensus/v1/tx.proto b/packages/cosmos/proto/cosmos/consensus/v1/tx.proto new file mode 100644 index 00000000..0a7a3de0 --- /dev/null +++ b/packages/cosmos/proto/cosmos/consensus/v1/tx.proto @@ -0,0 +1,39 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Msg defines the bank Msg service. +service Msg { + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/consensus parameters to update. + // VersionsParams is not included in this Msg because it is tracked + // separarately in x/upgrade. + // + // NOTE: All parameters must be supplied. + tendermint.types.BlockParams block = 2; + tendermint.types.EvidenceParams evidence = 3; + tendermint.types.ValidatorParams validator = 4; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} diff --git a/packages/cosmos/proto/cosmos/crisis/module/v1/module.proto b/packages/cosmos/proto/cosmos/crisis/module/v1/module.proto new file mode 100644 index 00000000..fe924962 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crisis/module/v1/module.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package cosmos.crisis.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the crisis module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/crisis" + }; + + // fee_collector_name is the name of the FeeCollector ModuleAccount. + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/crisis/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/crisis/v1beta1/genesis.proto new file mode 100644 index 00000000..b0ddb9b6 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crisis/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +// GenesisState defines the crisis module's genesis state. +message GenesisState { + // constant_fee is the fee used to verify the invariant in the crisis + // module. + cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/crisis/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/crisis/v1beta1/tx.proto new file mode 100644 index 00000000..4fcf5bf6 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crisis/v1beta1/tx.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // VerifyInvariant defines a method to verify a particular invariant. + rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); + + // UpdateParams defines a governance operation for updating the x/crisis module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgVerifyInvariant represents a message to verify a particular invariance. +message MsgVerifyInvariant { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "cosmos-sdk/MsgVerifyInvariant"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // sender is the account address of private key to send coins to fee collector account. + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // name of the invariant module. + string invariant_module_name = 2; + + // invariant_route is the msg's invariant route. + string invariant_route = 3; +} + +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +message MsgVerifyInvariantResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/crisis/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // constant_fee defines the x/crisis parameter. + cosmos.base.v1beta1.Coin constant_fee = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/packages/cosmos/proto/cosmos/crypto/ed25519/keys.proto b/packages/cosmos/proto/cosmos/crypto/ed25519/keys.proto new file mode 100644 index 00000000..728b5483 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crypto/ed25519/keys.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package cosmos.crypto.ed25519; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; + +// PubKey is an ed25519 public key for handling Tendermint keys in SDK. +// It's needed for Any serialization and SDK compatibility. +// It must not be used in a non Tendermint key context because it doesn't implement +// ADR-28. Nevertheless, you will like to use ed25519 in app user level +// then you must create a new proto message and follow ADR-28 for Address construction. +message PubKey { + option (amino.name) = "tendermint/PubKeyEd25519"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; + option (gogoproto.goproto_stringer) = false; + + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; +} + +// Deprecated: PrivKey defines a ed25519 private key. +// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. +message PrivKey { + option (amino.name) = "tendermint/PrivKeyEd25519"; + option (amino.message_encoding) = "key_field"; + + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; +} diff --git a/packages/cosmos/proto/cosmos/crypto/hd/v1/hd.proto b/packages/cosmos/proto/cosmos/crypto/hd/v1/hd.proto new file mode 100644 index 00000000..e25b70d1 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crypto/hd/v1/hd.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.crypto.hd.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; +option (gogoproto.goproto_getters_all) = false; + +// BIP44Params is used as path field in ledger item in Record. +message BIP44Params { + option (amino.name) = "crypto/keys/hd/BIP44Params"; + + option (gogoproto.goproto_stringer) = false; + // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + uint32 purpose = 1; + // coin_type is a constant that improves privacy + uint32 coin_type = 2; + // account splits the key space into independent user identities + uint32 account = 3; + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + // chain. + bool change = 4; + // address_index is used as child index in BIP32 derivation + uint32 address_index = 5; +} diff --git a/packages/cosmos/proto/cosmos/crypto/keyring/v1/record.proto b/packages/cosmos/proto/cosmos/crypto/keyring/v1/record.proto new file mode 100644 index 00000000..e79ea7f4 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crypto/keyring/v1/record.proto @@ -0,0 +1,48 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.crypto.keyring.v1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/crypto/hd/v1/hd.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.gogoproto_import) = false; + +// Record is used for representing a key in the keyring. +message Record { + // name represents a name of Record + string name = 1; + // pub_key represents a public key in any format + google.protobuf.Any pub_key = 2; + + // Record contains one of the following items + oneof item { + // local stores the private key locally. + Local local = 3; + // ledger stores the information about a Ledger key. + Ledger ledger = 4; + // Multi does not store any other information. + Multi multi = 5; + // Offline does not store any other information. + Offline offline = 6; + } + + // Item is a keyring item stored in a keyring backend. + // Local item + message Local { + google.protobuf.Any priv_key = 1; + } + + // Ledger item + message Ledger { + hd.v1.BIP44Params path = 1; + } + + // Multi item + message Multi {} + + // Offline item + message Offline {} +} diff --git a/packages/cosmos/proto/cosmos/crypto/multisig/keys.proto b/packages/cosmos/proto/cosmos/crypto/multisig/keys.proto new file mode 100644 index 00000000..fa0dec57 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crypto/multisig/keys.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.crypto.multisig; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; + +// LegacyAminoPubKey specifies a public key type +// which nests multiple public keys and a threshold, +// it uses legacy amino address rules. +message LegacyAminoPubKey { + option (amino.name) = "tendermint/PubKeyMultisigThreshold"; + // The Amino encoding of a LegacyAminoPubkey is the legacy amino + // encoding of the `PubKeyMultisigThreshold` struct defined below: + // https://github.com/tendermint/tendermint/blob/v0.33.9/crypto/multisig/threshold_pubkey.go + // + // There are 2 differences with what a "normal" Amino encoding + // would output: + // 1. The `threshold` field is always a string (whereas Amino would + // by default marshal uint32 as a number). + // 2. The `public_keys` field is renamed to `pubkeys`, which is also + // reflected in the `amino.field_name` annotation. + option (amino.message_encoding) = "threshold_string"; + option (gogoproto.goproto_getters) = false; + + uint32 threshold = 1; + repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys", (amino.field_name) = "pubkeys"]; +} diff --git a/packages/cosmos/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/packages/cosmos/proto/cosmos/crypto/multisig/v1beta1/multisig.proto new file mode 100644 index 00000000..bf671f17 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crypto/multisig/v1beta1/multisig.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.crypto.multisig.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; + +// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. +// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers +// signed and with which modes. +message MultiSignature { + option (gogoproto.goproto_unrecognized) = true; + repeated bytes signatures = 1; +} + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after proto encoding. +// This is not thread safe, and is not intended for concurrent usage. +message CompactBitArray { + option (gogoproto.goproto_stringer) = false; + + uint32 extra_bits_stored = 1; + bytes elems = 2; +} diff --git a/packages/cosmos/proto/cosmos/crypto/secp256k1/keys.proto b/packages/cosmos/proto/cosmos/crypto/secp256k1/keys.proto new file mode 100644 index 00000000..e2358d6d --- /dev/null +++ b/packages/cosmos/proto/cosmos/crypto/secp256k1/keys.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package cosmos.crypto.secp256k1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; + +// PubKey defines a secp256k1 public key +// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte +// if the y-coordinate is the lexicographically largest of the two associated with +// the x-coordinate. Otherwise the first byte is a 0x03. +// This prefix is followed with the x-coordinate. +message PubKey { + option (amino.name) = "tendermint/PubKeySecp256k1"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; + option (gogoproto.goproto_stringer) = false; + + bytes key = 1; +} + +// PrivKey defines a secp256k1 private key. +message PrivKey { + option (amino.name) = "tendermint/PrivKeySecp256k1"; + option (amino.message_encoding) = "key_field"; + + bytes key = 1; +} diff --git a/packages/cosmos/proto/cosmos/crypto/secp256r1/keys.proto b/packages/cosmos/proto/cosmos/crypto/secp256r1/keys.proto new file mode 100644 index 00000000..2e96c6e3 --- /dev/null +++ b/packages/cosmos/proto/cosmos/crypto/secp256r1/keys.proto @@ -0,0 +1,23 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.crypto.secp256r1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; +option (gogoproto.messagename_all) = true; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// PubKey defines a secp256r1 ECDSA public key. +message PubKey { + // Point on secp256r1 curve in a compressed representation as specified in section + // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; +} + +// PrivKey defines a secp256r1 ECDSA private key. +message PrivKey { + // secret number serialized using big-endian encoding + bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; +} diff --git a/packages/cosmos/proto/cosmos/distribution/module/v1/module.proto b/packages/cosmos/proto/cosmos/distribution/module/v1/module.proto new file mode 100644 index 00000000..accf920c --- /dev/null +++ b/packages/cosmos/proto/cosmos/distribution/module/v1/module.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.distribution.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the distribution module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/distribution" + }; + + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/distribution/v1beta1/distribution.proto b/packages/cosmos/proto/cosmos/distribution/v1beta1/distribution.proto new file mode 100644 index 00000000..226003da --- /dev/null +++ b/packages/cosmos/proto/cosmos/distribution/v1beta1/distribution.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// Params defines the set of params for the distribution module. +message Params { + option (amino.name) = "cosmos-sdk/x/distribution/Params"; + option (gogoproto.goproto_stringer) = false; + + string community_tax = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Deprecated: The base_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. + string base_proposer_reward = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + deprecated = true + ]; + + // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. + string bonus_proposer_reward = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + deprecated = true + ]; + + bool withdraw_addr_enabled = 4; +} + +// ValidatorHistoricalRewards represents historical rewards for a validator. +// Height is implicit within the store key. +// Cumulative reward ratio is the sum from the zeroeth period +// until this period of rewards / tokens, per the spec. +// The reference count indicates the number of objects +// which might need to reference this historical entry at any point. +// ReferenceCount = +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization +message ValidatorHistoricalRewards { + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + uint32 reference_count = 2; +} + +// ValidatorCurrentRewards represents current rewards and current +// period for a validator kept as a running counter and incremented +// each block as long as the validator's tokens remain constant. +message ValidatorCurrentRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + uint64 period = 2; +} + +// ValidatorAccumulatedCommission represents accumulated commission +// for a validator kept as a running counter, can be withdrawn at any time. +message ValidatorAccumulatedCommission { + repeated cosmos.base.v1beta1.DecCoin commission = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +// for a validator inexpensive to track, allows simple sanity checks. +message ValidatorOutstandingRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// ValidatorSlashEvent represents a validator slash event. +// Height is implicit within the store key. +// This is needed to calculate appropriate amount of staking tokens +// for delegations which are withdrawn after a slash has occurred. +message ValidatorSlashEvent { + uint64 validator_period = 1; + string fraction = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +message ValidatorSlashEvents { + option (gogoproto.goproto_stringer) = false; + repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// FeePool is the global fee pool for distribution. +message FeePool { + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} + +// CommunityPoolSpendProposal details a proposal for use of community funds, +// together with how many coins are proposed to be spent, and to which +// recipient account. +// +// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no +// longer a need for an explicit CommunityPoolSpendProposal. To spend community +// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov +// module via a v1 governance proposal. +message CommunityPoolSpendProposal { + option deprecated = true; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string recipient = 3; + repeated cosmos.base.v1beta1.Coin amount = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// DelegatorStartingInfo represents the starting info for a delegator reward +// period. It tracks the previous validator period, the delegation's amount of +// staking token, and the creation height (to check later on if any slashes have +// occurred). NOTE: Even though validators are slashed to whole staking tokens, +// the delegators within the validator may be left with less than a full token, +// thus sdk.Dec is used. +message DelegatorStartingInfo { + uint64 previous_period = 1; + string stake = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 height = 3 + [(gogoproto.jsontag) = "creation_height", (amino.field_name) = "creation_height", (amino.dont_omitempty) = true]; +} + +// DelegationDelegatorReward represents the properties +// of a delegator's delegation reward. +message DelegationDelegatorReward { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + repeated cosmos.base.v1beta1.DecCoin reward = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +// with a deposit +message CommunityPoolSpendProposalWithDeposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string recipient = 3; + string amount = 4; + string deposit = 5; +} diff --git a/packages/cosmos/proto/cosmos/distribution/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/distribution/v1beta1/genesis.proto new file mode 100644 index 00000000..5bf2d6bb --- /dev/null +++ b/packages/cosmos/proto/cosmos/distribution/v1beta1/genesis.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// DelegatorWithdrawInfo is the address for where distributions rewards are +// withdrawn to by default this struct is only used at genesis to feed in +// default withdraw addresses. +message DelegatorWithdrawInfo { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // withdraw_address is the address to withdraw the delegation rewards to. + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +message ValidatorOutstandingRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // outstanding_rewards represents the outstanding rewards of a validator. + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// ValidatorAccumulatedCommissionRecord is used for import / export via genesis +// json. +message ValidatorAccumulatedCommissionRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // accumulated is the accumulated commission of a validator. + ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorHistoricalRewardsRecord is used for import / export via genesis +// json. +message ValidatorHistoricalRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // period defines the period the historical rewards apply to. + uint64 period = 2; + + // rewards defines the historical rewards of a validator. + ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +message ValidatorCurrentRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // rewards defines the current rewards of a validator. + ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// DelegatorStartingInfoRecord used for import / export via genesis json. +message DelegatorStartingInfoRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_address is the address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // starting_info defines the starting info of a delegator. + DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorSlashEventRecord is used for import / export via genesis json. +message ValidatorSlashEventRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // height defines the block height at which the slash event occurred. + uint64 height = 2; + // period is the period of the slash event. + uint64 period = 3; + // validator_slash_event describes the slash event. + ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// GenesisState defines the distribution module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the fee pool at genesis. + FeePool fee_pool = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the delegator withdraw infos at genesis. + repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the previous proposer at genesis. + string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // fee_pool defines the outstanding rewards of all validators at genesis. + repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the accumulated commissions of all validators at genesis. + repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the historical rewards of all validators at genesis. + repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the current rewards of all validators at genesis. + repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the delegator starting infos at genesis. + repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the validator slash events at genesis. + repeated ValidatorSlashEventRecord validator_slash_events = 10 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/distribution/v1beta1/query.proto b/packages/cosmos/proto/cosmos/distribution/v1beta1/query.proto new file mode 100644 index 00000000..4788467d --- /dev/null +++ b/packages/cosmos/proto/cosmos/distribution/v1beta1/query.proto @@ -0,0 +1,256 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; + +// Query defines the gRPC querier service for distribution module. +service Query { + // Params queries params of the distribution module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; + } + + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator + rpc ValidatorDistributionInfo(QueryValidatorDistributionInfoRequest) + returns (QueryValidatorDistributionInfoResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}"; + } + + // ValidatorOutstandingRewards queries rewards of a validator address. + rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) + returns (QueryValidatorOutstandingRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/outstanding_rewards"; + } + + // ValidatorCommission queries accumulated commission for a validator. + rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/commission"; + } + + // ValidatorSlashes queries slash events of a validator. + rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes"; + } + + // DelegationRewards queries the total rewards accrued by a delegation. + rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/" + "{validator_address}"; + } + + // DelegationTotalRewards queries the total rewards accrued by a each + // validator. + rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; + } + + // DelegatorValidators queries the validators of a delegator. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/validators"; + } + + // DelegatorWithdrawAddress queries withdraw address of a delegator. + rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/withdraw_address"; + } + + // CommunityPool queries the community pool coins. + rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoResponse { + // operator_address defines the validator operator address. + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // self_bond_rewards defines the self delegations rewards. + repeated cosmos.base.v1beta1.DecCoin self_bond_rewards = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; + // commission defines the commission the validator received. + repeated cosmos.base.v1beta1.DecCoin commission = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// QueryValidatorOutstandingRewardsRequest is the request type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorOutstandingRewardsResponse is the response type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsResponse { + ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorCommissionRequest is the request type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorCommissionResponse is the response type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionResponse { + // commission defines the commission the validator received. + ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorSlashesRequest is the request type for the +// Query/ValidatorSlashes RPC method +message QueryValidatorSlashesRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // starting_height defines the optional starting height to query the slashes. + uint64 starting_height = 2; + // starting_height defines the optional ending height to query the slashes. + uint64 ending_height = 3; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryValidatorSlashesResponse is the response type for the +// Query/ValidatorSlashes RPC method. +message QueryValidatorSlashesResponse { + // slashes defines the slashes the validator received. + repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRewardsRequest is the request type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address defines the validator address to query for. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationRewardsResponse is the response type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsResponse { + // rewards defines the rewards accrued by a delegation. + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} + +// QueryDelegationTotalRewardsRequest is the request type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationTotalRewardsResponse is the response type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsResponse { + // rewards defines all the rewards accrued by a delegator. + repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // total defines the sum of all the rewards. + repeated cosmos.base.v1beta1.DecCoin total = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} + +// QueryDelegatorValidatorsRequest is the request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorValidatorsResponse is the response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validators defines the validators a delegator is delegating for. + repeated string validators = 1; +} + +// QueryDelegatorWithdrawAddressRequest is the request type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorWithdrawAddressResponse is the response type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // withdraw_address defines the delegator address to query for. + string withdraw_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +message QueryCommunityPoolRequest {} + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +message QueryCommunityPoolResponse { + // pool defines community pool's coins. + repeated cosmos.base.v1beta1.DecCoin pool = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/packages/cosmos/proto/cosmos/distribution/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/distribution/v1beta1/tx.proto new file mode 100644 index 00000000..957747cf --- /dev/null +++ b/packages/cosmos/proto/cosmos/distribution/v1beta1/tx.proto @@ -0,0 +1,178 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; + +// Msg defines the distribution Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); + + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); + + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); + + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); + + // UpdateParams defines a governance operation for updating the x/distribution + // module parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CommunityPoolSpend defines a governance operation for sending tokens from + // the community pool in the x/distribution module to another account, which + // could be the governance module itself. The authority is defined in the + // keeper. + // + // Since: cosmos-sdk 0.47 + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); +} + +// MsgSetWithdrawAddress sets the withdraw address for +// a delegator (or validator self-delegation). +message MsgSetWithdrawAddress { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgModifyWithdrawAddress"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response +// type. +message MsgSetWithdrawAddressResponse {} + +// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator +// from a single validator. +message MsgWithdrawDelegatorReward { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawDelegationReward"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +// response type. +message MsgWithdrawDelegatorRewardResponse { + // Since: cosmos-sdk 0.46 + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgWithdrawValidatorCommission withdraws the full commission to the validator +// address. +message MsgWithdrawValidatorCommission { + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawValCommission"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawValidatorCommissionResponse defines the +// Msg/WithdrawValidatorCommission response type. +message MsgWithdrawValidatorCommissionResponse { + // Since: cosmos-sdk 0.46 + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +message MsgFundCommunityPool { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgFundCommunityPool"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +message MsgFundCommunityPoolResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distribution/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/distribution parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgCommunityPoolSpend defines a message for sending tokens from the community +// pool to another account. This message is typically executed via a governance +// proposal with the governance module being the executing authority. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpend { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distr/MsgCommunityPoolSpend"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string recipient = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpendResponse {} diff --git a/packages/cosmos/proto/cosmos/evidence/module/v1/module.proto b/packages/cosmos/proto/cosmos/evidence/module/v1/module.proto new file mode 100644 index 00000000..fceea7da --- /dev/null +++ b/packages/cosmos/proto/cosmos/evidence/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.evidence.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the evidence module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/evidence" + }; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/evidence/v1beta1/evidence.proto b/packages/cosmos/proto/cosmos/evidence/v1beta1/evidence.proto new file mode 100644 index 00000000..8dca3201 --- /dev/null +++ b/packages/cosmos/proto/cosmos/evidence/v1beta1/evidence.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +// Equivocation implements the Evidence interface and defines evidence of double +// signing misbehavior. +message Equivocation { + option (amino.name) = "cosmos-sdk/Equivocation"; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // height is the equivocation height. + int64 height = 1; + + // time is the equivocation time. + google.protobuf.Timestamp time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // power is the equivocation validator power. + int64 power = 3; + + // consensus_address is the equivocation validator consensus address. + string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/evidence/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/evidence/v1beta1/genesis.proto new file mode 100644 index 00000000..199f446f --- /dev/null +++ b/packages/cosmos/proto/cosmos/evidence/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +import "google/protobuf/any.proto"; + +// GenesisState defines the evidence module's genesis state. +message GenesisState { + // evidence defines all the evidence at genesis. + repeated google.protobuf.Any evidence = 1; +} diff --git a/packages/cosmos/proto/cosmos/evidence/v1beta1/query.proto b/packages/cosmos/proto/cosmos/evidence/v1beta1/query.proto new file mode 100644 index 00000000..34163dd5 --- /dev/null +++ b/packages/cosmos/proto/cosmos/evidence/v1beta1/query.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +// Query defines the gRPC querier service. +service Query { + // Evidence queries evidence based on evidence hash. + rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{hash}"; + } + + // AllEvidence queries all evidence. + rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence"; + } +} + +// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +message QueryEvidenceRequest { + // evidence_hash defines the hash of the requested evidence. + // Deprecated: Use hash, a HEX encoded string, instead. + bytes evidence_hash = 1 + [deprecated = true, (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + + // hash defines the evidence hash of the requested evidence. + // + // Since: cosmos-sdk 0.47 + string hash = 2; +} + +// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +message QueryEvidenceResponse { + // evidence returns the requested evidence. + google.protobuf.Any evidence = 1; +} + +// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceResponse { + // evidence returns all evidences. + repeated google.protobuf.Any evidence = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/cosmos/proto/cosmos/evidence/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/evidence/v1beta1/tx.proto new file mode 100644 index 00000000..f5646e2d --- /dev/null +++ b/packages/cosmos/proto/cosmos/evidence/v1beta1/tx.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +// Msg defines the evidence Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); +} + +// MsgSubmitEvidence represents a message that supports submitting arbitrary +// Evidence of misbehavior such as equivocation or counterfactual signing. +message MsgSubmitEvidence { + option (cosmos.msg.v1.signer) = "submitter"; + option (amino.name) = "cosmos-sdk/MsgSubmitEvidence"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // submitter is the signer account address of evidence. + string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // evidence defines the evidence of misbehavior. + google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.v1beta1.Evidence"]; +} + +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +message MsgSubmitEvidenceResponse { + // hash defines the hash of the evidence. + bytes hash = 4; +} diff --git a/packages/cosmos/proto/cosmos/feegrant/module/v1/module.proto b/packages/cosmos/proto/cosmos/feegrant/module/v1/module.proto new file mode 100644 index 00000000..d838f02f --- /dev/null +++ b/packages/cosmos/proto/cosmos/feegrant/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.feegrant.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the feegrant module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/feegrant" + }; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/feegrant/v1beta1/feegrant.proto b/packages/cosmos/proto/cosmos/feegrant/v1beta1/feegrant.proto new file mode 100644 index 00000000..1cfe741b --- /dev/null +++ b/packages/cosmos/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -0,0 +1,93 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// BasicAllowance implements Allowance with a one-time grant of coins +// that optionally expires. The grantee can use up to SpendLimit to cover fees. +message BasicAllowance { + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/BasicAllowance"; + + // spend_limit specifies the maximum amount of coins that can be spent + // by this allowance and will be updated as coins are spent. If it is + // empty, there is no spend limit and any amount of coins can be spent. + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // expiration specifies an optional time when this allowance expires + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; +} + +// PeriodicAllowance extends Allowance to allow for both a maximum cap, +// as well as a limit per time period. +message PeriodicAllowance { + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/PeriodicAllowance"; + + // basic specifies a struct of `BasicAllowance` + BasicAllowance basic = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + google.protobuf.Duration period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // period_spend_limit specifies the maximum number of coins that can be spent + // in the period + repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // period_can_spend is the number of coins left to be spent before the period_reset time + repeated cosmos.base.v1beta1.Coin period_can_spend = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // period_reset is the time at which this period resets and a new one begins, + // it is calculated from the start time of the first transaction after the + // last period ended + google.protobuf.Timestamp period_reset = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// AllowedMsgAllowance creates allowance only for specified message types. +message AllowedMsgAllowance { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/AllowedMsgAllowance"; + + // allowance can be any of basic and periodic fee allowance. + google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; + + // allowed_messages are the messages for which the grantee has the access. + repeated string allowed_messages = 2; +} + +// Grant is stored in the KVStore to record a grant with full context +message Grant { + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; +} diff --git a/packages/cosmos/proto/cosmos/feegrant/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/feegrant/v1beta1/genesis.proto new file mode 100644 index 00000000..a1ead956 --- /dev/null +++ b/packages/cosmos/proto/cosmos/feegrant/v1beta1/genesis.proto @@ -0,0 +1,14 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// GenesisState contains a set of fee allowances, persisted from the store +message GenesisState { + repeated Grant allowances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/feegrant/v1beta1/query.proto b/packages/cosmos/proto/cosmos/feegrant/v1beta1/query.proto new file mode 100644 index 00000000..baef7770 --- /dev/null +++ b/packages/cosmos/proto/cosmos/feegrant/v1beta1/query.proto @@ -0,0 +1,84 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Query defines the gRPC querier service. +service Query { + + // Allowance returns fee granted to the grantee by the granter. + rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; + } + + // Allowances returns all the grants for address. + rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; + } + + // AllowancesByGranter returns all the grants given by an address + // + // Since: cosmos-sdk 0.46 + rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; + } +} + +// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +message QueryAllowanceRequest { + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. +message QueryAllowanceResponse { + // allowance is a allowance granted for grantee by granter. + cosmos.feegrant.v1beta1.Grant allowance = 1; +} + +// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +message QueryAllowancesRequest { + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +message QueryAllowancesResponse { + // allowances are allowance's granted for grantee by granter. + repeated cosmos.feegrant.v1beta1.Grant allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryAllowancesByGranterRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryAllowancesByGranterResponse { + // allowances that have been issued by the granter. + repeated cosmos.feegrant.v1beta1.Grant allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/cosmos/proto/cosmos/feegrant/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/feegrant/v1beta1/tx.proto new file mode 100644 index 00000000..20bbaf48 --- /dev/null +++ b/packages/cosmos/proto/cosmos/feegrant/v1beta1/tx.proto @@ -0,0 +1,57 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Msg defines the feegrant msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // GrantAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); + + // RevokeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); +} + +// MsgGrantAllowance adds permission for Grantee to spend up to Allowance +// of fees from the account of Granter. +message MsgGrantAllowance { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrantAllowance"; + + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; +} + +// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. +message MsgGrantAllowanceResponse {} + +// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +message MsgRevokeAllowance { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevokeAllowance"; + + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +message MsgRevokeAllowanceResponse {} diff --git a/packages/cosmos/proto/cosmos/genutil/module/v1/module.proto b/packages/cosmos/proto/cosmos/genutil/module/v1/module.proto new file mode 100644 index 00000000..86e6f576 --- /dev/null +++ b/packages/cosmos/proto/cosmos/genutil/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.genutil.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the genutil module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/genutil" + }; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/genutil/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/genutil/v1beta1/genesis.proto new file mode 100644 index 00000000..45aa6bb2 --- /dev/null +++ b/packages/cosmos/proto/cosmos/genutil/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package cosmos.genutil.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; + +// GenesisState defines the raw genesis transaction in JSON. +message GenesisState { + // gen_txs defines the genesis transactions. + repeated bytes gen_txs = 1 [ + (gogoproto.casttype) = "encoding/json.RawMessage", + (gogoproto.jsontag) = "gentxs", + (amino.field_name) = "gentxs", + (amino.dont_omitempty) = true + ]; +} diff --git a/packages/cosmos/proto/cosmos/gov/module/v1/module.proto b/packages/cosmos/proto/cosmos/gov/module/v1/module.proto new file mode 100644 index 00000000..9544cfe2 --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/module/v1/module.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package cosmos.gov.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the gov module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/gov" + }; + + // max_metadata_len defines the maximum proposal metadata length. + // Defaults to 255 if not explicitly set. + uint64 max_metadata_len = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/gov/v1/genesis.proto b/packages/cosmos/proto/cosmos/gov/v1/genesis.proto new file mode 100644 index 00000000..b9cf573f --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1/genesis.proto @@ -0,0 +1,33 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.gov.v1; + +import "cosmos/gov/v1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2; + // votes defines all the votes present at genesis. + repeated Vote votes = 3; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + VotingParams voting_params = 6 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + TallyParams tally_params = 7 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 8; +} diff --git a/packages/cosmos/proto/cosmos/gov/v1/gov.proto b/packages/cosmos/proto/cosmos/gov/v1/gov.proto new file mode 100644 index 00000000..49bfcc26 --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1/gov.proto @@ -0,0 +1,220 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// WeightedVoteOption defines a unit of vote for vote split. +message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. + VoteOption option = 1; + + // weight is the vote weight associated with the vote option. + string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + // id defines the unique id of the proposal. + uint64 id = 1; + + // messages are the arbitrary messages to be executed if the proposal passes. + repeated google.protobuf.Any messages = 2; + + // status defines the proposal status. + ProposalStatus status = 3; + + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4; + + // submit_time is the time of proposal submission. + google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true]; + + // deposit_end_time is the end time for deposition. + google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true]; + + // total_deposit is the total deposit on the proposal. + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_start_time is the starting time to vote on a proposal. + google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; + + // voting_end_time is the end time of voting on a proposal. + google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 10; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 11; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 12; + + // Proposer is the address of the proposal sumbitter + // + // Since: cosmos-sdk 0.47 + string proposer = 13 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + PROPOSAL_STATUS_UNSPECIFIED = 0; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + // yes_count is the number of yes votes on a proposal. + string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; + // abstain_count is the number of abstain votes on a proposal. + string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_count is the number of no votes on a proposal. + string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_with_veto_count is the number of no with veto votes on a proposal. + string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter is the voter address of the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + reserved 3; + + // options is the weighted vote options. + repeated WeightedVoteOption options = 4; + + // metadata is any arbitrary metadata to attached to the vote. + string metadata = 5; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "min_deposit,omitempty"]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.jsontag) = "max_deposit_period,omitempty"]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Duration of the voting period. + google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +message Params { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [(gogoproto.stdduration) = true]; + + // Duration of the voting period. + google.protobuf.Duration voting_period = 3 [(gogoproto.stdduration) = true]; + + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // The ratio representing the proportion of the deposit value that must be paid at proposal submission. + string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // burn deposits if a proposal does not meet quorum + bool burn_vote_quorum = 13; + + // burn deposits if the proposal does not enter voting period + bool burn_proposal_deposit_prevote = 14; + + // burn deposits if quorum with vote type no_veto is met + bool burn_vote_veto = 15; +} diff --git a/packages/cosmos/proto/cosmos/gov/v1/query.proto b/packages/cosmos/proto/cosmos/gov/v1/query.proto new file mode 100644 index 00000000..0c1c9f2b --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1/query.proto @@ -0,0 +1,193 @@ + +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1/gov.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + // proposal is the requested governance proposal. + Proposal proposal = 1; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + // proposals defines all the requested governance proposals. + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defines the queried vote. + Vote vote = 1; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defines the queried votes. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // Deprecated: Prefer to use `params` instead. + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 4; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + // deposits defines the requested deposits. + repeated Deposit deposits = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1; +} diff --git a/packages/cosmos/proto/cosmos/gov/v1/tx.proto b/packages/cosmos/proto/cosmos/gov/v1/tx.proto new file mode 100644 index 00000000..1708066c --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1/tx.proto @@ -0,0 +1,172 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1/gov.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Msg defines the gov Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SubmitProposal defines a method to create new proposal given the messages. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + rpc ExecLegacyContent(MsgExecLegacyContent) returns (MsgExecLegacyContentResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/v1/MsgSubmitProposal"; + + // messages are the arbitrary messages to be executed if proposal passes. + repeated google.protobuf.Any messages = 1; + + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // proposer is the account address of the proposer. + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 4; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 5; + + // summary is the summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 6; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +message MsgExecLegacyContent { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/v1/MsgExecLegacyContent"; + + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // authority must be the gov module address. + string authority = 2; +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +message MsgExecLegacyContentResponse {} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVote"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the Vote. + string metadata = 4; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +message MsgVoteWeighted { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVoteWeighted"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // options defines the weighted vote options. + repeated WeightedVoteOption options = 3; + + // metadata is any arbitrary metadata attached to the VoteWeighted. + string metadata = 4; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/v1/MsgDeposit"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/gov/v1/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/gov parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/packages/cosmos/proto/cosmos/gov/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/gov/v1beta1/genesis.proto new file mode 100644 index 00000000..a680590c --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1beta1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package cosmos.gov.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2 + [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // votes defines all the votes present at genesis. + repeated Vote votes = 3 + [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4 + [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to deposit. + DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to voting. + VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to tally. + TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/gov/v1beta1/gov.proto b/packages/cosmos/proto/cosmos/gov/v1beta1/gov.proto new file mode 100644 index 00000000..dc8fcfd3 --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1beta1/gov.proto @@ -0,0 +1,252 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; +} + +// WeightedVoteOption defines a unit of vote for vote split. +// +// Since: cosmos-sdk 0.43 +message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. + VoteOption option = 1; + + // weight is the vote weight associated with the vote option. + string weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval. +message TextProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/TextProposal"; + + option (gogoproto.equal) = true; + + // title of the proposal. + string title = 1; + + // description associated with the proposal. + string description = 2; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + option (gogoproto.equal) = true; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // content is the proposal's content. + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // status defines the proposal status. + ProposalStatus status = 3; + + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // submit_time is the time of proposal submission. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // deposit_end_time is the end time for deposition. + google.protobuf.Timestamp deposit_end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // total_deposit is the total deposit on the proposal. + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // voting_start_time is the starting time to vote on a proposal. + google.protobuf.Timestamp voting_start_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_end_time is the end time of voting on a proposal. + google.protobuf.Timestamp voting_end_time = 9 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + option (gogoproto.equal) = true; + + // yes is the number of yes votes on a proposal. + string yes = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // abstain is the number of abstain votes on a proposal. + string abstain = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // no is the number of no votes on a proposal. + string no = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // no_with_veto is the number of no with veto votes on a proposal. + string no_with_veto = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (amino.field_name) = "id", (amino.dont_omitempty) = true]; + + // voter is the voter address of the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if and only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + VoteOption option = 3 [deprecated = true]; + + // options is the weighted vote options. + // + // Since: cosmos-sdk 0.43 + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.jsontag) = "min_deposit,omitempty" + ]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "max_deposit_period,omitempty" + ]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Duration of the voting period. + google.protobuf.Duration voting_period = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + bytes quorum = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "quorum,omitempty" + ]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "threshold,omitempty" + ]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + bytes veto_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto_threshold,omitempty" + ]; +} diff --git a/packages/cosmos/proto/cosmos/gov/v1beta1/query.proto b/packages/cosmos/proto/cosmos/gov/v1beta1/query.proto new file mode 100644 index 00000000..f225a0f6 --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1beta1/query.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + Proposal proposal = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + // proposals defines all the requested governance proposals. + repeated Proposal proposals = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defines the queried vote. + Vote vote = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defines the queried votes. + repeated Vote votes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + // deposits defines the requested deposits. + repeated Deposit deposits = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/gov/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/gov/v1beta1/tx.proto new file mode 100644 index 00000000..0afa1d56 --- /dev/null +++ b/packages/cosmos/proto/cosmos/gov/v1beta1/tx.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + // + // Since: cosmos-sdk 0.43 + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/MsgSubmitProposal"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // proposer is the account address of the proposer. + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; +} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVote"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. + VoteOption option = 3; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeighted { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVoteWeighted"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // options defines the weighted vote options. + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgDeposit"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} diff --git a/packages/cosmos/proto/cosmos/group/module/v1/module.proto b/packages/cosmos/proto/cosmos/group/module/v1/module.proto new file mode 100644 index 00000000..d1e7ffb2 --- /dev/null +++ b/packages/cosmos/proto/cosmos/group/module/v1/module.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package cosmos.group.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "amino/amino.proto"; + +// Module is the config object of the group module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/group" + }; + + // max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec + // to execute the proposal. + google.protobuf.Duration max_execution_period = 1 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. + // Defaults to 255 if not explicitly set. + uint64 max_metadata_len = 2; +} diff --git a/packages/cosmos/proto/cosmos/group/v1/events.proto b/packages/cosmos/proto/cosmos/group/v1/events.proto new file mode 100644 index 00000000..c2cfe872 --- /dev/null +++ b/packages/cosmos/proto/cosmos/group/v1/events.proto @@ -0,0 +1,81 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/group/v1/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// EventCreateGroup is an event emitted when a group is created. +message EventCreateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventUpdateGroup is an event emitted when a group is updated. +message EventUpdateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventCreateGroupPolicy is an event emitted when a group policy is created. +message EventCreateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +message EventUpdateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventSubmitProposal is an event emitted when a proposal is created. +message EventSubmitProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +message EventWithdrawProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventVote is an event emitted when a voter votes on a proposal. +message EventVote { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventExec is an event emitted when a proposal is executed. +message EventExec { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // result is the proposal execution result. + ProposalExecutorResult result = 2; + + // logs contains error logs in case the execution result is FAILURE. + string logs = 3; +} + +// EventLeaveGroup is an event emitted when group member leaves the group. +message EventLeaveGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // address is the account address of the group member. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/packages/cosmos/proto/cosmos/group/v1/genesis.proto b/packages/cosmos/proto/cosmos/group/v1/genesis.proto new file mode 100644 index 00000000..e4c895e9 --- /dev/null +++ b/packages/cosmos/proto/cosmos/group/v1/genesis.proto @@ -0,0 +1,39 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "cosmos/group/v1/types.proto"; + +// GenesisState defines the group module's genesis state. +message GenesisState { + + // group_seq is the group table orm.Sequence, + // it is used to get the next group ID. + uint64 group_seq = 1; + + // groups is the list of groups info. + repeated GroupInfo groups = 2; + + // group_members is the list of groups members. + repeated GroupMember group_members = 3; + + // group_policy_seq is the group policy table orm.Sequence, + // it is used to generate the next group policy account address. + uint64 group_policy_seq = 4; + + // group_policies is the list of group policies info. + repeated GroupPolicyInfo group_policies = 5; + + // proposal_seq is the proposal table orm.Sequence, + // it is used to get the next proposal ID. + uint64 proposal_seq = 6; + + // proposals is the list of proposals. + repeated Proposal proposals = 7; + + // votes is the list of votes. + repeated Vote votes = 8; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/group/v1/query.proto b/packages/cosmos/proto/cosmos/group/v1/query.proto new file mode 100644 index 00000000..2cabc8e8 --- /dev/null +++ b/packages/cosmos/proto/cosmos/group/v1/query.proto @@ -0,0 +1,293 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/group/v1/types.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// Query is the cosmos.group.v1 Query service. +service Query { + + // GroupInfo queries group info based on group id. + rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_info/{group_id}"; + }; + + // GroupPolicyInfo queries group policy info based on account address of group policy. + rpc GroupPolicyInfo(QueryGroupPolicyInfoRequest) returns (QueryGroupPolicyInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}"; + }; + + // GroupMembers queries members of a group by group id. + rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}"; + }; + + // GroupsByAdmin queries groups by admin address. + rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_admin/{admin}"; + }; + + // GroupPoliciesByGroup queries group policies by group id. + rpc GroupPoliciesByGroup(QueryGroupPoliciesByGroupRequest) returns (QueryGroupPoliciesByGroupResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}"; + }; + + // GroupPoliciesByAdmin queries group policies by admin address. + rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}"; + }; + + // Proposal queries a proposal based on proposal id. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposal/{proposal_id}"; + }; + + // ProposalsByGroupPolicy queries proposals based on account address of group policy. + rpc ProposalsByGroupPolicy(QueryProposalsByGroupPolicyRequest) returns (QueryProposalsByGroupPolicyResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals_by_group_policy/{address}"; + }; + + // VoteByProposalVoter queries a vote by proposal id and voter. + rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}"; + }; + + // VotesByProposal queries a vote by proposal id. + rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}"; + }; + + // VotesByVoter queries a vote by voter. + rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_voter/{voter}"; + }; + + // GroupsByMember queries groups by member address. + rpc GroupsByMember(QueryGroupsByMemberRequest) returns (QueryGroupsByMemberResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}"; + }; + + // TallyResult returns the tally result of a proposal. If the proposal is + // still in voting period, then this query computes the current tally state, + // which might not be final. On the other hand, if the proposal is final, + // then it simply returns the `final_tally_result` state stored in the + // proposal itself. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; + }; +} + +// QueryGroupInfoRequest is the Query/GroupInfo request type. +message QueryGroupInfoRequest { + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// QueryGroupInfoResponse is the Query/GroupInfo response type. +message QueryGroupInfoResponse { + // info is the GroupInfo of the group. + GroupInfo info = 1; +} + +// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. +message QueryGroupPolicyInfoRequest { + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. +message QueryGroupPolicyInfoResponse { + // info is the GroupPolicyInfo of the group policy. + GroupPolicyInfo info = 1; +} + +// QueryGroupMembersRequest is the Query/GroupMembers request type. +message QueryGroupMembersRequest { + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. +message QueryGroupMembersResponse { + // members are the members of the group with given group_id. + repeated GroupMember members = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. +message QueryGroupsByAdminRequest { + // admin is the account address of a group's admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. +message QueryGroupsByAdminResponse { + // groups are the groups info with the provided admin. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. +message QueryGroupPoliciesByGroupRequest { + // group_id is the unique ID of the group policy's group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. +message QueryGroupPoliciesByGroupResponse { + // group_policies are the group policies info associated with the provided group. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. +message QueryGroupPoliciesByAdminRequest { + // admin is the admin address of the group policy. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. +message QueryGroupPoliciesByAdminResponse { + // group_policies are the group policies info with provided admin. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryProposalRequest is the Query/Proposal request type. +message QueryProposalRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the Query/Proposal response type. +message QueryProposalResponse { + // proposal is the proposal info. + Proposal proposal = 1; +} + +// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. +message QueryProposalsByGroupPolicyRequest { + // address is the account address of the group policy related to proposals. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. +message QueryProposalsByGroupPolicyResponse { + // proposals are the proposals with given group policy. + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. +message QueryVoteByProposalVoterRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // voter is a proposal voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. +message QueryVoteByProposalVoterResponse { + // vote is the vote with given proposal_id and voter. + Vote vote = 1; +} + +// QueryVotesByProposalRequest is the Query/VotesByProposal request type. +message QueryVotesByProposalRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByProposalResponse is the Query/VotesByProposal response type. +message QueryVotesByProposalResponse { + // votes are the list of votes for given proposal_id. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVotesByVoterRequest is the Query/VotesByVoter request type. +message QueryVotesByVoterRequest { + // voter is a proposal voter account address. + string voter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByVoterResponse is the Query/VotesByVoter response type. +message QueryVotesByVoterResponse { + // votes are the list of votes by given voter. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. +message QueryGroupsByMemberRequest { + // address is the group member address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. +message QueryGroupsByMemberResponse { + // groups are the groups info with the provided group member. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the Query/TallyResult request type. +message QueryTallyResultRequest { + // proposal_id is the unique id of a proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the Query/TallyResult response type. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/group/v1/tx.proto b/packages/cosmos/proto/cosmos/group/v1/tx.proto new file mode 100644 index 00000000..20e04cb7 --- /dev/null +++ b/packages/cosmos/proto/cosmos/group/v1/tx.proto @@ -0,0 +1,394 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/group/v1/types.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +// Msg is the cosmos.group.v1 Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. + rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse); + + // UpdateGroupMembers updates the group members with given group id and admin address. + rpc UpdateGroupMembers(MsgUpdateGroupMembers) returns (MsgUpdateGroupMembersResponse); + + // UpdateGroupAdmin updates the group admin with given group id and previous admin address. + rpc UpdateGroupAdmin(MsgUpdateGroupAdmin) returns (MsgUpdateGroupAdminResponse); + + // UpdateGroupMetadata updates the group metadata with given group id and admin address. + rpc UpdateGroupMetadata(MsgUpdateGroupMetadata) returns (MsgUpdateGroupMetadataResponse); + + // CreateGroupPolicy creates a new group policy using given DecisionPolicy. + rpc CreateGroupPolicy(MsgCreateGroupPolicy) returns (MsgCreateGroupPolicyResponse); + + // CreateGroupWithPolicy creates a new group with policy. + rpc CreateGroupWithPolicy(MsgCreateGroupWithPolicy) returns (MsgCreateGroupWithPolicyResponse); + + // UpdateGroupPolicyAdmin updates a group policy admin. + rpc UpdateGroupPolicyAdmin(MsgUpdateGroupPolicyAdmin) returns (MsgUpdateGroupPolicyAdminResponse); + + // UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. + rpc UpdateGroupPolicyDecisionPolicy(MsgUpdateGroupPolicyDecisionPolicy) + returns (MsgUpdateGroupPolicyDecisionPolicyResponse); + + // UpdateGroupPolicyMetadata updates a group policy metadata. + rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse); + + // SubmitProposal submits a new proposal. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // WithdrawProposal withdraws a proposal. + rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse); + + // Vote allows a voter to vote on a proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // Exec executes a proposal. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // LeaveGroup allows a group member to leave the group. + rpc LeaveGroup(MsgLeaveGroup) returns (MsgLeaveGroupResponse); +} + +// +// Groups +// + +// MsgCreateGroup is the Msg/CreateGroup request type. +message MsgCreateGroup { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroup"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // metadata is any arbitrary metadata to attached to the group. + string metadata = 3; +} + +// MsgCreateGroupResponse is the Msg/CreateGroup response type. +message MsgCreateGroupResponse { + // group_id is the unique ID of the newly created group. + uint64 group_id = 1; +} + +// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. +message MsgUpdateGroupMembers { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMembers"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // member_updates is the list of members to update, + // set weight to 0 to remove a member. + repeated MemberRequest member_updates = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. +message MsgUpdateGroupMembersResponse {} + +// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. +message MsgUpdateGroupAdmin { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupAdmin"; + + // admin is the current account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // new_admin is the group new admin account address. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. +message MsgUpdateGroupAdminResponse {} + +// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. +message MsgUpdateGroupMetadata { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMetadata"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is the updated group's metadata. + string metadata = 3; +} + +// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. +message MsgUpdateGroupMetadataResponse {} + +// +// Group Policies +// + +// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. +message MsgCreateGroupPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupPolicy"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is any arbitrary metadata attached to the group policy. + string metadata = 3; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. +message MsgCreateGroupPolicyResponse { + // address is the account address of the newly created group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. +message MsgUpdateGroupPolicyAdmin { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of the group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // new_admin is the new group policy admin. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +message MsgUpdateGroupPolicyAdminResponse {} + +// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. +message MsgCreateGroupWithPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupWithPolicy"; + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group and group policy admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // group_metadata is any arbitrary metadata attached to the group. + string group_metadata = 3; + + // group_policy_metadata is any arbitrary metadata attached to the group policy. + string group_policy_metadata = 4; + + // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + // and group policy admin. + bool group_policy_as_admin = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. +message MsgCreateGroupWithPolicyResponse { + // group_id is the unique ID of the newly created group with policy. + uint64 group_id = 1; + + // group_policy_address is the account address of the newly created group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. +message MsgUpdateGroupPolicyDecisionPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupDecisionPolicy"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // decision_policy is the updated group policy's decision policy. + google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. +message MsgUpdateGroupPolicyDecisionPolicyResponse {} + +// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. +message MsgUpdateGroupPolicyMetadata { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is the group policy metadata to be updated. + string metadata = 3; +} + +// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. +message MsgUpdateGroupPolicyMetadataResponse {} + +// +// Proposals and Voting +// + +// Exec defines modes of execution of a proposal on creation or on new vote. +enum Exec { + // An empty value means that there should be a separate + // MsgExec request for the proposal to execute. + EXEC_UNSPECIFIED = 0; + + // Try to execute the proposal immediately. + // If the proposal is not allowed per the DecisionPolicy, + // the proposal will still be open and could + // be executed at a later point. + EXEC_TRY = 1; +} + +// MsgSubmitProposal is the Msg/SubmitProposal request type. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposers"; + option (amino.name) = "cosmos-sdk/group/MsgSubmitProposal"; + + option (gogoproto.goproto_getters) = false; + + // group_policy_address is the account address of group policy. + string group_policy_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // proposers are the account addresses of the proposers. + // Proposers signatures will be counted as yes votes. + repeated string proposers = 2; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 3; + + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 4; + + // exec defines the mode of execution of the proposal, + // whether it should be executed immediately on creation or not. + // If so, proposers signatures are considered as Yes votes. + Exec exec = 5; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 6; + + // summary is the summary of the proposal. + // + // Since: cosmos-sdk 0.47 + string summary = 7; +} + +// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// MsgWithdrawProposal is the Msg/WithdrawProposal request type. +message MsgWithdrawProposal { + option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgWithdrawProposal"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // address is the admin of the group policy or one of the proposer of the proposal. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. +message MsgWithdrawProposalResponse {} + +// MsgVote is the Msg/Vote request type. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/group/MsgVote"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // voter is the voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the vote. + string metadata = 4; + + // exec defines whether the proposal should be executed + // immediately after voting or not. + Exec exec = 5; +} + +// MsgVoteResponse is the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgExec is the Msg/Exec request type. +message MsgExec { + option (cosmos.msg.v1.signer) = "signer"; + option (amino.name) = "cosmos-sdk/group/MsgExec"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // executor is the account address used to execute the proposal. + string executor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgExecResponse is the Msg/Exec request type. +message MsgExecResponse { + // result is the final result of the proposal execution. + ProposalExecutorResult result = 2; +} + +// MsgLeaveGroup is the Msg/LeaveGroup request type. +message MsgLeaveGroup { + option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgLeaveGroup"; + + // address is the account address of the group member. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; +} + +// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. +message MsgLeaveGroupResponse {} diff --git a/packages/cosmos/proto/cosmos/group/v1/types.proto b/packages/cosmos/proto/cosmos/group/v1/types.proto new file mode 100644 index 00000000..99838401 --- /dev/null +++ b/packages/cosmos/proto/cosmos/group/v1/types.proto @@ -0,0 +1,333 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "amino/amino.proto"; + +// Member represents a group member with an account address, +// non-zero weight, metadata and added_at timestamp. +message Member { + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata attached to the member. + string metadata = 3; + + // added_at is a timestamp specifying when a member was added. + google.protobuf.Timestamp added_at = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// MemberRequest represents a group member to be used in Msg server requests. +// Contrary to `Member`, it doesn't have any `added_at` field +// since this field cannot be set as part of requests. +message MemberRequest { + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata attached to the member. + string metadata = 3; +} + +// ThresholdDecisionPolicy is a decision policy where a proposal passes when it +// satisfies the two following conditions: +// 1. The sum of all `YES` voter's weights is greater or equal than the defined +// `threshold`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. +message ThresholdDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/ThresholdDecisionPolicy"; + + // threshold is the minimum weighted sum of `YES` votes that must be met or + // exceeded for a proposal to succeed. + string threshold = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// PercentageDecisionPolicy is a decision policy where a proposal passes when +// it satisfies the two following conditions: +// 1. The percentage of all `YES` voters' weights out of the total group weight +// is greater or equal than the given `percentage`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. +message PercentageDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/PercentageDecisionPolicy"; + + // percentage is the minimum percentage of the weighted sum of `YES` votes must + // meet for a proposal to succeed. + string percentage = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// DecisionPolicyWindows defines the different windows for voting and execution. +message DecisionPolicyWindows { + // voting_period is the duration from submission of a proposal to the end of voting period + // Within this times votes can be submitted with MsgVote. + google.protobuf.Duration voting_period = 1 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // min_execution_period is the minimum duration after the proposal submission + // where members can start sending MsgExec. This means that the window for + // sending a MsgExec transaction is: + // `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + // where max_execution_period is a app-specific config, defined in the keeper. + // If not set, min_execution_period will default to 0. + // + // Please make sure to set a `min_execution_period` that is smaller than + // `voting_period + max_execution_period`, or else the above execution window + // is empty, meaning that all proposals created with this decision policy + // won't be able to be executed. + google.protobuf.Duration min_execution_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// VoteOption enumerates the valid vote options for a given proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + // return an error. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// +// State +// + +// GroupInfo represents the high-level on-chain information for a group. +message GroupInfo { + // id is the unique ID of the group. + uint64 id = 1; + + // admin is the account address of the group's admin. + string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata to attached to the group. + string metadata = 3; + + // version is used to track changes to a group's membership structure that + // would break existing proposals. Whenever any members weight is changed, + // or any member is added or removed this version is incremented and will + // cause proposals based on older versions of this group to fail + uint64 version = 4; + + // total_weight is the sum of the group members' weights. + string total_weight = 5; + + // created_at is a timestamp specifying when a group was created. + google.protobuf.Timestamp created_at = 6 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// GroupMember represents the relationship between a group and a member. +message GroupMember { + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // member is the member data. + Member member = 2; +} + +// GroupPolicyInfo represents the high-level on-chain information for a group policy. +message GroupPolicyInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + // address is the account address of group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // admin is the account address of the group admin. + string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the group policy. + string metadata = 4; + + // version is used to track changes to a group's GroupPolicyInfo structure that + // would create a different result on a running proposal. + uint64 version = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; + + // created_at is a timestamp specifying when a group policy was created. + google.protobuf.Timestamp created_at = 7 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// Proposal defines a group proposal. Any member of a group can submit a proposal +// for a group policy to decide upon. +// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal +// passes as well as some optional metadata associated with the proposal. +message Proposal { + option (gogoproto.goproto_getters) = false; + + // id is the unique id of the proposal. + uint64 id = 1; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 3; + + // proposers are the account addresses of the proposers. + repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // submit_time is a timestamp specifying when a proposal was submitted. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // group_version tracks the version of the group at proposal submission. + // This field is here for informational purposes only. + uint64 group_version = 6; + + // group_policy_version tracks the version of the group policy at proposal submission. + // When a decision policy is changed, existing proposals from previous policy + // versions will become invalid with the `ABORTED` status. + // This field is here for informational purposes only. + uint64 group_policy_version = 7; + + // status represents the high level position in the life cycle of the proposal. Initial value is Submitted. + ProposalStatus status = 8; + + // final_tally_result contains the sums of all weighted votes for this + // proposal for each vote option. It is empty at submission, and only + // populated after tallying, at voting period end or at proposal execution, + // whichever happens first. + TallyResult final_tally_result = 9 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_period_end is the timestamp before which voting must be done. + // Unless a successful MsgExec is called before (to execute a proposal whose + // tally is successful before the voting period ends), tallying will be done + // at this point, and the `final_tally_result`and `status` fields will be + // accordingly updated. + google.protobuf.Timestamp voting_period_end = 10 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // executor_result is the final result of the proposal execution. Initial value is NotRun. + ProposalExecutorResult executor_result = 11; + + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 12; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 13; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 14; +} + +// ProposalStatus defines proposal statuses. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is invalid and not allowed. + PROPOSAL_STATUS_UNSPECIFIED = 0; + + // Initial status of a proposal when submitted. + PROPOSAL_STATUS_SUBMITTED = 1; + + // Final status of a proposal when the final tally is done and the outcome + // passes the group policy's decision policy. + PROPOSAL_STATUS_ACCEPTED = 2; + + // Final status of a proposal when the final tally is done and the outcome + // is rejected by the group policy's decision policy. + PROPOSAL_STATUS_REJECTED = 3; + + // Final status of a proposal when the group policy is modified before the + // final tally. + PROPOSAL_STATUS_ABORTED = 4; + + // A proposal can be withdrawn before the voting start time by the owner. + // When this happens the final status is Withdrawn. + PROPOSAL_STATUS_WITHDRAWN = 5; +} + +// ProposalExecutorResult defines types of proposal executor results. +enum ProposalExecutorResult { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is not allowed. + PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0; + + // We have not yet run the executor. + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1; + + // The executor was successful and proposed action updated state. + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2; + + // The executor returned an error and proposed action didn't update state. + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3; +} + +// TallyResult represents the sum of weighted votes for each vote option. +message TallyResult { + option (gogoproto.goproto_getters) = false; + + // yes_count is the weighted sum of yes votes. + string yes_count = 1; + + // abstain_count is the weighted sum of abstainers. + string abstain_count = 2; + + // no_count is the weighted sum of no votes. + string no_count = 3; + + // no_with_veto_count is the weighted sum of veto. + string no_with_veto_count = 4; +} + +// Vote represents a vote for a proposal. +message Vote { + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // voter is the account address of the voter. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the vote. + string metadata = 4; + + // submit_time is the timestamp when the vote was submitted. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} diff --git a/packages/cosmos/proto/cosmos/mint/module/v1/module.proto b/packages/cosmos/proto/cosmos/mint/module/v1/module.proto new file mode 100644 index 00000000..2ea1ef3d --- /dev/null +++ b/packages/cosmos/proto/cosmos/mint/module/v1/module.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.mint.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the mint module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/mint" + }; + + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/mint/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/mint/v1beta1/genesis.proto new file mode 100644 index 00000000..b6cc1504 --- /dev/null +++ b/packages/cosmos/proto/cosmos/mint/v1beta1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// GenesisState defines the mint module's genesis state. +message GenesisState { + // minter is a space for holding current inflation information. + Minter minter = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // params defines all the parameters of the module. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/mint/v1beta1/mint.proto b/packages/cosmos/proto/cosmos/mint/v1beta1/mint.proto new file mode 100644 index 00000000..49b00a5d --- /dev/null +++ b/packages/cosmos/proto/cosmos/mint/v1beta1/mint.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// Minter represents the minting state. +message Minter { + // current annual inflation rate + string inflation = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // current annual expected provisions + string annual_provisions = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Params defines the parameters for the x/mint module. +message Params { + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/x/mint/Params"; + + // type of coin to mint + string mint_denom = 1; + // maximum annual change in inflation rate + string inflation_rate_change = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // maximum inflation rate + string inflation_max = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // minimum inflation rate + string inflation_min = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // goal of percent bonded atoms + string goal_bonded = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // expected blocks per year + uint64 blocks_per_year = 6; +} diff --git a/packages/cosmos/proto/cosmos/mint/v1beta1/query.proto b/packages/cosmos/proto/cosmos/mint/v1beta1/query.proto new file mode 100644 index 00000000..002f2744 --- /dev/null +++ b/packages/cosmos/proto/cosmos/mint/v1beta1/query.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/params"; + } + + // Inflation returns the current minting inflation value. + rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; + } + + // AnnualProvisions current minting annual provisions value. + rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryInflationRequest is the request type for the Query/Inflation RPC method. +message QueryInflationRequest {} + +// QueryInflationResponse is the response type for the Query/Inflation RPC +// method. +message QueryInflationResponse { + // inflation is the current minting inflation value. + bytes inflation = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// QueryAnnualProvisionsRequest is the request type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsRequest {} + +// QueryAnnualProvisionsResponse is the response type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsResponse { + // annual_provisions is the current minting annual provisions value. + bytes annual_provisions = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/packages/cosmos/proto/cosmos/mint/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/mint/v1beta1/tx.proto new file mode 100644 index 00000000..ec71fb73 --- /dev/null +++ b/packages/cosmos/proto/cosmos/mint/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +// Msg defines the x/mint Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/mint/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/packages/cosmos/proto/cosmos/msg/v1/msg.proto b/packages/cosmos/proto/cosmos/msg/v1/msg.proto new file mode 100644 index 00000000..853efa1f --- /dev/null +++ b/packages/cosmos/proto/cosmos/msg/v1/msg.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package cosmos.msg.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice"; + +extend google.protobuf.ServiceOptions { + // service indicates that the service is a Msg service and that requests + // must be transported via blockchain transactions rather than gRPC. + // Tooling can use this annotation to distinguish between Msg services and + // other types of services via reflection. + bool service = 11110000; +} + +extend google.protobuf.MessageOptions { + // signer must be used in cosmos messages in order + // to signal to external clients which fields in a + // given cosmos message must be filled with signer + // information (address). + // The field must be the protobuf name of the message + // field extended with this MessageOption. + // The field must either be of string kind, or of message + // kind in case the signer information is contained within + // a message inside the cosmos message. + repeated string signer = 11110000; +} diff --git a/packages/cosmos/proto/cosmos/nft/module/v1/module.proto b/packages/cosmos/proto/cosmos/nft/module/v1/module.proto new file mode 100644 index 00000000..8f820fa0 --- /dev/null +++ b/packages/cosmos/proto/cosmos/nft/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.nft.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the nft module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/nft" + }; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/nft/v1beta1/event.proto b/packages/cosmos/proto/cosmos/nft/v1beta1/event.proto new file mode 100644 index 00000000..2f6d5a0d --- /dev/null +++ b/packages/cosmos/proto/cosmos/nft/v1beta1/event.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// EventSend is emitted on Msg/Send +message EventSend { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3; + + // receiver is the receiver address of nft + string receiver = 4; +} + +// EventMint is emitted on Mint +message EventMint { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; +} + +// EventBurn is emitted on Burn +message EventBurn { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; +} diff --git a/packages/cosmos/proto/cosmos/nft/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/nft/v1beta1/genesis.proto new file mode 100644 index 00000000..75b5245a --- /dev/null +++ b/packages/cosmos/proto/cosmos/nft/v1beta1/genesis.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// GenesisState defines the nft module's genesis state. +message GenesisState { + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + + // entry defines all nft owned by a person. + repeated Entry entries = 2; +} + +// Entry Defines all nft owned by a person +message Entry { + // owner is the owner address of the following nft + string owner = 1; + + // nfts is a group of nfts of the same owner + repeated cosmos.nft.v1beta1.NFT nfts = 2; +} diff --git a/packages/cosmos/proto/cosmos/nft/v1beta1/nft.proto b/packages/cosmos/proto/cosmos/nft/v1beta1/nft.proto new file mode 100644 index 00000000..b1241260 --- /dev/null +++ b/packages/cosmos/proto/cosmos/nft/v1beta1/nft.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// Class defines the class of the nft type. +message Class { + // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + string id = 1; + + // name defines the human-readable name of the NFT classification. Optional + string name = 2; + + // symbol is an abbreviated name for nft classification. Optional + string symbol = 3; + + // description is a brief description of nft classification. Optional + string description = 4; + + // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + string uri = 5; + + // uri_hash is a hash of the document pointed by uri. Optional + string uri_hash = 6; + + // data is the app specific metadata of the NFT class. Optional + google.protobuf.Any data = 7; +} + +// NFT defines the NFT. +message NFT { + // class_id associated with the NFT, similar to the contract address of ERC721 + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; + + // uri for the NFT metadata stored off chain + string uri = 3; + + // uri_hash is a hash of the document pointed by uri + string uri_hash = 4; + + // data is an app specific data of the NFT. Optional + google.protobuf.Any data = 10; +} diff --git a/packages/cosmos/proto/cosmos/nft/v1beta1/query.proto b/packages/cosmos/proto/cosmos/nft/v1beta1/query.proto new file mode 100644 index 00000000..ae482e4c --- /dev/null +++ b/packages/cosmos/proto/cosmos/nft/v1beta1/query.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/balance/{owner}/{class_id}"; + } + + // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + rpc Owner(QueryOwnerRequest) returns (QueryOwnerResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/owner/{class_id}/{id}"; + } + + // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/supply/{class_id}"; + } + + // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in + // ERC721Enumerable + rpc NFTs(QueryNFTsRequest) returns (QueryNFTsResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts"; + } + + // NFT queries an NFT based on its class and id. + rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts/{class_id}/{id}"; + } + + // Class queries an NFT class based on its id + rpc Class(QueryClassRequest) returns (QueryClassResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes/{class_id}"; + } + + // Classes queries all NFT classes + rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method +message QueryBalanceRequest { + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method +message QueryBalanceResponse { + // amount is the number of all NFTs of a given class owned by the owner + uint64 amount = 1; +} + +// QueryOwnerRequest is the request type for the Query/Owner RPC method +message QueryOwnerRequest { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; +} + +// QueryOwnerResponse is the response type for the Query/Owner RPC method +message QueryOwnerResponse { + // owner is the owner address of the nft + string owner = 1; +} + +// QuerySupplyRequest is the request type for the Query/Supply RPC method +message QuerySupplyRequest { + // class_id associated with the nft + string class_id = 1; +} + +// QuerySupplyResponse is the response type for the Query/Supply RPC method +message QuerySupplyResponse { + // amount is the number of all NFTs from the given class + uint64 amount = 1; +} + +// QueryNFTstRequest is the request type for the Query/NFTs RPC method +message QueryNFTsRequest { + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +message QueryNFTsResponse { + // NFT defines the NFT + repeated cosmos.nft.v1beta1.NFT nfts = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryNFTRequest is the request type for the Query/NFT RPC method +message QueryNFTRequest { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; +} + +// QueryNFTResponse is the response type for the Query/NFT RPC method +message QueryNFTResponse { + // owner is the owner address of the nft + cosmos.nft.v1beta1.NFT nft = 1; +} + +// QueryClassRequest is the request type for the Query/Class RPC method +message QueryClassRequest { + // class_id associated with the nft + string class_id = 1; +} + +// QueryClassResponse is the response type for the Query/Class RPC method +message QueryClassResponse { + // class defines the class of the nft type. + cosmos.nft.v1beta1.Class class = 1; +} + +// QueryClassesRequest is the request type for the Query/Classes RPC method +message QueryClassesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClassesResponse is the response type for the Query/Classes RPC method +message QueryClassesResponse { + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/cosmos/proto/cosmos/nft/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/nft/v1beta1/tx.proto new file mode 100644 index 00000000..0637cd8d --- /dev/null +++ b/packages/cosmos/proto/cosmos/nft/v1beta1/tx.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the nft Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Send defines a method to send a nft from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); +} + +// MsgSend represents a message to send a nft from one account to another account. +message MsgSend { + option (cosmos.msg.v1.signer) = "sender"; + + // class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + string class_id = 1; + + // id defines the unique identification of nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // receiver is the receiver address of nft + string receiver = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/orm/module/v1alpha1/module.proto b/packages/cosmos/proto/cosmos/orm/module/v1alpha1/module.proto new file mode 100644 index 00000000..cb7bbbee --- /dev/null +++ b/packages/cosmos/proto/cosmos/orm/module/v1alpha1/module.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package cosmos.orm.module.v1alpha1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module defines the ORM module which adds providers to the app container for +// module-scoped DB's. In the future it may provide gRPC services for interacting +// with ORM data. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/orm" + }; +} diff --git a/packages/cosmos/proto/cosmos/orm/query/v1alpha1/query.proto b/packages/cosmos/proto/cosmos/orm/query/v1alpha1/query.proto new file mode 100644 index 00000000..4500e99d --- /dev/null +++ b/packages/cosmos/proto/cosmos/orm/query/v1alpha1/query.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +package cosmos.orm.query.v1alpha1; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/any.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +// Query is a generic gRPC service for querying ORM data. +service Query { + + // Get queries an ORM table against an unique index. + rpc Get(GetRequest) returns (GetResponse); + + // List queries an ORM table against an index. + rpc List(ListRequest) returns (ListResponse); +} + +// GetRequest is the Query/Get request type. +message GetRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. If it is non-empty, it must + // refer to an unique index. + string index = 2; + + // values are the values of the fields corresponding to the requested index. + // There must be as many values provided as there are fields in the index and + // these values must correspond to the index field types. + repeated IndexValue values = 3; +} + +// GetResponse is the Query/Get response type. +message GetResponse { + + // result is the result of the get query. If no value is found, the gRPC + // status code NOT_FOUND will be returned. + google.protobuf.Any result = 1; +} + +// ListRequest is the Query/List request type. +message ListRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. + string index = 2; + + // query is the query expression corresponding to the provided index. If + // neither prefix nor range is specified, the query will list all the fields + // in the index. + oneof query { + + // prefix defines a prefix query. + Prefix prefix = 3; + + // range defines a range query. + Range range = 4; + } + + // pagination is the pagination request. + cosmos.base.query.v1beta1.PageRequest pagination = 5; + + // Prefix specifies the arguments to a prefix query. + message Prefix { + // values specifies the index values for the prefix query. + // It is valid to special a partial prefix with fewer values than + // the number of fields in the index. + repeated IndexValue values = 1; + } + + // Range specifies the arguments to a range query. + message Range { + // start specifies the starting index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue start = 1; + + // end specifies the inclusive ending index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue end = 2; + } +} + +// ListResponse is the Query/List response type. +message ListResponse { + + // results are the results of the query. + repeated google.protobuf.Any results = 1; + + // pagination is the pagination response. + cosmos.base.query.v1beta1.PageResponse pagination = 5; +} + +// IndexValue represents the value of a field in an ORM index expression. +message IndexValue { + + // value specifies the index value + oneof value { + // uint specifies a value for an uint32, fixed32, uint64, or fixed64 + // index field. + uint64 uint = 1; + + // int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + // index field. + int64 int = 2; + + // str specifies a value for a string index field. + string str = 3; + + // bytes specifies a value for a bytes index field. + bytes bytes = 4; + + // enum specifies a value for an enum index field. + string enum = 5; + + // bool specifies a value for a bool index field. + bool bool = 6; + + // timestamp specifies a value for a timestamp index field. + google.protobuf.Timestamp timestamp = 7; + + // duration specifies a value for a duration index field. + google.protobuf.Duration duration = 8; + } +} diff --git a/packages/cosmos/proto/cosmos/orm/v1/orm.proto b/packages/cosmos/proto/cosmos/orm/v1/orm.proto new file mode 100644 index 00000000..389babd1 --- /dev/null +++ b/packages/cosmos/proto/cosmos/orm/v1/orm.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package cosmos.orm.v1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + + // table specifies that this message will be used as an ORM table. It cannot + // be used together with the singleton option. + TableDescriptor table = 104503790; + + // singleton specifies that this message will be used as an ORM singleton. It cannot + // be used together with the table option. + SingletonDescriptor singleton = 104503791; +} + +// TableDescriptor describes an ORM table. +message TableDescriptor { + + // primary_key defines the primary key for the table. + PrimaryKeyDescriptor primary_key = 1; + + // index defines one or more secondary indexes. + repeated SecondaryIndexDescriptor index = 2; + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 3; +} + +// PrimaryKeyDescriptor describes a table primary key. +message PrimaryKeyDescriptor { + + // fields is a comma-separated list of fields in the primary key. Spaces are + // not allowed. Supported field types, their encodings, and any applicable constraints + // are described below. + // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers. + // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers such as auto-incrementing sequences. + // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + // sorted iteration. These types are well-suited for encoding fixed with + // decimals as integers. + // - string's are encoded as raw bytes in terminal key segments and null-terminated + // in non-terminal segments. Null characters are thus forbidden in strings. + // string fields support sorted iteration. + // - bytes are encoded as raw bytes in terminal segments and length-prefixed + // with a 32-bit unsigned varint in non-terminal segments. + // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + // an encoding that enables sorted iteration. + // - google.protobuf.Timestamp and google.protobuf.Duration are encoded + // as 12 bytes using an encoding that enables sorted iteration. + // - enum fields are encoded using varint encoding and do not support sorted + // iteration. + // - bool fields are encoded as a single byte 0 or 1. + // + // All other fields types are unsupported in keys including repeated and + // oneof fields. + // + // Primary keys are prefixed by the varint encoded table id and the byte 0x0 + // plus any additional prefix specified by the schema. + string fields = 1; + + // auto_increment specifies that the primary key is generated by an + // auto-incrementing integer. If this is set to true fields must only + // contain one field of that is of type uint64. + bool auto_increment = 2; +} + +// PrimaryKeyDescriptor describes a table secondary index. +message SecondaryIndexDescriptor { + + // fields is a comma-separated list of fields in the index. The supported + // field types are the same as those for PrimaryKeyDescriptor.fields. + // Index keys are prefixed by the varint encoded table id and the varint + // encoded index id plus any additional prefix specified by the schema. + // + // In addition the field segments, non-unique index keys are suffixed with + // any additional primary key fields not present in the index fields so that the + // primary key can be reconstructed. Unique indexes instead of being suffixed + // store the remaining primary key fields in the value.. + string fields = 1; + + // id is a non-zero integer ID that must be unique within the indexes for this + // table and less than 32768. It may be deprecated in the future when this can + // be auto-generated. + uint32 id = 2; + + // unique specifies that this an unique index. + bool unique = 3; +} + +// TableDescriptor describes an ORM singleton table which has at most one instance. +message SingletonDescriptor { + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/orm/v1alpha1/schema.proto b/packages/cosmos/proto/cosmos/orm/v1alpha1/schema.proto new file mode 100644 index 00000000..ab713340 --- /dev/null +++ b/packages/cosmos/proto/cosmos/orm/v1alpha1/schema.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package cosmos.orm.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module_schema is used to define the ORM schema for an app module. + // All module config messages that use module_schema must also declare + // themselves as app module config messages using the cosmos.app.v1.is_module + // option. + ModuleSchemaDescriptor module_schema = 104503792; +} + +// ModuleSchemaDescriptor describe's a module's ORM schema. +message ModuleSchemaDescriptor { + repeated FileEntry schema_file = 1; + + // FileEntry describes an ORM file used in a module. + message FileEntry { + // id is a prefix that will be varint encoded and prepended to all the + // table keys specified in the file's tables. + uint32 id = 1; + + // proto_file_name is the name of a file .proto in that contains + // table definitions. The .proto file must be in a package that the + // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + string proto_file_name = 2; + + // storage_type optionally indicates the type of storage this file's + // tables should used. If it is left unspecified, the default KV-storage + // of the app will be used. + StorageType storage_type = 3; + } + + // prefix is an optional prefix that precedes all keys in this module's + // store. + bytes prefix = 2; +} + +// StorageType +enum StorageType { + // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent + // KV-storage where primary key entries are stored in merkle-tree + // backed commitment storage and indexes and seqs are stored in + // fast index storage. Note that the Cosmos SDK before store/v2alpha1 + // does not support this. + STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; + + // STORAGE_TYPE_MEMORY indicates in-memory storage that will be + // reloaded every time an app restarts. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_MEMORY = 1; + + // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + // at the end of every block. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_TRANSIENT = 2; + + // STORAGE_TYPE_INDEX indicates persistent storage which is not backed + // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK + // before store/v2alpha1 does not support this. + STORAGE_TYPE_INDEX = 3; + + // STORAGE_TYPE_INDEX indicates persistent storage which is backed by + // a merkle-tree. With this type of storage, both primary and index keys + // will affect the app hash and this is generally less efficient + // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index + // keys into index storage. Note that modules built with the + // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT + // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX + // because this is the only type of persistent storage available. + STORAGE_TYPE_COMMITMENT = 4; +} diff --git a/packages/cosmos/proto/cosmos/params/module/v1/module.proto b/packages/cosmos/proto/cosmos/params/module/v1/module.proto new file mode 100644 index 00000000..75e7f995 --- /dev/null +++ b/packages/cosmos/proto/cosmos/params/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.params.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the params module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/params" + }; +} diff --git a/packages/cosmos/proto/cosmos/params/v1beta1/params.proto b/packages/cosmos/proto/cosmos/params/v1beta1/params.proto new file mode 100644 index 00000000..7bda4651 --- /dev/null +++ b/packages/cosmos/proto/cosmos/params/v1beta1/params.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// ParameterChangeProposal defines a proposal to change one or more parameters. +message ParameterChangeProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/ParameterChangeProposal"; + + string title = 1; + string description = 2; + repeated ParamChange changes = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ParamChange defines an individual parameter change, for use in +// ParameterChangeProposal. +message ParamChange { + option (gogoproto.goproto_stringer) = false; + + string subspace = 1; + string key = 2; + string value = 3; +} diff --git a/packages/cosmos/proto/cosmos/params/v1beta1/query.proto b/packages/cosmos/proto/cosmos/params/v1beta1/query.proto new file mode 100644 index 00000000..827422ea --- /dev/null +++ b/packages/cosmos/proto/cosmos/params/v1beta1/query.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/params/v1beta1/params.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; + +// Query defines the gRPC querier service. +service Query { + // Params queries a specific parameter of a module, given its subspace and + // key. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/params"; + } + + // Subspaces queries for all registered subspaces and all keys for a subspace. + // + // Since: cosmos-sdk 0.46 + rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/subspaces"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest { + // subspace defines the module to query the parameter for. + string subspace = 1; + + // key defines the key of the parameter in the subspace. + string key = 2; +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // param defines the queried parameter. + ParamChange param = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QuerySubspacesRequest defines a request type for querying for all registered +// subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 +message QuerySubspacesRequest {} + +// QuerySubspacesResponse defines the response types for querying for all +// registered subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 +message QuerySubspacesResponse { + repeated Subspace subspaces = 1; +} + +// Subspace defines a parameter subspace name and all the keys that exist for +// the subspace. +// +// Since: cosmos-sdk 0.46 +message Subspace { + string subspace = 1; + repeated string keys = 2; +} diff --git a/packages/cosmos/proto/cosmos/query/v1/query.proto b/packages/cosmos/proto/cosmos/query/v1/query.proto new file mode 100644 index 00000000..e42e73d7 --- /dev/null +++ b/packages/cosmos/proto/cosmos/query/v1/query.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package cosmos.query.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO: once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +extend google.protobuf.MethodOptions { + // module_query_safe is set to true when the query is safe to be called from + // within the state machine, for example from another module's Keeper, via + // ADR-033 calls or from CosmWasm contracts. + // Concretely, it means that the query is: + // 1. deterministic: given a block height, returns the exact same response + // upon multiple calls; and doesn't introduce any state-machine-breaking + // changes across SDK patch version. + // 2. consumes gas correctly. + // + // If you are a module developer and want to add this annotation to one of + // your own queries, please make sure that the corresponding query: + // 1. is deterministic and won't introduce state-machine-breaking changes + // without a coordinated upgrade path, + // 2. has its gas tracked, to avoid the attack vector where no gas is + // accounted for on potentially high-computation queries. + // + // For queries that potentially consume a large amount of gas (for example + // those with pagination, if the pagination field is incorrectly set), we + // also recommend adding Protobuf comments to warn module developers + // consuming these queries. + // + // When set to true, the query can safely be called + bool module_query_safe = 11110001; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/reflection/v1/reflection.proto b/packages/cosmos/proto/cosmos/reflection/v1/reflection.proto new file mode 100644 index 00000000..1f575b83 --- /dev/null +++ b/packages/cosmos/proto/cosmos/reflection/v1/reflection.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package cosmos.reflection.v1; + +import "google/protobuf/descriptor.proto"; +import "cosmos/query/v1/query.proto"; + +// Package cosmos.reflection.v1 provides support for inspecting protobuf +// file descriptors. +service ReflectionService { + // FileDescriptors queries all the file descriptors in the app in order + // to enable easier generation of dynamic clients. + rpc FileDescriptors(FileDescriptorsRequest) returns (FileDescriptorsResponse) { + // NOTE: file descriptors SHOULD NOT be part of consensus because they + // include changes to doc commands and module_query_safe should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// FileDescriptorsRequest is the Query/FileDescriptors request type. +message FileDescriptorsRequest {} + +// FileDescriptorsResponse is the Query/FileDescriptors response type. +message FileDescriptorsResponse { + // files is the file descriptors. + repeated google.protobuf.FileDescriptorProto files = 1; +} diff --git a/packages/cosmos/proto/cosmos/slashing/module/v1/module.proto b/packages/cosmos/proto/cosmos/slashing/module/v1/module.proto new file mode 100644 index 00000000..52433075 --- /dev/null +++ b/packages/cosmos/proto/cosmos/slashing/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.slashing.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the slashing module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/slashing" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/packages/cosmos/proto/cosmos/slashing/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/slashing/v1beta1/genesis.proto new file mode 100644 index 00000000..36bcf76f --- /dev/null +++ b/packages/cosmos/proto/cosmos/slashing/v1beta1/genesis.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// GenesisState defines the slashing module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // signing_infos represents a map between validator addresses and their + // signing infos. + repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // missed_blocks represents a map between validator addresses and their + // missed blocks. + repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// SigningInfo stores validator signing info of corresponding address. +message SigningInfo { + // address is the validator address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_signing_info represents the signing info of this validator. + ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorMissedBlocks contains array of missed blocks of corresponding +// address. +message ValidatorMissedBlocks { + // address is the validator address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // missed_blocks is an array of missed blocks by the validator. + repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MissedBlock contains height and missed status as boolean. +message MissedBlock { + // index is the height at which the block was missed. + int64 index = 1; + // missed is the missed status. + bool missed = 2; +} diff --git a/packages/cosmos/proto/cosmos/slashing/v1beta1/query.proto b/packages/cosmos/proto/cosmos/slashing/v1beta1/query.proto new file mode 100644 index 00000000..761e1a4b --- /dev/null +++ b/packages/cosmos/proto/cosmos/slashing/v1beta1/query.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +// Query provides defines the gRPC querier service +service Query { + // Params queries the parameters of slashing module + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; + } + + // SigningInfo queries the signing info of given cons address + rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; + } + + // SigningInfos queries signing info of all validators + rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC +// method +message QuerySigningInfoRequest { + // cons_address is the address to query signing info of + string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC +// method +message QuerySigningInfoResponse { + // val_signing_info is the signing info of requested val cons address + ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC +// method +message QuerySigningInfosRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC +// method +message QuerySigningInfosResponse { + // info is the signing info of all validators + repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/cosmos/proto/cosmos/slashing/v1beta1/slashing.proto b/packages/cosmos/proto/cosmos/slashing/v1beta1/slashing.proto new file mode 100644 index 00000000..dc1f4211 --- /dev/null +++ b/packages/cosmos/proto/cosmos/slashing/v1beta1/slashing.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// ValidatorSigningInfo defines a validator's signing info for monitoring their +// liveness activity. +message ValidatorSigningInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Height at which validator was first a candidate OR was unjailed + int64 start_height = 2; + // Index which is incremented each time the validator was a bonded + // in a block and may have signed a precommit or not. This in conjunction with the + // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + int64 index_offset = 3; + // Timestamp until which the validator is jailed due to liveness downtime. + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // Whether or not a validator has been tombstoned (killed out of validator set). It is set + // once the validator commits an equivocation or for any other configured misbehiavor. + bool tombstoned = 5; + // A counter kept to avoid unnecessary array reads. + // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + int64 missed_blocks_counter = 6; +} + +// Params represents the parameters used for by the slashing module. +message Params { + option (amino.name) = "cosmos-sdk/x/slashing/Params"; + + int64 signed_blocks_window = 1; + bytes min_signed_per_window = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + google.protobuf.Duration downtime_jail_duration = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; + bytes slash_fraction_double_sign = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + bytes slash_fraction_downtime = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/packages/cosmos/proto/cosmos/slashing/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/slashing/v1beta1/tx.proto new file mode 100644 index 00000000..300fc775 --- /dev/null +++ b/packages/cosmos/proto/cosmos/slashing/v1beta1/tx.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +// Msg defines the slashing Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); + + // UpdateParams defines a governance operation for updating the x/slashing module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUnjail defines the Msg/Unjail request type +message MsgUnjail { + option (cosmos.msg.v1.signer) = "validator_addr"; + option (amino.name) = "cosmos-sdk/MsgUnjail"; + + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_addr = 1 [ + (cosmos_proto.scalar) = "cosmos.AddressString", + (gogoproto.jsontag) = "address", + (amino.field_name) = "address", + (amino.dont_omitempty) = true + ]; +} + +// MsgUnjailResponse defines the Msg/Unjail response type +message MsgUnjailResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/slashing/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/slashing parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/packages/cosmos/proto/cosmos/staking/module/v1/module.proto b/packages/cosmos/proto/cosmos/staking/module/v1/module.proto new file mode 100644 index 00000000..7ef4a06c --- /dev/null +++ b/packages/cosmos/proto/cosmos/staking/module/v1/module.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.staking.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the staking module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/staking" + }; + + // hooks_order specifies the order of staking hooks and should be a list + // of module names which provide a staking hooks instance. If no order is + // provided, then hooks will be applied in alphabetical order of module names. + repeated string hooks_order = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} diff --git a/packages/cosmos/proto/cosmos/staking/v1beta1/authz.proto b/packages/cosmos/proto/cosmos/staking/v1beta1/authz.proto new file mode 100644 index 00000000..055d1b64 --- /dev/null +++ b/packages/cosmos/proto/cosmos/staking/v1beta1/authz.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// StakeAuthorization defines authorization for delegate/undelegate/redelegate. +// +// Since: cosmos-sdk 0.43 +message StakeAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/StakeAuthorization"; + + // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + // empty, there is no spend limit and any amount of coins can be delegated. + cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + // validators is the oneof that represents either allow_list or deny_list + oneof validators { + // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + // account. + Validators allow_list = 2; + // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. + Validators deny_list = 3; + } + // Validators defines list of validator addresses. + message Validators { + repeated string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + } + // authorization_type defines one of AuthorizationType. + AuthorizationType authorization_type = 4; +} + +// AuthorizationType defines the type of staking module authorization type +// +// Since: cosmos-sdk 0.43 +enum AuthorizationType { + // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type + AUTHORIZATION_TYPE_UNSPECIFIED = 0; + // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate + AUTHORIZATION_TYPE_DELEGATE = 1; + // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + AUTHORIZATION_TYPE_UNDELEGATE = 2; + // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate + AUTHORIZATION_TYPE_REDELEGATE = 3; +} diff --git a/packages/cosmos/proto/cosmos/staking/v1beta1/genesis.proto b/packages/cosmos/proto/cosmos/staking/v1beta1/genesis.proto new file mode 100644 index 00000000..482d50cc --- /dev/null +++ b/packages/cosmos/proto/cosmos/staking/v1beta1/genesis.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// GenesisState defines the staking module's genesis state. +message GenesisState { + // params defines all the parameters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // last_total_power tracks the total amounts of bonded tokens recorded during + // the previous end block. + bytes last_total_power = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // last_validator_powers is a special index that provides a historical list + // of the last-block's bonded validators. + repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // delegations defines the validator set at genesis. + repeated Validator validators = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // delegations defines the delegations active at genesis. + repeated Delegation delegations = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // unbonding_delegations defines the unbonding delegations active at genesis. + repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // redelegations defines the redelegations active at genesis. + repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + bool exported = 8; +} + +// LastValidatorPower required for validator set update logic. +message LastValidatorPower { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the validator. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // power defines the power of the validator. + int64 power = 2; +} diff --git a/packages/cosmos/proto/cosmos/staking/v1beta1/query.proto b/packages/cosmos/proto/cosmos/staking/v1beta1/query.proto new file mode 100644 index 00000000..06eb5551 --- /dev/null +++ b/packages/cosmos/proto/cosmos/staking/v1beta1/query.proto @@ -0,0 +1,387 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Query defines the gRPC querier service. +service Query { + // Validators queries all validators that match the given status. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; + } + + // Validator queries validator info for given validator address. + rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; + } + + // ValidatorDelegations queries delegate info for given validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; + } + + // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) + returns (QueryValidatorUnbondingDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" + "{validator_addr}/unbonding_delegations"; + } + + // Delegation queries delegate info for given validator delegator pair. + rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}"; + } + + // UnbondingDelegation queries unbonding info for given validator delegator + // pair. + rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}/unbonding_delegation"; + } + + // DelegatorDelegations queries all delegations of a given delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; + } + + // DelegatorUnbondingDelegations queries all unbonding delegations of a given + // delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) + returns (QueryDelegatorUnbondingDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" + "{delegator_addr}/unbonding_delegations"; + } + + // Redelegations queries redelegations of given address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; + } + + // DelegatorValidators queries all validators info for given delegator + // address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; + } + + // DelegatorValidator queries validator info for given delegator validator + // pair. + rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" + "{validator_addr}"; + } + + // HistoricalInfo queries the historical info for given height. + rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; + } + + // Pool queries the pool info. + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; + } + + // Parameters queries the staking parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + } +} + +// QueryValidatorsRequest is request type for Query/Validators RPC method. +message QueryValidatorsRequest { + // status enables to query for validators matching a given status. + string status = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorsResponse is response type for the Query/Validators RPC method +message QueryValidatorsResponse { + // validators contains all the queried validators. + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorRequest is response type for the Query/Validator RPC method +message QueryValidatorRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorResponse is response type for the Query/Validator RPC method +message QueryValidatorResponse { + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorDelegationsRequest is request type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorDelegationsResponse is response type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsResponse { + repeated DelegationResponse delegation_responses = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "DelegationResponses"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorUnbondingDelegationsRequest is required type for the +// Query/ValidatorUnbondingDelegations RPC method +message QueryValidatorUnbondingDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorUnbondingDelegationsResponse is response type for the +// Query/ValidatorUnbondingDelegations RPC method. +message QueryValidatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRequest is request type for the Query/Delegation RPC method. +message QueryDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationResponse is response type for the Query/Delegation RPC method. +message QueryDelegationResponse { + // delegation_responses defines the delegation info of a delegation. + DelegationResponse delegation_response = 1; +} + +// QueryUnbondingDelegationRequest is request type for the +// Query/UnbondingDelegation RPC method. +message QueryUnbondingDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationResponse is response type for the Query/UnbondingDelegation +// RPC method. +message QueryUnbondingDelegationResponse { + // unbond defines the unbonding information of a delegation. + UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDelegatorDelegationsRequest is request type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorDelegationsResponse is response type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsResponse { + // delegation_responses defines all the delegations' info of a delegator. + repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorUnbondingDelegationsRequest is request type for the +// Query/DelegatorUnbondingDelegations RPC method. +message QueryDelegatorUnbondingDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryUnbondingDelegatorDelegationsResponse is response type for the +// Query/UnbondingDelegatorDelegations RPC method. +message QueryDelegatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRedelegationsRequest is request type for the Query/Redelegations RPC +// method. +message QueryRedelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // src_validator_addr defines the validator address to redelegate from. + string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // dst_validator_addr defines the validator address to redelegate to. + string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryRedelegationsResponse is response type for the Query/Redelegations RPC +// method. +message QueryRedelegationsResponse { + repeated RedelegationResponse redelegation_responses = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorsRequest is request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorValidatorsResponse is response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + // validators defines the validators' info of a delegator. + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorRequest is request type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorValidatorResponse response type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorResponse { + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoRequest { + // height defines at which height to query the historical info. + int64 height = 1; +} + +// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoResponse { + // hist defines the historical info at the given height. + HistoricalInfo hist = 1; +} + +// QueryPoolRequest is request type for the Query/Pool RPC method. +message QueryPoolRequest {} + +// QueryPoolResponse is response type for the Query/Pool RPC method. +message QueryPoolResponse { + // pool defines the pool info. + Pool pool = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/staking/v1beta1/staking.proto b/packages/cosmos/proto/cosmos/staking/v1beta1/staking.proto new file mode 100644 index 00000000..e7620c55 --- /dev/null +++ b/packages/cosmos/proto/cosmos/staking/v1beta1/staking.proto @@ -0,0 +1,405 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "tendermint/types/types.proto"; +import "tendermint/abci/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// HistoricalInfo contains header and validator information for a given block. +// It is stored as part of staking module's state, which persists the `n` most +// recent HistoricalInfo +// (`n` is set by the staking module's `historical_entries` parameter). +message HistoricalInfo { + tendermint.types.Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Validator valset = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// CommissionRates defines the initial commission rates to be used for creating +// a validator. +message CommissionRates { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // rate is the commission rate charged to delegators, as a fraction. + string rate = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. + string max_rate = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. + string max_change_rate = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Commission defines commission parameters for a given validator. +message Commission { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // commission_rates defines the initial commission rates to be used for creating a validator. + CommissionRates commission_rates = 1 + [(gogoproto.embed) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // update_time is the last time the commission rate was changed. + google.protobuf.Timestamp update_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// Description defines a validator description. +message Description { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // moniker defines a human-readable name for the validator. + string moniker = 1; + // identity defines an optional identity signature (ex. UPort or Keybase). + string identity = 2; + // website defines an optional website link. + string website = 3; + // security_contact defines an optional email for security contact. + string security_contact = 4; + // details define other optional details. + string details = 5; +} + +// Validator defines a validator, together with the total amount of the +// Validator's bond shares and their exchange rate to coins. Slashing results in +// a decrease in the exchange rate, allowing correct calculation of future +// undelegations without iterating over delegators. When coins are delegated to +// this validator, the validator is credited with a delegation whose number of +// bond shares is based on the amount of coins delegated divided by the current +// exchange rate. Voting power can be calculated as total bonded shares +// multiplied by exchange rate. +message Validator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech encoded in JSON. + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. + google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + // jailed defined whether the validator has been jailed from bonded status or not. + bool jailed = 3; + // status is the validator status (bonded/unbonding/unbonded). + BondStatus status = 4; + // tokens define the delegated tokens (incl. self-delegation). + string tokens = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // delegator_shares defines total shares issued to a validator's delegators. + string delegator_shares = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // description defines the description terms for the validator. + Description description = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. + int64 unbonding_height = 8; + // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. + google.protobuf.Timestamp unbonding_time = 9 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // commission defines the commission parameters. + Commission commission = 10 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // min_self_delegation is the validator's self declared minimum self delegation. + // + // Since: cosmos-sdk 0.46 + string min_self_delegation = 11 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // strictly positive if this validator's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 12; + + // list of unbonding ids, each uniquely identifing an unbonding of this validator + repeated uint64 unbonding_ids = 13; +} + +// BondStatus is the status of a validator. +enum BondStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an invalid validator status. + BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + // UNBONDED defines a validator that is not bonded. + BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; + // UNBONDING defines a validator that is unbonding. + BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; + // BONDED defines a validator that is bonded. + BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; +} + +// ValAddresses defines a repeated set of validator addresses. +message ValAddresses { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = true; + + repeated string addresses = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVPair is struct that just has a delegator-validator pair with no other data. +// It is intended to be used as a marshalable pointer. For example, a DVPair can +// be used to construct the key to getting an UnbondingDelegation from state. +message DVPair { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVPairs defines an array of DVPair objects. +message DVPairs { + repeated DVPair pairs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// DVVTriplet is struct that just has a delegator-validator-validator triplet +// with no other data. It is intended to be used as a marshalable pointer. For +// example, a DVVTriplet can be used to construct the key to getting a +// Redelegation from state. +message DVVTriplet { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVVTriplets defines an array of DVVTriplet objects. +message DVVTriplets { + repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Delegation represents the bond with tokens held by an account. It is +// owned by one delegator, and is associated with the voting power of one +// validator. +message Delegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // shares define the delegation shares received. + string shares = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// UnbondingDelegation stores all of a single delegator's unbonding bonds +// for a single validator in an time-ordered list. +message UnbondingDelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // entries are the unbonding delegation entries. + repeated UnbondingDelegationEntry entries = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries +} + +// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +message UnbondingDelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height is the height which the unbonding took place. + int64 creation_height = 1; + // completion_time is the unix time for unbonding completion. + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // initial_balance defines the tokens initially scheduled to receive at completion. + string initial_balance = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // balance defines the tokens to receive at completion. + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // Incrementing id that uniquely identifies this entry + uint64 unbonding_id = 5; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; +} + +// RedelegationEntry defines a redelegation object with relevant metadata. +message RedelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height defines the height which the redelegation took place. + int64 creation_height = 1; + // completion_time defines the unix time for redelegation completion. + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // initial_balance defines the initial balance when redelegation started. + string initial_balance = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // shares_dst is the amount of destination-validator shares created by redelegation. + string shares_dst = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // Incrementing id that uniquely identifies this entry + uint64 unbonding_id = 5; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; +} + +// Redelegation contains the list of a particular delegator's redelegating bonds +// from a particular source validator to a particular destination validator. +message Redelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_src_address is the validator redelegation source operator address. + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_dst_address is the validator redelegation destination operator address. + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // entries are the redelegation entries. + repeated RedelegationEntry entries = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries +} + +// Params defines the parameters for the x/staking module. +message Params { + option (amino.name) = "cosmos-sdk/x/staking/Params"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // unbonding_time is the time duration of unbonding. + google.protobuf.Duration unbonding_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; + // max_validators is the maximum number of validators. + uint32 max_validators = 2; + // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + uint32 max_entries = 3; + // historical_entries is the number of historical entries to persist. + uint32 historical_entries = 4; + // bond_denom defines the bondable coin denomination. + string bond_denom = 5; + // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators + string min_commission_rate = 6 [ + (gogoproto.moretags) = "yaml:\"min_commission_rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// DelegationResponse is equivalent to Delegation except that it contains a +// balance in addition to shares which is more suitable for client responses. +message DelegationResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + + Delegation delegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +// contains a balance in addition to shares which is more suitable for client +// responses. +message RedelegationEntryResponse { + option (gogoproto.equal) = true; + + RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// RedelegationResponse is equivalent to a Redelegation except that its entries +// contain a balance in addition to shares which is more suitable for client +// responses. +message RedelegationResponse { + option (gogoproto.equal) = false; + + Redelegation redelegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Pool is used for tracking bonded and not-bonded token supply of the bond +// denomination. +message Pool { + option (gogoproto.description) = true; + option (gogoproto.equal) = true; + string not_bonded_tokens = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "not_bonded_tokens", + (amino.dont_omitempty) = true + ]; + string bonded_tokens = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "bonded_tokens", + (amino.dont_omitempty) = true + ]; +} + +// Infraction indicates the infraction a validator commited. +enum Infraction { + // UNSPECIFIED defines an empty infraction. + INFRACTION_UNSPECIFIED = 0; + // DOUBLE_SIGN defines a validator that double-signs a block. + INFRACTION_DOUBLE_SIGN = 1; + // DOWNTIME defines a validator that missed signing too many blocks. + INFRACTION_DOWNTIME = 2; +} + +// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. +// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +message ValidatorUpdates { + repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/packages/cosmos/proto/cosmos/staking/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/staking/v1beta1/tx.proto new file mode 100644 index 00000000..42e2218e --- /dev/null +++ b/packages/cosmos/proto/cosmos/staking/v1beta1/tx.proto @@ -0,0 +1,201 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Msg defines the staking Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateValidator defines a method for creating a new validator. + rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); + + // EditValidator defines a method for editing an existing validator. + rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); + + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); + + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); + + // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + // and delegate back to previous validator. + // + // Since: cosmos-sdk 0.46 + rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse); + + // UpdateParams defines an operation for updating the x/staking module + // parameters. + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgCreateValidator defines a SDK message for creating a new validator. +message MsgCreateValidator { + // NOTE(fdymylja): this is a particular case in which + // if validator_address == delegator_address then only one + // is expected to sign, otherwise both are. + option (cosmos.msg.v1.signer) = "delegator_address"; + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgCreateValidator"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string min_self_delegation = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +message MsgCreateValidatorResponse {} + +// MsgEditValidator defines a SDK message for editing an existing validator. +message MsgEditValidator { + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgEditValidator"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // We pass a reference to the new commission rate and min self delegation as + // it's not mandatory to update. If not updated, the deserialized rate will be + // zero with no way to distinguish if an update was intended. + // REF: #2373 + string commission_rate = 3 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + string min_self_delegation = 4 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; +} + +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +message MsgEditValidatorResponse {} + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message MsgDelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgDelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgDelegateResponse defines the Msg/Delegate response type. +message MsgDelegateResponse {} + +// MsgBeginRedelegate defines a SDK message for performing a redelegation +// of coins from a delegator and source validator to a destination validator. +message MsgBeginRedelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgBeginRedelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +message MsgBeginRedelegateResponse { + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a +// delegate and a validator. +message MsgUndelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgUndelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUndelegateResponse defines the Msg/Undelegate response type. +message MsgUndelegateResponse { + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegation { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgCancelUnbondingDelegation"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // amount is always less than or equal to unbonding delegation entry balance + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // creation_height is the height which the unbonding took place. + int64 creation_height = 4; +} + +// MsgCancelUnbondingDelegationResponse +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegationResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/staking/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // params defines the x/staking parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +}; + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {}; diff --git a/packages/cosmos/proto/cosmos/tx/config/v1/config.proto b/packages/cosmos/proto/cosmos/tx/config/v1/config.proto new file mode 100644 index 00000000..15553a28 --- /dev/null +++ b/packages/cosmos/proto/cosmos/tx/config/v1/config.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.tx.config.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Config is the config object of the x/auth/tx package. +message Config { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth/tx" + }; + + // skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_ante_handler = 1; + + // skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_post_handler = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/tx/signing/v1beta1/signing.proto b/packages/cosmos/proto/cosmos/tx/signing/v1beta1/signing.proto new file mode 100644 index 00000000..12d5868b --- /dev/null +++ b/packages/cosmos/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -0,0 +1,106 @@ +syntax = "proto3"; +package cosmos.tx.signing.v1beta1; + +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; + +// SignMode represents a signing mode with its own security guarantees. +// +// This enum should be considered a registry of all known sign modes +// in the Cosmos ecosystem. Apps are not expected to support all known +// sign modes. Apps that would like to support custom sign modes are +// encouraged to open a small PR against this file to add a new case +// to this SignMode enum describing their sign mode so that different +// apps have a consistent version of this enum. +enum SignMode { + // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + // rejected. + SIGN_MODE_UNSPECIFIED = 0; + + // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + // verified with raw bytes from Tx. + SIGN_MODE_DIRECT = 1; + + // SIGN_MODE_TEXTUAL is a future signing mode that will verify some + // human-readable textual representation on top of the binary representation + // from SIGN_MODE_DIRECT. It is currently not supported. + SIGN_MODE_TEXTUAL = 2; + + // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + // require signers signing over other signers' `signer_info`. It also allows + // for adding Tips in transactions. + // + // Since: cosmos-sdk 0.46 + SIGN_MODE_DIRECT_AUX = 3; + + // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + // Amino JSON and will be removed in the future. + SIGN_MODE_LEGACY_AMINO_JSON = 127; + + // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + // + // Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + // but is not implemented on the SDK by default. To enable EIP-191, you need + // to pass a custom `TxConfig` that has an implementation of + // `SignModeHandler` for EIP-191. The SDK may decide to fully support + // EIP-191 in the future. + // + // Since: cosmos-sdk 0.45.2 + SIGN_MODE_EIP_191 = 191; +} + +// SignatureDescriptors wraps multiple SignatureDescriptor's. +message SignatureDescriptors { + // signatures are the signature descriptors + repeated SignatureDescriptor signatures = 1; +} + +// SignatureDescriptor is a convenience type which represents the full data for +// a signature including the public key of the signer, signing modes and the +// signature itself. It is primarily used for coordinating signatures between +// clients. +message SignatureDescriptor { + // public_key is the public key of the signer + google.protobuf.Any public_key = 1; + + Data data = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to prevent + // replay attacks. + uint64 sequence = 3; + + // Data represents signature data + message Data { + // sum is the oneof that specifies whether this represents single or multi-signature data + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a multisig signer + Multi multi = 2; + } + + // Single is the signature data for a single signer + message Single { + // mode is the signing mode of the single signer + SignMode mode = 1; + + // signature is the raw signature bytes + bytes signature = 2; + } + + // Multi is the signature data for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // signatures is the signatures of the multi-signature + repeated Data signatures = 2; + } + } +} diff --git a/packages/cosmos/proto/cosmos/tx/v1beta1/service.proto b/packages/cosmos/proto/cosmos/tx/v1beta1/service.proto new file mode 100644 index 00000000..16b3de0d --- /dev/null +++ b/packages/cosmos/proto/cosmos/tx/v1beta1/service.proto @@ -0,0 +1,277 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/abci/v1beta1/abci.proto"; +import "cosmos/tx/v1beta1/tx.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "tendermint/types/block.proto"; +import "tendermint/types/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Service defines a gRPC service for interacting with transactions. +service Service { + // Simulate simulates executing a transaction for estimating gas usage. + rpc Simulate(SimulateRequest) returns (SimulateResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/simulate" + body: "*" + }; + } + // GetTx fetches a tx by hash. + rpc GetTx(GetTxRequest) returns (GetTxResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; + } + // BroadcastTx broadcast transaction. + rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/txs" + body: "*" + }; + } + // GetTxsEvent fetches txs by event. + rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; + } + // GetBlockWithTxs fetches a block with decoded txs. + // + // Since: cosmos-sdk 0.45.2 + rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; + } + // TxDecode decodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxDecode(TxDecodeRequest) returns (TxDecodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode" + body: "*" + }; + } + // TxEncode encodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxEncode(TxEncodeRequest) returns (TxEncodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode" + body: "*" + }; + } + // TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + // + // Since: cosmos-sdk 0.47 + rpc TxEncodeAmino(TxEncodeAminoRequest) returns (TxEncodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode/amino" + body: "*" + }; + } + // TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + // + // Since: cosmos-sdk 0.47 + rpc TxDecodeAmino(TxDecodeAminoRequest) returns (TxDecodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode/amino" + body: "*" + }; + } +} + +// GetTxsEventRequest is the request type for the Service.TxsByEvents +// RPC method. +message GetTxsEventRequest { + // events is the list of transaction event type. + repeated string events = 1; + // pagination defines a pagination for the request. + // Deprecated post v0.46.x: use page and limit instead. + cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; + + OrderBy order_by = 3; + // page is the page number to query, starts at 1. If not provided, will default to first page. + uint64 page = 4; + // limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + uint64 limit = 5; +} + +// OrderBy defines the sorting order +enum OrderBy { + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + ORDER_BY_UNSPECIFIED = 0; + // ORDER_BY_ASC defines ascending order + ORDER_BY_ASC = 1; + // ORDER_BY_DESC defines descending order + ORDER_BY_DESC = 2; +} + +// GetTxsEventResponse is the response type for the Service.TxsByEvents +// RPC method. +message GetTxsEventResponse { + // txs is the list of queried transactions. + repeated cosmos.tx.v1beta1.Tx txs = 1; + // tx_responses is the list of queried TxResponses. + repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; + // pagination defines a pagination for the response. + // Deprecated post v0.46.x: use total instead. + cosmos.base.query.v1beta1.PageResponse pagination = 3 [deprecated = true]; + // total is total number of results available + uint64 total = 4; +} + +// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +// RPC method. +message BroadcastTxRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; + BroadcastMode mode = 2; +} + +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +enum BroadcastMode { + // zero-value for mode ordering + BROADCAST_MODE_UNSPECIFIED = 0; + // DEPRECATED: use BROADCAST_MODE_SYNC instead, + // BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + BROADCAST_MODE_BLOCK = 1 [deprecated = true]; + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + // a CheckTx execution response only. + BROADCAST_MODE_SYNC = 2; + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + // immediately. + BROADCAST_MODE_ASYNC = 3; +} + +// BroadcastTxResponse is the response type for the +// Service.BroadcastTx method. +message BroadcastTxResponse { + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 1; +} + +// SimulateRequest is the request type for the Service.Simulate +// RPC method. +message SimulateRequest { + // tx is the transaction to simulate. + // Deprecated. Send raw tx bytes instead. + cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; + // tx_bytes is the raw transaction. + // + // Since: cosmos-sdk 0.43 + bytes tx_bytes = 2; +} + +// SimulateResponse is the response type for the +// Service.SimulateRPC method. +message SimulateResponse { + // gas_info is the information about gas used in the simulation. + cosmos.base.abci.v1beta1.GasInfo gas_info = 1; + // result is the result of the simulation. + cosmos.base.abci.v1beta1.Result result = 2; +} + +// GetTxRequest is the request type for the Service.GetTx +// RPC method. +message GetTxRequest { + // hash is the tx hash to query, encoded as a hex string. + string hash = 1; +} + +// GetTxResponse is the response type for the Service.GetTx method. +message GetTxResponse { + // tx is the queried transaction. + cosmos.tx.v1beta1.Tx tx = 1; + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 2; +} + +// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs +// RPC method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsRequest { + // height is the height of the block to query. + int64 height = 1; + // pagination defines a pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsResponse { + // txs are the transactions in the block. + repeated cosmos.tx.v1beta1.Tx txs = 1; + .tendermint.types.BlockID block_id = 2; + .tendermint.types.Block block = 3; + // pagination defines a pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 4; +} + +// TxDecodeRequest is the request type for the Service.TxDecode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; +} + +// TxDecodeResponse is the response type for the +// Service.TxDecode method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeResponse { + // tx is the decoded transaction. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeRequest is the request type for the Service.TxEncode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeRequest { + // tx is the transaction to encode. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeResponse is the response type for the +// Service.TxEncode method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeResponse { + // tx_bytes is the encoded transaction bytes. + bytes tx_bytes = 1; +} + +// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoRequest { + string amino_json = 1; +} + +// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoResponse { + bytes amino_binary = 1; +} + +// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoRequest { + bytes amino_binary = 1; +} + +// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoResponse { + string amino_json = 1; +} diff --git a/packages/cosmos/proto/cosmos/tx/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/tx/v1beta1/tx.proto new file mode 100644 index 00000000..a71a3e11 --- /dev/null +++ b/packages/cosmos/proto/cosmos/tx/v1beta1/tx.proto @@ -0,0 +1,256 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/tx/signing/v1beta1/signing.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Tx is the standard type used for broadcasting transactions. +message Tx { + // body is the processable content of the transaction + TxBody body = 1; + + // auth_info is the authorization related content of the transaction, + // specifically signers, signer modes and fee + AuthInfo auth_info = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// TxRaw is a variant of Tx that pins the signer's exact binary representation +// of body and auth_info. This is used for signing, broadcasting and +// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and +// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used +// as the transaction ID. +message TxRaw { + // body_bytes is a protobuf serialization of a TxBody that matches the + // representation in SignDoc. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in SignDoc. + bytes auth_info_bytes = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +message SignDoc { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in TxRaw. + bytes auth_info_bytes = 2; + + // chain_id is the unique identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker + string chain_id = 3; + + // account_number is the account number of the account in state + uint64 account_number = 4; +} + +// SignDocDirectAux is the type used for generating sign bytes for +// SIGN_MODE_DIRECT_AUX. +// +// Since: cosmos-sdk 0.46 +message SignDocDirectAux { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // public_key is the public key of the signing account. + google.protobuf.Any public_key = 2; + + // chain_id is the identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker. + string chain_id = 3; + + // account_number is the account number of the account in state. + uint64 account_number = 4; + + // sequence is the sequence number of the signing account. + uint64 sequence = 5; + + // Tip is the optional tip used for transactions fees paid in another denom. + // It should be left empty if the signer is not the tipper for this + // transaction. + // + // This field is ignored if the chain didn't enable tips, i.e. didn't add the + // `TipDecorator` in its posthandler. + Tip tip = 6; +} + +// TxBody is the body of a transaction that all signers sign over. +message TxBody { + // messages is a list of messages to be executed. The required signers of + // those messages define the number and order of elements in AuthInfo's + // signer_infos and Tx's signatures. Each required signer address is added to + // the list only the first time it occurs. + // By convention, the first required signer (usually from the first message) + // is referred to as the primary signer and pays the fee for the whole + // transaction. + repeated google.protobuf.Any messages = 1; + + // memo is any arbitrary note/comment to be added to the transaction. + // WARNING: in clients, any publicly exposed text should not be called memo, + // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + string memo = 2; + + // timeout is the block height after which this transaction will not + // be processed by the chain + uint64 timeout_height = 3; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, the transaction will be rejected + repeated google.protobuf.Any extension_options = 1023; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, they will be ignored + repeated google.protobuf.Any non_critical_extension_options = 2047; +} + +// AuthInfo describes the fee and signer modes that are used to sign a +// transaction. +message AuthInfo { + // signer_infos defines the signing modes for the required signers. The number + // and order of elements must match the required signers from TxBody's + // messages. The first element is the primary signer and the one which pays + // the fee. + repeated SignerInfo signer_infos = 1; + + // Fee is the fee and gas limit for the transaction. The first signer is the + // primary signer and the one which pays the fee. The fee can be calculated + // based on the cost of evaluating the body and doing signature verification + // of the signers. This can be estimated via simulation. + Fee fee = 2; + + // Tip is the optional tip used for transactions fees paid in another denom. + // + // This field is ignored if the chain didn't enable tips, i.e. didn't add the + // `TipDecorator` in its posthandler. + // + // Since: cosmos-sdk 0.46 + Tip tip = 3; +} + +// SignerInfo describes the public key and signing mode of a single top-level +// signer. +message SignerInfo { + // public_key is the public key of the signer. It is optional for accounts + // that already exist in state. If unset, the verifier can use the required \ + // signer address for this position and lookup the public key. + google.protobuf.Any public_key = 1; + + // mode_info describes the signing mode of the signer and is a nested + // structure to support nested multisig pubkey's + ModeInfo mode_info = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to + // prevent replay attacks. + uint64 sequence = 3; +} + +// ModeInfo describes the signing mode of a single or nested multisig signer. +message ModeInfo { + // sum is the oneof that specifies whether this represents a single or nested + // multisig signer + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a nested multisig signer + Multi multi = 2; + } + + // Single is the mode info for a single signer. It is structured as a message + // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + // future + message Single { + // mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 1; + } + + // Multi is the mode info for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // mode_infos is the corresponding modes of the signers of the multisig + // which could include nested multisig public keys + repeated ModeInfo mode_infos = 2; + } +} + +// Fee includes the amount of coins paid in fees and the maximum +// gas to be used by the transaction. The ratio yields an effective "gasprice", +// which must be above some miminum to be accepted into the mempool. +message Fee { + // amount is the amount of coins to be paid as a fee + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // gas_limit is the maximum gas that can be used in transaction processing + // before an out of gas error occurs + uint64 gas_limit = 2; + + // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + // the payer must be a tx signer (and thus have signed this field in AuthInfo). + // setting this field does *not* change the ordering of required signers for the transaction. + string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + // not support fee grants, this will fail + string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// Tip is the tip used for meta-transactions. +// +// Since: cosmos-sdk 0.46 +message Tip { + // amount is the amount of the tip + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // tipper is the address of the account paying for the tip + string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a +// tipper) builds and sends to the fee payer (who will build and broadcast the +// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected +// by the node if sent directly as-is. +// +// Since: cosmos-sdk 0.46 +message AuxSignerData { + // address is the bech32-encoded address of the auxiliary signer. If using + // AuxSignerData across different chains, the bech32 prefix of the target + // chain (where the final transaction is broadcasted) should be used. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + // signs. Note: we use the same sign doc even if we're signing with + // LEGACY_AMINO_JSON. + SignDocDirectAux sign_doc = 2; + // mode is the signing mode of the single signer. + cosmos.tx.signing.v1beta1.SignMode mode = 3; + // sig is the signature of the sign doc. + bytes sig = 4; +} diff --git a/packages/cosmos/proto/cosmos/upgrade/module/v1/module.proto b/packages/cosmos/proto/cosmos/upgrade/module/v1/module.proto new file mode 100644 index 00000000..a4cf5808 --- /dev/null +++ b/packages/cosmos/proto/cosmos/upgrade/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.upgrade.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the upgrade module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/upgrade" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/upgrade/v1beta1/query.proto b/packages/cosmos/proto/cosmos/upgrade/v1beta1/query.proto new file mode 100644 index 00000000..870cf9ee --- /dev/null +++ b/packages/cosmos/proto/cosmos/upgrade/v1beta1/query.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; + +// Query defines the gRPC upgrade querier service. +service Query { + // CurrentPlan queries the current upgrade plan. + rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan"; + } + + // AppliedPlan queries a previously applied upgrade plan by its name. + rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}"; + } + + // UpgradedConsensusState queries the consensus state that will serve + // as a trusted kernel for the next version of this chain. It will only be + // stored at the last height of this chain. + // UpgradedConsensusState RPC not supported with legacy querier + // This rpc is deprecated now that IBC has its own replacement + // (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { + option deprecated = true; + option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}"; + } + + // ModuleVersions queries the list of module versions from state. + // + // Since: cosmos-sdk 0.43 + rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; + } + + // Returns the account with authority to conduct upgrades + // + // Since: cosmos-sdk 0.46 + rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority"; + } +} + +// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanRequest {} + +// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanResponse { + // plan is the current upgrade plan. + Plan plan = 1; +} + +// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanRequest { + // name is the name of the applied plan to query for. + string name = 1; +} + +// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanResponse { + // height is the block height at which the plan was applied. + int64 height = 1; +} + +// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateRequest { + option deprecated = true; + + // last height of the current chain must be sent in request + // as this is the height under which next consensus state is stored + int64 last_height = 1; +} + +// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateResponse { + option deprecated = true; + reserved 1; + + // Since: cosmos-sdk 0.43 + bytes upgraded_consensus_state = 2; +} + +// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions +// RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryModuleVersionsRequest { + // module_name is a field to query a specific module + // consensus version from state. Leaving this empty will + // fetch the full list of module versions from state + string module_name = 1; +} + +// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions +// RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryModuleVersionsResponse { + // module_versions is a list of module names with their consensus versions. + repeated ModuleVersion module_versions = 1; +} + +// QueryAuthorityRequest is the request type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityRequest {} + +// QueryAuthorityResponse is the response type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityResponse { + string address = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/upgrade/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/upgrade/v1beta1/tx.proto new file mode 100644 index 00000000..293bea02 --- /dev/null +++ b/packages/cosmos/proto/cosmos/upgrade/v1beta1/tx.proto @@ -0,0 +1,62 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; + +// Msg defines the upgrade Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SoftwareUpgrade is a governance operation for initiating a software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse); + + // CancelUpgrade is a governance operation for cancelling a previously + // approved software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse); +} + +// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSoftwareUpgrade"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // plan is the upgrade plan. + Plan plan = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgradeResponse {} + +// MsgCancelUpgrade is the Msg/CancelUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgCancelUpgrade"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgradeResponse {} diff --git a/packages/cosmos/proto/cosmos/upgrade/v1beta1/upgrade.proto b/packages/cosmos/proto/cosmos/upgrade/v1beta1/upgrade.proto new file mode 100644 index 00000000..0a967168 --- /dev/null +++ b/packages/cosmos/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; +option (gogoproto.goproto_getters_all) = false; + +// Plan specifies information about a planned upgrade and when it should occur. +message Plan { + option (amino.name) = "cosmos-sdk/Plan"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // Sets the name for the upgrade. This name will be used by the upgraded + // version of the software to apply any special "on-upgrade" commands during + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + string name = 1; + + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + google.protobuf.Timestamp time = 2 + [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // The height at which the upgrade must be performed. + int64 height = 3; + + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; + + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. + google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; +} + +// SoftwareUpgradeProposal is a gov Content type for initiating a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgSoftwareUpgrade. +message SoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // title of the proposal + string title = 1; + + // description of the proposal + string description = 2; + + // plan of the proposal + Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgCancelUpgrade. +message CancelSoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/CancelSoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // title of the proposal + string title = 1; + + // description of the proposal + string description = 2; +} + +// ModuleVersion specifies a module and its consensus version. +// +// Since: cosmos-sdk 0.43 +message ModuleVersion { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // name of the app module + string name = 1; + + // consensus version of the app module + uint64 version = 2; +} diff --git a/packages/cosmos/proto/cosmos/vesting/module/v1/module.proto b/packages/cosmos/proto/cosmos/vesting/module/v1/module.proto new file mode 100644 index 00000000..88bb89c1 --- /dev/null +++ b/packages/cosmos/proto/cosmos/vesting/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.vesting.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the vesting module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth/vesting" + }; +} \ No newline at end of file diff --git a/packages/cosmos/proto/cosmos/vesting/v1beta1/tx.proto b/packages/cosmos/proto/cosmos/vesting/v1beta1/tx.proto new file mode 100644 index 00000000..1a9a7b70 --- /dev/null +++ b/packages/cosmos/proto/cosmos/vesting/v1beta1/tx.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/vesting/v1beta1/vesting.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateVestingAccount defines a method that enables creating a vesting + // account. + rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); + // CreatePermanentLockedAccount defines a method that enables creating a permanent + // locked account. + // + // Since: cosmos-sdk 0.46 + rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse); + // CreatePeriodicVestingAccount defines a method that enables creating a + // periodic vesting account. + // + // Since: cosmos-sdk 0.46 + rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse); +} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +message MsgCreateVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreateVestingAccount"; + + option (gogoproto.equal) = true; + + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + int64 end_time = 4; + bool delayed = 5; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +message MsgCreateVestingAccountResponse {} + +// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent +// locked account. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePermanentLockedAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePermLockedAccount"; + option (gogoproto.equal) = true; + + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePermanentLockedAccountResponse {} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePeriodicVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePeriodicVestingAccount"; + + option (gogoproto.equal) = false; + + string from_address = 1; + string to_address = 2; + int64 start_time = 3; + repeated Period vesting_periods = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount +// response type. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePeriodicVestingAccountResponse {} diff --git a/packages/cosmos/proto/cosmos/vesting/v1beta1/vesting.proto b/packages/cosmos/proto/cosmos/vesting/v1beta1/vesting.proto new file mode 100644 index 00000000..0dbf20ab --- /dev/null +++ b/packages/cosmos/proto/cosmos/vesting/v1beta1/vesting.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// BaseVestingAccount implements the VestingAccount interface. It contains all +// the necessary fields needed for any vesting account implementation. +message BaseVestingAccount { + option (amino.name) = "cosmos-sdk/BaseVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; + repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + int64 end_time = 5; +} + +// ContinuousVestingAccount implements the VestingAccount interface. It +// continuously vests by unlocking coins linearly with respect to time. +message ContinuousVestingAccount { + option (amino.name) = "cosmos-sdk/ContinuousVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2; +} + +// DelayedVestingAccount implements the VestingAccount interface. It vests all +// coins after a specific time, but non prior. In other words, it keeps them +// locked until a specified time. +message DelayedVestingAccount { + option (amino.name) = "cosmos-sdk/DelayedVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} + +// Period defines a length of time and amount of coins that will vest. +message Period { + option (gogoproto.goproto_stringer) = false; + + int64 length = 1; + repeated cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// PeriodicVestingAccount implements the VestingAccount interface. It +// periodically vests by unlocking coins during each specified period. +message PeriodicVestingAccount { + option (amino.name) = "cosmos-sdk/PeriodicVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// PermanentLockedAccount implements the VestingAccount interface. It does +// not ever release coins, locking them indefinitely. Coins in this account can +// still be used for delegating and for governance votes even while locked. +// +// Since: cosmos-sdk 0.43 +message PermanentLockedAccount { + option (amino.name) = "cosmos-sdk/PermanentLockedAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} diff --git a/packages/cosmos/proto/cosmos_proto/cosmos.proto b/packages/cosmos/proto/cosmos_proto/cosmos.proto new file mode 100644 index 00000000..5c63b86f --- /dev/null +++ b/packages/cosmos/proto/cosmos_proto/cosmos.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; + +extend google.protobuf.MessageOptions { + + // implements_interface is used to indicate the type name of the interface + // that a message implements so that it can be used in google.protobuf.Any + // fields that accept that interface. A message can implement multiple + // interfaces. Interfaces should be declared using a declare_interface + // file option. + repeated string implements_interface = 93001; +} + +extend google.protobuf.FieldOptions { + + // accepts_interface is used to annotate that a google.protobuf.Any + // field accepts messages that implement the specified interface. + // Interfaces should be declared using a declare_interface file option. + string accepts_interface = 93001; + + // scalar is used to indicate that this field follows the formatting defined + // by the named scalar which should be declared with declare_scalar. Code + // generators may choose to use this information to map this field to a + // language-specific type representing the scalar. + string scalar = 93002; +} + +extend google.protobuf.FileOptions { + + // declare_interface declares an interface type to be used with + // accepts_interface and implements_interface. Interface names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given interface type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/interfaces.proto in the file descriptor set. + repeated InterfaceDescriptor declare_interface = 793021; + + // declare_scalar declares a scalar type to be used with + // the scalar field option. Scalar names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given scalar type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/scalars.proto in the file descriptor set. + repeated ScalarDescriptor declare_scalar = 793022; +} + +// InterfaceDescriptor describes an interface type to be used with +// accepts_interface and implements_interface and declared by declare_interface. +message InterfaceDescriptor { + + // name is the name of the interface. It should be a short-name (without + // a period) such that the fully qualified name of the interface will be + // package.name, ex. for the package a.b and interface named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the interface and its + // purpose. + string description = 2; +} + +// ScalarDescriptor describes an scalar type to be used with +// the scalar field option and declared by declare_scalar. +// Scalars extend simple protobuf built-in types with additional +// syntax and semantics, for instance to represent big integers. +// Scalars should ideally define an encoding such that there is only one +// valid syntactical representation for a given semantic meaning, +// i.e. the encoding should be deterministic. +message ScalarDescriptor { + + // name is the name of the scalar. It should be a short-name (without + // a period) such that the fully qualified name of the scalar will be + // package.name, ex. for the package a.b and scalar named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the scalar and its + // encoding format. For instance a big integer or decimal scalar should + // specify precisely the expected encoding format. + string description = 2; + + // field_type is the type of field with which this scalar can be used. + // Scalars can be used with one and only one type of field so that + // encoding standards and simple and clear. Currently only string and + // bytes fields are supported for scalars. + repeated ScalarType field_type = 3; +} + +enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0; + SCALAR_TYPE_STRING = 1; + SCALAR_TYPE_BYTES = 2; +} diff --git a/packages/cosmos/proto/gogoproto/gogo.proto b/packages/cosmos/proto/gogoproto/gogo.proto new file mode 100644 index 00000000..974b36a7 --- /dev/null +++ b/packages/cosmos/proto/gogoproto/gogo.proto @@ -0,0 +1,145 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/cosmos/gogoproto +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "GoGoProtos"; +option go_package = "github.com/cosmos/gogoproto/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; + + optional string castrepeated = 65013; +} diff --git a/packages/cosmos/proto/google/api/annotations.proto b/packages/cosmos/proto/google/api/annotations.proto new file mode 100644 index 00000000..efdab3db --- /dev/null +++ b/packages/cosmos/proto/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/packages/cosmos/proto/google/api/http.proto b/packages/cosmos/proto/google/api/http.proto new file mode 100644 index 00000000..113fa936 --- /dev/null +++ b/packages/cosmos/proto/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/packages/cosmos/proto/ibc/applications/fee/v1/ack.proto b/packages/cosmos/proto/ibc/applications/fee/v1/ack.proto new file mode 100644 index 00000000..2f3746d2 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/fee/v1/ack.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; + +// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +message IncentivizedAcknowledgement { + // the underlying app acknowledgement bytes + bytes app_acknowledgement = 1; + // the relayer address which submits the recv packet message + string forward_relayer_address = 2; + // success flag of the base application callback + bool underlying_app_success = 3; +} diff --git a/packages/cosmos/proto/ibc/applications/fee/v1/fee.proto b/packages/cosmos/proto/ibc/applications/fee/v1/fee.proto new file mode 100644 index 00000000..867e8845 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/fee/v1/fee.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Fee defines the ICS29 receive, acknowledgement and timeout fees +message Fee { + // the packet receive fee + repeated cosmos.base.v1beta1.Coin recv_fee = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; + + // the packet acknowledgement fee + repeated cosmos.base.v1beta1.Coin ack_fee = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; + + // the packet timeout fee + repeated cosmos.base.v1beta1.Coin timeout_fee = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; +} + +// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers +message PacketFee { + option (cosmos.msg.v1.signer) = "refund_address"; + + // fee encapsulates the recv, ack and timeout fees associated with an IBC packet + Fee fee = 1 [(gogoproto.nullable) = false]; + // the refund address for unspent fees + string refund_address = 2; + // optional list of relayers permitted to receive fees + repeated string relayers = 3; +} + +// PacketFees contains a list of type PacketFee +message PacketFees { + // list of packet fees + repeated PacketFee packet_fees = 1 [(gogoproto.nullable) = false]; +} + +// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId +message IdentifiedPacketFees { + // unique packet identifier comprised of the channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; + // list of packet fees + repeated PacketFee packet_fees = 2 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/applications/fee/v1/genesis.proto b/packages/cosmos/proto/ibc/applications/fee/v1/genesis.proto new file mode 100644 index 00000000..11e56e76 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/fee/v1/genesis.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; + +import "gogoproto/gogo.proto"; +import "ibc/applications/fee/v1/fee.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// GenesisState defines the ICS29 fee middleware genesis state +message GenesisState { + // list of identified packet fees + repeated IdentifiedPacketFees identified_fees = 1 [(gogoproto.nullable) = false]; + // list of fee enabled channels + repeated FeeEnabledChannel fee_enabled_channels = 2 [(gogoproto.nullable) = false]; + // list of registered payees + repeated RegisteredPayee registered_payees = 3 [(gogoproto.nullable) = false]; + // list of registered counterparty payees + repeated RegisteredCounterpartyPayee registered_counterparty_payees = 4 [(gogoproto.nullable) = false]; + // list of forward relayer addresses + repeated ForwardRelayerAddress forward_relayers = 5 [(gogoproto.nullable) = false]; +} + +// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +message FeeEnabledChannel { + // unique port identifier + string port_id = 1; + // unique channel identifier + string channel_id = 2; +} + +// RegisteredPayee contains the relayer address and payee address for a specific channel +message RegisteredPayee { + // unique channel identifier + string channel_id = 1; + // the relayer address + string relayer = 2; + // the payee address + string payee = 3; +} + +// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used +// for recv fee distribution) +message RegisteredCounterpartyPayee { + // unique channel identifier + string channel_id = 1; + // the relayer address + string relayer = 2; + // the counterparty payee address + string counterparty_payee = 3; +} + +// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements +message ForwardRelayerAddress { + // the forward relayer address + string address = 1; + // unique packet identifier comprised of the channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 2 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/applications/fee/v1/metadata.proto b/packages/cosmos/proto/ibc/applications/fee/v1/metadata.proto new file mode 100644 index 00000000..1e82e7c2 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/fee/v1/metadata.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; + +// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring +// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning +message Metadata { + // fee_version defines the ICS29 fee version + string fee_version = 1; + // app_version defines the underlying application version, which may or may not be a JSON encoded bytestring + string app_version = 2; +} diff --git a/packages/cosmos/proto/ibc/applications/fee/v1/query.proto b/packages/cosmos/proto/ibc/applications/fee/v1/query.proto new file mode 100644 index 00000000..726370ee --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/fee/v1/query.proto @@ -0,0 +1,218 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/applications/fee/v1/fee.proto"; +import "ibc/applications/fee/v1/genesis.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Query defines the ICS29 gRPC querier service. +service Query { + // IncentivizedPackets returns all incentivized packets and their associated fees + rpc IncentivizedPackets(QueryIncentivizedPacketsRequest) returns (QueryIncentivizedPacketsResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/incentivized_packets"; + } + + // IncentivizedPacket returns all packet fees for a packet given its identifier + rpc IncentivizedPacket(QueryIncentivizedPacketRequest) returns (QueryIncentivizedPacketResponse) { + option (google.api.http).get = + "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/" + "{packet_id.sequence}/incentivized_packet"; + } + + // Gets all incentivized packets for a specific channel + rpc IncentivizedPacketsForChannel(QueryIncentivizedPacketsForChannelRequest) + returns (QueryIncentivizedPacketsForChannelResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/incentivized_packets"; + } + + // TotalRecvFees returns the total receive fees for a packet given its identifier + rpc TotalRecvFees(QueryTotalRecvFeesRequest) returns (QueryTotalRecvFeesResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" + "sequences/{packet_id.sequence}/total_recv_fees"; + } + + // TotalAckFees returns the total acknowledgement fees for a packet given its identifier + rpc TotalAckFees(QueryTotalAckFeesRequest) returns (QueryTotalAckFeesResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" + "sequences/{packet_id.sequence}/total_ack_fees"; + } + + // TotalTimeoutFees returns the total timeout fees for a packet given its identifier + rpc TotalTimeoutFees(QueryTotalTimeoutFeesRequest) returns (QueryTotalTimeoutFeesResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" + "sequences/{packet_id.sequence}/total_timeout_fees"; + } + + // Payee returns the registered payee address for a specific channel given the relayer address + rpc Payee(QueryPayeeRequest) returns (QueryPayeeResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/payee"; + } + + // CounterpartyPayee returns the registered counterparty payee for forward relaying + rpc CounterpartyPayee(QueryCounterpartyPayeeRequest) returns (QueryCounterpartyPayeeResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/counterparty_payee"; + } + + // FeeEnabledChannels returns a list of all fee enabled channels + rpc FeeEnabledChannels(QueryFeeEnabledChannelsRequest) returns (QueryFeeEnabledChannelsResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/fee_enabled"; + } + + // FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel + rpc FeeEnabledChannel(QueryFeeEnabledChannelRequest) returns (QueryFeeEnabledChannelResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/fee_enabled"; + } +} + +// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc +message QueryIncentivizedPacketsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + // block height at which to query + uint64 query_height = 2; +} + +// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc +message QueryIncentivizedPacketsResponse { + // list of identified fees for incentivized packets + repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1 [(gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +message QueryIncentivizedPacketRequest { + // unique packet identifier comprised of channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; + // block height at which to query + uint64 query_height = 2; +} + +// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc +message QueryIncentivizedPacketResponse { + // the identified fees for the incentivized packet + ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packet = 1 [(gogoproto.nullable) = false]; +} + +// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets +// for a specific channel +message QueryIncentivizedPacketsForChannelRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + string port_id = 2; + string channel_id = 3; + // Height to query at + uint64 query_height = 4; +} + +// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC +message QueryIncentivizedPacketsForChannelResponse { + // Map of all incentivized_packets + repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc +message QueryTotalRecvFeesRequest { + // the packet identifier for the associated fees + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; +} + +// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc +message QueryTotalRecvFeesResponse { + // the total packet receive fees + repeated cosmos.base.v1beta1.Coin recv_fees = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc +message QueryTotalAckFeesRequest { + // the packet identifier for the associated fees + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; +} + +// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc +message QueryTotalAckFeesResponse { + // the total packet acknowledgement fees + repeated cosmos.base.v1beta1.Coin ack_fees = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc +message QueryTotalTimeoutFeesRequest { + // the packet identifier for the associated fees + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; +} + +// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc +message QueryTotalTimeoutFeesResponse { + // the total packet timeout fees + repeated cosmos.base.v1beta1.Coin timeout_fees = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// QueryPayeeRequest defines the request type for the Payee rpc +message QueryPayeeRequest { + // unique channel identifier + string channel_id = 1; + // the relayer address to which the distribution address is registered + string relayer = 2; +} + +// QueryPayeeResponse defines the response type for the Payee rpc +message QueryPayeeResponse { + // the payee address to which packet fees are paid out + string payee_address = 1; +} + +// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc +message QueryCounterpartyPayeeRequest { + // unique channel identifier + string channel_id = 1; + // the relayer address to which the counterparty is registered + string relayer = 2; +} + +// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc +message QueryCounterpartyPayeeResponse { + // the counterparty payee address used to compensate forward relaying + string counterparty_payee = 1; +} + +// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc +message QueryFeeEnabledChannelsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + // block height at which to query + uint64 query_height = 2; +} + +// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc +message QueryFeeEnabledChannelsResponse { + // list of fee enabled channels + repeated ibc.applications.fee.v1.FeeEnabledChannel fee_enabled_channels = 1 [(gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc +message QueryFeeEnabledChannelRequest { + // unique port identifier + string port_id = 1; + // unique channel identifier + string channel_id = 2; +} + +// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc +message QueryFeeEnabledChannelResponse { + // boolean flag representing the fee enabled channel status + bool fee_enabled = 1; +} diff --git a/packages/cosmos/proto/ibc/applications/fee/v1/tx.proto b/packages/cosmos/proto/ibc/applications/fee/v1/tx.proto new file mode 100644 index 00000000..393bc879 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/fee/v1/tx.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "ibc/applications/fee/v1/fee.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the ICS29 Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // RegisterPayee defines a rpc handler method for MsgRegisterPayee + // RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional + // payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on + // the source chain from which packets originate as this is where fee distribution takes place. This function may be + // called more than once by a relayer, in which case, the latest payee is always used. + rpc RegisterPayee(MsgRegisterPayee) returns (MsgRegisterPayeeResponse); + + // RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee + // RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty + // payee address before relaying. This ensures they will be properly compensated for forward relaying since + // the destination chain must include the registered counterparty payee address in the acknowledgement. This function + // may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. + rpc RegisterCounterpartyPayee(MsgRegisterCounterpartyPayee) returns (MsgRegisterCounterpartyPayeeResponse); + + // PayPacketFee defines a rpc handler method for MsgPayPacketFee + // PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of the packet at the next sequence + // NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows + // initiates the lifecycle of the incentivized packet + rpc PayPacketFee(MsgPayPacketFee) returns (MsgPayPacketFeeResponse); + + // PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync + // PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of a known packet (i.e. at a particular sequence) + rpc PayPacketFeeAsync(MsgPayPacketFeeAsync) returns (MsgPayPacketFeeAsyncResponse); +} + +// MsgRegisterPayee defines the request type for the RegisterPayee rpc +message MsgRegisterPayee { + option (amino.name) = "cosmos-sdk/MsgRegisterPayee"; + option (cosmos.msg.v1.signer) = "relayer"; + + option (gogoproto.goproto_getters) = false; + + // unique port identifier + string port_id = 1; + // unique channel identifier + string channel_id = 2; + // the relayer address + string relayer = 3; + // the payee address + string payee = 4; +} + +// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc +message MsgRegisterPayeeResponse {} + +// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc +message MsgRegisterCounterpartyPayee { + option (amino.name) = "cosmos-sdk/MsgRegisterCounterpartyPayee"; + option (cosmos.msg.v1.signer) = "relayer"; + + option (gogoproto.goproto_getters) = false; + + // unique port identifier + string port_id = 1; + // unique channel identifier + string channel_id = 2; + // the relayer address + string relayer = 3; + // the counterparty payee address + string counterparty_payee = 4; +} + +// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc +message MsgRegisterCounterpartyPayeeResponse {} + +// MsgPayPacketFee defines the request type for the PayPacketFee rpc +// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be +// paid for +message MsgPayPacketFee { + option (amino.name) = "cosmos-sdk/MsgPayPacketFee"; + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // fee encapsulates the recv, ack and timeout fees associated with an IBC packet + ibc.applications.fee.v1.Fee fee = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // the source port unique identifier + string source_port_id = 2; + // the source channel unique identifier + string source_channel_id = 3; + // account address to refund fee if necessary + string signer = 4; + // optional list of relayers permitted to the receive packet fees + repeated string relayers = 5; +} + +// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc +message MsgPayPacketFeeResponse {} + +// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc +// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) +message MsgPayPacketFeeAsync { + option (amino.name) = "cosmos-sdk/MsgPayPacketFeeAsync"; + option (cosmos.msg.v1.signer) = "packet_fee"; + option (gogoproto.goproto_getters) = false; + + // unique packet identifier comprised of the channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // the packet fee associated with a particular IBC packet + PacketFee packet_fee = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc +message MsgPayPacketFeeAsyncResponse {} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto new file mode 100644 index 00000000..2e6bbe1a --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.controller.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; + +// Params defines the set of on-chain interchain accounts parameters. +// The following parameters may be used to disable the controller submodule. +message Params { + // controller_enabled enables or disables the controller submodule. + bool controller_enabled = 1; +} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/query.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/query.proto new file mode 100644 index 00000000..31885fcb --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/query.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.controller.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; + +import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; +import "google/api/annotations.proto"; + +// Query provides defines the gRPC querier service. +service Query { + // InterchainAccount returns the interchain account address for a given owner address on a given connection + rpc InterchainAccount(QueryInterchainAccountRequest) returns (QueryInterchainAccountResponse) { + option (google.api.http).get = + "/ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}"; + } + + // Params queries all parameters of the ICA controller submodule. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ibc/apps/interchain_accounts/controller/v1/params"; + } +} + +// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. +message QueryInterchainAccountRequest { + string owner = 1; + string connection_id = 2; +} + +// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. +message QueryInterchainAccountResponse { + string address = 1; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto new file mode 100644 index 00000000..ec5c2e62 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.controller.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; + +import "gogoproto/gogo.proto"; +import "ibc/applications/interchain_accounts/v1/packet.proto"; +import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; +import "cosmos/msg/v1/msg.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Msg defines the 27-interchain-accounts/controller Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. + rpc RegisterInterchainAccount(MsgRegisterInterchainAccount) returns (MsgRegisterInterchainAccountResponse); + // SendTx defines a rpc handler for MsgSendTx. + rpc SendTx(MsgSendTx) returns (MsgSendTxResponse); + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount +message MsgRegisterInterchainAccount { + option (cosmos.msg.v1.signer) = "owner"; + + option (gogoproto.goproto_getters) = false; + + string owner = 1; + string connection_id = 2; + string version = 3; + ibc.core.channel.v1.Order ordering = 4; +} + +// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount +message MsgRegisterInterchainAccountResponse { + option (gogoproto.goproto_getters) = false; + + string channel_id = 1; + string port_id = 2; +} + +// MsgSendTx defines the payload for Msg/SendTx +message MsgSendTx { + option (cosmos.msg.v1.signer) = "owner"; + + option (gogoproto.goproto_getters) = false; + + string owner = 1; + string connection_id = 2; + ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 3 [(gogoproto.nullable) = false]; + // Relative timeout timestamp provided will be added to the current block time during transaction execution. + // The timeout timestamp must be non-zero. + uint64 relative_timeout = 4; +} + +// MsgSendTxResponse defines the response for MsgSendTx +message MsgSendTxResponse { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; +} + +// MsgUpdateParams defines the payload for Msg/UpdateParams +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the 27-interchain-accounts/controller parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto new file mode 100644 index 00000000..4393e5b0 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.genesis.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types"; + +import "gogoproto/gogo.proto"; +import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; +import "ibc/applications/interchain_accounts/host/v1/host.proto"; + +// GenesisState defines the interchain accounts genesis state +message GenesisState { + ControllerGenesisState controller_genesis_state = 1 [(gogoproto.nullable) = false]; + HostGenesisState host_genesis_state = 2 [(gogoproto.nullable) = false]; +} + +// ControllerGenesisState defines the interchain accounts controller genesis state +message ControllerGenesisState { + repeated ActiveChannel active_channels = 1 [(gogoproto.nullable) = false]; + repeated RegisteredInterchainAccount interchain_accounts = 2 [(gogoproto.nullable) = false]; + repeated string ports = 3; + ibc.applications.interchain_accounts.controller.v1.Params params = 4 [(gogoproto.nullable) = false]; +} + +// HostGenesisState defines the interchain accounts host genesis state +message HostGenesisState { + repeated ActiveChannel active_channels = 1 [(gogoproto.nullable) = false]; + repeated RegisteredInterchainAccount interchain_accounts = 2 [(gogoproto.nullable) = false]; + string port = 3; + ibc.applications.interchain_accounts.host.v1.Params params = 4 [(gogoproto.nullable) = false]; +} + +// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to +// indicate if the channel is middleware enabled +message ActiveChannel { + string connection_id = 1; + string port_id = 2; + string channel_id = 3; + bool is_middleware_enabled = 4; +} + +// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address +message RegisteredInterchainAccount { + string connection_id = 1; + string port_id = 2; + string account_address = 3; +} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/host.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/host.proto new file mode 100644 index 00000000..9165f36e --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/host.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.host.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; + +// Params defines the set of on-chain interchain accounts parameters. +// The following parameters may be used to disable the host submodule. +message Params { + // host_enabled enables or disables the host submodule. + bool host_enabled = 1; + // allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. + repeated string allow_messages = 2; +} + +// QueryRequest defines the parameters for a particular query request +// by an interchain account. +message QueryRequest { + // path defines the path of the query request as defined by ADR-021. + // https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + string path = 1; + // data defines the payload of the query request as defined by ADR-021. + // https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + bytes data = 2; +} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/query.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/query.proto new file mode 100644 index 00000000..6f206a14 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/query.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.host.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; + +import "google/api/annotations.proto"; +import "ibc/applications/interchain_accounts/host/v1/host.proto"; + +// Query provides defines the gRPC querier service. +service Query { + // Params queries all parameters of the ICA host submodule. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ibc/apps/interchain_accounts/host/v1/params"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/tx.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/tx.proto new file mode 100644 index 00000000..22e8c9b3 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/host/v1/tx.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.host.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; +import "ibc/applications/interchain_accounts/host/v1/host.proto"; + +// Msg defines the 27-interchain-accounts/host Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // ModuleQuerySafe defines a rpc handler for MsgModuleQuerySafe. + rpc ModuleQuerySafe(MsgModuleQuerySafe) returns (MsgModuleQuerySafeResponse); +} + +// MsgUpdateParams defines the payload for Msg/UpdateParams +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the 27-interchain-accounts/host parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +message MsgUpdateParamsResponse {} + +// MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe +message MsgModuleQuerySafe { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // requests defines the module safe queries to execute. + repeated QueryRequest requests = 2; +} + +// MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe +message MsgModuleQuerySafeResponse { + // height at which the responses were queried + uint64 height = 1; + + // protobuf encoded responses for each query + repeated bytes responses = 2; +} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/account.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/account.proto new file mode 100644 index 00000000..4a6947c1 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/account.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +message InterchainAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ibc.applications.interchain_accounts.v1.InterchainAccountI"; + + cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; + string account_owner = 2; +} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/metadata.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/metadata.proto new file mode 100644 index 00000000..df72b41e --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/metadata.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; + +// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring +// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning +message Metadata { + // version defines the ICS27 protocol version + string version = 1; + // controller_connection_id is the connection identifier associated with the controller chain + string controller_connection_id = 2; + // host_connection_id is the connection identifier associated with the host chain + string host_connection_id = 3; + // address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step + // NOTE: the address field is empty on the OnChanOpenInit handshake step + string address = 4; + // encoding defines the supported codec format + string encoding = 5; + // tx_type defines the type of transactions the interchain account can execute + string tx_type = 6; +} diff --git a/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/packet.proto b/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/packet.proto new file mode 100644 index 00000000..f75a1463 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/interchain_accounts/v1/packet.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; + +// Type defines a classification of message issued from a controller chain to its associated interchain accounts +// host +enum Type { + option (gogoproto.goproto_enum_prefix) = false; + + // Default zero value enumeration + TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; + // Execute a transaction on an interchain accounts host chain + TYPE_EXECUTE_TX = 1 [(gogoproto.enumvalue_customname) = "EXECUTE_TX"]; +} + +// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. +message InterchainAccountPacketData { + Type type = 1; + bytes data = 2; + string memo = 3; +} + +// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. +message CosmosTx { + repeated google.protobuf.Any messages = 1; +} diff --git a/packages/cosmos/proto/ibc/applications/transfer/v1/authz.proto b/packages/cosmos/proto/ibc/applications/transfer/v1/authz.proto new file mode 100644 index 00000000..e7561b07 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/transfer/v1/authz.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Allocation defines the spend limit for a particular port and channel +message Allocation { + // the port on which the packet will be sent + string source_port = 1; + // the channel by which the packet will be sent + string source_channel = 2; + // spend limitation on the channel + repeated cosmos.base.v1beta1.Coin spend_limit = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // allow list of receivers, an empty allow list permits any receiver address + repeated string allow_list = 4; + // allow list of packet data keys, an empty list prohibits all packet data keys; + // a list only with "*" permits any packet data key + repeated string allowed_packet_data = 5; +} + +// TransferAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account for ibc transfer on a specific channel +message TransferAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + + // port and channel amounts + repeated Allocation allocations = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/applications/transfer/v1/genesis.proto b/packages/cosmos/proto/ibc/applications/transfer/v1/genesis.proto new file mode 100644 index 00000000..f7d707f6 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/transfer/v1/genesis.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; + +import "ibc/applications/transfer/v1/transfer.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +// GenesisState defines the ibc-transfer genesis state +message GenesisState { + string port_id = 1; + repeated DenomTrace denom_traces = 2 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; + Params params = 3 [(gogoproto.nullable) = false]; + // total_escrowed contains the total amount of tokens escrowed + // by the transfer module + repeated cosmos.base.v1beta1.Coin total_escrowed = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/applications/transfer/v1/query.proto b/packages/cosmos/proto/ibc/applications/transfer/v1/query.proto new file mode 100644 index 00000000..78829671 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/transfer/v1/query.proto @@ -0,0 +1,121 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/applications/transfer/v1/transfer.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; + +// Query provides defines the gRPC querier service. +service Query { + // DenomTraces queries all denomination traces. + rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces"; + } + + // DenomTrace queries a denomination trace information. + rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash=**}"; + } + + // Params queries all parameters of the ibc-transfer module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/params"; + } + + // DenomHash queries a denomination hash information. + rpc DenomHash(QueryDenomHashRequest) returns (QueryDenomHashResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace=**}"; + } + + // EscrowAddress returns the escrow address for a particular port and channel id. + rpc EscrowAddress(QueryEscrowAddressRequest) returns (QueryEscrowAddressResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address"; + } + + // TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. + rpc TotalEscrowForDenom(QueryTotalEscrowForDenomRequest) returns (QueryTotalEscrowForDenomResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denoms/{denom=**}/total_escrow"; + } +} + +// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC +// method +message QueryDenomTraceRequest { + // hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. + string hash = 1; +} + +// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC +// method. +message QueryDenomTraceResponse { + // denom_trace returns the requested denomination trace information. + DenomTrace denom_trace = 1; +} + +// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC +// method +message QueryDenomTracesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC +// method. +message QueryDenomTracesResponse { + // denom_traces returns all denominations trace information. + repeated DenomTrace denom_traces = 1 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} + +// QueryDenomHashRequest is the request type for the Query/DenomHash RPC +// method +message QueryDenomHashRequest { + // The denomination trace ([port_id]/[channel_id])+/[denom] + string trace = 1; +} + +// QueryDenomHashResponse is the response type for the Query/DenomHash RPC +// method. +message QueryDenomHashResponse { + // hash (in hex format) of the denomination trace information. + string hash = 1; +} + +// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. +message QueryEscrowAddressRequest { + // unique port identifier + string port_id = 1; + // unique channel identifier + string channel_id = 2; +} + +// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. +message QueryEscrowAddressResponse { + // the escrow account address + string escrow_address = 1; +} + +// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. +message QueryTotalEscrowForDenomRequest { + string denom = 1; +} + +// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. +message QueryTotalEscrowForDenomResponse { + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/applications/transfer/v1/transfer.proto b/packages/cosmos/proto/ibc/applications/transfer/v1/transfer.proto new file mode 100644 index 00000000..7f772376 --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/transfer/v1/transfer.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; + +// DenomTrace contains the base denomination for ICS20 fungible tokens and the +// source tracing information path. +message DenomTrace { + // path defines the chain of port/channel identifiers used for tracing the + // source of the fungible token. + string path = 1; + // base denomination of the relayed fungible token. + string base_denom = 2; +} + +// Params defines the set of IBC transfer parameters. +// NOTE: To prevent a single token from being transferred, set the +// TransfersEnabled parameter to true and then set the bank module's SendEnabled +// parameter for the denomination to false. +message Params { + // send_enabled enables or disables all cross-chain token transfers from this + // chain. + bool send_enabled = 1; + // receive_enabled enables or disables all cross-chain token transfers to this + // chain. + bool receive_enabled = 2; +} diff --git a/packages/cosmos/proto/ibc/applications/transfer/v1/tx.proto b/packages/cosmos/proto/ibc/applications/transfer/v1/tx.proto new file mode 100644 index 00000000..42c70d3b --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/transfer/v1/tx.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/applications/transfer/v1/transfer.proto"; + +// Msg defines the ibc/transfer Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Transfer defines a rpc handler method for MsgTransfer. + rpc Transfer(MsgTransfer) returns (MsgTransferResponse); + + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +// ICS20 enabled chains. See ICS Spec here: +// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures +message MsgTransfer { + option (amino.name) = "cosmos-sdk/MsgTransfer"; + option (cosmos.msg.v1.signer) = "sender"; + + option (gogoproto.goproto_getters) = false; + + // the port on which the packet will be sent + string source_port = 1; + // the channel by which the packet will be sent + string source_channel = 2; + // the tokens to be transferred + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // the sender address + string sender = 4; + // the recipient address on the destination chain + string receiver = 5; + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + ibc.core.client.v1.Height timeout_height = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // Timeout timestamp in absolute nanoseconds since unix epoch. + // The timeout is disabled when set to 0. + uint64 timeout_timestamp = 7; + // optional memo + string memo = 8; +} + +// MsgTransferResponse defines the Msg/Transfer response type. +message MsgTransferResponse { + option (gogoproto.goproto_getters) = false; + + // sequence number of the transfer packet sent + uint64 sequence = 1; +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the transfer parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/applications/transfer/v2/packet.proto b/packages/cosmos/proto/ibc/applications/transfer/v2/packet.proto new file mode 100644 index 00000000..bff35bdd --- /dev/null +++ b/packages/cosmos/proto/ibc/applications/transfer/v2/packet.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v2; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; + +// FungibleTokenPacketData defines a struct for the packet payload +// See FungibleTokenPacketData spec: +// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures +message FungibleTokenPacketData { + // the token denomination to be transferred + string denom = 1; + // the token amount to be transferred + string amount = 2; + // the sender address + string sender = 3; + // the recipient address on the destination chain + string receiver = 4; + // optional memo + string memo = 5; +} diff --git a/packages/cosmos/proto/ibc/core/channel/v1/channel.proto b/packages/cosmos/proto/ibc/core/channel/v1/channel.proto new file mode 100644 index 00000000..242ff8fd --- /dev/null +++ b/packages/cosmos/proto/ibc/core/channel/v1/channel.proto @@ -0,0 +1,187 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// Channel defines pipeline for exactly-once packet delivery between specific +// modules on separate blockchains, which has at least one end capable of +// sending packets and one end capable of receiving packets. +message Channel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + Counterparty counterparty = 3 [(gogoproto.nullable) = false]; + // list of connection identifiers, in order, along which packets sent on + // this channel will travel + repeated string connection_hops = 4; + // opaque channel version, which is agreed upon during the handshake + string version = 5; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 6; +} + +// IdentifiedChannel defines a channel with additional port and channel +// identifier fields. +message IdentifiedChannel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + Counterparty counterparty = 3 [(gogoproto.nullable) = false]; + // list of connection identifiers, in order, along which packets sent on + // this channel will travel + repeated string connection_hops = 4; + // opaque channel version, which is agreed upon during the handshake + string version = 5; + // port identifier + string port_id = 6; + // channel identifier + string channel_id = 7; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 8; +} + +// State defines if a channel is in one of the following states: +// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. +enum State { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; + // A channel has just started the opening handshake. + STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; + // A channel has acknowledged the handshake step on the counterparty chain. + STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; + // A channel has completed the handshake. Open channels are + // ready to send and receive packets. + STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; + // A channel has been closed and can no longer be used to send or receive + // packets. + STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; + // A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. + STATE_FLUSHING = 5 [(gogoproto.enumvalue_customname) = "FLUSHING"]; + // A channel has just completed flushing any in-flight packets. + STATE_FLUSHCOMPLETE = 6 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"]; +} + +// Order defines if a channel is ORDERED or UNORDERED +enum Order { + option (gogoproto.goproto_enum_prefix) = false; + + // zero-value for channel ordering + ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; + // packets can be delivered in any order, which may differ from the order in + // which they were sent. + ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"]; + // packets are delivered exactly in the order which they were sent + ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; +} + +// Counterparty defines a channel end counterparty +message Counterparty { + option (gogoproto.goproto_getters) = false; + + // port on the counterparty chain which owns the other end of the channel. + string port_id = 1; + // channel end on the counterparty chain + string channel_id = 2; +} + +// Packet defines a type that carries data across different chains through IBC +message Packet { + option (gogoproto.goproto_getters) = false; + + // number corresponds to the order of sends and receives, where a Packet + // with an earlier sequence number must be sent and received before a Packet + // with a later sequence number. + uint64 sequence = 1; + // identifies the port on the sending chain. + string source_port = 2; + // identifies the channel end on the sending chain. + string source_channel = 3; + // identifies the port on the receiving chain. + string destination_port = 4; + // identifies the channel end on the receiving chain. + string destination_channel = 5; + // actual opaque bytes transferred directly to the application module + bytes data = 6; + // block height after which the packet times out + ibc.core.client.v1.Height timeout_height = 7 [(gogoproto.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet times out + uint64 timeout_timestamp = 8; +} + +// PacketState defines the generic type necessary to retrieve and store +// packet commitments, acknowledgements, and receipts. +// Caller is responsible for knowing the context necessary to interpret this +// state as a commitment, acknowledgement, or a receipt. +message PacketState { + option (gogoproto.goproto_getters) = false; + + // channel port identifier. + string port_id = 1; + // channel unique identifier. + string channel_id = 2; + // packet sequence. + uint64 sequence = 3; + // embedded data that represents packet state. + bytes data = 4; +} + +// PacketId is an identifier for a unique Packet +// Source chains refer to packets by source port/channel +// Destination chains refer to packets by destination port/channel +message PacketId { + option (gogoproto.goproto_getters) = false; + + // channel port identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// Acknowledgement is the recommended acknowledgement format to be used by +// app-specific protocols. +// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental +// conflicts with other protobuf message formats used for acknowledgements. +// The first byte of any message with this format will be the non-ASCII values +// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: +// https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope +message Acknowledgement { + // response contains either a result or an error and must be non-empty + oneof response { + bytes result = 21; + string error = 22; + } +} + +// Timeout defines an execution deadline structure for 04-channel handlers. +// This includes packet lifecycle handlers as well as the upgrade handshake handlers. +// A valid Timeout contains either one or both of a timestamp and block height (sequence). +message Timeout { + // block height after which the packet or upgrade times out + ibc.core.client.v1.Height height = 1 [(gogoproto.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet or upgrade times out + uint64 timestamp = 2; +} + +// Params defines the set of IBC channel parameters. +message Params { + // the relative timeout after which channel upgrades will time out. + Timeout upgrade_timeout = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/core/channel/v1/genesis.proto b/packages/cosmos/proto/ibc/core/channel/v1/genesis.proto new file mode 100644 index 00000000..665b2b15 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/channel/v1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// GenesisState defines the ibc channel submodule's genesis state. +message GenesisState { + repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false]; + repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; + repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; + repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; + repeated PacketSequence send_sequences = 5 [(gogoproto.nullable) = false]; + repeated PacketSequence recv_sequences = 6 [(gogoproto.nullable) = false]; + repeated PacketSequence ack_sequences = 7 [(gogoproto.nullable) = false]; + // the sequence for the next generated channel identifier + uint64 next_channel_sequence = 8; + Params params = 9 [(gogoproto.nullable) = false]; +} + +// PacketSequence defines the genesis type necessary to retrieve and store +// next send and receive sequences. +message PacketSequence { + string port_id = 1; + string channel_id = 2; + uint64 sequence = 3; +} diff --git a/packages/cosmos/proto/ibc/core/channel/v1/query.proto b/packages/cosmos/proto/ibc/core/channel/v1/query.proto new file mode 100644 index 00000000..f89d2127 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/channel/v1/query.proto @@ -0,0 +1,459 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "ibc/core/client/v1/client.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/upgrade.proto"; + +// Query provides defines the gRPC querier service +service Query { + // Channel queries an IBC Channel. + rpc Channel(QueryChannelRequest) returns (QueryChannelResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}"; + } + + // Channels queries all the IBC channels of a chain. + rpc Channels(QueryChannelsRequest) returns (QueryChannelsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels"; + } + + // ConnectionChannels queries all the channels associated with a connection + // end. + rpc ConnectionChannels(QueryConnectionChannelsRequest) returns (QueryConnectionChannelsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/connections/{connection}/channels"; + } + + // ChannelClientState queries for the client state for the channel associated + // with the provided channel identifiers. + rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/client_state"; + } + + // ChannelConsensusState queries for the consensus state for the channel + // associated with the provided channel identifiers. + rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/consensus_state/revision/" + "{revision_number}/height/{revision_height}"; + } + + // PacketCommitment queries a stored packet commitment hash. + rpc PacketCommitment(QueryPacketCommitmentRequest) returns (QueryPacketCommitmentResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" + "packet_commitments/{sequence}"; + } + + // PacketCommitments returns all the packet commitments hashes associated + // with a channel. + rpc PacketCommitments(QueryPacketCommitmentsRequest) returns (QueryPacketCommitmentsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_commitments"; + } + + // PacketReceipt queries if a given packet sequence has been received on the + // queried chain + rpc PacketReceipt(QueryPacketReceiptRequest) returns (QueryPacketReceiptResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_receipts/{sequence}"; + } + + // PacketAcknowledgement queries a stored packet acknowledgement hash. + rpc PacketAcknowledgement(QueryPacketAcknowledgementRequest) returns (QueryPacketAcknowledgementResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_acks/{sequence}"; + } + + // PacketAcknowledgements returns all the packet acknowledgements associated + // with a channel. + rpc PacketAcknowledgements(QueryPacketAcknowledgementsRequest) returns (QueryPacketAcknowledgementsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_acknowledgements"; + } + + // UnreceivedPackets returns all the unreceived IBC packets associated with a + // channel and sequences. + rpc UnreceivedPackets(QueryUnreceivedPacketsRequest) returns (QueryUnreceivedPacketsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" + "packet_commitments/" + "{packet_commitment_sequences}/unreceived_packets"; + } + + // UnreceivedAcks returns all the unreceived IBC acknowledgements associated + // with a channel and sequences. + rpc UnreceivedAcks(QueryUnreceivedAcksRequest) returns (QueryUnreceivedAcksResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_commitments/" + "{packet_ack_sequences}/unreceived_acks"; + } + + // NextSequenceReceive returns the next receive sequence for a given channel. + rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/next_sequence"; + } + + // NextSequenceSend returns the next send sequence for a given channel. + rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/next_sequence_send"; + } + + // UpgradeError returns the error receipt if the upgrade handshake failed. + rpc UpgradeError(QueryUpgradeErrorRequest) returns (QueryUpgradeErrorResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade_error"; + } + + // Upgrade returns the upgrade for a given port and channel id. + rpc Upgrade(QueryUpgradeRequest) returns (QueryUpgradeResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade"; + } + + // ChannelParams queries all parameters of the ibc channel submodule. + rpc ChannelParams(QueryChannelParamsRequest) returns (QueryChannelParamsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/params"; + } +} + +// QueryChannelRequest is the request type for the Query/Channel RPC method +message QueryChannelRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryChannelResponse is the response type for the Query/Channel RPC method. +// Besides the Channel end, it includes a proof and the height from which the +// proof was retrieved. +message QueryChannelResponse { + // channel associated with the request identifiers + ibc.core.channel.v1.Channel channel = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelsRequest is the request type for the Query/Channels RPC method +message QueryChannelsRequest { + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryChannelsResponse is the response type for the Query/Channels RPC method. +message QueryChannelsResponse { + // list of stored channels of the chain. + repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionChannelsRequest is the request type for the +// Query/QueryConnectionChannels RPC method +message QueryConnectionChannelsRequest { + // connection unique identifier + string connection = 1; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryConnectionChannelsResponse is the Response type for the +// Query/QueryConnectionChannels RPC method +message QueryConnectionChannelsResponse { + // list of channels associated with a connection. + repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelClientStateRequest is the request type for the Query/ClientState +// RPC method +message QueryChannelClientStateRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryChannelClientStateResponse is the Response type for the +// Query/QueryChannelClientState RPC method +message QueryChannelClientStateResponse { + // client state associated with the channel + ibc.core.client.v1.IdentifiedClientState identified_client_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelConsensusStateRequest is the request type for the +// Query/ConsensusState RPC method +message QueryChannelConsensusStateRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // revision number of the consensus state + uint64 revision_number = 3; + // revision height of the consensus state + uint64 revision_height = 4; +} + +// QueryChannelClientStateResponse is the Response type for the +// Query/QueryChannelClientState RPC method +message QueryChannelConsensusStateResponse { + // consensus state associated with the channel + google.protobuf.Any consensus_state = 1; + // client ID associated with the consensus state + string client_id = 2; + // merkle proof of existence + bytes proof = 3; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; +} + +// QueryPacketCommitmentRequest is the request type for the +// Query/PacketCommitment RPC method +message QueryPacketCommitmentRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// QueryPacketCommitmentResponse defines the client query response for a packet +// which also includes a proof and the height from which the proof was +// retrieved +message QueryPacketCommitmentResponse { + // packet associated with the request fields + bytes commitment = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryPacketCommitmentsRequest is the request type for the +// Query/QueryPacketCommitments RPC method +message QueryPacketCommitmentsRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryPacketCommitmentsResponse is the request type for the +// Query/QueryPacketCommitments RPC method +message QueryPacketCommitmentsResponse { + repeated ibc.core.channel.v1.PacketState commitments = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryPacketReceiptRequest is the request type for the +// Query/PacketReceipt RPC method +message QueryPacketReceiptRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// QueryPacketReceiptResponse defines the client query response for a packet +// receipt which also includes a proof, and the height from which the proof was +// retrieved +message QueryPacketReceiptResponse { + // success flag for if receipt exists + bool received = 2; + // merkle proof of existence + bytes proof = 3; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; +} + +// QueryPacketAcknowledgementRequest is the request type for the +// Query/PacketAcknowledgement RPC method +message QueryPacketAcknowledgementRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// QueryPacketAcknowledgementResponse defines the client query response for a +// packet which also includes a proof and the height from which the +// proof was retrieved +message QueryPacketAcknowledgementResponse { + // packet associated with the request fields + bytes acknowledgement = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryPacketAcknowledgementsRequest is the request type for the +// Query/QueryPacketCommitments RPC method +message QueryPacketAcknowledgementsRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 3; + // list of packet sequences + repeated uint64 packet_commitment_sequences = 4; +} + +// QueryPacketAcknowledgemetsResponse is the request type for the +// Query/QueryPacketAcknowledgements RPC method +message QueryPacketAcknowledgementsResponse { + repeated ibc.core.channel.v1.PacketState acknowledgements = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUnreceivedPacketsRequest is the request type for the +// Query/UnreceivedPackets RPC method +message QueryUnreceivedPacketsRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // list of packet sequences + repeated uint64 packet_commitment_sequences = 3; +} + +// QueryUnreceivedPacketsResponse is the response type for the +// Query/UnreceivedPacketCommitments RPC method +message QueryUnreceivedPacketsResponse { + // list of unreceived packet sequences + repeated uint64 sequences = 1; + // query block height + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; +} + +// QueryUnreceivedAcks is the request type for the +// Query/UnreceivedAcks RPC method +message QueryUnreceivedAcksRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // list of acknowledgement sequences + repeated uint64 packet_ack_sequences = 3; +} + +// QueryUnreceivedAcksResponse is the response type for the +// Query/UnreceivedAcks RPC method +message QueryUnreceivedAcksResponse { + // list of unreceived acknowledgement sequences + repeated uint64 sequences = 1; + // query block height + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; +} + +// QueryNextSequenceReceiveRequest is the request type for the +// Query/QueryNextSequenceReceiveRequest RPC method +message QueryNextSequenceReceiveRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QuerySequenceResponse is the response type for the +// Query/QueryNextSequenceReceiveResponse RPC method +message QueryNextSequenceReceiveResponse { + // next sequence receive number + uint64 next_sequence_receive = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryNextSequenceSendRequest is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryNextSequenceSendResponse is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendResponse { + // next sequence send number + uint64 next_sequence_send = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorResponse { + ErrorReceipt error_receipt = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method +message QueryUpgradeRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method +message QueryUpgradeResponse { + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +message QueryChannelParamsRequest {} + +// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +message QueryChannelParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/core/channel/v1/tx.proto b/packages/cosmos/proto/ibc/core/channel/v1/tx.proto new file mode 100644 index 00000000..3f30e8b8 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/channel/v1/tx.proto @@ -0,0 +1,469 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "ibc/core/channel/v1/upgrade.proto"; + +// Msg defines the ibc/channel Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); + + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); + + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); + + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); + + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); + + // ChannelCloseConfirm defines a rpc handler method for + // MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + + // Timeout defines a rpc handler method for MsgTimeout. + rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); + + // ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. + rpc ChannelUpgradeInit(MsgChannelUpgradeInit) returns (MsgChannelUpgradeInitResponse); + + // ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. + rpc ChannelUpgradeTry(MsgChannelUpgradeTry) returns (MsgChannelUpgradeTryResponse); + + // ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. + rpc ChannelUpgradeAck(MsgChannelUpgradeAck) returns (MsgChannelUpgradeAckResponse); + + // ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. + rpc ChannelUpgradeConfirm(MsgChannelUpgradeConfirm) returns (MsgChannelUpgradeConfirmResponse); + + // ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. + rpc ChannelUpgradeOpen(MsgChannelUpgradeOpen) returns (MsgChannelUpgradeOpenResponse); + + // ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. + rpc ChannelUpgradeTimeout(MsgChannelUpgradeTimeout) returns (MsgChannelUpgradeTimeoutResponse); + + // ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. + rpc ChannelUpgradeCancel(MsgChannelUpgradeCancel) returns (MsgChannelUpgradeCancelResponse); + + // UpdateChannelParams defines a rpc handler method for MsgUpdateParams. + rpc UpdateChannelParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + rpc PruneAcknowledgements(MsgPruneAcknowledgements) returns (MsgPruneAcknowledgementsResponse); +} + +// ResponseResultType defines the possible outcomes of the execution of a message +enum ResponseResultType { + option (gogoproto.goproto_enum_prefix) = false; + + // Default zero value enumeration + RESPONSE_RESULT_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; + // The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + RESPONSE_RESULT_TYPE_NOOP = 1 [(gogoproto.enumvalue_customname) = "NOOP"]; + // The message was executed successfully + RESPONSE_RESULT_TYPE_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "SUCCESS"]; + // The message was executed unsuccessfully + RESPONSE_RESULT_TYPE_FAILURE = 3 [(gogoproto.enumvalue_customname) = "FAILURE"]; +} + +// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +// is called by a relayer on Chain A. +message MsgChannelOpenInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + Channel channel = 2 [(gogoproto.nullable) = false]; + string signer = 3; +} + +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +message MsgChannelOpenInitResponse { + option (gogoproto.goproto_getters) = false; + + string channel_id = 1; + string version = 2; +} + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// on Chain B. The version field within the Channel field has been deprecated. Its +// value will be ignored by core IBC. +message MsgChannelOpenTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + // Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. + string previous_channel_id = 2 [deprecated = true]; + // NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. + Channel channel = 3 [(gogoproto.nullable) = false]; + string counterparty_version = 4; + bytes proof_init = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +message MsgChannelOpenTryResponse { + option (gogoproto.goproto_getters) = false; + + string version = 1; + string channel_id = 2; +} + +// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +// the change of channel state to TRYOPEN on Chain B. +// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel +// in the same block as executing this message otherwise the counterparty will +// be incapable of opening. +message MsgChannelOpenAck { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + string counterparty_channel_id = 3; + string counterparty_version = 4; + bytes proof_try = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +message MsgChannelOpenAckResponse {} + +// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of channel state to OPEN on Chain A. +message MsgChannelOpenConfirm { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + bytes proof_ack = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response +// type. +message MsgChannelOpenConfirmResponse {} + +// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +// to close a channel with Chain B. +message MsgChannelCloseInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + string signer = 3; +} + +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +message MsgChannelCloseInitResponse {} + +// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +// to acknowledge the change of channel state to CLOSED on Chain A. +message MsgChannelCloseConfirm { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + bytes proof_init = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; + uint64 counterparty_upgrade_sequence = 6; +} + +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response +// type. +message MsgChannelCloseConfirmResponse {} + +// MsgRecvPacket receives incoming IBC packet +message MsgRecvPacket { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_commitment = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +message MsgRecvPacketResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgTimeout receives timed-out packet +message MsgTimeout { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 4; + string signer = 5; +} + +// MsgTimeoutResponse defines the Msg/Timeout response type. +message MsgTimeoutResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +message MsgTimeoutOnClose { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + bytes proof_close = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 5; + string signer = 6; + uint64 counterparty_upgrade_sequence = 7; +} + +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +message MsgTimeoutOnCloseResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgAcknowledgement receives incoming IBC acknowledgement +message MsgAcknowledgement { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes acknowledgement = 2; + bytes proof_acked = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +message MsgAcknowledgementResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc +// WARNING: Initializing a channel upgrade in the same block as opening the channel +// may result in the counterparty being incapable of opening. +message MsgChannelUpgradeInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + UpgradeFields fields = 3 [(gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type +message MsgChannelUpgradeInitResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; +} + +// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc +message MsgChannelUpgradeTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + repeated string proposed_upgrade_connection_hops = 3; + UpgradeFields counterparty_upgrade_fields = 4 [(gogoproto.nullable) = false]; + uint64 counterparty_upgrade_sequence = 5; + bytes proof_channel = 6; + bytes proof_upgrade = 7; + ibc.core.client.v1.Height proof_height = 8 [(gogoproto.nullable) = false]; + string signer = 9; +} + +// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type +message MsgChannelUpgradeTryResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; + ResponseResultType result = 3; +} + +// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc +message MsgChannelUpgradeAck { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + Upgrade counterparty_upgrade = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + bytes proof_upgrade = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type +message MsgChannelUpgradeAckResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc +message MsgChannelUpgradeConfirm { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + Upgrade counterparty_upgrade = 4 [(gogoproto.nullable) = false]; + bytes proof_channel = 5; + bytes proof_upgrade = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; + string signer = 8; +} + +// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type +message MsgChannelUpgradeConfirmResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc +message MsgChannelUpgradeOpen { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + uint64 counterparty_upgrade_sequence = 4; + bytes proof_channel = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type +message MsgChannelUpgradeOpenResponse {} + +// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc +message MsgChannelUpgradeTimeout { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + Channel counterparty_channel = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type +message MsgChannelUpgradeTimeoutResponse {} + +// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc +message MsgChannelUpgradeCancel { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + ErrorReceipt error_receipt = 3 [(gogoproto.nullable) = false]; + bytes proof_error_receipt = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type +message MsgChannelUpgradeCancelResponse {} + +// MsgUpdateParams is the MsgUpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + option (gogoproto.goproto_getters) = false; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1; + + // params defines the channel parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} + +// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgements { + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + uint64 limit = 3; + string signer = 4; +} + +// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgementsResponse { + // Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + uint64 total_pruned_sequences = 1; + // Number of sequences left after pruning. + uint64 total_remaining_sequences = 2; +} diff --git a/packages/cosmos/proto/ibc/core/channel/v1/upgrade.proto b/packages/cosmos/proto/ibc/core/channel/v1/upgrade.proto new file mode 100644 index 00000000..81530ed2 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/channel/v1/upgrade.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Upgrade is a verifiable type which contains the relevant information +// for an attempted upgrade. It provides the proposed changes to the channel +// end, the timeout for this upgrade attempt and the next packet sequence +// which allows the counterparty to efficiently know the highest sequence it has received. +// The next sequence send is used for pruning and upgrading from unordered to ordered channels. +message Upgrade { + option (gogoproto.goproto_getters) = false; + + UpgradeFields fields = 1 [(gogoproto.nullable) = false]; + Timeout timeout = 2 [(gogoproto.nullable) = false]; + uint64 next_sequence_send = 3; +} + +// UpgradeFields are the fields in a channel end which may be changed +// during a channel upgrade. +message UpgradeFields { + option (gogoproto.goproto_getters) = false; + + Order ordering = 1; + repeated string connection_hops = 2; + string version = 3; +} + +// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the +// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the +// next sequence. +message ErrorReceipt { + option (gogoproto.goproto_getters) = false; + + // the channel upgrade sequence + uint64 sequence = 1; + // the error message detailing the cause of failure + string message = 2; +} diff --git a/packages/cosmos/proto/ibc/core/client/v1/client.proto b/packages/cosmos/proto/ibc/core/client/v1/client.proto new file mode 100644 index 00000000..7a09e360 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/client/v1/client.proto @@ -0,0 +1,113 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; + +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +message IdentifiedClientState { + // client identifier + string client_id = 1; + // client state + google.protobuf.Any client_state = 2; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height +// field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // consensus state + google.protobuf.Any consensus_state = 2; +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +message ClientConsensusStates { + // client identifier + string client_id = 1; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; +} + +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +message Height { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // the revision that the client is currently on + uint64 revision_number = 1; + // the height within the given revision + uint64 revision_height = 2; +} + +// Params defines the set of IBC light client parameters. +message Params { + // allowed_clients defines the list of allowed client state types which can be created + // and interacted with. If a client type is removed from the allowed clients list, usage + // of this client will be disabled until it is added again to the list. + repeated string allowed_clients = 1; +} + +// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute +// client's latest consensus state is copied over to the subject client. The proposal +// handler may fail if the subject and the substitute do not match in client and +// chain parameters (with exception to latest height, frozen height, and chain-id). +// +// Deprecated: Please use MsgRecoverClient in favour of this message type. +message ClientUpdateProposal { + option deprecated = true; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (gogoproto.goproto_getters) = false; + + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // the client identifier for the client to be updated if the proposal passes + string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""]; + // the substitute client identifier for the client standing in for the subject + // client + string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""]; +} + +// UpgradeProposal is a gov Content type for initiating an IBC breaking +// upgrade. +// +// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. +message UpgradeProposal { + option deprecated = true; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; + + string title = 1; + string description = 2; + cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false]; + + // An UpgradedClientState must be provided to perform an IBC breaking upgrade. + // This will make the chain commit to the correct upgraded (self) client state + // before the upgrade occurs, so that connecting chains can verify that the + // new upgraded client is valid by verifying a proof on the previous version + // of the chain. This will allow IBC connections to persist smoothly across + // planned chain upgrades + google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; +} diff --git a/packages/cosmos/proto/ibc/core/client/v1/genesis.proto b/packages/cosmos/proto/ibc/core/client/v1/genesis.proto new file mode 100644 index 00000000..4abd943c --- /dev/null +++ b/packages/cosmos/proto/ibc/core/client/v1/genesis.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; + +import "ibc/core/client/v1/client.proto"; +import "gogoproto/gogo.proto"; + +// GenesisState defines the ibc client submodule's genesis state. +message GenesisState { + // client states with their corresponding identifiers + repeated IdentifiedClientState clients = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; + // consensus states from each client + repeated ClientConsensusStates clients_consensus = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "ClientsConsensusStates"]; + // metadata from each client + repeated IdentifiedGenesisMetadata clients_metadata = 3 [(gogoproto.nullable) = false]; + Params params = 4 [(gogoproto.nullable) = false]; + // Deprecated: create_localhost has been deprecated. + // The localhost client is automatically created at genesis. + bool create_localhost = 5 [deprecated = true]; + // the sequence for the next generated client identifier + uint64 next_client_sequence = 6; +} + +// GenesisMetadata defines the genesis type for metadata that will be used +// to export all client store keys that are not client or consensus states. +message GenesisMetadata { + option (gogoproto.goproto_getters) = false; + + // store key of metadata without clientID-prefix + bytes key = 1; + // metadata value + bytes value = 2; +} + +// IdentifiedGenesisMetadata has the client metadata with the corresponding +// client id. +message IdentifiedGenesisMetadata { + string client_id = 1; + repeated GenesisMetadata client_metadata = 2 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/core/client/v1/query.proto b/packages/cosmos/proto/ibc/core/client/v1/query.proto new file mode 100644 index 00000000..905a9188 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/client/v1/query.proto @@ -0,0 +1,242 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/query/v1/query.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/commitment/v1/commitment.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; + +// Query provides defines the gRPC querier service +service Query { + // ClientState queries an IBC light client. + rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/client_states/{client_id}"; + } + + // ClientStates queries all the IBC light clients of a chain. + rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) { + option (google.api.http).get = "/ibc/core/client/v1/client_states"; + } + + // ConsensusState queries a consensus state associated with a client state at + // a given height. + rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/consensus_states/" + "{client_id}/revision/{revision_number}/" + "height/{revision_height}"; + } + + // ConsensusStates queries all the consensus state associated with a given + // client. + rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) { + option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}"; + } + + // ConsensusStateHeights queries the height of every consensus states associated with a given client. + rpc ConsensusStateHeights(QueryConsensusStateHeightsRequest) returns (QueryConsensusStateHeightsResponse) { + option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}/heights"; + } + + // Status queries the status of an IBC client. + rpc ClientStatus(QueryClientStatusRequest) returns (QueryClientStatusResponse) { + option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}"; + } + + // ClientParams queries all parameters of the ibc client submodule. + rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) { + option (google.api.http).get = "/ibc/core/client/v1/params"; + } + + // UpgradedClientState queries an Upgraded IBC light client. + rpc UpgradedClientState(QueryUpgradedClientStateRequest) returns (QueryUpgradedClientStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/upgraded_client_states"; + } + + // UpgradedConsensusState queries an Upgraded IBC consensus state. + rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states"; + } + + // VerifyMembership queries an IBC light client for proof verification of a value at a given key path. + rpc VerifyMembership(QueryVerifyMembershipRequest) returns (QueryVerifyMembershipResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http) = { + post: "/ibc/core/client/v1/verify_membership" + body: "*" + }; + } +} + +// QueryClientStateRequest is the request type for the Query/ClientState RPC +// method +message QueryClientStateRequest { + // client state unique identifier + string client_id = 1; +} + +// QueryClientStateResponse is the response type for the Query/ClientState RPC +// method. Besides the client state, it includes a proof and the height from +// which the proof was retrieved. +message QueryClientStateResponse { + // client state associated with the request identifier + google.protobuf.Any client_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryClientStatesRequest is the request type for the Query/ClientStates RPC +// method +message QueryClientStatesRequest { + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClientStatesResponse is the response type for the Query/ClientStates RPC +// method. +message QueryClientStatesResponse { + // list of stored ClientStates of the chain. + repeated IdentifiedClientState client_states = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryConsensusStateRequest is the request type for the Query/ConsensusState +// RPC method. Besides the consensus state, it includes a proof and the height +// from which the proof was retrieved. +message QueryConsensusStateRequest { + // client identifier + string client_id = 1; + // consensus state revision number + uint64 revision_number = 2; + // consensus state revision height + uint64 revision_height = 3; + // latest_height overrides the height field and queries the latest stored + // ConsensusState + bool latest_height = 4; +} + +// QueryConsensusStateResponse is the response type for the Query/ConsensusState +// RPC method +message QueryConsensusStateResponse { + // consensus state associated with the client identifier at the given height + google.protobuf.Any consensus_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates +// RPC method. +message QueryConsensusStatesRequest { + // client identifier + string client_id = 1; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryConsensusStatesResponse is the response type for the +// Query/ConsensusStates RPC method +message QueryConsensusStatesResponse { + // consensus states associated with the identifier + repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false]; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights +// RPC method. +message QueryConsensusStateHeightsRequest { + // client identifier + string client_id = 1; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryConsensusStateHeightsResponse is the response type for the +// Query/ConsensusStateHeights RPC method +message QueryConsensusStateHeightsResponse { + // consensus state heights + repeated Height consensus_state_heights = 1 [(gogoproto.nullable) = false]; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC +// method +message QueryClientStatusRequest { + // client unique identifier + string client_id = 1; +} + +// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC +// method. It returns the current status of the IBC client. +message QueryClientStatusResponse { + string status = 1; +} + +// QueryClientParamsRequest is the request type for the Query/ClientParams RPC +// method. +message QueryClientParamsRequest {} + +// QueryClientParamsResponse is the response type for the Query/ClientParams RPC +// method. +message QueryClientParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} + +// QueryUpgradedClientStateRequest is the request type for the +// Query/UpgradedClientState RPC method +message QueryUpgradedClientStateRequest {} + +// QueryUpgradedClientStateResponse is the response type for the +// Query/UpgradedClientState RPC method. +message QueryUpgradedClientStateResponse { + // client state associated with the request identifier + google.protobuf.Any upgraded_client_state = 1; +} + +// QueryUpgradedConsensusStateRequest is the request type for the +// Query/UpgradedConsensusState RPC method +message QueryUpgradedConsensusStateRequest {} + +// QueryUpgradedConsensusStateResponse is the response type for the +// Query/UpgradedConsensusState RPC method. +message QueryUpgradedConsensusStateResponse { + // Consensus state associated with the request identifier + google.protobuf.Any upgraded_consensus_state = 1; +} + +// QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method +message QueryVerifyMembershipRequest { + // client unique identifier. + string client_id = 1; + // the proof to be verified by the client. + bytes proof = 2; + // the height of the commitment root at which the proof is verified. + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + // the commitment key path. + ibc.core.commitment.v1.MerklePath merkle_path = 4 [(gogoproto.nullable) = false]; + // the value which is proven. + bytes value = 5; + // optional time delay + uint64 time_delay = 6; + // optional block delay + uint64 block_delay = 7; +} + +// QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method +message QueryVerifyMembershipResponse { + // boolean indicating success or failure of proof verification. + bool success = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/core/client/v1/tx.proto b/packages/cosmos/proto/ibc/core/client/v1/tx.proto new file mode 100644 index 00000000..b504ab69 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/client/v1/tx.proto @@ -0,0 +1,175 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "ibc/core/client/v1/client.proto"; + +// Msg defines the ibc/client Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateClient defines a rpc handler method for MsgCreateClient. + rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); + + // UpdateClient defines a rpc handler method for MsgUpdateClient. + rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); + + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); + + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); + + // RecoverClient defines a rpc handler method for MsgRecoverClient. + rpc RecoverClient(MsgRecoverClient) returns (MsgRecoverClientResponse); + + // IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. + rpc IBCSoftwareUpgrade(MsgIBCSoftwareUpgrade) returns (MsgIBCSoftwareUpgradeResponse); + + // UpdateClientParams defines a rpc handler method for MsgUpdateParams. + rpc UpdateClientParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgCreateClient defines a message to create an IBC client +message MsgCreateClient { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // light client state + google.protobuf.Any client_state = 1; + // consensus state associated with the client that corresponds to a given + // height. + google.protobuf.Any consensus_state = 2; + // signer address + string signer = 3; +} + +// MsgCreateClientResponse defines the Msg/CreateClient response type. +message MsgCreateClientResponse {} + +// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +// the given client message. +message MsgUpdateClient { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1; + // client message to update the light client + google.protobuf.Any client_message = 2; + // signer address + string signer = 3; +} + +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +message MsgUpdateClientResponse {} + +// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client +// state +message MsgUpgradeClient { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1; + // upgraded client state + google.protobuf.Any client_state = 2; + // upgraded consensus state, only contains enough information to serve as a + // basis of trust in update logic + google.protobuf.Any consensus_state = 3; + // proof that old chain committed to new client + bytes proof_upgrade_client = 4; + // proof that old chain committed to new consensus state + bytes proof_upgrade_consensus_state = 5; + // signer address + string signer = 6; +} + +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +message MsgUpgradeClientResponse {} + +// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +// light client misbehaviour. +// This message has been deprecated. Use MsgUpdateClient instead. +message MsgSubmitMisbehaviour { + option deprecated = true; + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1; + // misbehaviour used for freezing the light client + google.protobuf.Any misbehaviour = 2; + // signer address + string signer = 3; +} + +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response +// type. +message MsgSubmitMisbehaviourResponse {} + +// MsgRecoverClient defines the message used to recover a frozen or expired client. +message MsgRecoverClient { + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "signer"; + + // the client identifier for the client to be updated if the proposal passes + string subject_client_id = 1; + // the substitute client identifier for the client which will replace the subject + // client + string substitute_client_id = 2; + + // signer address + string signer = 3; +} + +// MsgRecoverClientResponse defines the Msg/RecoverClient response type. +message MsgRecoverClientResponse {} + +// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal +message MsgIBCSoftwareUpgrade { + option (cosmos.msg.v1.signer) = "signer"; + cosmos.upgrade.v1beta1.Plan plan = 1 [(gogoproto.nullable) = false]; + // An UpgradedClientState must be provided to perform an IBC breaking upgrade. + // This will make the chain commit to the correct upgraded (self) client state + // before the upgrade occurs, so that connecting chains can verify that the + // new upgraded client is valid by verifying a proof on the previous version + // of the chain. This will allow IBC connections to persist smoothly across + // planned chain upgrades. Correspondingly, the UpgradedClientState field has been + // deprecated in the Cosmos SDK to allow for this logic to exist solely in + // the 02-client module. + google.protobuf.Any upgraded_client_state = 2; + // signer address + string signer = 3; +} + +// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. +message MsgIBCSoftwareUpgradeResponse {} + +// MsgUpdateParams defines the sdk.Msg type to update the client parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the client parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} diff --git a/packages/cosmos/proto/ibc/core/commitment/v1/commitment.proto b/packages/cosmos/proto/ibc/core/commitment/v1/commitment.proto new file mode 100644 index 00000000..b4753be2 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/commitment/v1/commitment.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +package ibc.core.commitment.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/ics23/v1/proofs.proto"; + +// MerkleRoot defines a merkle root hash. +// In the Cosmos SDK, the AppHash of a block header becomes the root. +message MerkleRoot { + option (gogoproto.goproto_getters) = false; + + bytes hash = 1; +} + +// MerklePrefix is merkle path prefixed to the key. +// The constructed key from the Path and the key will be append(Path.KeyPath, +// append(Path.KeyPrefix, key...)) +message MerklePrefix { + bytes key_prefix = 1; +} + +// MerklePath is the path used to verify commitment proofs, which can be an +// arbitrary structured object (defined by a commitment type). +// MerklePath is represented from root-to-leaf +message MerklePath { + repeated string key_path = 1; +} + +// MerkleProof is a wrapper type over a chain of CommitmentProofs. +// It demonstrates membership or non-membership for an element or set of +// elements, verifiable in conjunction with a known commitment root. Proofs +// should be succinct. +// MerkleProofs are ordered from leaf-to-root +message MerkleProof { + repeated cosmos.ics23.v1.CommitmentProof proofs = 1; +} diff --git a/packages/cosmos/proto/ibc/core/connection/v1/connection.proto b/packages/cosmos/proto/ibc/core/connection/v1/connection.proto new file mode 100644 index 00000000..5b4554ca --- /dev/null +++ b/packages/cosmos/proto/ibc/core/connection/v1/connection.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/commitment/v1/commitment.proto"; + +// ICS03 - Connection Data Structures as defined in +// https://github.com/cosmos/ibc/blob/master/spec/core/ics-003-connection-semantics#data-structures + +// ConnectionEnd defines a stateful object on a chain connected to another +// separate one. +// NOTE: there must only be 2 defined ConnectionEnds to establish +// a connection between two chains. +message ConnectionEnd { + option (gogoproto.goproto_getters) = false; + // client associated with this connection. + string client_id = 1; + // IBC version which can be utilised to determine encodings or protocols for + // channels or packets utilising this connection. + repeated Version versions = 2; + // current state of the connection end. + State state = 3; + // counterparty chain associated with this connection. + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + // delay period that must pass before a consensus state can be used for + // packet-verification NOTE: delay period logic is only implemented by some + // clients. + uint64 delay_period = 5; +} + +// IdentifiedConnection defines a connection with additional connection +// identifier field. +message IdentifiedConnection { + option (gogoproto.goproto_getters) = false; + // connection identifier. + string id = 1; + // client associated with this connection. + string client_id = 2; + // IBC version which can be utilised to determine encodings or protocols for + // channels or packets utilising this connection + repeated Version versions = 3; + // current state of the connection end. + State state = 4; + // counterparty chain associated with this connection. + Counterparty counterparty = 5 [(gogoproto.nullable) = false]; + // delay period associated with this connection. + uint64 delay_period = 6; +} + +// State defines if a connection is in one of the following states: +// INIT, TRYOPEN, OPEN or UNINITIALIZED. +enum State { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; + // A connection end has just started the opening handshake. + STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; + // A connection end has acknowledged the handshake step on the counterparty + // chain. + STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; + // A connection end has completed the handshake. + STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; +} + +// Counterparty defines the counterparty chain associated with a connection end. +message Counterparty { + option (gogoproto.goproto_getters) = false; + + // identifies the client on the counterparty chain associated with a given + // connection. + string client_id = 1; + // identifies the connection end on the counterparty chain associated with a + // given connection. + string connection_id = 2; + // commitment merkle prefix of the counterparty chain. + ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; +} + +// ClientPaths define all the connection paths for a client state. +message ClientPaths { + // list of connection paths + repeated string paths = 1; +} + +// ConnectionPaths define all the connection paths for a given client state. +message ConnectionPaths { + // client state unique identifier + string client_id = 1; + // list of connection paths + repeated string paths = 2; +} + +// Version defines the versioning scheme used to negotiate the IBC version in +// the connection handshake. +message Version { + option (gogoproto.goproto_getters) = false; + + // unique version identifier + string identifier = 1; + // list of features compatible with the specified identifier + repeated string features = 2; +} + +// Params defines the set of Connection parameters. +message Params { + // maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + // largest amount of time that the chain might reasonably take to produce the next block under normal operating + // conditions. A safe choice is 3-5x the expected time per block. + uint64 max_expected_time_per_block = 1; +} diff --git a/packages/cosmos/proto/ibc/core/connection/v1/genesis.proto b/packages/cosmos/proto/ibc/core/connection/v1/genesis.proto new file mode 100644 index 00000000..a5eb6b3a --- /dev/null +++ b/packages/cosmos/proto/ibc/core/connection/v1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/connection/v1/connection.proto"; + +// GenesisState defines the ibc connection submodule's genesis state. +message GenesisState { + repeated IdentifiedConnection connections = 1 [(gogoproto.nullable) = false]; + repeated ConnectionPaths client_connection_paths = 2 [(gogoproto.nullable) = false]; + // the sequence for the next generated connection identifier + uint64 next_connection_sequence = 3; + Params params = 4 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/core/connection/v1/query.proto b/packages/cosmos/proto/ibc/core/connection/v1/query.proto new file mode 100644 index 00000000..c0f1a6f5 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/connection/v1/query.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/connection/v1/connection.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; + +// Query provides defines the gRPC querier service +service Query { + // Connection queries an IBC connection end. + rpc Connection(QueryConnectionRequest) returns (QueryConnectionResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}"; + } + + // Connections queries all the IBC connections of a chain. + rpc Connections(QueryConnectionsRequest) returns (QueryConnectionsResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections"; + } + + // ClientConnections queries the connection paths associated with a client + // state. + rpc ClientConnections(QueryClientConnectionsRequest) returns (QueryClientConnectionsResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/client_connections/{client_id}"; + } + + // ConnectionClientState queries the client state associated with the + // connection. + rpc ConnectionClientState(QueryConnectionClientStateRequest) returns (QueryConnectionClientStateResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/client_state"; + } + + // ConnectionConsensusState queries the consensus state associated with the + // connection. + rpc ConnectionConsensusState(QueryConnectionConsensusStateRequest) returns (QueryConnectionConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/consensus_state/" + "revision/{revision_number}/height/{revision_height}"; + } + + // ConnectionParams queries all parameters of the ibc connection submodule. + rpc ConnectionParams(QueryConnectionParamsRequest) returns (QueryConnectionParamsResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/params"; + } +} + +// QueryConnectionRequest is the request type for the Query/Connection RPC +// method +message QueryConnectionRequest { + // connection unique identifier + string connection_id = 1; +} + +// QueryConnectionResponse is the response type for the Query/Connection RPC +// method. Besides the connection end, it includes a proof and the height from +// which the proof was retrieved. +message QueryConnectionResponse { + // connection associated with the request identifier + ibc.core.connection.v1.ConnectionEnd connection = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionsRequest is the request type for the Query/Connections RPC +// method +message QueryConnectionsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryConnectionsResponse is the response type for the Query/Connections RPC +// method. +message QueryConnectionsResponse { + // list of stored connections of the chain. + repeated ibc.core.connection.v1.IdentifiedConnection connections = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryClientConnectionsRequest is the request type for the +// Query/ClientConnections RPC method +message QueryClientConnectionsRequest { + // client identifier associated with a connection + string client_id = 1; +} + +// QueryClientConnectionsResponse is the response type for the +// Query/ClientConnections RPC method +message QueryClientConnectionsResponse { + // slice of all the connection paths associated with a client. + repeated string connection_paths = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was generated + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionClientStateRequest is the request type for the +// Query/ConnectionClientState RPC method +message QueryConnectionClientStateRequest { + // connection identifier + string connection_id = 1; +} + +// QueryConnectionClientStateResponse is the response type for the +// Query/ConnectionClientState RPC method +message QueryConnectionClientStateResponse { + // client state associated with the channel + ibc.core.client.v1.IdentifiedClientState identified_client_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionConsensusStateRequest is the request type for the +// Query/ConnectionConsensusState RPC method +message QueryConnectionConsensusStateRequest { + // connection identifier + string connection_id = 1; + uint64 revision_number = 2; + uint64 revision_height = 3; +} + +// QueryConnectionConsensusStateResponse is the response type for the +// Query/ConnectionConsensusState RPC method +message QueryConnectionConsensusStateResponse { + // consensus state associated with the channel + google.protobuf.Any consensus_state = 1; + // client ID associated with the consensus state + string client_id = 2; + // merkle proof of existence + bytes proof = 3; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; +} + +// QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. +message QueryConnectionParamsRequest {} + +// QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. +message QueryConnectionParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/core/connection/v1/tx.proto b/packages/cosmos/proto/ibc/core/connection/v1/tx.proto new file mode 100644 index 00000000..8e59c27d --- /dev/null +++ b/packages/cosmos/proto/ibc/core/connection/v1/tx.proto @@ -0,0 +1,146 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; +import "google/protobuf/any.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/connection/v1/connection.proto"; + +// Msg defines the ibc/connection Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); + + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); + + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); + + // ConnectionOpenConfirm defines a rpc handler method for + // MsgConnectionOpenConfirm. + rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); + + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateParams. + rpc UpdateConnectionParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgConnectionOpenInit defines the msg sent by an account on Chain A to +// initialize a connection with Chain B. +message MsgConnectionOpenInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string client_id = 1; + Counterparty counterparty = 2 [(gogoproto.nullable) = false]; + Version version = 3; + uint64 delay_period = 4; + string signer = 5; +} + +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response +// type. +message MsgConnectionOpenInitResponse {} + +// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +// connection on Chain B. +message MsgConnectionOpenTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string client_id = 1; + // Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. + string previous_connection_id = 2 [deprecated = true]; + google.protobuf.Any client_state = 3; + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + uint64 delay_period = 5; + repeated Version counterparty_versions = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; + // proof of the initialization the connection on Chain A: `UNINITIALIZED -> + // INIT` + bytes proof_init = 8; + // proof of client state included in message + bytes proof_client = 9; + // proof of client consensus state + bytes proof_consensus = 10; + ibc.core.client.v1.Height consensus_height = 11 [(gogoproto.nullable) = false]; + string signer = 12; + // optional proof data for host state machines that are unable to introspect their own consensus state + bytes host_consensus_state_proof = 13; +} + +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +message MsgConnectionOpenTryResponse {} + +// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to +// acknowledge the change of connection state to TRYOPEN on Chain B. +message MsgConnectionOpenAck { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string connection_id = 1; + string counterparty_connection_id = 2; + Version version = 3; + google.protobuf.Any client_state = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + // proof of the initialization the connection on Chain B: `UNINITIALIZED -> + // TRYOPEN` + bytes proof_try = 6; + // proof of client state included in message + bytes proof_client = 7; + // proof of client consensus state + bytes proof_consensus = 8; + ibc.core.client.v1.Height consensus_height = 9 [(gogoproto.nullable) = false]; + string signer = 10; + // optional proof data for host state machines that are unable to introspect their own consensus state + bytes host_consensus_state_proof = 11; +} + +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +message MsgConnectionOpenAckResponse {} + +// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of connection state to OPEN on Chain A. +message MsgConnectionOpenConfirm { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string connection_id = 1; + // proof for the change of the connection state on Chain A: `INIT -> OPEN` + bytes proof_ack = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm +// response type. +message MsgConnectionOpenConfirmResponse {} + +// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the connection parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/core/types/v1/genesis.proto b/packages/cosmos/proto/ibc/core/types/v1/genesis.proto new file mode 100644 index 00000000..4b34f688 --- /dev/null +++ b/packages/cosmos/proto/ibc/core/types/v1/genesis.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package ibc.core.types.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/genesis.proto"; +import "ibc/core/connection/v1/genesis.proto"; +import "ibc/core/channel/v1/genesis.proto"; + +// GenesisState defines the ibc module's genesis state. +message GenesisState { + // ICS002 - Clients genesis state + ibc.core.client.v1.GenesisState client_genesis = 1 [(gogoproto.nullable) = false]; + // ICS003 - Connections genesis state + ibc.core.connection.v1.GenesisState connection_genesis = 2 [(gogoproto.nullable) = false]; + // ICS004 - Channel genesis state + ibc.core.channel.v1.GenesisState channel_genesis = 3 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/lightclients/localhost/v2/localhost.proto b/packages/cosmos/proto/ibc/lightclients/localhost/v2/localhost.proto new file mode 100644 index 00000000..635db852 --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/localhost/v2/localhost.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package ibc.lightclients.localhost.v2; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/09-localhost;localhost"; + +import "ibc/core/client/v1/client.proto"; +import "gogoproto/gogo.proto"; + +// ClientState defines the 09-localhost client state +message ClientState { + option (gogoproto.goproto_getters) = false; + + // the latest block height + ibc.core.client.v1.Height latest_height = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/packages/cosmos/proto/ibc/lightclients/solomachine/v2/solomachine.proto new file mode 100644 index 00000000..9dc2690c --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v2; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7"; + +import "ibc/core/connection/v1/connection.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +message ClientState { + option (gogoproto.goproto_getters) = false; + // latest sequence of the client state + uint64 sequence = 1; + // frozen sequence of the solo machine + bool is_frozen = 2; + ConsensusState consensus_state = 3; + // when set to true, will allow governance to update a solo machine client. + // The client will be unfrozen if it is frozen. + bool allow_update_after_proposal = 4; +} + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // public key of the solo machine + google.protobuf.Any public_key = 1; + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + string diversifier = 2; + uint64 timestamp = 3; +} + +// Header defines a solo machine consensus header +message Header { + option (gogoproto.goproto_getters) = false; + // sequence to update solo machine public key at + uint64 sequence = 1; + uint64 timestamp = 2; + bytes signature = 3; + google.protobuf.Any new_public_key = 4; + string new_diversifier = 5; +} + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + string client_id = 1; + uint64 sequence = 2; + SignatureAndData signature_one = 3; + SignatureAndData signature_two = 4; +} + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +message SignatureAndData { + option (gogoproto.goproto_getters) = false; + bytes signature = 1; + DataType data_type = 2; + bytes data = 3; + uint64 timestamp = 4; +} + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +message TimestampedSignatureData { + option (gogoproto.goproto_getters) = false; + bytes signature_data = 1; + uint64 timestamp = 2; +} + +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; + uint64 timestamp = 2; + string diversifier = 3; + // type of the data used + DataType data_type = 4; + // marshaled data + bytes data = 5; +} + +// DataType defines the type of solo machine proof being created. This is done +// to preserve uniqueness of different data sign byte encodings. +enum DataType { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; + // Data type for client state verification + DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; + // Data type for consensus state verification + DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; + // Data type for connection state verification + DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; + // Data type for channel state verification + DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; + // Data type for packet commitment verification + DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; + // Data type for packet acknowledgement verification + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; + // Data type for packet receipt absence verification + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; + // Data type for next sequence recv verification + DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; + // Data type for header verification + DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; +} + +// HeaderData returns the SignBytes data for update verification. +message HeaderData { + option (gogoproto.goproto_getters) = false; + + // header public key + google.protobuf.Any new_pub_key = 1; + // header diversifier + string new_diversifier = 2; +} + +// ClientStateData returns the SignBytes data for client state verification. +message ClientStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any client_state = 2; +} + +// ConsensusStateData returns the SignBytes data for consensus state +// verification. +message ConsensusStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any consensus_state = 2; +} + +// ConnectionStateData returns the SignBytes data for connection state +// verification. +message ConnectionStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.connection.v1.ConnectionEnd connection = 2; +} + +// ChannelStateData returns the SignBytes data for channel state +// verification. +message ChannelStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.channel.v1.Channel channel = 2; +} + +// PacketCommitmentData returns the SignBytes data for packet commitment +// verification. +message PacketCommitmentData { + bytes path = 1; + bytes commitment = 2; +} + +// PacketAcknowledgementData returns the SignBytes data for acknowledgement +// verification. +message PacketAcknowledgementData { + bytes path = 1; + bytes acknowledgement = 2; +} + +// PacketReceiptAbsenceData returns the SignBytes data for +// packet receipt absence verification. +message PacketReceiptAbsenceData { + bytes path = 1; +} + +// NextSequenceRecvData returns the SignBytes data for verification of the next +// sequence to be received. +message NextSequenceRecvData { + bytes path = 1; + uint64 next_seq_recv = 2; +} diff --git a/packages/cosmos/proto/ibc/lightclients/solomachine/v3/solomachine.proto b/packages/cosmos/proto/ibc/lightclients/solomachine/v3/solomachine.proto new file mode 100644 index 00000000..194905b3 --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/solomachine/v3/solomachine.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v3; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine;solomachine"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +message ClientState { + option (gogoproto.goproto_getters) = false; + // latest sequence of the client state + uint64 sequence = 1; + // frozen sequence of the solo machine + bool is_frozen = 2; + ConsensusState consensus_state = 3; +} + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // public key of the solo machine + google.protobuf.Any public_key = 1; + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + string diversifier = 2; + uint64 timestamp = 3; +} + +// Header defines a solo machine consensus header +message Header { + option (gogoproto.goproto_getters) = false; + + uint64 timestamp = 1; + bytes signature = 2; + google.protobuf.Any new_public_key = 3; + string new_diversifier = 4; +} + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; + SignatureAndData signature_one = 2; + SignatureAndData signature_two = 3; +} + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +message SignatureAndData { + option (gogoproto.goproto_getters) = false; + + bytes signature = 1; + bytes path = 2; + bytes data = 3; + uint64 timestamp = 4; +} + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +message TimestampedSignatureData { + option (gogoproto.goproto_getters) = false; + + bytes signature_data = 1; + uint64 timestamp = 2; +} + +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { + option (gogoproto.goproto_getters) = false; + + // the sequence number + uint64 sequence = 1; + // the proof timestamp + uint64 timestamp = 2; + // the public key diversifier + string diversifier = 3; + // the standardised path bytes + bytes path = 4; + // the marshaled data bytes + bytes data = 5; +} + +// HeaderData returns the SignBytes data for update verification. +message HeaderData { + option (gogoproto.goproto_getters) = false; + + // header public key + google.protobuf.Any new_pub_key = 1; + // header diversifier + string new_diversifier = 2; +} diff --git a/packages/cosmos/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/packages/cosmos/proto/ibc/lightclients/tendermint/v1/tendermint.proto new file mode 100644 index 00000000..bd759f4e --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/tendermint/v1/tendermint.proto @@ -0,0 +1,101 @@ +syntax = "proto3"; + +package ibc.lightclients.tendermint.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint;tendermint"; + +import "tendermint/types/validator.proto"; +import "tendermint/types/types.proto"; +import "cosmos/ics23/v1/proofs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/commitment/v1/commitment.proto"; +import "gogoproto/gogo.proto"; + +// ClientState from Tendermint tracks the current validator set, latest height, +// and a possible frozen height. +message ClientState { + option (gogoproto.goproto_getters) = false; + + string chain_id = 1; + Fraction trust_level = 2 [(gogoproto.nullable) = false]; + // duration of the period since the LatestTimestamp during which the + // submitted headers are valid for upgrade + google.protobuf.Duration trusting_period = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + // duration of the staking unbonding period + google.protobuf.Duration unbonding_period = 4 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + // defines how much new (untrusted) header's Time can drift into the future. + google.protobuf.Duration max_clock_drift = 5 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + // Block height when the client was frozen due to a misbehaviour + ibc.core.client.v1.Height frozen_height = 6 [(gogoproto.nullable) = false]; + // Latest height the client was updated to + ibc.core.client.v1.Height latest_height = 7 [(gogoproto.nullable) = false]; + + // Proof specifications used in verifying counterparty state + repeated cosmos.ics23.v1.ProofSpec proof_specs = 8; + + // Path at which next upgraded client will be committed. + // Each element corresponds to the key for a single CommitmentProof in the + // chained proof. NOTE: ClientState must stored under + // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + // the default upgrade module, upgrade_path should be []string{"upgrade", + // "upgradedIBCState"}` + repeated string upgrade_path = 9; + + // allow_update_after_expiry is deprecated + bool allow_update_after_expiry = 10 [deprecated = true]; + // allow_update_after_misbehaviour is deprecated + bool allow_update_after_misbehaviour = 11 [deprecated = true]; +} + +// ConsensusState defines the consensus state from Tendermint. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + + // timestamp that corresponds to the block height in which the ConsensusState + // was stored. + google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // commitment root (i.e app hash) + ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; + bytes next_validators_hash = 3 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; +} + +// Misbehaviour is a wrapper over two conflicting Headers +// that implements Misbehaviour interface expected by ICS-02 +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + + // ClientID is deprecated + string client_id = 1 [deprecated = true]; + Header header_1 = 2 [(gogoproto.customname) = "Header1"]; + Header header_2 = 3 [(gogoproto.customname) = "Header2"]; +} + +// Header defines the Tendermint client consensus Header. +// It encapsulates all the information necessary to update from a trusted +// Tendermint ConsensusState. The inclusion of TrustedHeight and +// TrustedValidators allows this update to process correctly, so long as the +// ConsensusState for the TrustedHeight exists, this removes race conditions +// among relayers The SignedHeader and ValidatorSet are the new untrusted update +// fields for the client. The TrustedHeight is the height of a stored +// ConsensusState on the client that will be used to verify the new untrusted +// header. The Trusted ConsensusState must be within the unbonding period of +// current time in order to correctly verify, and the TrustedValidators must +// hash to TrustedConsensusState.NextValidatorsHash since that is the last +// trusted validator set at the TrustedHeight. +message Header { + .tendermint.types.SignedHeader signed_header = 1 [(gogoproto.embed) = true]; + + .tendermint.types.ValidatorSet validator_set = 2; + ibc.core.client.v1.Height trusted_height = 3 [(gogoproto.nullable) = false]; + .tendermint.types.ValidatorSet trusted_validators = 4; +} + +// Fraction defines the protobuf message type for tmmath.Fraction that only +// supports positive values. +message Fraction { + uint64 numerator = 1; + uint64 denominator = 2; +} diff --git a/packages/cosmos/proto/ibc/lightclients/wasm/v1/genesis.proto b/packages/cosmos/proto/ibc/lightclients/wasm/v1/genesis.proto new file mode 100644 index 00000000..637ba167 --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/wasm/v1/genesis.proto @@ -0,0 +1,20 @@ + +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +// GenesisState defines 08-wasm's keeper genesis state +message GenesisState { + // uploaded light client wasm contracts + repeated Contract contracts = 1 [(gogoproto.nullable) = false]; +} + +// Contract stores contract code +message Contract { + option (gogoproto.goproto_getters) = false; + // contract byte code + bytes code_bytes = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/ibc/lightclients/wasm/v1/query.proto b/packages/cosmos/proto/ibc/lightclients/wasm/v1/query.proto new file mode 100644 index 00000000..bbbed29d --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/wasm/v1/query.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +// Query service for wasm module +service Query { + // Get all Wasm checksums + rpc Checksums(QueryChecksumsRequest) returns (QueryChecksumsResponse) { + option (google.api.http).get = "/ibc/lightclients/wasm/v1/checksums"; + } + + // Get Wasm code for given checksum + rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { + option (google.api.http).get = "/ibc/lightclients/wasm/v1/checksums/{checksum}/code"; + } +} + +// QueryChecksumsRequest is the request type for the Query/Checksums RPC method. +message QueryChecksumsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryChecksumsResponse is the response type for the Query/Checksums RPC method. +message QueryChecksumsResponse { + // checksums is a list of the hex encoded checksums of all wasm codes stored. + repeated string checksums = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryCodeRequest is the request type for the Query/Code RPC method. +message QueryCodeRequest { + // checksum is a hex encoded string of the code stored. + string checksum = 1; +} + +// QueryCodeResponse is the response type for the Query/Code RPC method. +message QueryCodeResponse { + bytes data = 1; +} diff --git a/packages/cosmos/proto/ibc/lightclients/wasm/v1/tx.proto b/packages/cosmos/proto/ibc/lightclients/wasm/v1/tx.proto new file mode 100644 index 00000000..d2fc4659 --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/wasm/v1/tx.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the ibc/08-wasm Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // StoreCode defines a rpc handler method for MsgStoreCode. + rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); + + // RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. + rpc RemoveChecksum(MsgRemoveChecksum) returns (MsgRemoveChecksumResponse); + + // MigrateContract defines a rpc handler method for MsgMigrateContract. + rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); +} + +// MsgStoreCode defines the request type for the StoreCode rpc. +message MsgStoreCode { + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // wasm byte code of light client contract. It can be raw or gzip compressed + bytes wasm_byte_code = 2; +} + +// MsgStoreCodeResponse defines the response type for the StoreCode rpc +message MsgStoreCodeResponse { + // checksum is the sha256 hash of the stored code + bytes checksum = 1; +} + +// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. +message MsgRemoveChecksum { + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // checksum is the sha256 hash to be removed from the store + bytes checksum = 2; +} + +// MsgStoreChecksumResponse defines the response type for the StoreCode rpc +message MsgRemoveChecksumResponse {} + +// MsgMigrateContract defines the request type for the MigrateContract rpc. +message MsgMigrateContract { + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // the client id of the contract + string client_id = 2; + // checksum is the sha256 hash of the new wasm byte code for the contract + bytes checksum = 3; + // the json encoded message to be passed to the contract on migration + bytes msg = 4; +} + +// MsgMigrateContractResponse defines the response type for the MigrateContract rpc +message MsgMigrateContractResponse {} diff --git a/packages/cosmos/proto/ibc/lightclients/wasm/v1/wasm.proto b/packages/cosmos/proto/ibc/lightclients/wasm/v1/wasm.proto new file mode 100644 index 00000000..b6a45e3d --- /dev/null +++ b/packages/cosmos/proto/ibc/lightclients/wasm/v1/wasm.proto @@ -0,0 +1,43 @@ + +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +// Wasm light client's Client state +message ClientState { + option (gogoproto.goproto_getters) = false; + // bytes encoding the client state of the underlying light client + // implemented as a Wasm contract. + bytes data = 1; + bytes checksum = 2; + ibc.core.client.v1.Height latest_height = 3 [(gogoproto.nullable) = false]; +} + +// Wasm light client's ConsensusState +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // bytes encoding the consensus state of the underlying light client + // implemented as a Wasm contract. + bytes data = 1; +} + +// Wasm light client message (either header(s) or misbehaviour) +message ClientMessage { + option (gogoproto.goproto_getters) = false; + + bytes data = 1; +} + +// Checksums defines a list of all checksums that are stored +// +// Deprecated: This message is deprecated in favor of storing the checksums +// using a Collections.KeySet. +message Checksums { + option deprecated = true; + + repeated bytes checksums = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/accum/v1beta1/accum.proto b/packages/cosmos/proto/osmosis/accum/v1beta1/accum.proto new file mode 100644 index 00000000..ab54ddbb --- /dev/null +++ b/packages/cosmos/proto/osmosis/accum/v1beta1/accum.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; +package osmosis.accum.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/osmoutils/accum"; + +// AccumulatorContent is the state-entry for the global accumulator. +// It contains the name of the global accumulator and the total value of +// shares belonging to it from all positions. +message AccumulatorContent { + repeated cosmos.base.v1beta1.DecCoin accum_value = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + string total_shares = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message Options {} + +// Record corresponds to an individual position value belonging to the +// global accumulator. +message Record { + // num_shares is the number of shares belonging to the position associated + // with this record. + string num_shares = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // accum_value_per_share is the subset of coins per shar of the global + // accumulator value that allows to infer how much a position is entitled to + // per share that it owns. + // + // In the default case with no intervals, this value equals to the global + // accumulator value at the time of the position creation, the last update or + // reward claim. + // + // In the interval case such as concentrated liquidity, this value equals to + // the global growth of rewards inside the interval during one of: the time of + // the position creation, the last update or reward claim. Note, that + // immediately prior to claiming or updating rewards, this value must be + // updated to "the growth inside at the time of last update + the growth + // outside at the time of the current block". This is so that the claiming + // logic can subtract this updated value from the global accumulator value to + // get the growth inside the interval from the time of last update up until + // the current block time. + repeated cosmos.base.v1beta1.DecCoin accum_value_per_share = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + // unclaimed_rewards_total is the total amount of unclaimed rewards that the + // position is entitled to. This value is updated whenever shares are added or + // removed from an existing position. We also expose API for manually updating + // this value for some custom use cases such as merging pre-existing positions + // into a single one. + repeated cosmos.base.v1beta1.DecCoin unclaimed_rewards_total = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + Options options = 4; +} diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/params.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/params.proto new file mode 100644 index 00000000..a7f2bc57 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/params.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types"; + +message Params { + // authorized_tick_spacing is an array of uint64s that represents the tick + // spacing values concentrated-liquidity pools can be created with. For + // example, an authorized_tick_spacing of [1, 10, 30] allows for pools + // to be created with tick spacing of 1, 10, or 30. + repeated uint64 authorized_tick_spacing = 1 + [ (gogoproto.moretags) = "yaml:\"authorized_tick_spacing\"" ]; + repeated string authorized_spread_factors = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"authorized_spread_factors\"", + (gogoproto.nullable) = false + ]; + // balancer_shares_reward_discount is the rate by which incentives flowing + // from CL to Balancer pools will be discounted to encourage LPs to migrate. + // e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full + // range CL LPs. + // This field can range from (0,1]. If set to 1, it indicates that all + // incentives stay at cl pool. + string balancer_shares_reward_discount = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"balancer_shares_reward_discount\"", + (gogoproto.nullable) = false + ]; + // authorized_quote_denoms is a list of quote denoms that can be used as + // token1 when creating a pool. We limit the quote assets to a small set for + // the purposes of having convenient price increments stemming from tick to + // price conversion. These increments are in a human readable magnitude only + // for token1 as a quote. For limit orders in the future, this will be a + // desirable property in terms of UX as to allow users to set limit orders at + // prices in terms of token1 (quote asset) that are easy to reason about. + repeated string authorized_quote_denoms = 4 + [ (gogoproto.moretags) = "yaml:\"authorized_quote_denoms\"" ]; + repeated google.protobuf.Duration authorized_uptimes = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"authorized_uptimes\"" + ]; + + // is_permissionless_pool_creation_enabled is a boolean that determines if + // concentrated liquidity pools can be created via message. At launch, + // we consider allowing only governance to create pools, and then later + // allowing permissionless pool creation by switching this flag to true + // with a governance proposal. + bool is_permissionless_pool_creation_enabled = 6 + [ (gogoproto.moretags) = + "yaml:\"is_permissionless_pool_creation_enabled\"" ]; + + // unrestricted_pool_creator_whitelist is a list of addresses that are + // allowed to bypass restrictions on permissionless supercharged pool + // creation, like pool_creation_enabled, restricted quote assets, no + // double creation of pools, etc. + repeated string unrestricted_pool_creator_whitelist = 7 + [ (gogoproto.moretags) = "yaml:\"unrestricted_pool_creator_whitelist\"" ]; + + uint64 hook_gas_limit = 8 + [ (gogoproto.moretags) = "yaml:\"hook_gas_limit\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto new file mode 100644 index 00000000..ac24072f --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model"; + +service Msg { + rpc CreateConcentratedPool(MsgCreateConcentratedPool) + returns (MsgCreateConcentratedPoolResponse); +} + +// ===================== MsgCreateConcentratedPool +message MsgCreateConcentratedPool { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom0 = 2 [ (gogoproto.moretags) = "yaml:\"denom0\"" ]; + string denom1 = 3 [ (gogoproto.moretags) = "yaml:\"denom1\"" ]; + uint64 tick_spacing = 4 [ (gogoproto.moretags) = "yaml:\"tick_spacing\"" ]; + string spread_factor = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"spread_factor\"", + (gogoproto.nullable) = false + ]; +} + +// Returns a unique poolID to identify the pool with. +message MsgCreateConcentratedPoolResponse { + uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; +} diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto new file mode 100644 index 00000000..ca8f6da0 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto @@ -0,0 +1,88 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "osmosis/accum/v1beta1/accum.proto"; +import "osmosis/concentratedliquidity/params.proto"; +import "osmosis/concentratedliquidity/v1beta1/position.proto"; +import "osmosis/concentratedliquidity/v1beta1/tick_info.proto"; +import "osmosis/concentratedliquidity/v1beta1/incentive_record.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types/genesis"; + +// FullTick contains tick index and pool id along with other tick model +// information. +message FullTick { + // pool id associated with the tick. + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + // tick's index. + int64 tick_index = 2 [ (gogoproto.moretags) = "yaml:\"tick_index\"" ]; + // tick's info. + TickInfo info = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"tick_info\"" + ]; +} + +// PoolData represents a serialized pool along with its ticks +// for genesis state. +message PoolData { + // pool struct + google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "PoolI" ]; + // pool's ticks + repeated FullTick ticks = 2 + [ (gogoproto.moretags) = "yaml:\"ticks\"", (gogoproto.nullable) = false ]; + AccumObject spread_reward_accumulator = 3 [ + (gogoproto.moretags) = "yaml:\"spread_reward_accumulator\"", + (gogoproto.nullable) = false + ]; + repeated AccumObject incentives_accumulators = 4 [ + (gogoproto.moretags) = "yaml:\"incentives_accumulator\"", + (gogoproto.nullable) = false + ]; + // incentive records to be set + repeated IncentiveRecord incentive_records = 5 + [ (gogoproto.nullable) = false ]; +} + +message PositionData { + Position position = 1; + uint64 lock_id = 2 [ (gogoproto.moretags) = "yaml:\"lock_id\"" ]; + osmosis.accum.v1beta1.Record spread_reward_accum_record = 3 + [ (gogoproto.nullable) = false ]; + repeated osmosis.accum.v1beta1.Record uptime_accum_records = 4 + [ (gogoproto.nullable) = false ]; +} + +// GenesisState defines the concentrated liquidity module's genesis state. +message GenesisState { + // params are all the parameters of the module + Params params = 1 [ (gogoproto.nullable) = false ]; + // pool data containing serialized pool struct and ticks. + repeated PoolData pool_data = 2 [ (gogoproto.nullable) = false ]; + + repeated PositionData position_data = 3 [ (gogoproto.nullable) = false ]; + + uint64 next_position_id = 4 + [ (gogoproto.moretags) = "yaml:\"next_position_id\"" ]; + + uint64 next_incentive_record_id = 5 + [ (gogoproto.moretags) = "yaml:\"next_incentive_record_id\"" ]; + + uint64 incentives_accumulator_pool_id_migration_threshold = 6 + [ (gogoproto.moretags) = + "yaml:\"incentives_accumulator_pool_id_migration_threshold\"" ]; +} + +message AccumObject { + // In original struct of Accum object, store.KVStore is stored together. + // For handling genesis, we do not need to include store.KVStore since we use + // CL module's KVStore. + + // Accumulator's name (pulled from AccumulatorContent) + string name = 1 [ (gogoproto.moretags) = "yaml:\"name\"" ]; + + osmosis.accum.v1beta1.AccumulatorContent accum_content = 2; +} diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/gov.proto new file mode 100644 index 00000000..5d683263 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/gov.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types"; + +// CreateConcentratedLiquidityPoolsProposal is a gov Content type for creating +// concentrated liquidity pools. If a CreateConcentratedLiquidityPoolsProposal +// passes, the pools are created via pool manager module account. +message CreateConcentratedLiquidityPoolsProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + + repeated PoolRecord pool_records = 3 [ + (gogoproto.moretags) = "yaml:\"pool_records\"", + (gogoproto.nullable) = false + ]; +} +// TickSpacingDecreaseProposal is a gov Content type for proposing a tick +// spacing decrease for a pool. The proposal will fail if one of the pools do +// not exist, or if the new tick spacing is not less than the current tick +// spacing. +message TickSpacingDecreaseProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + repeated PoolIdToTickSpacingRecord pool_id_to_tick_spacing_records = 3 + [ (gogoproto.nullable) = false ]; +} + +// PoolIdToTickSpacingRecord is a struct that contains a pool id to new tick +// spacing pair. +message PoolIdToTickSpacingRecord { + option (gogoproto.equal) = true; + + uint64 pool_id = 1; + uint64 new_tick_spacing = 2; +} + +message PoolRecord { + option (gogoproto.equal) = true; + + string denom0 = 1 [ (gogoproto.moretags) = "yaml:\"denom0\"" ]; + string denom1 = 2 [ (gogoproto.moretags) = "yaml:\"denom1\"" ]; + uint64 tick_spacing = 3 [ (gogoproto.moretags) = "yaml:\"tick_spacing\"" ]; + reserved 4; + string spread_factor = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"spread_factor\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto new file mode 100644 index 00000000..9f670106 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types"; + +// IncentiveRecord is the high-level struct we use to deal with an independent +// incentive being distributed on a pool. Note that PoolId, Denom, and MinUptime +// are included in the key so we avoid storing them in state, hence the +// distinction between IncentiveRecord and IncentiveRecordBody. +message IncentiveRecord { + // incentive_id is the id uniquely identifying this incentive record. + uint64 incentive_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_id\"" ]; + uint64 pool_id = 2; + + // incentive record body holds necessary + IncentiveRecordBody incentive_record_body = 4 [ + (gogoproto.moretags) = "yaml:\"incentive_record_body\"", + (gogoproto.nullable) = false + ]; + // min_uptime is the minimum uptime required for liquidity to qualify for this + // incentive. It should be always be one of the supported uptimes in + // types.SupportedUptimes + google.protobuf.Duration min_uptime = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"min_uptime\"" + ]; +} + +// IncentiveRecordBody represents the body stored in state for each individual +// record. +message IncentiveRecordBody { + // remaining_coin is the total amount of incentives to be distributed + cosmos.base.v1beta1.DecCoin remaining_coin = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", + (gogoproto.moretags) = "yaml:\"remaining_coins\"" + ]; + + // emission_rate is the incentive emission rate per second + string emission_rate = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"emission_rate\"", + (gogoproto.nullable) = false + ]; + + // start_time is the time when the incentive starts distributing + google.protobuf.Timestamp start_time = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/pool.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/pool.proto new file mode 100644 index 00000000..7be00405 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/pool.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; +// This is a legacy package that requires additional migration logic +// in order to use the correct package. Decision made to use legacy package path +// until clear steps for migration logic and the unknowns for state breaking are +// investigated for changing proto package. +package osmosis.concentratedliquidity.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model"; + +message Pool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "PoolI"; + + // pool's address holding all liquidity tokens. + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + + // address holding the incentives liquidity. + string incentives_address = 2 + [ (gogoproto.moretags) = "yaml:\"incentives_address\"" ]; + + // address holding spread rewards from swaps. + string spread_rewards_address = 3 + [ (gogoproto.moretags) = "yaml:\"spread_rewards_address\"" ]; + + uint64 id = 4; + + // Amount of total liquidity + string current_tick_liquidity = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"current_tick_liquidity\"", + (gogoproto.nullable) = false + ]; + + string token0 = 6; + string token1 = 7; + + string current_sqrt_price = 8 [ + (gogoproto.customtype) = "github.com/osmosis-labs/osmosis/osmomath.BigDec", + (gogoproto.moretags) = "yaml:\"spot_price\"", + (gogoproto.nullable) = false + ]; + int64 current_tick = 9 [ (gogoproto.moretags) = "yaml:\"current_tick\"" ]; + // tick_spacing must be one of the authorized_tick_spacing values set in the + // concentrated-liquidity parameters + uint64 tick_spacing = 10 [ (gogoproto.moretags) = "yaml:\"tick_spacing\"" ]; + int64 exponent_at_price_one = 11 + [ (gogoproto.moretags) = "yaml:\"exponent_at_price_one\"" ]; + + // spread_factor is the ratio that is charged on the amount of token in. + string spread_factor = 12 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"spread_factor\"", + (gogoproto.nullable) = false + ]; + + // last_liquidity_update is the last time either the pool liquidity or the + // active tick changed + google.protobuf.Timestamp last_liquidity_update = 13 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"last_liquidity_update\"" + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/position.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/position.proto new file mode 100644 index 00000000..f564ce79 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/position.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; +// this is a legacy package that requires additional migration logic +// in order to use the correct package. Decision made to use legacy package path +// until clear steps for migration logic and the unknowns for state breaking are +// investigated for changing proto package. +package osmosis.concentratedliquidity.v1beta1; + +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/lockup/lock.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model"; + +// Position contains position's id, address, pool id, lower tick, upper tick +// join time, and liquidity. +message Position { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 pool_id = 3 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + int64 lower_tick = 4; + int64 upper_tick = 5; + google.protobuf.Timestamp join_time = 6 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"join_time\"" + ]; + string liquidity = 7 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity\"", + (gogoproto.nullable) = false + ]; +} + +// FullPositionBreakdown returns: +// - the position itself +// - the amount the position translates in terms of asset0 and asset1 +// - the amount of claimable fees +// - the amount of claimable incentives +// - the amount of incentives that would be forfeited if the position was closed +// now +message FullPositionBreakdown { + Position position = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin asset0 = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + cosmos.base.v1beta1.Coin asset1 = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + repeated cosmos.base.v1beta1.Coin claimable_spread_rewards = 4 [ + (gogoproto.moretags) = "yaml:\"claimable_spread_rewards\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin claimable_incentives = 5 [ + (gogoproto.moretags) = "yaml:\"claimable_incentives\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin forfeited_incentives = 6 [ + (gogoproto.moretags) = "yaml:\"forfeited_incentives\"", + (gogoproto.nullable) = false + ]; +} + +message PositionWithPeriodLock { + Position position = 1 [ (gogoproto.nullable) = false ]; + osmosis.lockup.PeriodLock locks = 2 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.proto new file mode 100644 index 00000000..9d2df713 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.proto @@ -0,0 +1,363 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/concentratedliquidity/params.proto"; +import "osmosis/concentratedliquidity/v1beta1/tick_info.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +import "osmosis/concentratedliquidity/v1beta1/position.proto"; +import "osmosis/concentratedliquidity/v1beta1/incentive_record.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/client/queryproto"; + +service Query { + // Pools returns all concentrated liquidity pools + rpc Pools(PoolsRequest) returns (PoolsResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/pools"; + } + + // Params returns concentrated liquidity module params. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/params"; + } + + // UserPositions returns all concentrated positions of some address. + rpc UserPositions(UserPositionsRequest) returns (UserPositionsResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/positions/{address}"; + } + + // LiquidityPerTickRange returns the amount of liquidity per every tick range + // existing within the given pool + rpc LiquidityPerTickRange(LiquidityPerTickRangeRequest) + returns (LiquidityPerTickRangeResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/liquidity_per_tick_range"; + } + + // LiquidityNetInDirection returns liquidity net in the direction given. + // Uses the bound if specified, if not uses either min tick / max tick + // depending on the direction. + rpc LiquidityNetInDirection(LiquidityNetInDirectionRequest) + returns (LiquidityNetInDirectionResponse) { + option (google.api.http).get = "/osmosis/concentratedliquidity/v1beta1/" + "liquidity_net_in_direction"; + } + + // ClaimableSpreadRewards returns the amount of spread rewards that can be + // claimed by a position with the given id. + rpc ClaimableSpreadRewards(ClaimableSpreadRewardsRequest) + returns (ClaimableSpreadRewardsResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/claimable_spread_rewards"; + }; + + // ClaimableIncentives returns the amount of incentives that can be claimed + // and how many would be forfeited by a position with the given id. + rpc ClaimableIncentives(ClaimableIncentivesRequest) + returns (ClaimableIncentivesResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/claimable_incentives"; + }; + + // PositionById returns a position with the given id. + rpc PositionById(PositionByIdRequest) returns (PositionByIdResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/position_by_id"; + }; + + // PoolAccumulatorRewards returns the pool-global accumulator rewards. + // Contains spread factor rewards and uptime rewards. + rpc PoolAccumulatorRewards(PoolAccumulatorRewardsRequest) + returns (PoolAccumulatorRewardsResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/pool_accum_rewards"; + } + + // IncentiveRecords returns the incentive records for a given poolId + rpc IncentiveRecords(IncentiveRecordsRequest) + returns (IncentiveRecordsResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/incentive_records"; + }; + + // TickAccumulatorTrackers returns the tick accumulator trackers. + // Contains spread factor and uptime accumulator trackers. + rpc TickAccumulatorTrackers(TickAccumulatorTrackersRequest) + returns (TickAccumulatorTrackersResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/tick_accum_trackers"; + }; + + // CFMMPoolIdLinkFromConcentratedPoolId returns the pool id of the CFMM + // pool that is linked with the given concentrated pool. + rpc CFMMPoolIdLinkFromConcentratedPoolId( + CFMMPoolIdLinkFromConcentratedPoolIdRequest) + returns (CFMMPoolIdLinkFromConcentratedPoolIdResponse) { + option (google.api.http).get = "/osmosis/concentratedliquidity/v1beta1/" + "cfmm_pool_id_link_from_concentrated/" + "{concentrated_pool_id}"; + } + + // UserUnbondingPositions returns the position and lock info of unbonding + // positions of the given address. + rpc UserUnbondingPositions(UserUnbondingPositionsRequest) + returns (UserUnbondingPositionsResponse) { + option (google.api.http).get = "/osmosis/concentratedliquidity/v1beta1/" + "user_unbonding_positions/" + "{address}"; + } + + // GetTotalLiquidity returns total liquidity across all cl pools. + rpc GetTotalLiquidity(GetTotalLiquidityRequest) + returns (GetTotalLiquidityResponse) { + option (google.api.http).get = + "/osmosis/concentratedliquidity/v1beta1/get_total_liquidity"; + } + + // NumNextInitializedTicks returns the provided number of next initialized + // ticks in the direction of swapping the token in denom. + rpc NumNextInitializedTicks(NumNextInitializedTicksRequest) + returns (NumNextInitializedTicksResponse) { + option (google.api.http).get = "/osmosis/concentratedliquidity/v1beta1/" + "num_next_initialized_ticks"; + } +} + +//=============================== UserPositions +message UserPositionsRequest { + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message UserPositionsResponse { + repeated FullPositionBreakdown positions = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +//=============================== PositionById +message PositionByIdRequest { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; +} + +message PositionByIdResponse { + FullPositionBreakdown position = 1 [ (gogoproto.nullable) = false ]; +} + +message NumPoolPositionsRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message NumPoolPositionsResponse { + uint64 position_count = 1 + [ (gogoproto.moretags) = "yaml:\"position_count\"" ]; +} + +//=============================== Pools +message PoolsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} +message PoolsResponse { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +//=============================== ModuleParams +message ParamsRequest {} +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } + +message TickLiquidityNet { + string liquidity_net = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity_net\"", + (gogoproto.nullable) = false + ]; + int64 tick_index = 2 [ (gogoproto.moretags) = "yaml:\"tick_index\"" ]; +} + +message LiquidityDepthWithRange { + string liquidity_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity_net\"", + (gogoproto.nullable) = false + ]; + int64 lower_tick = 2 [ (gogoproto.moretags) = "yaml:\"lower_tick\"" ]; + int64 upper_tick = 3 [ (gogoproto.moretags) = "yaml:\"upper_tick\"" ]; +} + +//=============================== LiquidityNetInDirection +message LiquidityNetInDirectionRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in = 2 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + int64 start_tick = 3 [ (gogoproto.moretags) = "yaml:\"start_tick\"" ]; + bool use_cur_tick = 4 [ (gogoproto.moretags) = "yaml:\"use_cur_tick\"" ]; + int64 bound_tick = 5 [ (gogoproto.moretags) = "yaml:\"bound_tick\"" ]; + bool use_no_bound = 6 [ (gogoproto.moretags) = "yaml:\"use_no_bound\"" ]; +} +message LiquidityNetInDirectionResponse { + repeated TickLiquidityNet liquidity_depths = 1 + [ (gogoproto.nullable) = false ]; + int64 current_tick = 2; + string current_liquidity = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"current_liquidity\"", + (gogoproto.nullable) = false + ]; + string current_sqrt_price = 4 [ + + (gogoproto.customtype) = "github.com/osmosis-labs/osmosis/osmomath.BigDec", + (gogoproto.moretags) = "yaml:\"current_sqrt_price\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== LiquidityPerTickRange +message LiquidityPerTickRangeRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message LiquidityPerTickRangeResponse { + repeated LiquidityDepthWithRange liquidity = 1 + [ (gogoproto.nullable) = false ]; + + int64 bucket_index = 2 [ (gogoproto.moretags) = "yaml:\"bucket_index\"" ]; +} + +// ===================== QueryClaimableSpreadRewards +message ClaimableSpreadRewardsRequest { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; +} + +message ClaimableSpreadRewardsResponse { + repeated cosmos.base.v1beta1.Coin claimable_spread_rewards = 1 [ + (gogoproto.moretags) = "yaml:\"claimable_spread_rewards\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== QueryClaimableIncentives +message ClaimableIncentivesRequest { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; +} + +message ClaimableIncentivesResponse { + repeated cosmos.base.v1beta1.Coin claimable_incentives = 1 [ + (gogoproto.moretags) = "yaml:\"claimable_incentives\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin forfeited_incentives = 2 [ + (gogoproto.moretags) = "yaml:\"forfeited_incentives\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== QueryPoolAccumulatorRewards +message PoolAccumulatorRewardsRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message PoolAccumulatorRewardsResponse { + repeated cosmos.base.v1beta1.DecCoin spread_reward_growth_global = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + repeated UptimeTracker uptime_growth_global = 2 [ + (gogoproto.moretags) = "yaml:\"uptime_growth_global\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== QueryTickAccumulatorTrackers +message TickAccumulatorTrackersRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + int64 tick_index = 2 [ (gogoproto.moretags) = "yaml:\"tick_index\"" ]; +} + +message TickAccumulatorTrackersResponse { + repeated cosmos.base.v1beta1.DecCoin + spread_reward_growth_opposite_direction_of_last_traversal = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + repeated UptimeTracker uptime_trackers = 2 [ + (gogoproto.moretags) = "yaml:\"uptime_trackers\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== QueryIncentiveRecords +message IncentiveRecordsRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message IncentiveRecordsResponse { + repeated IncentiveRecord incentive_records = 1 + [ (gogoproto.nullable) = false ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +//=============================== CFMMPoolIdLinkFromConcentratedPoolId +message CFMMPoolIdLinkFromConcentratedPoolIdRequest { + uint64 concentrated_pool_id = 1 + [ (gogoproto.moretags) = "yaml:\"concentrated_pool_id\"" ]; +} + +message CFMMPoolIdLinkFromConcentratedPoolIdResponse { + uint64 cfmm_pool_id = 1 [ (gogoproto.moretags) = "yaml:\"cfmm_pool_id\"" ]; +} + +//=============================== UserUnbondingPositions +message UserUnbondingPositionsRequest { + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; +} + +message UserUnbondingPositionsResponse { + repeated PositionWithPeriodLock positions_with_period_lock = 1 + [ (gogoproto.nullable) = false ]; +} + +//=============================== GetTotalLiquidity +message GetTotalLiquidityRequest {} +message GetTotalLiquidityResponse { + repeated cosmos.base.v1beta1.Coin total_liquidity = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +//=============================== NumNextInitializedTicks +message NumNextInitializedTicksRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in_denom = 2 + [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ]; + uint64 num_next_initialized_ticks = 3 + [ (gogoproto.moretags) = "yaml:\"num_next_initialized_ticks\"" ]; +} +message NumNextInitializedTicksResponse { + repeated TickLiquidityNet liquidity_depths = 1 + [ (gogoproto.nullable) = false ]; + int64 current_tick = 2; + string current_liquidity = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"current_liquidity\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.yml b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.yml new file mode 100644 index 00000000..7f4d324d --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/query.yml @@ -0,0 +1,81 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/client" +queries: + Pools: + proto_wrapper: + query_func: "k.Pools" + cli: + cmd: "Pools" + Params: + proto_wrapper: + query_func: "k.Params" + cli: + cmd: "Params" + UserPositions: + proto_wrapper: + query_func: "k.UserPositions" + cli: + cmd: "UserPositions" + LiquidityPerTickRange: + proto_wrapper: + query_func: "k.LiquidityPerTickRange" + cli: + cmd: "LiquidityPerTickRange" + LiquidityNetInDirection: + proto_wrapper: + query_func: "k.LiquidityNetInDirection" + cli: + cmd: "LiquidityNetInDirection" + ClaimableSpreadRewards: + proto_wrapper: + query_func: "k.ClaimableSpreadRewards" + cli: + cmd: "ClaimableSpreadRewards" + ClaimableIncentives: + proto_wrapper: + query_func: "k.ClaimableIncentives" + cli: + cmd: "ClaimableIncentives" + PositionById: + proto_wrapper: + query_func: "k.PositionById" + cli: + cmd: "PositionById" + PoolAccumulatorRewards: + proto_wrapper: + query_func: "k.PoolAccumulatorRewards" + TickAccumulatorTrackers: + proto_wrapper: + query_func: "k.TickAccumulatorTrackers" + IncentiveRecords: + proto_wrapper: + query_func: "k.IncentiveRecords" + cli: + cmd: "IncentiveRecords" + CFMMPoolIdLinkFromConcentratedPoolId: + proto_wrapper: + query_func: "k.CFMMPoolIdLinkFromConcentratedPoolId" + cli: + cmd: "CFMMPoolIdLinkFromConcentratedPoolId" + UserUnbondingPositions: + proto_wrapper: + query_func: "k.UserUnbondingPositions" + cli: + cmd: "UserUnbondingPositions" + GetTotalLiquidity: + proto_wrapper: + query_func: "k.GetTotalLiquidity" + cli: + cmd: "GetTotalLiquidity" + NumNextInitializedTicks: + proto_wrapper: + query_func: "k.NumNextInitializedTicks" + cli: + cmd: "NumNextInitializedTicks" + NumPoolPositions: + proto_wrapper: + query_func: "k.NumPoolPositions" + cli: + cmd: "NumPoolPositions" diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tick_info.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tick_info.proto new file mode 100644 index 00000000..ef30a474 --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tick_info.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +// this is a legacy package that requires additional migration logic +// in order to use the correct package. Decision made to use legacy package path +// until clear steps for migration logic and the unknowns for state breaking are +// investigated for changing proto package. +package osmosis.concentratedliquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model"; + +message TickInfo { + string liquidity_gross = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity_gross\"", + (gogoproto.nullable) = false + ]; + string liquidity_net = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity_net\"", + (gogoproto.nullable) = false + ]; + // Total spread rewards accumulated in the opposite direction that the tick + // was last crossed. i.e. if the current tick is to the right of this tick + // (meaning its currently a greater price), then this is the total spread + // rewards accumulated below the tick. If the current tick is to the left of + // this tick (meaning its currently at a lower price), then this is the total + // spread rewards accumulated above the tick. + // + // Note: the way this value is used depends on the direction of spread rewards + // we are calculating for. If we are calculating spread rewards below the + // lower tick and the lower tick is the active tick, then this is the + // spreadRewardGrowthGlobal - the lower tick's + // spreadRewardGrowthOppositeDirectionOfLastTraversal. If we are calculating + // spread rewards above the upper tick and the upper tick is the active tick, + // then this is just the tick's + // spreadRewardGrowthOppositeDirectionOfLastTraversal value. + repeated cosmos.base.v1beta1.DecCoin + spread_reward_growth_opposite_direction_of_last_traversal = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + // uptime_trackers is a container encapsulating the uptime trackers. + // We use a container instead of a "repeated UptimeTracker" directly + // because we need the ability to serialize and deserialize the + // container easily for events when crossing a tick. + UptimeTrackers uptime_trackers = 4 [ + (gogoproto.moretags) = "yaml:\"uptime_trackers\"", + (gogoproto.nullable) = false + ]; +} + +message UptimeTrackers { + repeated UptimeTracker list = 1 + [ (gogoproto.moretags) = "yaml:\"list\"", (gogoproto.nullable) = false ]; +} + +message UptimeTracker { + repeated cosmos.base.v1beta1.DecCoin uptime_growth_outside = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tx.proto new file mode 100644 index 00000000..754d86dd --- /dev/null +++ b/packages/cosmos/proto/osmosis/concentratedliquidity/v1beta1/tx.proto @@ -0,0 +1,238 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types"; + +service Msg { + rpc CreatePosition(MsgCreatePosition) returns (MsgCreatePositionResponse); + rpc WithdrawPosition(MsgWithdrawPosition) + returns (MsgWithdrawPositionResponse); + // AddToPosition attempts to add amount0 and amount1 to a position + // with the given position id. + // To maintain backwards-compatibility with future implementations of + // charging, this function deletes the old position and creates a new one with + // the resulting amount after addition. + rpc AddToPosition(MsgAddToPosition) returns (MsgAddToPositionResponse); + rpc CollectSpreadRewards(MsgCollectSpreadRewards) + returns (MsgCollectSpreadRewardsResponse); + rpc CollectIncentives(MsgCollectIncentives) + returns (MsgCollectIncentivesResponse); + // TransferPositions transfers ownership of a set of one or more positions + // from a sender to a recipient. + rpc TransferPositions(MsgTransferPositions) + returns (MsgTransferPositionsResponse); +} + +// ===================== MsgCreatePosition +message MsgCreatePosition { + option (amino.name) = "osmosis/cl-create-position"; + + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + int64 lower_tick = 3 [ (gogoproto.moretags) = "yaml:\"lower_tick\"" ]; + int64 upper_tick = 4 [ (gogoproto.moretags) = "yaml:\"upper_tick\"" ]; + // tokens_provided is the amount of tokens provided for the position. + // It must at a minimum be of length 1 (for a single sided position) + // and at a maximum be of length 2 (for a position that straddles the current + // tick). + repeated cosmos.base.v1beta1.Coin tokens_provided = 5 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + string token_min_amount0 = 6 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_min_amount0\"", + (gogoproto.nullable) = false + ]; + string token_min_amount1 = 7 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_min_amount1\"", + (gogoproto.nullable) = false + ]; +} + +message MsgCreatePositionResponse { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + string amount0 = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount0\"", + (gogoproto.nullable) = false + ]; + string amount1 = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount1\"", + (gogoproto.nullable) = false + ]; + string liquidity_created = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity_created\"", + (gogoproto.nullable) = false + ]; + // the lower and upper tick are in the response because there are + // instances in which multiple ticks represent the same price, so + // we may move their provided tick to the canonical tick that represents + // the same price. + int64 lower_tick = 6 [ (gogoproto.moretags) = "yaml:\"lower_tick\"" ]; + int64 upper_tick = 7 [ (gogoproto.moretags) = "yaml:\"upper_tick\"" ]; +} + +// ===================== MsgAddToPosition +message MsgAddToPosition { + option (amino.name) = "osmosis/cl-add-to-position"; + + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + // amount0 represents the amount of token0 willing to put in. + string amount0 = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount_0\"", + (gogoproto.nullable) = false + ]; + // amount1 represents the amount of token1 willing to put in. + string amount1 = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount_1\"", + (gogoproto.nullable) = false + ]; + // token_min_amount0 represents the minimum amount of token0 desired from the + // new position being created. Note that this field indicates the min amount0 + // corresponding to the liquidity that is being added, not the total + // liquidity of the position. + string token_min_amount0 = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_min_amount0\"", + (gogoproto.nullable) = false + ]; + // token_min_amount1 represents the minimum amount of token1 desired from the + // new position being created. Note that this field indicates the min amount1 + // corresponding to the liquidity that is being added, not the total + // liquidity of the position. + string token_min_amount1 = 6 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_min_amount1\"", + (gogoproto.nullable) = false + ]; +} + +message MsgAddToPositionResponse { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + string amount0 = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount0\"", + (gogoproto.nullable) = false + ]; + string amount1 = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount1\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgWithdrawPosition +message MsgWithdrawPosition { + option (amino.name) = "osmosis/cl-withdraw-position"; + + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string liquidity_amount = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgWithdrawPositionResponse { + string amount0 = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount0\"", + (gogoproto.nullable) = false + ]; + string amount1 = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount1\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgCollectSpreadRewards +message MsgCollectSpreadRewards { + option (amino.name) = "osmosis/cl-col-sp-rewards"; + + repeated uint64 position_ids = 1 + [ (gogoproto.moretags) = "yaml:\"position_ids\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +} + +message MsgCollectSpreadRewardsResponse { + repeated cosmos.base.v1beta1.Coin collected_spread_rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"collected_spread_rewards\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgCollectIncentives +message MsgCollectIncentives { + option (amino.name) = "osmosis/cl-collect-incentives"; + + repeated uint64 position_ids = 1 + [ (gogoproto.moretags) = "yaml:\"position_ids\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +} + +message MsgCollectIncentivesResponse { + repeated cosmos.base.v1beta1.Coin collected_incentives = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"collected_incentives\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin forfeited_incentives = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"forfeited_incentives\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgFungifyChargedPositions +message MsgFungifyChargedPositions { + option (amino.name) = "osmosis/cl-fungify-charged-positions"; + + repeated uint64 position_ids = 1 + [ (gogoproto.moretags) = "yaml:\"position_ids\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +} + +message MsgFungifyChargedPositionsResponse { + uint64 new_position_id = 1 + [ (gogoproto.moretags) = "yaml:\"new_position_id\"" ]; +} + +// ===================== MsgTransferPositions +message MsgTransferPositions { + option (amino.name) = "osmosis/cl-transfer-positions"; + + repeated uint64 position_ids = 1 + [ (gogoproto.moretags) = "yaml:\"position_ids\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string new_owner = 3 [ (gogoproto.moretags) = "yaml:\"new_owner\"" ]; +} + +message MsgTransferPositionsResponse {} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto new file mode 100644 index 00000000..c19faa61 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +import "osmosis/cosmwasmpool/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/types"; + +// GenesisState defines the cosmwasmpool module's genesis state. +message GenesisState { + // params is the container of cosmwasmpool parameters. + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated google.protobuf.Any pools = 2 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/gov.proto new file mode 100644 index 00000000..de374896 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/gov.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/types"; + +// UploadCosmWasmPoolCodeAndWhiteListProposal is a gov Content type for +// uploading coswasm pool code and adding it to internal whitelist. Only the +// code ids created by this message are eligible for being x/cosmwasmpool pools. +message UploadCosmWasmPoolCodeAndWhiteListProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 3 [ (gogoproto.customname) = "WASMByteCode" ]; +} + +// MigratePoolContractsProposal is a gov Content type for +// migrating given pools to the new contract code and adding to internal +// whitelist if needed. It has two options to perform the migration: +// +// 1. If the codeID is non-zero, it will migrate the pool contracts to a given +// codeID assuming that it has already been uploaded. uploadByteCode must be +// empty in such a case. Fails if codeID does not exist. Fails if uploadByteCode +// is not empty. +// +// 2. If the codeID is zero, it will upload the given uploadByteCode and use the +// new resulting code id to migrate the pool to. Errors if uploadByteCode is +// empty or invalid. +// +// In both cases, if one of the pools specified by the given poolID does not +// exist, the proposal fails. +// +// The reason for having poolIDs be a slice of ids is to account for the +// potential need for emergency migration of all old code ids associated with +// particular pools to new code ids, or simply having the flexibility of +// migrating multiple older pool contracts to a new one at once when there is a +// release. +// +// poolD count to be submitted at once is gated by a governance paramets (20 at +// launch). The proposal fails if more. Note that 20 was chosen arbitrarily to +// have a constant bound on the number of pools migrated at once. This size will +// be configured by a module parameter so it can be changed by a constant. +message MigratePoolContractsProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + + // pool_ids are the pool ids of the contracts to be migrated + // either to the new_code_id that is already uploaded to chain or to + // the given wasm_byte_code. + repeated uint64 pool_ids = 3; + + // new_code_id is the code id of the contract code to migrate to. + // Assumes that the code is already uploaded to chain. Only one of + // new_code_id and wasm_byte_code should be set. + uint64 new_code_id = 4; + + // WASMByteCode can be raw or gzip compressed. Assumes that the code id + // has not been uploaded yet so uploads the given code and migrates to it. + // Only one of new_code_id and wasm_byte_code should be set. + bytes wasm_byte_code = 5 [ (gogoproto.customname) = "WASMByteCode" ]; + + // MigrateMsg migrate message to be used for migrating the pool contracts. + bytes migrate_msg = 6; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto new file mode 100644 index 00000000..5fd979c6 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/cosmwasm/msg"; + +// ===================== InstantiateMsg +message InstantiateMsg { + // pool_asset_denoms is the list of asset denoms that are initialized + // at pool creation time. + repeated string pool_asset_denoms = 1; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto new file mode 100644 index 00000000..2b4ee637 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/cosmwasm/msg"; + +// ===================== CalcOutAmtGivenIn +message CalcOutAmtGivenIn { + // token_in is the token to be sent to the pool. + cosmos.base.v1beta1.Coin token_in = 1 [ (gogoproto.nullable) = false ]; + + // token_out_denom is the token denom to be received from the pool. + string token_out_denom = 2; + + // swap_fee is the swap fee for this swap estimate. + string swap_fee = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message CalcOutAmtGivenInRequest { + // calc_out_amt_given_in is the structure containing all the request + // information for this query. + CalcOutAmtGivenIn calc_out_amt_given_in = 1 [ (gogoproto.nullable) = false ]; +} + +message CalcOutAmtGivenInResponse { + // token_out is the token out computed from this swap estimate call. + cosmos.base.v1beta1.Coin token_out = 1 [ (gogoproto.nullable) = false ]; +} + +// ===================== CalcInAmtGivenOut +message CalcInAmtGivenOut { + // token_out is the token out to be receoved from the pool. + cosmos.base.v1beta1.Coin token_out = 1 [ (gogoproto.nullable) = false ]; + + // token_in_denom is the token denom to be sentt to the pool. + string token_in_denom = 2; + + // swap_fee is the swap fee for this swap estimate. + string swap_fee = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message CalcInAmtGivenOutRequest { + // calc_in_amt_given_out is the structure containing all the request + // information for this query. + CalcInAmtGivenOut calc_in_amt_given_out = 1 [ (gogoproto.nullable) = false ]; +} + +message CalcInAmtGivenOutResponse { + // token_in is the token in computed from this swap estimate call. + cosmos.base.v1beta1.Coin token_in = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto new file mode 100644 index 00000000..b2ba0ca9 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto @@ -0,0 +1,87 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/cosmwasm/msg"; + +// ===================== SwapExactAmountIn +message SwapExactAmountIn { + string sender = 1; + // token_in is the token to be sent to the pool. + cosmos.base.v1beta1.Coin token_in = 2 [ (gogoproto.nullable) = false ]; + + // token_out_denom is the token denom to be received from the pool. + string token_out_denom = 3; + + // token_out_min_amount is the minimum amount of token_out to be received from + // the pool. + string token_out_min_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // swap_fee is the swap fee for this swap estimate. + string swap_fee = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message SwapExactAmountInSudoMsg { + // swap_exact_amount_in is the structure containing all the request + // information for this message. + SwapExactAmountIn swap_exact_amount_in = 1 [ (gogoproto.nullable) = false ]; +} + +message SwapExactAmountInSudoMsgResponse { + // token_out_amount is the token out computed from this swap estimate call. + string token_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +// ===================== SwapExactAmountOut +message SwapExactAmountOut { + string sender = 1; + // token_out is the token to be sent out of the pool. + cosmos.base.v1beta1.Coin token_out = 2 [ (gogoproto.nullable) = false ]; + + // token_in_denom is the token denom to be sent too the pool. + string token_in_denom = 3; + + // token_in_max_amount is the maximum amount of token_in to be sent to the + // pool. + string token_in_max_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // swap_fee is the swap fee for this swap estimate. + string swap_fee = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message SwapExactAmountOutSudoMsg { + // swap_exact_amount_out is the structure containing all the request + // information for this message. + SwapExactAmountOut swap_exact_amount_out = 1 [ (gogoproto.nullable) = false ]; +} + +message SwapExactAmountOutSudoMsgResponse { + // token_in_amount is the token in computed from this swap estimate call. + string token_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto new file mode 100644 index 00000000..10558680 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package osmosis.cosmwasmpool.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/model"; + +// CosmWasmPool represents the data serialized into state for each CW pool. +// +// Note: CW Pool has 2 pool models: +// - CosmWasmPool which is a proto-generated store model used for serialization +// into state. +// - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling +// the contract. +// +// CosmWasmPool implements the poolmanager.PoolI interface but it panics on all +// methods. The reason is that access to wasmKeeper is required to call the +// contract. +// +// Instead, all interactions and poolmanager.PoolI methods are to be performed +// on the Pool struct. The reason why we cannot have a Pool struct only is +// because it cannot be serialized into state due to having a non-serializable +// wasmKeeper field. +message CosmWasmPool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "PoolI"; + string contract_address = 1 + [ (gogoproto.moretags) = "yaml:\"contract_address\"" ]; + uint64 pool_id = 2; + uint64 code_id = 3; + bytes instantiate_msg = 4 + [ (gogoproto.moretags) = "yaml:\"instantiate_msg\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto new file mode 100644 index 00000000..a80572cf --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/cosmwasm/msg"; + +// ===================== GetSwapFeeQueryMsg +message GetSwapFeeQueryMsg { + // get_swap_fee is the query structure to get swap fee. + EmptyStruct get_swap_fee = 1 [ (gogoproto.nullable) = false ]; +} + +message GetSwapFeeQueryMsgResponse { + // swap_fee is the swap fee for this swap estimate. + string swap_fee = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// ===================== SpotPriceQueryMsg +message SpotPrice { + // quote_asset_denom is the quote asset of the spot query. + string quote_asset_denom = 1; + + // base_asset_denom is the base asset of the spot query. + string base_asset_denom = 2; +} + +message SpotPriceQueryMsg { + // spot_price is the structure containing request field of the spot price + // query message. + SpotPrice spot_price = 1 [ (gogoproto.nullable) = false ]; +} + +message SpotPriceQueryMsgResponse { + // spot_price is the spot price returned. + string spot_price = 1; +} + +// ===================== GetTotalPoolLiquidityQueryMsg +message EmptyStruct {} + +message GetTotalPoolLiquidityQueryMsg { + // get_total_pool_liquidity is the structure containing request field of the + // total pool liquidity query message. + EmptyStruct get_total_pool_liquidity = 1 [ (gogoproto.nullable) = false ]; +} + +message GetTotalPoolLiquidityQueryMsgResponse { + // total_pool_liquidity is the total liquidity in the pool denominated in + // coins. + repeated cosmos.base.v1beta1.Coin total_pool_liquidity = 1 + [ (gogoproto.nullable) = false ]; +} + +// ===================== GetTotalSharesQueryMsg +message GetTotalSharesQueryMsg { + // get_total_shares is the structure containing request field of the + // total shares query message. + EmptyStruct get_total_shares = 1 [ (gogoproto.nullable) = false ]; +} + +message GetTotalSharesQueryMsgResponse { + // total_shares is the amount of shares returned. + string total_shares = 1; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto new file mode 100644 index 00000000..31b3a298 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/cosmwasm/msg/transmuter"; + +// ===================== JoinPoolExecuteMsg +message EmptyRequest {} + +message JoinPoolExecuteMsgRequest { + // join_pool is the structure containing all request fields of the join pool + // execute message. + EmptyRequest join_pool = 1 [ (gogoproto.nullable) = false ]; +} + +message JoinPoolExecuteMsgResponse {} + +// ===================== ExitPoolExecuteMsg +message ExitPoolExecuteMsgRequest { + // exit_pool is the structure containing all request fields of the exit pool + // execute message. + EmptyRequest exit_pool = 1 [ (gogoproto.nullable) = false ]; +} + +message ExitPoolExecuteMsgResponse {} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto new file mode 100644 index 00000000..d701538d --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/model"; + +service MsgCreator { + rpc CreateCosmWasmPool(MsgCreateCosmWasmPool) + returns (MsgCreateCosmWasmPoolResponse); +} + +// ===================== MsgCreateCosmwasmPool +message MsgCreateCosmWasmPool { + uint64 code_id = 1 [ (gogoproto.moretags) = "yaml:\"code_id\"" ]; + bytes instantiate_msg = 2 + [ (gogoproto.moretags) = "yaml:\"instantiate_msg\"" ]; + string sender = 3 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +} + +// Returns a unique poolID to identify the pool with. +message MsgCreateCosmWasmPoolResponse { + uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/params.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/params.proto new file mode 100644 index 00000000..835dd779 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/params.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/types"; + +message Params { + // code_ide_whitelist contains the list of code ids that are allowed to be + // instantiated. + repeated uint64 code_id_whitelist = 1 + [ (gogoproto.moretags) = "yaml:\"code_id_whitelist\"" ]; + // pool_migration_limit is the maximum number of pools that can be migrated + // at once via governance proposal. This is to have a constant bound on the + // number of pools that can be migrated at once and remove the possibility + // of an unlikely scenario of causing a chain halt due to a large migration. + uint64 pool_migration_limit = 2 + [ (gogoproto.moretags) = "yaml:\"pool_migration_limit\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.proto new file mode 100644 index 00000000..45ea09b8 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/cosmwasmpool/v1beta1/params.proto"; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/client/queryproto"; + +service Query { + // Pools returns all cosmwasm pools + rpc Pools(PoolsRequest) returns (PoolsResponse) { + option (google.api.http).get = "/osmosis/cosmwasmpool/v1beta1/pools"; + } + + // Params returns the parameters of the x/cosmwasmpool module. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = "/osmosis/cosmwasmpool/v1beta1/params"; + } + + rpc ContractInfoByPoolId(ContractInfoByPoolIdRequest) + returns (ContractInfoByPoolIdResponse) { + option (google.api.http).get = + "/osmosis/cosmwasmpool/v1beta1/contract_info"; + } +} + +//=============================== ContractInfoByPoolId +message ParamsRequest {} +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } + +//=============================== Pools +message PoolsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} +message PoolsResponse { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +//=============================== ContractInfoByPoolId +message ContractInfoByPoolIdRequest { + // pool_id is the pool id of the requested pool. + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message ContractInfoByPoolIdResponse { + // contract_address is the pool address and contract address + // of the requested pool id. + string contract_address = 1 + [ (gogoproto.moretags) = "yaml:\"contract_address\"" ]; + + // code_id is the code id of the requested pool id. + uint64 code_id = 2 [ (gogoproto.moretags) = "yaml:\"code_id\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.yml b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.yml new file mode 100644 index 00000000..700e3fa4 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/query.yml @@ -0,0 +1,20 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/client" +queries: + Params: + proto_wrapper: + query_func: "k.GetParams" + cli: + cmd: "GetParams" + Pools: + proto_wrapper: + query_func: "k.Pools" + cli: + cmd: "Pools" + ContractInfoByPoolId: + proto_wrapper: + query_func: "k.ContractInfoByPoolId" + cli: + cmd: "ContractInfoByPoolId" diff --git a/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/tx.proto new file mode 100644 index 00000000..ebc24cf7 --- /dev/null +++ b/packages/cosmos/proto/osmosis/cosmwasmpool/v1beta1/tx.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package osmosis.cosmwasmpool.v1beta1; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/cosmwasmpool/types"; + +service Msg {} diff --git a/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/downtime_duration.proto b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/downtime_duration.proto new file mode 100644 index 00000000..9b677588 --- /dev/null +++ b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/downtime_duration.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package osmosis.downtimedetector.v1beta1; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/downtime-detector/types"; + +enum Downtime { + DURATION_30S = 0; + DURATION_1M = 1; + DURATION_2M = 2; + DURATION_3M = 3; + DURATION_4M = 4; + DURATION_5M = 5; + DURATION_10M = 6; + DURATION_20M = 7; + DURATION_30M = 8; + DURATION_40M = 9; + DURATION_50M = 10; + DURATION_1H = 11; + DURATION_1_5H = 12; + DURATION_2H = 13; + DURATION_2_5H = 14; + DURATION_3H = 15; + DURATION_4H = 16; + DURATION_5H = 17; + DURATION_6H = 18; + DURATION_9H = 19; + DURATION_12H = 20; + DURATION_18H = 21; + DURATION_24H = 22; + DURATION_36H = 23; + DURATION_48H = 24; +} diff --git a/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/genesis.proto new file mode 100644 index 00000000..9e75c216 --- /dev/null +++ b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package osmosis.downtimedetector.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "osmosis/downtimedetector/v1beta1/downtime_duration.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/downtime-detector/types"; + +message GenesisDowntimeEntry { + Downtime duration = 1 [ (gogoproto.moretags) = "yaml:\"duration\"" ]; + google.protobuf.Timestamp last_downtime = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"last_downtime\"" + ]; +} + +// GenesisState defines the twap module's genesis state. +message GenesisState { + repeated GenesisDowntimeEntry downtimes = 1 [ (gogoproto.nullable) = false ]; + + google.protobuf.Timestamp last_block_time = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"last_block_time\"" + ]; +} diff --git a/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.proto b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.proto new file mode 100644 index 00000000..158101dd --- /dev/null +++ b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package osmosis.downtimedetector.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/downtimedetector/v1beta1/genesis.proto"; +import "osmosis/downtimedetector/v1beta1/downtime_duration.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/downtime-detector/client/queryproto"; + +service Query { + rpc RecoveredSinceDowntimeOfLength(RecoveredSinceDowntimeOfLengthRequest) + returns (RecoveredSinceDowntimeOfLengthResponse) { + option (google.api.http).get = + "/osmosis/downtime-detector/v1beta1/RecoveredSinceDowntimeOfLength"; + } +} + +// Query for has it been at least $RECOVERY_DURATION units of time, +// since the chain has been down for $DOWNTIME_DURATION. +message RecoveredSinceDowntimeOfLengthRequest { + Downtime downtime = 1 [ (gogoproto.moretags) = "yaml:\"downtime\"" ]; + google.protobuf.Duration recovery = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"recovery_duration\"" + ]; +} + +message RecoveredSinceDowntimeOfLengthResponse { + bool succesfully_recovered = 1; +} diff --git a/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.yml b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.yml new file mode 100644 index 00000000..9c2ed6dd --- /dev/null +++ b/packages/cosmos/proto/osmosis/downtimedetector/v1beta1/query.yml @@ -0,0 +1,8 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/downtime-detector" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/downtime-detector/client" +queries: + RecoveredSinceDowntimeOfLength: + proto_wrapper: + query_func: "k.RecoveredSinceDowntimeOfLength" diff --git a/packages/cosmos/proto/osmosis/epochs/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/epochs/v1beta1/genesis.proto new file mode 100644 index 00000000..f355c564 --- /dev/null +++ b/packages/cosmos/proto/osmosis/epochs/v1beta1/genesis.proto @@ -0,0 +1,72 @@ +syntax = "proto3"; +package osmosis.epochs.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/x/epochs/types"; + +// EpochInfo is a struct that describes the data going into +// a timer defined by the x/epochs module. +message EpochInfo { + // identifier is a unique reference to this particular timer. + string identifier = 1; + // start_time is the time at which the timer first ever ticks. + // If start_time is in the future, the epoch will not begin until the start + // time. + google.protobuf.Timestamp start_time = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + // duration is the time in between epoch ticks. + // In order for intended behavior to be met, duration should + // be greater than the chains expected block time. + // Duration must be non-zero. + google.protobuf.Duration duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + // current_epoch is the current epoch number, or in other words, + // how many times has the timer 'ticked'. + // The first tick (current_epoch=1) is defined as + // the first block whose blocktime is greater than the EpochInfo start_time. + int64 current_epoch = 4; + // current_epoch_start_time describes the start time of the current timer + // interval. The interval is (current_epoch_start_time, + // current_epoch_start_time + duration] When the timer ticks, this is set to + // current_epoch_start_time = last_epoch_start_time + duration only one timer + // tick for a given identifier can occur per block. + // + // NOTE! The current_epoch_start_time may diverge significantly from the + // wall-clock time the epoch began at. Wall-clock time of epoch start may be + // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + // duration = 5. Suppose the chain goes offline at t=14, and comes back online + // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + // * The t=30 block will start the epoch for (10, 15] + // * The t=31 block will start the epoch for (15, 20] + // * The t=32 block will start the epoch for (20, 25] + // * The t=33 block will start the epoch for (25, 30] + // * The t=34 block will start the epoch for (30, 35] + // * The **t=36** block will start the epoch for (35, 40] + google.protobuf.Timestamp current_epoch_start_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"current_epoch_start_time\"" + ]; + // epoch_counting_started is a boolean, that indicates whether this + // epoch timer has began yet. + bool epoch_counting_started = 6; + reserved 7; + // current_epoch_start_height is the block height at which the current epoch + // started. (The block height at which the timer last ticked) + int64 current_epoch_start_height = 8; +} + +// GenesisState defines the epochs module's genesis state. +message GenesisState { + repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/epochs/v1beta1/query.proto b/packages/cosmos/proto/osmosis/epochs/v1beta1/query.proto new file mode 100644 index 00000000..d1a68dea --- /dev/null +++ b/packages/cosmos/proto/osmosis/epochs/v1beta1/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package osmosis.epochs.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/epochs/v1beta1/genesis.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/x/epochs/types"; + +// Query defines the gRPC querier service. +service Query { + // EpochInfos provide running epochInfos + rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) { + option (google.api.http).get = "/osmosis/epochs/v1beta1/epochs"; + } + // CurrentEpoch provide current epoch of specified identifier + rpc CurrentEpoch(QueryCurrentEpochRequest) + returns (QueryCurrentEpochResponse) { + option (google.api.http).get = "/osmosis/epochs/v1beta1/current_epoch"; + } +} + +message QueryEpochsInfoRequest {} +message QueryEpochsInfoResponse { + repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryCurrentEpochRequest { string identifier = 1; } +message QueryCurrentEpochResponse { int64 current_epoch = 1; } \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto new file mode 100644 index 00000000..3c14c4fa --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package osmosis.gamm.poolmodels.balancer.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "osmosis/gamm/v1beta1/balancerPool.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer"; + +service Msg { + rpc CreateBalancerPool(MsgCreateBalancerPool) + returns (MsgCreateBalancerPoolResponse); +} + +// ===================== MsgCreatePool +message MsgCreateBalancerPool { + option (amino.name) = "osmosis/gamm/create-balancer-pool"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + osmosis.gamm.v1beta1.PoolParams pool_params = 2 + [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; + + repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 3 + [ (gogoproto.nullable) = false ]; + + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; +} + +// Returns the poolID +message MsgCreateBalancerPoolResponse { + uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; +} diff --git a/packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.proto b/packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.proto new file mode 100644 index 00000000..ea51a546 --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; +package osmosis.gamm.poolmodels.stableswap.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap"; + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +message PoolParams { + option (amino.name) = "osmosis/gamm/StableswapPoolParams"; + + string swap_fee = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"swap_fee\"", + (gogoproto.nullable) = false + ]; + // N.B.: exit fee is disabled during pool creation in x/poolmanager. While old + // pools can maintain a non-zero fee. No new pool can be created with non-zero + // fee anymore + string exit_fee = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"exit_fee\"", + (gogoproto.nullable) = false + ]; +} + +// Pool is the stableswap Pool struct +message Pool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "PoolI"; + option (amino.name) = "osmosis/gamm/StableswapPool"; + + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 id = 2; + + PoolParams pool_params = 3 [ + (gogoproto.moretags) = "yaml:\"stableswap_pool_params\"", + (gogoproto.nullable) = false + ]; + + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + // sum of all LP shares + cosmos.base.v1beta1.Coin total_shares = 5 [ + (gogoproto.moretags) = "yaml:\"total_shares\"", + (gogoproto.nullable) = false + ]; + // assets in the pool + repeated cosmos.base.v1beta1.Coin pool_liquidity = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // for calculation amognst assets with different precisions + repeated uint64 scaling_factors = 7 + [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factors\"" ]; + // scaling_factor_controller is the address can adjust pool scaling factors + string scaling_factor_controller = 8 + [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.proto new file mode 100644 index 00000000..64c98260 --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package osmosis.gamm.poolmodels.stableswap.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/stableswap"; + +service Msg { + rpc CreateStableswapPool(MsgCreateStableswapPool) + returns (MsgCreateStableswapPoolResponse); + rpc StableSwapAdjustScalingFactors(MsgStableSwapAdjustScalingFactors) + returns (MsgStableSwapAdjustScalingFactorsResponse); +} + +// ===================== MsgCreatePool +message MsgCreateStableswapPool { + option (amino.name) = "osmosis/gamm/create-stableswap-pool"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + PoolParams pool_params = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; + + repeated cosmos.base.v1beta1.Coin initial_pool_liquidity = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + repeated uint64 scaling_factors = 4 + [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"" ]; + + string future_pool_governor = 5 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + + string scaling_factor_controller = 6 + [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ]; +} + +// Returns a poolID with custom poolName. +message MsgCreateStableswapPoolResponse { + uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; +} + +// Sender must be the pool's scaling_factor_governor in order for the tx to +// succeed. Adjusts stableswap scaling factors. +message MsgStableSwapAdjustScalingFactors { + option (amino.name) = "osmosis/gamm/stableswap-adjust-scaling-factors"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.customname) = "PoolID" ]; + + repeated uint64 scaling_factors = 3 + [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"" ]; +} + +message MsgStableSwapAdjustScalingFactorsResponse {} diff --git a/packages/cosmos/proto/osmosis/gamm/v1beta1/balancerPool.proto b/packages/cosmos/proto/osmosis/gamm/v1beta1/balancerPool.proto new file mode 100644 index 00000000..4de2485b --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/v1beta1/balancerPool.proto @@ -0,0 +1,162 @@ +syntax = "proto3"; +// this is a legacy package that requires additional migration logic +// in order to use the correct package. Decision made to use legacy package path +// until clear steps for migration logic and the unknowns for state breaking are +// investigated for changing proto package. +package osmosis.gamm.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/pool-models/balancer"; + +// Parameters for changing the weights in a balancer pool smoothly from +// a start weight and end weight over a period of time. +// Currently, the only smooth change supported is linear changing between +// the two weights, but more types may be added in the future. +// When these parameters are set, the weight w(t) for pool time `t` is the +// following: +// t <= start_time: w(t) = initial_pool_weights +// start_time < t <= start_time + duration: +// w(t) = initial_pool_weights + (t - start_time) * +// (target_pool_weights - initial_pool_weights) / (duration) +// t > start_time + duration: w(t) = target_pool_weights +message SmoothWeightChangeParams { + // The start time for beginning the weight change. + // If a parameter change / pool instantiation leaves this blank, + // it should be generated by the state_machine as the current time. + google.protobuf.Timestamp start_time = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + // Duration for the weights to change over + google.protobuf.Duration duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + // The initial pool weights. These are copied from the pool's settings + // at the time of weight change instantiation. + // The amount PoolAsset.token.amount field is ignored if present, + // future type refactorings should just have a type with the denom & weight + // here. + repeated osmosis.gamm.v1beta1.PoolAsset initial_pool_weights = 3 [ + (gogoproto.moretags) = "yaml:\"initial_pool_weights\"", + (gogoproto.nullable) = false + ]; + // The target pool weights. The pool weights will change linearly with respect + // to time between start_time, and start_time + duration. The amount + // PoolAsset.token.amount field is ignored if present, future type + // refactorings should just have a type with the denom & weight here. + repeated osmosis.gamm.v1beta1.PoolAsset target_pool_weights = 4 [ + (gogoproto.moretags) = "yaml:\"target_pool_weights\"", + (gogoproto.nullable) = false + ]; + // Intermediate variable for the 'slope' of pool weights. This is equal to + // (target_pool_weights - initial_pool_weights) / (duration) + // TODO: Work out precision, and decide if this is good to add + // repeated PoolAsset poolWeightSlope = 5 [ + // (gogoproto.moretags) = "yaml:\"pool_weight_slope\"", + // (gogoproto.nullable) = false + // ]; +} + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +message PoolParams { + option (amino.name) = "osmosis/gamm/BalancerPoolParams"; + + string swap_fee = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"swap_fee\"", + (gogoproto.nullable) = false + ]; + // N.B.: exit fee is disabled during pool creation in x/poolmanager. While old + // pools can maintain a non-zero fee. No new pool can be created with non-zero + // fee anymore + string exit_fee = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"exit_fee\"", + (gogoproto.nullable) = false + ]; + SmoothWeightChangeParams smooth_weight_change_params = 3 [ + (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", + (gogoproto.nullable) = true + ]; +} + +// Pool asset is an internal struct that combines the amount of the +// token in the pool, and its balancer weight. +// This is an awkward packaging of data, +// and should be revisited in a future state migration. +message PoolAsset { + // Coins we are talking about, + // the denomination must be unique amongst all PoolAssets for this pool. + cosmos.base.v1beta1.Coin token = 1 + [ (gogoproto.moretags) = "yaml:\"token\"", (gogoproto.nullable) = false ]; + // Weight that is not normalized. This weight must be less than 2^50 + string weight = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"weight\"", + (gogoproto.nullable) = false + ]; +} + +message Pool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "PoolI"; + option (amino.name) = "osmosis/gamm/BalancerPool"; + + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 id = 2; + + PoolParams pool_params = 3 [ + (gogoproto.moretags) = "yaml:\"balancer_pool_params\"", + (gogoproto.nullable) = false + ]; + + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + // TODO: Further improve these docs + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + // sum of all LP tokens sent out + cosmos.base.v1beta1.Coin total_shares = 5 [ + (gogoproto.moretags) = "yaml:\"total_shares\"", + (gogoproto.nullable) = false + ]; + // These are assumed to be sorted by denomiation. + // They contain the pool asset and the information about the weight + repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 6 [ + (gogoproto.moretags) = "yaml:\"pool_assets\"", + (gogoproto.nullable) = false + ]; + // sum of all non-normalized pool weights + string total_weight = 7 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"total_weight\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/gamm/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/gamm/v1beta1/genesis.proto new file mode 100644 index 00000000..758cefe8 --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/v1beta1/genesis.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package osmosis.gamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/gamm/v1beta1/shared.proto"; + +// Params holds parameters for the incentives module +message Params { + repeated cosmos.base.v1beta1.Coin pool_creation_fee = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"pool_creation_fee\"", + (gogoproto.nullable) = false + ]; +} + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/types"; + +// GenesisState defines the gamm module's genesis state. +message GenesisState { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; + // will be renamed to next_pool_id in an upcoming version + uint64 next_pool_number = 2; + Params params = 3 [ (gogoproto.nullable) = false ]; + MigrationRecords migration_records = 4; +} diff --git a/packages/cosmos/proto/osmosis/gamm/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/gamm/v1beta1/gov.proto new file mode 100644 index 00000000..0c1b1992 --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/v1beta1/gov.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; +package osmosis.gamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/gamm/v1beta1/genesis.proto"; +import "osmosis/gamm/v1beta1/shared.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/types"; + +// ReplaceMigrationRecordsProposal is a gov Content type for updating the +// migration records. If a ReplaceMigrationRecordsProposal passes, the +// proposal’s records override the existing MigrationRecords set in the module. +// Each record specifies a single connection between a single balancer pool and +// a single concentrated pool. +message ReplaceMigrationRecordsProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/ReplaceMigrationRecordsProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated BalancerToConcentratedPoolLink records = 3 + [ (gogoproto.nullable) = false ]; +} + +// UpdateMigrationRecordsProposal is a gov Content type for updating the +// migration records. If a UpdateMigrationRecordsProposal passes, all the +// MigrationRecords in the proposals are edited. An existing +// BalancerToConcentratedPoolLink is not overridden unless explicitly included +// in the proposal. This differs from a ReplaceMigrationRecordsProposal because +// it only does an in place update of the MigrationRecords for records +// explicitly mentioned in the proposal. + +// Lastly, if the clPoolId is set to 0, the BalancerToConcentratedPoolLink is +// deleted + +// For example: if the existing DistrRecords were: +// [(Balancer 1, CL 5), (Balancer 2, CL 6), (Balancer 3, CL 7)] +// And an UpdateMigrationRecordsProposal includes +// [(Balancer 2, CL 0), (Balancer 3, CL 4), (Balancer 4, CL 10)] +// This would leave Balancer 1 record, delete Balancer 2 record, +// Edit Balancer 3 record, and Add Balancer 4 record +// The result MigrationRecords in state would be: +// [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] +message UpdateMigrationRecordsProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/UpdateMigrationRecordsProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated BalancerToConcentratedPoolLink records = 3 + [ (gogoproto.nullable) = false ]; +} +message PoolRecordWithCFMMLink { + option (gogoproto.equal) = true; + + string denom0 = 1 [ (gogoproto.moretags) = "yaml:\"denom0\"" ]; + string denom1 = 2 [ (gogoproto.moretags) = "yaml:\"denom1\"" ]; + uint64 tick_spacing = 3 [ (gogoproto.moretags) = "yaml:\"tick_spacing\"" ]; + string exponent_at_price_one = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"exponent_at_price_one\"", + (gogoproto.nullable) = false + ]; + string spread_factor = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"spread_factor\"", + (gogoproto.nullable) = false + ]; + uint64 balancer_pool_id = 6 + [ (gogoproto.moretags) = "yaml:\"balancer_pool_id\"" ]; +} + +// CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type +// for creating concentrated liquidity pools and linking it to a CFMM pool. +message CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = + "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + repeated PoolRecordWithCFMMLink pool_records_with_cfmm_link = 3 [ + (gogoproto.moretags) = "yaml:\"create_cl_pool_and_link_to_cfmm\"", + (gogoproto.nullable) = false + ]; +} + +// SetScalingFactorControllerProposal is a gov Content type for updating the +// scaling factor controller address of a stableswap pool +message SetScalingFactorControllerProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/SetScalingFactorControllerProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + uint64 pool_id = 3; + string controller_address = 4; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/gamm/v1beta1/query.proto b/packages/cosmos/proto/osmosis/gamm/v1beta1/query.proto new file mode 100644 index 00000000..5a9d8640 --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/v1beta1/query.proto @@ -0,0 +1,365 @@ +syntax = "proto3"; +package osmosis.gamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/gamm/v1beta1/tx.proto"; +import "osmosis/poolmanager/v1beta1/swap_route.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "osmosis/gamm/v1beta1/shared.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/types"; + +service Query { + rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) { + option (google.api.http).get = "/osmosis/gamm/v1beta1/pools"; + } + + // Deprecated: please use the alternative in x/poolmanager + rpc NumPools(QueryNumPoolsRequest) returns (QueryNumPoolsResponse) { + option deprecated = true; + option (google.api.http).get = "/osmosis/gamm/v1beta1/num_pools"; + } + + rpc TotalLiquidity(QueryTotalLiquidityRequest) + returns (QueryTotalLiquidityResponse) { + option (google.api.http).get = "/osmosis/gamm/v1beta1/total_liquidity"; + } + + // PoolsWithFilter allows you to query specific pools with requested + // parameters + rpc PoolsWithFilter(QueryPoolsWithFilterRequest) + returns (QueryPoolsWithFilterResponse) { + option (google.api.http).get = "/osmosis/gamm/v1beta1/filtered_pools"; + } + + // Deprecated: please use the alternative in x/poolmanager + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option deprecated = true; + option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{pool_id}"; + } + + // PoolType returns the type of the pool. + // Returns "Balancer" as a string literal when the pool is a balancer pool. + // Errors if the pool is failed to be type caseted. + rpc PoolType(QueryPoolTypeRequest) returns (QueryPoolTypeResponse) { + option (google.api.http).get = "/osmosis/gamm/v1beta1/pool_type/{pool_id}"; + } + + // Simulates joining pool without a swap. Returns the amount of shares you'd + // get and tokens needed to provide + rpc CalcJoinPoolNoSwapShares(QueryCalcJoinPoolNoSwapSharesRequest) + returns (QueryCalcJoinPoolNoSwapSharesResponse) {} + + rpc CalcJoinPoolShares(QueryCalcJoinPoolSharesRequest) + returns (QueryCalcJoinPoolSharesResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/join_swap_exact_in"; + } + rpc CalcExitPoolCoinsFromShares(QueryCalcExitPoolCoinsFromSharesRequest) + returns (QueryCalcExitPoolCoinsFromSharesResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/exit_swap_share_amount_in"; + } + + rpc PoolParams(QueryPoolParamsRequest) returns (QueryPoolParamsResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/params"; + } + + // Deprecated: please use the alternative in x/poolmanager + rpc TotalPoolLiquidity(QueryTotalPoolLiquidityRequest) + returns (QueryTotalPoolLiquidityResponse) { + option deprecated = true; + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/total_pool_liquidity"; + } + + rpc TotalShares(QueryTotalSharesRequest) returns (QueryTotalSharesResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/total_shares"; + } + + // SpotPrice defines a gRPC query handler that returns the spot price given + // a base denomination and a quote denomination. + rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) { + option deprecated = true; + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/prices"; + } + + // Deprecated: please use the alternative in x/poolmanager + rpc EstimateSwapExactAmountIn(QuerySwapExactAmountInRequest) + returns (QuerySwapExactAmountInResponse) { + option deprecated = true; + option (google.api.http).get = + "/osmosis/gamm/v1beta1/{pool_id}/estimate/swap_exact_amount_in"; + } + + // Deprecated: please use the alternative in x/poolmanager + rpc EstimateSwapExactAmountOut(QuerySwapExactAmountOutRequest) + returns (QuerySwapExactAmountOutResponse) { + option deprecated = true; + option (google.api.http).get = + "/osmosis/gamm/v1beta1/{pool_id}/estimate/swap_exact_amount_out"; + } + + // ConcentratedPoolIdLinkFromBalancer returns the pool id of the concentrated + // pool that is linked with the given CFMM pool. + rpc ConcentratedPoolIdLinkFromCFMM(QueryConcentratedPoolIdLinkFromCFMMRequest) + returns (QueryConcentratedPoolIdLinkFromCFMMResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/concentrated_pool_id_link_from_cfmm/" + "{cfmm_pool_id}"; + } + + // CFMMConcentratedPoolLinks returns migration links between CFMM and + // Concentrated pools. + rpc CFMMConcentratedPoolLinks(QueryCFMMConcentratedPoolLinksRequest) + returns (QueryCFMMConcentratedPoolLinksResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/cfmm_concentrated_pool_links"; + } +} + +//=============================== Pool +// Deprecated: please use the alternative in x/poolmanager +message QueryPoolRequest { + option deprecated = true; + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +// Deprecated: please use the alternative in x/poolmanager +message QueryPoolResponse { + option deprecated = true; + google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "PoolI" ]; +} + +//=============================== Pools +message QueryPoolsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} +message QueryPoolsResponse { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +//=============================== NumPools +message QueryNumPoolsRequest { option deprecated = true; } +message QueryNumPoolsResponse { + option deprecated = true; + uint64 num_pools = 1 [ (gogoproto.moretags) = "yaml:\"num_pools\"" ]; +} + +//=============================== PoolType +message QueryPoolTypeRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message QueryPoolTypeResponse { + string pool_type = 1 [ (gogoproto.moretags) = "yaml:\"pool_type\"" ]; +} + +//=============================== CalcJoinPoolShares +message QueryCalcJoinPoolSharesRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + repeated cosmos.base.v1beta1.Coin tokens_in = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} +message QueryCalcJoinPoolSharesResponse { + string share_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_out_amount\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin tokens_out = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +//=============================== CalcExitPoolCoinsFromShares +message QueryCalcExitPoolCoinsFromSharesRequest { + uint64 pool_id = 1; + string share_in_amount = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} +message QueryCalcExitPoolCoinsFromSharesResponse { + repeated cosmos.base.v1beta1.Coin tokens_out = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +//=============================== PoolParams +message QueryPoolParamsRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message QueryPoolParamsResponse { google.protobuf.Any params = 1; } + +//=============================== PoolLiquidity +// Deprecated: please use the alternative in x/poolmanager +message QueryTotalPoolLiquidityRequest { + option deprecated = true; + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +// Deprecated: please use the alternative in x/poolmanager +message QueryTotalPoolLiquidityResponse { + option deprecated = true; + repeated cosmos.base.v1beta1.Coin liquidity = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"liquidity\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== TotalShares +message QueryTotalSharesRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message QueryTotalSharesResponse { + cosmos.base.v1beta1.Coin total_shares = 1 [ + (gogoproto.moretags) = "yaml:\"total_shares\"", + (gogoproto.nullable) = false + ]; +} +//=============================== CalcJoinPoolNoSwapShares +message QueryCalcJoinPoolNoSwapSharesRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + repeated cosmos.base.v1beta1.Coin tokens_in = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} +message QueryCalcJoinPoolNoSwapSharesResponse { + repeated cosmos.base.v1beta1.Coin tokens_out = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"tokens_out\"", + (gogoproto.nullable) = false + ]; + string shares_out = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} +// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice +// query. +message QuerySpotPriceRequest { + option deprecated = true; + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string base_asset_denom = 2 + [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; + string quote_asset_denom = 3 + [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; + reserved 4; + reserved "withSwapFee"; +} + +//=============================== PoolsWithFilter + +message QueryPoolsWithFilterRequest { + // String of the coins in single string separated by comma. Ex) + // 10uatom,100uosmo + string min_liquidity = 1 [ (gogoproto.moretags) = "yaml:\"min_liquidity\"" ]; + string pool_type = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryPoolsWithFilterResponse { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice +// query. +message QuerySpotPriceResponse { + option deprecated = true; + // String of the Dec. Ex) 10.203uatom + string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; +} + +//=============================== EstimateSwapExactAmountIn +message QuerySwapExactAmountInRequest { + option deprecated = true; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in = 3 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + repeated osmosis.poolmanager.v1beta1.SwapAmountInRoute routes = 4 [ + (gogoproto.moretags) = "yaml:\"routes\"", + (gogoproto.nullable) = false + ]; +} + +message QuerySwapExactAmountInResponse { + option deprecated = true; + string token_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_amount\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== EstimateSwapExactAmountOut +message QuerySwapExactAmountOutRequest { + option deprecated = true; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + repeated osmosis.poolmanager.v1beta1.SwapAmountOutRoute routes = 3 [ + (gogoproto.moretags) = "yaml:\"routes\"", + (gogoproto.nullable) = false + ]; + string token_out = 4 [ (gogoproto.moretags) = "yaml:\"token_out\"" ]; +} + +message QuerySwapExactAmountOutResponse { + option deprecated = true; + string token_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_amount\"", + (gogoproto.nullable) = false + ]; +} + +message QueryTotalLiquidityRequest {} + +message QueryTotalLiquidityResponse { + repeated cosmos.base.v1beta1.Coin liquidity = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"liquidity\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== QueryConcentratedPoolIdLinkFromCFMM +message QueryConcentratedPoolIdLinkFromCFMMRequest { + uint64 cfmm_pool_id = 1 [ (gogoproto.moretags) = "yaml:\"cfmm_pool_id\"" ]; +} + +message QueryConcentratedPoolIdLinkFromCFMMResponse { + uint64 concentrated_pool_id = 1; +} + +//=============================== QueryCFMMConcentratedPoolLinks +message QueryCFMMConcentratedPoolLinksRequest {} + +message QueryCFMMConcentratedPoolLinksResponse { + MigrationRecords migration_records = 1; +} diff --git a/packages/cosmos/proto/osmosis/gamm/v1beta1/shared.proto b/packages/cosmos/proto/osmosis/gamm/v1beta1/shared.proto new file mode 100644 index 00000000..06a4ef29 --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/v1beta1/shared.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package osmosis.gamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/types/migration"; + +// MigrationRecords contains all the links between balancer and concentrated +// pools +message MigrationRecords { + repeated BalancerToConcentratedPoolLink balancer_to_concentrated_pool_links = + 1 [ (gogoproto.nullable) = false ]; +} + +// BalancerToConcentratedPoolLink defines a single link between a single +// balancer pool and a single concentrated liquidity pool. This link is used to +// allow a balancer pool to migrate to a single canonical full range +// concentrated liquidity pool position +// A balancer pool can be linked to a maximum of one cl pool, and a cl pool can +// be linked to a maximum of one balancer pool. +message BalancerToConcentratedPoolLink { + option (gogoproto.equal) = true; + uint64 balancer_pool_id = 1; + uint64 cl_pool_id = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/gamm/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/gamm/v1beta1/tx.proto new file mode 100644 index 00000000..8c6cd6af --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/v1beta1/tx.proto @@ -0,0 +1,260 @@ +syntax = "proto3"; +package osmosis.gamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/poolmanager/v1beta1/swap_route.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/types"; + +service Msg { + rpc JoinPool(MsgJoinPool) returns (MsgJoinPoolResponse); + rpc ExitPool(MsgExitPool) returns (MsgExitPoolResponse); + rpc SwapExactAmountIn(MsgSwapExactAmountIn) + returns (MsgSwapExactAmountInResponse); + rpc SwapExactAmountOut(MsgSwapExactAmountOut) + returns (MsgSwapExactAmountOutResponse); + rpc JoinSwapExternAmountIn(MsgJoinSwapExternAmountIn) + returns (MsgJoinSwapExternAmountInResponse); + rpc JoinSwapShareAmountOut(MsgJoinSwapShareAmountOut) + returns (MsgJoinSwapShareAmountOutResponse); + rpc ExitSwapExternAmountOut(MsgExitSwapExternAmountOut) + returns (MsgExitSwapExternAmountOutResponse); + rpc ExitSwapShareAmountIn(MsgExitSwapShareAmountIn) + returns (MsgExitSwapShareAmountInResponse); +} + +// ===================== MsgJoinPool +// This is really MsgJoinPoolNoSwap +message MsgJoinPool { + option (amino.name) = "osmosis/gamm/join-pool"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string share_out_amount = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"pool_amount_out\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin token_in_maxs = 4 [ + (gogoproto.moretags) = "yaml:\"token_in_max_amounts\"", + (gogoproto.nullable) = false + ]; +} + +message MsgJoinPoolResponse { + string share_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_out_amount\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin token_in = 2 [ + (gogoproto.moretags) = "yaml:\"token_in\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgExitPool +message MsgExitPool { + option (amino.name) = "osmosis/gamm/exit-pool"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string share_in_amount = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_in_amount\"", + (gogoproto.nullable) = false + ]; + + repeated cosmos.base.v1beta1.Coin token_out_mins = 4 [ + (gogoproto.moretags) = "yaml:\"token_out_min_amounts\"", + (gogoproto.nullable) = false + ]; +} + +message MsgExitPoolResponse { + repeated cosmos.base.v1beta1.Coin token_out = 1 [ + (gogoproto.moretags) = "yaml:\"token_out\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgSwapExactAmountIn +message MsgSwapExactAmountIn { + option (amino.name) = "osmosis/gamm/swap-exact-amount-in"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated osmosis.poolmanager.v1beta1.SwapAmountInRoute routes = 2 + [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin token_in = 3 [ + (gogoproto.moretags) = "yaml:\"token_in\"", + (gogoproto.nullable) = false + ]; + string token_out_min_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_min_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSwapExactAmountInResponse { + string token_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSwapExactAmountOut { + option (amino.name) = "osmosis/gamm/swap-exact-amount-out"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated osmosis.poolmanager.v1beta1.SwapAmountOutRoute routes = 2 + [ (gogoproto.nullable) = false ]; + string token_in_max_amount = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_max_amount\"", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin token_out = 4 [ + (gogoproto.moretags) = "yaml:\"token_out\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSwapExactAmountOutResponse { + string token_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgJoinSwapExternAmountIn +// TODO: Rename to MsgJoinSwapExactAmountIn +message MsgJoinSwapExternAmountIn { + option (amino.name) = "osmosis/gamm/join-swap-extern-amount-in"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + cosmos.base.v1beta1.Coin token_in = 3 [ + (gogoproto.moretags) = "yaml:\"token_in\"", + (gogoproto.nullable) = false + ]; + string share_out_min_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_out_min_amount\"", + (gogoproto.nullable) = false + ]; + // repeated cosmos.base.v1beta1.Coin tokensIn = 5 [ + // (gogoproto.moretags) = "yaml:\"tokens_in\"", + // (gogoproto.nullable) = false + // ]; +} + +message MsgJoinSwapExternAmountInResponse { + string share_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_out_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgJoinSwapShareAmountOut +message MsgJoinSwapShareAmountOut { + option (amino.name) = "osmosis/gamm/join-swap-share-amount-out"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in_denom = 3 + [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ]; + string share_out_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_out_amount\"", + (gogoproto.nullable) = false + ]; + string token_in_max_amount = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_max_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgJoinSwapShareAmountOutResponse { + string token_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgExitSwapShareAmountIn +message MsgExitSwapShareAmountIn { + option (amino.name) = "osmosis/gamm/exit-swap-share-amount-in"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_out_denom = 3 + [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; + string share_in_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_in_amount\"", + (gogoproto.nullable) = false + ]; + string token_out_min_amount = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_min_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgExitSwapShareAmountInResponse { + string token_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgExitSwapExternAmountOut +message MsgExitSwapExternAmountOut { + option (amino.name) = "osmosis/gamm/exit-swap-extern-amount-out"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + cosmos.base.v1beta1.Coin token_out = 3 [ + (gogoproto.moretags) = "yaml:\"token_out\"", + (gogoproto.nullable) = false + ]; + string share_in_max_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_in_max_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgExitSwapExternAmountOutResponse { + string share_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"share_in_amount\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/gamm/v2/query.proto b/packages/cosmos/proto/osmosis/gamm/v2/query.proto new file mode 100644 index 00000000..acfd865e --- /dev/null +++ b/packages/cosmos/proto/osmosis/gamm/v2/query.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package osmosis.gamm.v2; + +import "gogoproto/gogo.proto"; +import "osmosis/gamm/v1beta1/tx.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/gamm/v2types"; + +service Query { + // Deprecated: please use alternate in x/poolmanager + rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) { + option deprecated = true; + option (google.api.http).get = "/osmosis/gamm/v2/pools/{pool_id}/prices"; + } +} + +// Deprecated: please use alternate in x/poolmanager +message QuerySpotPriceRequest { + option deprecated = true; + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string base_asset_denom = 2 + [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; + string quote_asset_denom = 3 + [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; +} + +// Deprecated: please use alternate in x/poolmanager +message QuerySpotPriceResponse { + option deprecated = true; + // String of the Dec. Ex) 10.203uatom + string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/ibchooks/genesis.proto b/packages/cosmos/proto/osmosis/ibchooks/genesis.proto new file mode 100644 index 00000000..ebd272b3 --- /dev/null +++ b/packages/cosmos/proto/osmosis/ibchooks/genesis.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package osmosis.ibchooks; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "osmosis/ibchooks/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/ibc-hooks/types"; + +message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; } diff --git a/packages/cosmos/proto/osmosis/ibchooks/params.proto b/packages/cosmos/proto/osmosis/ibchooks/params.proto new file mode 100644 index 00000000..604af7df --- /dev/null +++ b/packages/cosmos/proto/osmosis/ibchooks/params.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package osmosis.ibchooks; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/ibc-hooks/types"; + +message Params { + repeated string allowed_async_ack_contracts = 1 + [ (gogoproto.moretags) = "yaml:\"allowed_async_ack_contracts\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/ibchooks/tx.proto b/packages/cosmos/proto/osmosis/ibchooks/tx.proto new file mode 100644 index 00000000..b5d7a2c3 --- /dev/null +++ b/packages/cosmos/proto/osmosis/ibchooks/tx.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package osmosis.ibchooks; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/ibc-hooks/types"; + +// Msg defines the Msg service. +service Msg { + // EmitIBCAck checks the sender can emit the ack and writes the IBC + // acknowledgement + rpc EmitIBCAck(MsgEmitIBCAck) returns (MsgEmitIBCAckResponse); +} + +message MsgEmitIBCAck { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 packet_sequence = 2 + [ (gogoproto.moretags) = "yaml:\"packet_sequence\"" ]; + string channel = 3 [ (gogoproto.moretags) = "yaml:\"channel\"" ]; +} +message MsgEmitIBCAckResponse { + string contract_result = 1 + [ (gogoproto.moretags) = "yaml:\"contract_result\"" ]; + string ibc_ack = 2 [ (gogoproto.moretags) = "yaml:\"ibc_ack\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/genesis.proto new file mode 100644 index 00000000..48dcedf6 --- /dev/null +++ b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package osmosis.ibcratelimit.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "osmosis/ibcratelimit/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/ibc-rate-limit/types"; + +// GenesisState defines the ibc-rate-limit module's genesis state. +message GenesisState { + // params are all the parameters of the module + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/params.proto b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/params.proto new file mode 100644 index 00000000..225dd4b5 --- /dev/null +++ b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package osmosis.ibcratelimit.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/ibc-rate-limit/types"; + +// Params defines the parameters for the ibc-rate-limit module. +message Params { + string contract_address = 1 + [ (gogoproto.moretags) = "yaml:\"contract_address\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.proto b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.proto new file mode 100644 index 00000000..6163508e --- /dev/null +++ b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package osmosis.ibcratelimit.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/ibcratelimit/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/ibc-rate-limit/client/queryproto"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the ibc-rate-limit module's + // parameters. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = "/osmosis/ibc-rate-limit/v1beta1/params"; + } +} + +// ParamsRequest is the request type for the Query/Params RPC method. +message ParamsRequest {} + +// aramsResponse is the response type for the Query/Params RPC method. +message ParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.yml b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.yml new file mode 100644 index 00000000..24007126 --- /dev/null +++ b/packages/cosmos/proto/osmosis/ibcratelimit/v1beta1/query.yml @@ -0,0 +1,10 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/ibc-rate-limit" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/ibc-rate-limit/client" +queries: + Params: + proto_wrapper: + query_func: "k.GetParams" + cli: + cmd: "GetParams" diff --git a/packages/cosmos/proto/osmosis/incentives/gauge.proto b/packages/cosmos/proto/osmosis/incentives/gauge.proto new file mode 100644 index 00000000..de5c6e59 --- /dev/null +++ b/packages/cosmos/proto/osmosis/incentives/gauge.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; +package osmosis.incentives; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/lockup/lock.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/incentives/types"; + +// Gauge is an object that stores and distributes yields to recipients who +// satisfy certain conditions. Currently gauges support conditions around the +// duration for which a given denom is locked. +message Gauge { + // id is the unique ID of a Gauge + uint64 id = 1; + // is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge + // Non-perpetual gauges distribute their tokens equally per epoch while the + // gauge is in the active period. Perpetual gauges distribute all their tokens + // at a single time and only distribute their tokens again once the gauge is + // refilled, Intended for use with incentives that get refilled daily. + bool is_perpetual = 2; + // distribute_to is where the gauge rewards are distributed to. + // This is queried via lock duration or by timestamp + osmosis.lockup.QueryCondition distribute_to = 3 + [ (gogoproto.nullable) = false ]; + // coins is the total amount of coins that have been in the gauge + // Can distribute multiple coin denoms + repeated cosmos.base.v1beta1.Coin coins = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // start_time is the distribution start time + google.protobuf.Timestamp start_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + // num_epochs_paid_over is the number of total epochs distribution will be + // completed over + uint64 num_epochs_paid_over = 6; + // filled_epochs is the number of epochs distribution has been completed on + // already + uint64 filled_epochs = 7; + // distributed_coins are coins that have been distributed already + repeated cosmos.base.v1beta1.Coin distributed_coins = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message LockableDurationsInfo { + // List of incentivised durations that gauges will pay out to + repeated google.protobuf.Duration lockable_durations = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"lockable_durations\"" + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/incentives/genesis.proto b/packages/cosmos/proto/osmosis/incentives/genesis.proto new file mode 100644 index 00000000..ca3cc8b5 --- /dev/null +++ b/packages/cosmos/proto/osmosis/incentives/genesis.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package osmosis.incentives; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "osmosis/incentives/params.proto"; +import "osmosis/incentives/gauge.proto"; +import "osmosis/incentives/group.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/incentives/types"; + +// GenesisState defines the incentives module's various parameters when first +// initialized +message GenesisState { + // params are all the parameters of the module + Params params = 1 [ (gogoproto.nullable) = false ]; + // gauges are all gauges (not including group gauges) that should exist at + // genesis + repeated Gauge gauges = 2 [ (gogoproto.nullable) = false ]; + // lockable_durations are all lockup durations that gauges can be locked for + // in order to receive incentives + repeated google.protobuf.Duration lockable_durations = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"lockable_durations\"" + ]; + // last_gauge_id is what the gauge number will increment from when creating + // the next gauge after genesis + uint64 last_gauge_id = 4; + // gauges are all group gauges that should exist at genesis + repeated Gauge group_gauges = 5 [ (gogoproto.nullable) = false ]; + // groups are all the groups that should exist at genesis + repeated Group groups = 6 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/incentives/gov.proto b/packages/cosmos/proto/osmosis/incentives/gov.proto new file mode 100644 index 00000000..60e2c1fa --- /dev/null +++ b/packages/cosmos/proto/osmosis/incentives/gov.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package osmosis.incentives; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "osmosis/incentives/group.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/incentives/types"; + +// CreateGroupsProposal is a type for creating one or more groups via +// governance. This is useful for creating groups without having to pay +// creation fees. +message CreateGroupsProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + repeated osmosis.incentives.CreateGroup create_groups = 3 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/incentives/group.proto b/packages/cosmos/proto/osmosis/incentives/group.proto new file mode 100644 index 00000000..612911e1 --- /dev/null +++ b/packages/cosmos/proto/osmosis/incentives/group.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; +package osmosis.incentives; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/lockup/lock.proto"; +import "osmosis/incentives/gauge.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/incentives/types"; + +// SplittingPolicy determines the way we want to split incentives in groupGauges +enum SplittingPolicy { + option (gogoproto.goproto_enum_prefix) = false; + + ByVolume = 0; +} + +// Note that while both InternalGaugeInfo and InternalGaugeRecord could +// technically be replaced by DistrInfo and DistrRecord from the pool-incentives +// module, we create separate types here to keep our abstractions clean and +// readable (pool-incentives distribution abstractions are used in a very +// specific way that does not directly relate to gauge logic). This also helps +// us sidestep a refactor to avoid an import cycle. +message InternalGaugeInfo { + string total_weight = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"total_weight\"", + (gogoproto.nullable) = false + ]; + repeated InternalGaugeRecord gauge_records = 2 + [ (gogoproto.nullable) = false ]; +} + +message InternalGaugeRecord { + option (gogoproto.equal) = true; + + uint64 gauge_id = 1 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ]; + // CurrentWeight is the current weight of this gauge being distributed to for + // this epoch. For instance, for volume splitting policy, this stores the + // volume generated in the last epoch of the linked pool. + string current_weight = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // CumulativeWeight serves as a snapshot of the accumulator being tracked + // based on splitting policy. For instance, for volume splitting policy, this + // stores the cumulative volume for the linked pool at time of last update. + string cumulative_weight = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +// Group is an object that stores a 1:1 mapped gauge ID, a list of pool gauge +// info, and a splitting policy. These are grouped into a single abstraction to +// allow for distribution of group incentives to internal gauges according to +// the specified splitting policy. +message Group { + uint64 group_gauge_id = 1; + InternalGaugeInfo internal_gauge_info = 2 [ (gogoproto.nullable) = false ]; + SplittingPolicy splitting_policy = 3; +} + +// CreateGroup is called via governance to create a new group. +// It takes an array of pool IDs to split the incentives across. +message CreateGroup { repeated uint64 pool_ids = 1; } + +// GroupsWithGauge is a helper struct that stores a group and its +// associated gauge. +message GroupsWithGauge { + Group group = 1 [ (gogoproto.nullable) = false ]; + Gauge gauge = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/incentives/params.proto b/packages/cosmos/proto/osmosis/incentives/params.proto new file mode 100644 index 00000000..42c24bfc --- /dev/null +++ b/packages/cosmos/proto/osmosis/incentives/params.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package osmosis.incentives; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/incentives/types"; + +// Params holds parameters for the incentives module +message Params { + // distr_epoch_identifier is what epoch type distribution will be triggered by + // (day, week, etc.) + string distr_epoch_identifier = 1 + [ (gogoproto.moretags) = "yaml:\"distr_epoch_identifier\"" ]; + + // group_creation_fee is the fee required to create a new group + // It is only charged to all addresses other than incentive module account + // or addresses in the unrestricted_creator_whitelist + repeated cosmos.base.v1beta1.Coin group_creation_fee = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // unrestricted_creator_whitelist is a list of addresses that are + // allowed to bypass restrictions on permissionless Group + // creation. In the future, we might expand these to creating gauges + // as well. + // The goal of this is to allow a subdao to manage incentives efficiently + // without being stopped by 5 day governance process or a high fee. + // At the same time, it prevents spam by having a fee for all + // other users. + repeated string unrestricted_creator_whitelist = 3 + [ (gogoproto.moretags) = "yaml:\"unrestricted_creator_whitelist\"" ]; + + // internal_uptime is the uptime used for internal incentives on pools that + // use NoLock gauges (currently only Concentrated Liquidity pools). + // + // Since Group gauges route through internal gauges, this parameter affects + // the uptime of those incentives as well (i.e. distributions through volume + // splitting incentives will use this uptime). + google.protobuf.Duration internal_uptime = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"internal_uptime\"" + ]; + // min_value_for_distribution is the minimum amount a token must be worth + // in order to be eligible for distribution. If the token is worth + // less than this amount (or the route between the two denoms is not + // registered), it will not be distributed and is forfeited to the remaining + // distributees that are eligible. + cosmos.base.v1beta1.Coin min_value_for_distribution = 5 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/incentives/query.proto b/packages/cosmos/proto/osmosis/incentives/query.proto new file mode 100644 index 00000000..4d5e049d --- /dev/null +++ b/packages/cosmos/proto/osmosis/incentives/query.proto @@ -0,0 +1,239 @@ +syntax = "proto3"; +package osmosis.incentives; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/incentives/gauge.proto"; +import "osmosis/lockup/lock.proto"; +import "osmosis/incentives/group.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/incentives/types"; + +// Query defines the gRPC querier service +service Query { + // ModuleToDistributeCoins returns coins that are going to be distributed + rpc ModuleToDistributeCoins(ModuleToDistributeCoinsRequest) + returns (ModuleToDistributeCoinsResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/module_to_distribute_coins"; + } + // GaugeByID returns gauges by their respective ID + rpc GaugeByID(GaugeByIDRequest) returns (GaugeByIDResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/gauge_by_id/{id}"; + } + // Gauges returns both upcoming and active gauges + rpc Gauges(GaugesRequest) returns (GaugesResponse) { + option (google.api.http).get = "/osmosis/incentives/v1beta1/gauges"; + } + // ActiveGauges returns active gauges + rpc ActiveGauges(ActiveGaugesRequest) returns (ActiveGaugesResponse) { + option (google.api.http).get = "/osmosis/incentives/v1beta1/active_gauges"; + } + // ActiveGaugesPerDenom returns active gauges by denom + rpc ActiveGaugesPerDenom(ActiveGaugesPerDenomRequest) + returns (ActiveGaugesPerDenomResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/active_gauges_per_denom"; + } + // Returns scheduled gauges that have not yet occurred + rpc UpcomingGauges(UpcomingGaugesRequest) returns (UpcomingGaugesResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/upcoming_gauges"; + } + // UpcomingGaugesPerDenom returns scheduled gauges that have not yet occurred + // by denom + rpc UpcomingGaugesPerDenom(UpcomingGaugesPerDenomRequest) + returns (UpcomingGaugesPerDenomResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/upcoming_gauges_per_denom"; + } + // RewardsEst returns an estimate of the rewards from now until a specified + // time in the future The querier either provides an address or a set of locks + // for which they want to find the associated rewards + rpc RewardsEst(RewardsEstRequest) returns (RewardsEstResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/rewards_est/{owner}"; + } + // LockableDurations returns lockable durations that are valid to distribute + // incentives for + rpc LockableDurations(QueryLockableDurationsRequest) + returns (QueryLockableDurationsResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/lockable_durations"; + } + // AllGroups returns all groups + rpc AllGroups(QueryAllGroupsRequest) returns (QueryAllGroupsResponse) { + option (google.api.http).get = "/osmosis/incentives/v1beta1/all_groups"; + } + // AllGroupsGauges returns all group gauges + rpc AllGroupsGauges(QueryAllGroupsGaugesRequest) + returns (QueryAllGroupsGaugesResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/all_groups_gauges"; + } + // AllGroupsWithGauge returns all groups with their group gauge + rpc AllGroupsWithGauge(QueryAllGroupsWithGaugeRequest) + returns (QueryAllGroupsWithGaugeResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/all_groups_with_gauge"; + } + // GroupByGroupGaugeID returns a group given its group gauge ID + rpc GroupByGroupGaugeID(QueryGroupByGroupGaugeIDRequest) + returns (QueryGroupByGroupGaugeIDResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/group_by_group_gauge_id/{id}"; + } + // CurrentWeightByGroupGaugeID returns the current weight since the + // the last epoch given a group gauge ID + rpc CurrentWeightByGroupGaugeID(QueryCurrentWeightByGroupGaugeIDRequest) + returns (QueryCurrentWeightByGroupGaugeIDResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/current_weight_by_group_gauge_id/" + "{group_gauge_id}"; + } +} + +message ModuleToDistributeCoinsRequest {} +message ModuleToDistributeCoinsResponse { + // Coins that have yet to be distributed + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message GaugeByIDRequest { + // Gague ID being queried + uint64 id = 1; +} +message GaugeByIDResponse { + // Gauge that corresponds to provided gague ID + Gauge gauge = 1; +} + +message GaugesRequest { + // Pagination defines pagination for the request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} +message GaugesResponse { + // Upcoming and active gauges + repeated Gauge data = 1 [ (gogoproto.nullable) = false ]; + // Pagination defines pagination for the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message ActiveGaugesRequest { + // Pagination defines pagination for the request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} +message ActiveGaugesResponse { + // Active gagues only + repeated Gauge data = 1 [ (gogoproto.nullable) = false ]; + // Pagination defines pagination for the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message ActiveGaugesPerDenomRequest { + // Desired denom when querying active gagues + string denom = 1; + // Pagination defines pagination for the request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} +message ActiveGaugesPerDenomResponse { + // Active gagues that match denom in query + repeated Gauge data = 1 [ (gogoproto.nullable) = false ]; + // Pagination defines pagination for the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message UpcomingGaugesRequest { + // Pagination defines pagination for the request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} +message UpcomingGaugesResponse { + // Gauges whose distribution is upcoming + repeated Gauge data = 1 [ (gogoproto.nullable) = false ]; + // Pagination defines pagination for the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message UpcomingGaugesPerDenomRequest { + // Filter for upcoming gagues that match specific denom + string denom = 1; + // Pagination defines pagination for the request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message UpcomingGaugesPerDenomResponse { + // Upcoming gagues that match denom in query + repeated Gauge upcoming_gauges = 1 [ (gogoproto.nullable) = false ]; + // Pagination defines pagination for the response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message RewardsEstRequest { + // Address that is being queried for future estimated rewards + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + // Lock IDs included in future reward estimation + repeated uint64 lock_ids = 2; + // Upper time limit of reward estimation + // Lower limit is current epoch + int64 end_epoch = 3; +} +message RewardsEstResponse { + // Estimated coin rewards that will be received at provided address + // from specified locks between current time and end epoch + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message QueryLockableDurationsRequest {} +message QueryLockableDurationsResponse { + // Time durations that users can lock coins for in order to receive rewards + repeated google.protobuf.Duration lockable_durations = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"lockable_durations\"" + ]; +} + +message QueryAllGroupsRequest {} +message QueryAllGroupsResponse { + repeated Group groups = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllGroupsGaugesRequest {} +message QueryAllGroupsGaugesResponse { + repeated Gauge gauges = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllGroupsWithGaugeRequest {} +message QueryAllGroupsWithGaugeResponse { + repeated GroupsWithGauge groups_with_gauge = 1 + [ (gogoproto.nullable) = false ]; +} + +message QueryGroupByGroupGaugeIDRequest { uint64 id = 1; } +message QueryGroupByGroupGaugeIDResponse { + Group group = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryCurrentWeightByGroupGaugeIDRequest { uint64 group_gauge_id = 1; } +message QueryCurrentWeightByGroupGaugeIDResponse { + repeated GaugeWeight gauge_weight = 1 [ (gogoproto.nullable) = false ]; +} + +message GaugeWeight { + uint64 gauge_id = 1; + string weight_ratio = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"weight_ratio\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/incentives/tx.proto b/packages/cosmos/proto/osmosis/incentives/tx.proto new file mode 100644 index 00000000..4778a3be --- /dev/null +++ b/packages/cosmos/proto/osmosis/incentives/tx.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package osmosis.incentives; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/incentives/gauge.proto"; +import "osmosis/lockup/lock.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/incentives/types"; + +service Msg { + rpc CreateGauge(MsgCreateGauge) returns (MsgCreateGaugeResponse); + rpc AddToGauge(MsgAddToGauge) returns (MsgAddToGaugeResponse); + rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse); +} + +// MsgCreateGauge creates a gague to distribute rewards to users +message MsgCreateGauge { + option (amino.name) = "osmosis/incentives/create-gauge"; + + // is_perpetual shows if it's a perpetual or non-perpetual gauge + // Non-perpetual gauges distribute their tokens equally per epoch while the + // gauge is in the active period. Perpetual gauges distribute all their tokens + // at a single time and only distribute their tokens again once the gauge is + // refilled + bool is_perpetual = 1; + // owner is the address of gauge creator + string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + // distribute_to show which lock the gauge should distribute to by time + // duration or by timestamp + osmosis.lockup.QueryCondition distribute_to = 3 + [ (gogoproto.nullable) = false ]; + // coins are coin(s) to be distributed by the gauge + repeated cosmos.base.v1beta1.Coin coins = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // start_time is the distribution start time + google.protobuf.Timestamp start_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"timestamp\"" + ]; + // num_epochs_paid_over is the number of epochs distribution will be completed + // over + uint64 num_epochs_paid_over = 6; + + // pool_id is the ID of the pool that the gauge is meant to be associated + // with. if pool_id is set, then the "QueryCondition.LockQueryType" must be + // "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct + // unset, including "QueryCondition.Denom". However, note that, internally, + // the empty string in "QueryCondition.Denom" ends up being overwritten with + // incentivestypes.NoLockExternalGaugeDenom() so that the gauges + // associated with a pool can be queried by this prefix if needed. + uint64 pool_id = 7; +} +message MsgCreateGaugeResponse {} + +// MsgAddToGauge adds coins to a previously created gauge +message MsgAddToGauge { + option (amino.name) = "osmosis/incentives/add-to-gauge"; + + // owner is the gauge owner's address + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + // gauge_id is the ID of gauge that rewards are getting added to + uint64 gauge_id = 2; + // rewards are the coin(s) to add to gauge + repeated cosmos.base.v1beta1.Coin rewards = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} +message MsgAddToGaugeResponse {} + +// MsgCreateGroup creates a group to distribute rewards to a group of pools +message MsgCreateGroup { + option (amino.name) = "osmosis/incentives/create-group"; + + // coins are the provided coins that the group will distribute + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // num_epochs_paid_over is the number of epochs distribution will be completed + // in. 0 means it's perpetual + uint64 num_epochs_paid_over = 2; + // owner is the group owner's address + string owner = 3 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + // pool_ids are the IDs of pools that the group is comprised of + repeated uint64 pool_ids = 4; +} +message MsgCreateGroupResponse { + // group_id is the ID of the group that is created from this msg + uint64 group_id = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/lockup/genesis.proto b/packages/cosmos/proto/osmosis/lockup/genesis.proto new file mode 100644 index 00000000..c6a0fc0e --- /dev/null +++ b/packages/cosmos/proto/osmosis/lockup/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package osmosis.lockup; + +import "gogoproto/gogo.proto"; +import "osmosis/lockup/lock.proto"; +import "osmosis/lockup/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/lockup/types"; + +// GenesisState defines the lockup module's genesis state. +message GenesisState { + uint64 last_lock_id = 1; + repeated PeriodLock locks = 2 [ (gogoproto.nullable) = false ]; + repeated SyntheticLock synthetic_locks = 3 [ (gogoproto.nullable) = false ]; + Params params = 4; +} diff --git a/packages/cosmos/proto/osmosis/lockup/lock.proto b/packages/cosmos/proto/osmosis/lockup/lock.proto new file mode 100644 index 00000000..489f25d7 --- /dev/null +++ b/packages/cosmos/proto/osmosis/lockup/lock.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; +package osmosis.lockup; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/lockup/types"; + +// PeriodLock is a single lock unit by period defined by the x/lockup module. +// It's a record of a locked coin at a specific time. It stores owner, duration, +// unlock time and the number of coins locked. A state of a period lock is +// created upon lock creation, and deleted once the lock has been matured after +// the `duration` has passed since unbonding started. +message PeriodLock { + // ID is the unique id of the lock. + // The ID of the lock is decided upon lock creation, incrementing by 1 for + // every lock. + uint64 ID = 1; + // Owner is the account address of the lock owner. + // Only the owner can modify the state of the lock. + string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + // Duration is the time needed for a lock to mature after unlocking has + // started. + google.protobuf.Duration duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + // EndTime refers to the time at which the lock would mature and get deleted. + // This value is first initialized when an unlock has started for the lock, + // end time being block time + duration. + google.protobuf.Timestamp end_time = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"end_time\"" + ]; + // Coins are the tokens locked within the lock, kept in the module account. + repeated cosmos.base.v1beta1.Coin coins = 5 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Reward Receiver Address is the address that would be receiving rewards for + // the incentives for the lock. This is set to owner by default and can be + // changed via separate msg. + string reward_receiver_address = 6 + [ (gogoproto.moretags) = "yaml:\"reward_receiver_address\"" ]; +} + +// LockQueryType defines the type of the lock query that can +// either be by duration or start time of the lock. +enum LockQueryType { + option (gogoproto.goproto_enum_prefix) = false; + + ByDuration = 0; + ByTime = 1; + NoLock = 2; + ByGroup = 3; +} + +// QueryCondition is a struct used for querying locks upon different conditions. +// Duration field and timestamp fields could be optional, depending on the +// LockQueryType. +message QueryCondition { + // LockQueryType is a type of lock query, ByLockDuration | ByLockTime + LockQueryType lock_query_type = 1; + // Denom represents the token denomination we are looking to lock up + string denom = 2; + // Duration is used to query locks with longer duration than the specified + // duration. Duration field must not be nil when the lock query type is + // `ByLockDuration`. + google.protobuf.Duration duration = 3 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + // Timestamp is used by locks started before the specified duration. + // Timestamp field must not be nil when the lock query type is `ByLockTime`. + // Querying locks with timestamp is currently not implemented. + google.protobuf.Timestamp timestamp = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"timestamp\"" + ]; +} + +// SyntheticLock is creating virtual lockup where new denom is combination of +// original denom and synthetic suffix. At the time of synthetic lockup creation +// and deletion, accumulation store is also being updated and on querier side, +// they can query as freely as native lockup. +message SyntheticLock { + // Underlying Lock ID is the underlying native lock's id for this synthetic + // lockup. A synthetic lock MUST have an underlying lock. + uint64 underlying_lock_id = 1; + // SynthDenom is the synthetic denom that is a combination of + // gamm share + bonding status + validator address. + string synth_denom = 2; + // used for unbonding synthetic lockups, for active synthetic lockups, this + // value is set to uninitialized value + google.protobuf.Timestamp end_time = 3 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"end_time\"" + ]; + // Duration is the duration for a synthetic lock to mature + // at the point of unbonding has started. + google.protobuf.Duration duration = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +} diff --git a/packages/cosmos/proto/osmosis/lockup/params.proto b/packages/cosmos/proto/osmosis/lockup/params.proto new file mode 100644 index 00000000..2bc8b6e6 --- /dev/null +++ b/packages/cosmos/proto/osmosis/lockup/params.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package osmosis.lockup; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/lockup/types"; + +message Params { + repeated string force_unlock_allowed_addresses = 1 + [ (gogoproto.moretags) = "yaml:\"force_unlock_allowed_address\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/lockup/query.proto b/packages/cosmos/proto/osmosis/lockup/query.proto new file mode 100644 index 00000000..d570cd7e --- /dev/null +++ b/packages/cosmos/proto/osmosis/lockup/query.proto @@ -0,0 +1,336 @@ +syntax = "proto3"; +package osmosis.lockup; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "osmosis/lockup/lock.proto"; +import "osmosis/lockup/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/lockup/types"; + +// Query defines the gRPC querier service. +service Query { + // Return full balance of the module + rpc ModuleBalance(ModuleBalanceRequest) returns (ModuleBalanceResponse) { + option (google.api.http).get = "/osmosis/lockup/v1beta1/module_balance"; + } + // Return locked balance of the module + rpc ModuleLockedAmount(ModuleLockedAmountRequest) + returns (ModuleLockedAmountResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/module_locked_amount"; + } + + // Returns unlockable coins which are not withdrawn yet + rpc AccountUnlockableCoins(AccountUnlockableCoinsRequest) + returns (AccountUnlockableCoinsResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_unlockable_coins/{owner}"; + } + // Returns unlocking coins + rpc AccountUnlockingCoins(AccountUnlockingCoinsRequest) + returns (AccountUnlockingCoinsResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_unlocking_coins/{owner}"; + } + // Return a locked coins that can't be withdrawn + rpc AccountLockedCoins(AccountLockedCoinsRequest) + returns (AccountLockedCoinsResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_coins/{owner}"; + } + + // Returns locked records of an account with unlock time beyond timestamp + rpc AccountLockedPastTime(AccountLockedPastTimeRequest) + returns (AccountLockedPastTimeResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_pasttime/{owner}"; + } + // Returns locked records of an account with unlock time beyond timestamp + // excluding tokens started unlocking + rpc AccountLockedPastTimeNotUnlockingOnly( + AccountLockedPastTimeNotUnlockingOnlyRequest) + returns (AccountLockedPastTimeNotUnlockingOnlyResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_pasttime_not_unlocking_only/" + "{owner}"; + } + // Returns unlocked records with unlock time before timestamp + rpc AccountUnlockedBeforeTime(AccountUnlockedBeforeTimeRequest) + returns (AccountUnlockedBeforeTimeResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_unlocked_before_time/{owner}"; + } + + // Returns lock records by address, timestamp, denom + rpc AccountLockedPastTimeDenom(AccountLockedPastTimeDenomRequest) + returns (AccountLockedPastTimeDenomResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_pasttime_denom/{owner}"; + } + + // Returns total locked per denom with longer past given time + rpc LockedDenom(LockedDenomRequest) returns (LockedDenomResponse) { + option (google.api.http).get = "/osmosis/lockup/v1beta1/locked_denom"; + } + + // Returns lock record by id + rpc LockedByID(LockedRequest) returns (LockedResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/locked_by_id/{lock_id}"; + } + + // Returns lock record by id + rpc LockRewardReceiver(LockRewardReceiverRequest) + returns (LockRewardReceiverResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/lock_reward_receiver/{lock_id}"; + } + + // Returns next lock ID + rpc NextLockID(NextLockIDRequest) returns (NextLockIDResponse) { + option (google.api.http).get = "/osmosis/lockup/v1beta1/next_lock_id"; + } + + // Returns synthetic lockup by native lockup id + // Deprecated: use SyntheticLockupByLockupID instead + rpc SyntheticLockupsByLockupID(SyntheticLockupsByLockupIDRequest) + returns (SyntheticLockupsByLockupIDResponse) { + option deprecated = true; + option (google.api.http).get = + "/osmosis/lockup/v1beta1/synthetic_lockups_by_lock_id/{lock_id}"; + } + + // Returns synthetic lockup by native lockup id + rpc SyntheticLockupByLockupID(SyntheticLockupByLockupIDRequest) + returns (SyntheticLockupByLockupIDResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/synthetic_lockup_by_lock_id/{lock_id}"; + } + + // Returns account locked records with longer duration + rpc AccountLockedLongerDuration(AccountLockedLongerDurationRequest) + returns (AccountLockedLongerDurationResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_longer_duration/{owner}"; + } + + // Returns account locked records with a specific duration + rpc AccountLockedDuration(AccountLockedDurationRequest) + returns (AccountLockedDurationResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_duration/{owner}"; + } + + // Returns account locked records with longer duration excluding tokens + // started unlocking + rpc AccountLockedLongerDurationNotUnlockingOnly( + AccountLockedLongerDurationNotUnlockingOnlyRequest) + returns (AccountLockedLongerDurationNotUnlockingOnlyResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/" + "account_locked_longer_duration_not_unlocking_only/{owner}"; + } + // Returns account's locked records for a denom with longer duration + rpc AccountLockedLongerDurationDenom(AccountLockedLongerDurationDenomRequest) + returns (AccountLockedLongerDurationDenomResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_longer_duration_denom/{owner}"; + } + // Params returns lockup params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/lockup/v1beta1/params"; + } +} + +message ModuleBalanceRequest {}; +message ModuleBalanceResponse { + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +}; + +message ModuleLockedAmountRequest {}; +message ModuleLockedAmountResponse { + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +}; + +message AccountUnlockableCoinsRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; +}; +message AccountUnlockableCoinsResponse { + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +}; + +message AccountUnlockingCoinsRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; +} +message AccountUnlockingCoinsResponse { + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message AccountLockedCoinsRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; +}; +message AccountLockedCoinsResponse { + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +}; + +message AccountLockedPastTimeRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Timestamp timestamp = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"timestamp\"" + ]; +}; +message AccountLockedPastTimeResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + +message AccountLockedPastTimeNotUnlockingOnlyRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Timestamp timestamp = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"timestamp\"" + ]; +}; +message AccountLockedPastTimeNotUnlockingOnlyResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + +message AccountUnlockedBeforeTimeRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Timestamp timestamp = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"timestamp\"" + ]; +}; +message AccountUnlockedBeforeTimeResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +} + +message AccountLockedPastTimeDenomRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Timestamp timestamp = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"timestamp\"" + ]; + string denom = 3; +}; +message AccountLockedPastTimeDenomResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + +message LockedDenomRequest { + string denom = 1; + google.protobuf.Duration duration = 2 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +} +message LockedDenomResponse { + string amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; +} + +message LockedRequest { uint64 lock_id = 1; }; +message LockedResponse { PeriodLock lock = 1; }; + +message LockRewardReceiverRequest { uint64 lock_id = 1; }; +message LockRewardReceiverResponse { string reward_receiver = 1; }; + +message NextLockIDRequest {}; +message NextLockIDResponse { uint64 lock_id = 1; }; + +message SyntheticLockupsByLockupIDRequest { + option deprecated = true; + uint64 lock_id = 1; +} +message SyntheticLockupsByLockupIDResponse { + option deprecated = true; + repeated SyntheticLock synthetic_locks = 1 [ (gogoproto.nullable) = false ]; +} + +message SyntheticLockupByLockupIDRequest { uint64 lock_id = 1; } +message SyntheticLockupByLockupIDResponse { + SyntheticLock synthetic_lock = 1 [ (gogoproto.nullable) = false ]; +} + +message AccountLockedLongerDurationRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Duration duration = 2 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +}; +message AccountLockedLongerDurationResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + +message AccountLockedDurationRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Duration duration = 2 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +}; +message AccountLockedDurationResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + +message AccountLockedLongerDurationNotUnlockingOnlyRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Duration duration = 2 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +}; +message AccountLockedLongerDurationNotUnlockingOnlyResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + +message AccountLockedLongerDurationDenomRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Duration duration = 2 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + string denom = 3; +}; +message AccountLockedLongerDurationDenomResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + +message QueryParamsRequest {} +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/lockup/tx.proto b/packages/cosmos/proto/osmosis/lockup/tx.proto new file mode 100644 index 00000000..c5f14310 --- /dev/null +++ b/packages/cosmos/proto/osmosis/lockup/tx.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; +package osmosis.lockup; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/lockup/lock.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/lockup/types"; + +// Msg defines the Msg service. +service Msg { + // LockTokens lock tokens + rpc LockTokens(MsgLockTokens) returns (MsgLockTokensResponse); + // BeginUnlockingAll begin unlocking all tokens + rpc BeginUnlockingAll(MsgBeginUnlockingAll) + returns (MsgBeginUnlockingAllResponse); + // MsgBeginUnlocking begins unlocking tokens by lock ID + rpc BeginUnlocking(MsgBeginUnlocking) returns (MsgBeginUnlockingResponse); + // MsgEditLockup edits the existing lockups by lock ID + rpc ExtendLockup(MsgExtendLockup) returns (MsgExtendLockupResponse); + rpc ForceUnlock(MsgForceUnlock) returns (MsgForceUnlockResponse); + // SetRewardReceiverAddress edits the reward receiver for the given lock ID + rpc SetRewardReceiverAddress(MsgSetRewardReceiverAddress) + returns (MsgSetRewardReceiverAddressResponse); +} + +message MsgLockTokens { + option (amino.name) = "osmosis/lockup/lock-tokens"; + + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Duration duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + repeated cosmos.base.v1beta1.Coin coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} +message MsgLockTokensResponse { uint64 ID = 1; } + +message MsgBeginUnlockingAll { + option (amino.name) = "osmosis/lockup/begin-unlock-tokens"; + + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; +} +message MsgBeginUnlockingAllResponse { repeated PeriodLock unlocks = 1; } + +message MsgBeginUnlocking { + option (amino.name) = "osmosis/lockup/begin-unlock-period-lock"; + + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + uint64 ID = 2; + // Amount of unlocking coins. Unlock all if not set. + repeated cosmos.base.v1beta1.Coin coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} +message MsgBeginUnlockingResponse { + bool success = 1; + uint64 unlockingLockID = 2; +} + +// MsgExtendLockup extends the existing lockup's duration. +// The new duration is longer than the original. +message MsgExtendLockup { + option (amino.name) = "osmosis/lockup/extend-lockup"; + + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + uint64 ID = 2; + + // duration to be set. fails if lower than the current duration, or is + // unlocking + google.protobuf.Duration duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + + // extend for other edit, e.g. cancel unlocking +} + +message MsgExtendLockupResponse { bool success = 1; } + +// MsgForceUnlock unlocks locks immediately for +// addresses registered via governance. +message MsgForceUnlock { + option (amino.name) = "osmosis/lockup/force-unlock-tokens"; + + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + uint64 ID = 2; + // Amount of unlocking coins. Unlock all if not set. + repeated cosmos.base.v1beta1.Coin coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message MsgForceUnlockResponse { bool success = 1; } + +message MsgSetRewardReceiverAddress { + option (amino.name) = "osmosis/lockup/set-reward-receiver-address"; + + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + uint64 lockID = 2; + string reward_receiver = 3 + [ (gogoproto.moretags) = "yaml:\"reward_receiver\"" ]; +} +message MsgSetRewardReceiverAddressResponse { bool success = 1; } \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/mint/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/mint/v1beta1/genesis.proto new file mode 100644 index 00000000..bf4344d5 --- /dev/null +++ b/packages/cosmos/proto/osmosis/mint/v1beta1/genesis.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package osmosis.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/mint/v1beta1/mint.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/mint/types"; + +// GenesisState defines the mint module's genesis state. +message GenesisState { + // minter is an abstraction for holding current rewards information. + Minter minter = 1 [ (gogoproto.nullable) = false ]; + + // params defines all the parameters of the mint module. + Params params = 2 [ (gogoproto.nullable) = false ]; + + // reduction_started_epoch is the first epoch in which the reduction of mint + // begins. + int64 reduction_started_epoch = 3 + [ (gogoproto.moretags) = "yaml:\"reduction_started_epoch\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/mint/v1beta1/mint.proto b/packages/cosmos/proto/osmosis/mint/v1beta1/mint.proto new file mode 100644 index 00000000..4f537913 --- /dev/null +++ b/packages/cosmos/proto/osmosis/mint/v1beta1/mint.proto @@ -0,0 +1,119 @@ +syntax = "proto3"; +package osmosis.mint.v1beta1; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/mint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; + +// Minter represents the minting state. +message Minter { + // epoch_provisions represent rewards for the current epoch. + string epoch_provisions = 1 [ + (gogoproto.moretags) = "yaml:\"epoch_provisions\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// WeightedAddress represents an address with a weight assigned to it. +// The weight is used to determine the proportion of the total minted +// tokens to be minted to the address. +message WeightedAddress { + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + string weight = 2 [ + (gogoproto.moretags) = "yaml:\"weight\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// DistributionProportions defines the distribution proportions of the minted +// denom. In other words, defines which stakeholders will receive the minted +// denoms and how much. +message DistributionProportions { + // staking defines the proportion of the minted mint_denom that is to be + // allocated as staking rewards. + string staking = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"staking\"", + (gogoproto.nullable) = false + ]; + // pool_incentives defines the proportion of the minted mint_denom that is + // to be allocated as pool incentives. + string pool_incentives = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"pool_incentives\"", + (gogoproto.nullable) = false + ]; + // developer_rewards defines the proportion of the minted mint_denom that is + // to be allocated to developer rewards address. + string developer_rewards = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"developer_rewards\"", + (gogoproto.nullable) = false + ]; + // community_pool defines the proportion of the minted mint_denom that is + // to be allocated to the community pool. + string community_pool = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"community_pool\"", + (gogoproto.nullable) = false + ]; +} + +// Params holds parameters for the x/mint module. +message Params { + option (gogoproto.goproto_stringer) = false; + + // mint_denom is the denom of the coin to mint. + string mint_denom = 1; + // genesis_epoch_provisions epoch provisions from the first epoch. + string genesis_epoch_provisions = 2 [ + (gogoproto.moretags) = "yaml:\"genesis_epoch_provisions\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // epoch_identifier mint epoch identifier e.g. (day, week). + string epoch_identifier = 3 + [ (gogoproto.moretags) = "yaml:\"epoch_identifier\"" ]; + // reduction_period_in_epochs the number of epochs it takes + // to reduce the rewards. + int64 reduction_period_in_epochs = 4 + [ (gogoproto.moretags) = "yaml:\"reduction_period_in_epochs\"" ]; + // reduction_factor is the reduction multiplier to execute + // at the end of each period set by reduction_period_in_epochs. + string reduction_factor = 5 [ + (gogoproto.moretags) = "yaml:\"reduction_factor\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // distribution_proportions defines the distribution proportions of the minted + // denom. In other words, defines which stakeholders will receive the minted + // denoms and how much. + DistributionProportions distribution_proportions = 6 + [ (gogoproto.nullable) = false ]; + // weighted_developer_rewards_receivers is the address to receive developer + // rewards with weights assignedt to each address. The final amount that each + // address receives is: epoch_provisions * + // distribution_proportions.developer_rewards * Address's Weight. + repeated WeightedAddress weighted_developer_rewards_receivers = 7 [ + (gogoproto.moretags) = "yaml:\"developer_rewards_receiver\"", + (gogoproto.nullable) = false + ]; + // minting_rewards_distribution_start_epoch start epoch to distribute minting + // rewards + int64 minting_rewards_distribution_start_epoch = 8 + [ (gogoproto.moretags) = + "yaml:\"minting_rewards_distribution_start_epoch\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/mint/v1beta1/query.proto b/packages/cosmos/proto/osmosis/mint/v1beta1/query.proto new file mode 100644 index 00000000..94d7a449 --- /dev/null +++ b/packages/cosmos/proto/osmosis/mint/v1beta1/query.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package osmosis.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "osmosis/mint/v1beta1/mint.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/mint/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/mint/v1beta1/params"; + } + + // EpochProvisions returns the current minting epoch provisions value. + rpc EpochProvisions(QueryEpochProvisionsRequest) + returns (QueryEpochProvisionsResponse) { + option (google.api.http).get = "/osmosis/mint/v1beta1/epoch_provisions"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryEpochProvisionsRequest is the request type for the +// Query/EpochProvisions RPC method. +message QueryEpochProvisionsRequest {} + +// QueryEpochProvisionsResponse is the response type for the +// Query/EpochProvisions RPC method. +message QueryEpochProvisionsResponse { + // epoch_provisions is the current minting per epoch provisions value. + bytes epoch_provisions = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/poolincentives/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/genesis.proto new file mode 100644 index 00000000..a115676e --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/genesis.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package osmosis.poolincentives.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "osmosis/poolincentives/v1beta1/incentives.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/pool-incentives/types"; + +// GenesisState defines the pool incentives module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated google.protobuf.Duration lockable_durations = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"lockable_durations\"" + ]; + DistrInfo distr_info = 3 [ + (gogoproto.nullable) = true, + (gogoproto.moretags) = "yaml:\"distr_info\"" + ]; + // any_pool_to_internal_gauges defines the gauges for any pool to internal + // pool. For every pool type (e.g. LP, Concentrated, etc), there is one such + // link + AnyPoolToInternalGauges any_pool_to_internal_gauges = 4 [ + (gogoproto.nullable) = true, + (gogoproto.moretags) = "yaml:\"internal_pool_to_gauges\"" + ]; + // concentrated_pool_to_no_lock_gauges defines the no lock gauges for + // concentrated pool. This only exists between concentrated pool and no lock + // gauges. Both external and internal gauges are included. + ConcentratedPoolToNoLockGauges concentrated_pool_to_no_lock_gauges = 5 [ + (gogoproto.nullable) = true, + (gogoproto.moretags) = "yaml:\"concentrated_pool_to_no_lock_gauges\"" + ]; +} diff --git a/packages/cosmos/proto/osmosis/poolincentives/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/gov.proto new file mode 100644 index 00000000..d5bc3f1f --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/gov.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; +package osmosis.poolincentives.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "osmosis/poolincentives/v1beta1/incentives.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/pool-incentives/types"; + +// ReplacePoolIncentivesProposal is a gov Content type for updating the pool +// incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records +// override the existing DistrRecords set in the module. Each record has a +// specified gauge id and weight, and the incentives are distributed to each +// gauge according to weight/total_weight. The incentives are put in the fee +// pool and it is allocated to gauges and community pool by the DistrRecords +// configuration. Note that gaugeId=0 represents the community pool. +message ReplacePoolIncentivesProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/ReplacePoolIncentivesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated DistrRecord records = 3 [ (gogoproto.nullable) = false ]; +} + +// UpdatePoolIncentivesProposal is a gov Content type for updating the pool +// incentives. If a UpdatePoolIncentivesProposal passes, all the DistrRecords +// in the proposals are edited. An existing DistrRecord is not overridden unless +// explicitly included in the proposal. +// This differs from an ReplacePoolIncentivesProposal because it only does an +// in place update of the DistrRecords for gauges explicitly mentioned in the +// proposal. + +// For example: if the existing DistrRecords were: +// [(Gauge 0, 5), (Gauge 1, 6), (Gauge 2, 6)] +// An UpdatePoolIncentivesProposal includes +// [(Gauge 1, 0), (Gauge 2, 4), (Gauge 3, 10)] +// This would delete Gauge 1, Edit Gauge 2, and Add Gauge 3 +// The result DistrRecords in state would be: +// [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] +message UpdatePoolIncentivesProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/UpdatePoolIncentivesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated DistrRecord records = 3 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/poolincentives/v1beta1/incentives.proto b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/incentives.proto new file mode 100644 index 00000000..7f2aa793 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/incentives.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package osmosis.poolincentives.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/pool-incentives/types"; + +message Params { + option (gogoproto.goproto_stringer) = false; + + // minted_denom is the denomination of the coin expected to be minted by the + // minting module. Pool-incentives module doesn’t actually mint the coin + // itself, but rather manages the distribution of coins that matches the + // defined minted_denom. + string minted_denom = 1 [ (gogoproto.moretags) = "yaml:\"minted_denom\"" ]; +} + +message LockableDurationsInfo { + repeated google.protobuf.Duration lockable_durations = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"lockable_durations\"" + ]; +} + +message DistrInfo { + string total_weight = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"total_weight\"", + (gogoproto.nullable) = false + ]; + repeated DistrRecord records = 2 [ (gogoproto.nullable) = false ]; +} + +message DistrRecord { + option (gogoproto.equal) = true; + + uint64 gauge_id = 1 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ]; + string weight = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message PoolToGauge { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + uint64 gauge_id = 2 [ (gogoproto.moretags) = "yaml:\"gauge\"" ]; + google.protobuf.Duration duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +} + +message AnyPoolToInternalGauges { + repeated PoolToGauge pool_to_gauge = 2 [ (gogoproto.nullable) = false ]; +} + +message ConcentratedPoolToNoLockGauges { + repeated PoolToGauge pool_to_gauge = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/poolincentives/v1beta1/query.proto b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/query.proto new file mode 100644 index 00000000..485722a8 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/query.proto @@ -0,0 +1,108 @@ +syntax = "proto3"; +package osmosis.poolincentives.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; +import "osmosis/incentives/gauge.proto"; +import "osmosis/poolincentives/v1beta1/incentives.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/pool-incentives/types"; + +service Query { + // GaugeIds takes the pool id and returns the matching gauge ids and durations + rpc GaugeIds(QueryGaugeIdsRequest) returns (QueryGaugeIdsResponse) { + option (google.api.http).get = + "/osmosis/pool-incentives/v1beta1/gauge-ids/{pool_id}"; + } + // DistrInfo returns the pool's matching gauge ids and weights. + rpc DistrInfo(QueryDistrInfoRequest) returns (QueryDistrInfoResponse) { + option (google.api.http).get = + "/osmosis/pool-incentives/v1beta1/distr_info"; + } + + // Params returns pool incentives params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/pool-incentives/v1beta1/params"; + } + + // LockableDurations returns lock durations for pools. + rpc LockableDurations(QueryLockableDurationsRequest) + returns (QueryLockableDurationsResponse) { + option (google.api.http).get = + "/osmosis/pool-incentives/v1beta1/lockable_durations"; + } + + // IncentivizedPools returns currently incentivized pools + rpc IncentivizedPools(QueryIncentivizedPoolsRequest) + returns (QueryIncentivizedPoolsResponse) { + option (google.api.http).get = + "/osmosis/pool-incentives/v1beta1/incentivized_pools"; + } + + // ExternalIncentiveGauges returns external incentive gauges. + rpc ExternalIncentiveGauges(QueryExternalIncentiveGaugesRequest) + returns (QueryExternalIncentiveGaugesResponse) { + option (google.api.http).get = + "/osmosis/pool-incentives/v1beta1/external_incentive_gauges"; + } +} + +message QueryGaugeIdsRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message QueryGaugeIdsResponse { + message GaugeIdWithDuration { + uint64 gauge_id = 1 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ]; + google.protobuf.Duration duration = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + string gauge_incentive_percentage = 3; + } + + repeated GaugeIdWithDuration gauge_ids_with_duration = 1 + [ (gogoproto.moretags) = "yaml:\"gauge_ids_with_duration\"" ]; +} + +message QueryDistrInfoRequest {} +message QueryDistrInfoResponse { + DistrInfo distr_info = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"distr_info\"" + ]; +} + +message QueryParamsRequest {} +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryLockableDurationsRequest {} +message QueryLockableDurationsResponse { + repeated google.protobuf.Duration lockable_durations = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"lockable_durations\"" + ]; +} + +message QueryIncentivizedPoolsRequest {} +message IncentivizedPool { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + google.protobuf.Duration lockable_duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"lockable_duration\"" + ]; + uint64 gauge_id = 3 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ]; +} +message QueryIncentivizedPoolsResponse { + repeated IncentivizedPool incentivized_pools = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"incentivized_pools\"" + ]; +} + +message QueryExternalIncentiveGaugesRequest {} +message QueryExternalIncentiveGaugesResponse { + repeated osmosis.incentives.Gauge data = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/poolincentives/v1beta1/shared.proto b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/shared.proto new file mode 100644 index 00000000..6b872a1e --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolincentives/v1beta1/shared.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package osmosis.poolincentives.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "osmosis/poolincentives/v1beta1/incentives.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/pool-incentives/types"; + +// MigrationRecords contains all the links between balancer and concentrated +// pools. +// +// This is copied over from the gamm proto file in order to circumnavigate +// the circular dependency between the two modules. +message MigrationRecords { + repeated BalancerToConcentratedPoolLink balancer_to_concentrated_pool_links = + 1 [ (gogoproto.nullable) = false ]; +} + +// BalancerToConcentratedPoolLink defines a single link between a single +// balancer pool and a single concentrated liquidity pool. This link is used to +// allow a balancer pool to migrate to a single canonical full range +// concentrated liquidity pool position +// A balancer pool can be linked to a maximum of one cl pool, and a cl pool can +// be linked to a maximum of one balancer pool. +// +// This is copied over from the gamm proto file in order to circumnavigate +// the circular dependency between the two modules. +message BalancerToConcentratedPoolLink { + option (gogoproto.equal) = true; + uint64 balancer_pool_id = 1; + uint64 cl_pool_id = 2; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/genesis.proto new file mode 100644 index 00000000..95095489 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/genesis.proto @@ -0,0 +1,147 @@ +syntax = "proto3"; +package osmosis.poolmanager.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/poolmanager/v1beta1/module_route.proto"; +import "osmosis/poolmanager/v1beta1/tx.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types"; + +// Params holds parameters for the poolmanager module +message Params { + repeated cosmos.base.v1beta1.Coin pool_creation_fee = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"pool_creation_fee\"", + (gogoproto.nullable) = false + ]; + // taker_fee_params is the container of taker fee parameters. + TakerFeeParams taker_fee_params = 2 [ + (gogoproto.moretags) = "yaml:\"taker_fee_params\"", + (gogoproto.nullable) = false + ]; + // authorized_quote_denoms is a list of quote denoms that can be used as + // token1 when creating a concentrated pool. We limit the quote assets to a + // small set for the purposes of having convenient price increments stemming + // from tick to price conversion. These increments are in a human readable + // magnitude only for token1 as a quote. For limit orders in the future, this + // will be a desirable property in terms of UX as to allow users to set limit + // orders at prices in terms of token1 (quote asset) that are easy to reason + // about. + repeated string authorized_quote_denoms = 3 + [ (gogoproto.moretags) = "yaml:\"authorized_quote_denoms\"" ]; +} + +// GenesisState defines the poolmanager module's genesis state. +message GenesisState { + // the next_pool_id + uint64 next_pool_id = 1; + // params is the container of poolmanager parameters. + Params params = 2 [ (gogoproto.nullable) = false ]; + // pool_routes is the container of the mappings from pool id to pool type. + repeated ModuleRoute pool_routes = 3 [ (gogoproto.nullable) = false ]; + + // KVStore state + TakerFeesTracker taker_fees_tracker = 4; + repeated PoolVolume pool_volumes = 5; + repeated DenomPairTakerFee denom_pair_taker_fee_store = 6 + [ (gogoproto.nullable) = false ]; +} + +// TakerFeeParams consolidates the taker fee parameters for the poolmanager. +message TakerFeeParams { + // default_taker_fee is the fee used when creating a new pool that doesn't + // fall under a custom pool taker fee or stableswap taker fee category. + string default_taker_fee = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.customname) = "DefaultTakerFee", + (gogoproto.nullable) = false + ]; + // osmo_taker_fee_distribution defines the distribution of taker fees + // generated in OSMO. As of this writing, it has two categories: + // - staking_rewards: the percent of the taker fee that gets distributed to + // stakers. + // - community_pool: the percent of the taker fee that gets sent to the + // community pool. + TakerFeeDistributionPercentage osmo_taker_fee_distribution = 2 [ + (gogoproto.customname) = "OsmoTakerFeeDistribution", + (gogoproto.nullable) = false + ]; + // non_osmo_taker_fee_distribution defines the distribution of taker fees + // generated in non-OSMO. As of this writing, it has two categories: + // - staking_rewards: the percent of the taker fee that gets swapped to OSMO + // and then distributed to stakers. + // - community_pool: the percent of the taker fee that gets sent to the + // community pool. Note: If the non-OSMO asset is an authorized_quote_denom, + // that denom is sent directly to the community pool. Otherwise, it is + // swapped to the community_pool_denom_to_swap_non_whitelisted_assets_to and + // then sent to the community pool as that denom. + TakerFeeDistributionPercentage non_osmo_taker_fee_distribution = 3 [ + (gogoproto.customname) = "NonOsmoTakerFeeDistribution", + (gogoproto.nullable) = false + ]; + // admin_addresses is a list of addresses that are allowed to set and remove + // custom taker fees for denom pairs. Governance also has the ability to set + // and remove custom taker fees for denom pairs, but with the normal + // governance delay. + repeated string admin_addresses = 4 + [ (gogoproto.moretags) = "yaml:\"admin_addresses\"" ]; + // community_pool_denom_to_swap_non_whitelisted_assets_to is the denom that + // non-whitelisted taker fees will be swapped to before being sent to + // the community pool. + string community_pool_denom_to_swap_non_whitelisted_assets_to = 5 + [ (gogoproto.moretags) = + "yaml:\"community_pool_denom_to_swap_non_whitelisted_assets_to\"" ]; + + // reduced_fee_whitelist is a list of addresses that are + // allowed to pay a reduce taker fee when performing a swap + // (i.e. swap without paying the taker fee). + // It is intended to be used for integrators who meet qualifying factors + // that are approved by governance. + // Initially, the taker fee is allowed to be bypassed completely. However + // In the future, we will charge a reduced taker fee instead of no fee at all. + repeated string reduced_fee_whitelist = 6 + [ (gogoproto.moretags) = "yaml:\"reduced_fee_whitelist\"" ]; +} + +// TakerFeeDistributionPercentage defines what percent of the taker fee category +// gets distributed to the available categories. +message TakerFeeDistributionPercentage { + string staking_rewards = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"staking_rewards\"", + (gogoproto.nullable) = false + ]; + string community_pool = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"community_pool\"", + (gogoproto.nullable) = false + ]; +} + +message TakerFeesTracker { + repeated cosmos.base.v1beta1.Coin taker_fees_to_stakers = 1 + [ (gogoproto.nullable) = false ]; + repeated cosmos.base.v1beta1.Coin taker_fees_to_community_pool = 2 + [ (gogoproto.nullable) = false ]; + int64 height_accounting_starts_from = 3 + [ (gogoproto.moretags) = "yaml:\"height_accounting_starts_from\"" ]; +} + +// PoolVolume stores the KVStore entries for each pool's volume, which +// is used in export/import genesis. +message PoolVolume { + // pool_id is the id of the pool. + uint64 pool_id = 1; + // pool_volume is the cumulative volume of the pool. + repeated cosmos.base.v1beta1.Coin pool_volume = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/gov.proto new file mode 100644 index 00000000..a8e3dca4 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/gov.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package osmosis.poolmanager.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/poolmanager/v1beta1/tx.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types"; + +// DenomPairTakerFeeProposal is a type for adding/removing a custom taker fee(s) +// for one or more denom pairs. +message DenomPairTakerFeeProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + + repeated osmosis.poolmanager.v1beta1.DenomPairTakerFee denom_pair_taker_fee = + 3 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/module_route.proto b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/module_route.proto new file mode 100644 index 00000000..7823571b --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/module_route.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package osmosis.poolmanager.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types"; + +// PoolType is an enumeration of all supported pool types. +enum PoolType { + option (gogoproto.goproto_enum_prefix) = false; + + // Balancer is the standard xy=k curve. Its pool model is defined in x/gamm. + Balancer = 0; + // Stableswap is the Solidly cfmm stable swap curve. Its pool model is defined + // in x/gamm. + Stableswap = 1; + // Concentrated is the pool model specific to concentrated liquidity. It is + // defined in x/concentrated-liquidity. + Concentrated = 2; + // CosmWasm is the pool model specific to CosmWasm. It is defined in + // x/cosmwasmpool. + CosmWasm = 3; +} + +// ModuleRouter defines a route encapsulating pool type. +// It is used as the value of a mapping from pool id to the pool type, +// allowing the pool manager to know which module to route swaps to given the +// pool id. +message ModuleRoute { + // pool_type specifies the type of the pool + PoolType pool_type = 1; + + uint64 pool_id = 2 [ + (gogoproto.moretags) = "yaml:\"pool_id\"", + (gogoproto.nullable) = true + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.proto b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.proto new file mode 100644 index 00000000..4c090c60 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.proto @@ -0,0 +1,370 @@ +syntax = "proto3"; +package osmosis.poolmanager.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/poolmanager/v1beta1/genesis.proto"; +import "osmosis/poolmanager/v1beta1/tx.proto"; +import "osmosis/poolmanager/v1beta1/swap_route.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/client/queryproto"; + +service Query { + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = "/osmosis/poolmanager/v1beta1/Params"; + } + + // Estimates swap amount out given in. + rpc EstimateSwapExactAmountIn(EstimateSwapExactAmountInRequest) + returns (EstimateSwapExactAmountInResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/{pool_id}/estimate/swap_exact_amount_in"; + } + + // EstimateSwapExactAmountInWithPrimitiveTypes is an alternative query for + // EstimateSwapExactAmountIn. Supports query via GRPC-Gateway by using + // primitive types instead of repeated structs. Each index in the + // routes_pool_id field corresponds to the respective routes_token_out_denom + // value, thus they are required to have the same length and are grouped + // together as pairs. + // example usage: + // http://0.0.0.0:1317/osmosis/poolmanager/v1beta1/1/estimate/ + // swap_exact_amount_in_with_primitive_types?token_in=100000stake&routes_token_out_denom=uatom + // &routes_token_out_denom=uion&routes_pool_id=1&routes_pool_id=2 + rpc EstimateSwapExactAmountInWithPrimitiveTypes( + EstimateSwapExactAmountInWithPrimitiveTypesRequest) + returns (EstimateSwapExactAmountInResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/{pool_id}/estimate/" + "swap_exact_amount_in_with_primitive_types"; + } + + rpc EstimateSinglePoolSwapExactAmountIn( + EstimateSinglePoolSwapExactAmountInRequest) + returns (EstimateSwapExactAmountInResponse) { + option (google.api.http).get = "/osmosis/poolmanager/v1beta1/{pool_id}/" + "estimate/single_pool_swap_exact_amount_in"; + } + + // Estimates swap amount in given out. + rpc EstimateSwapExactAmountOut(EstimateSwapExactAmountOutRequest) + returns (EstimateSwapExactAmountOutResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/{pool_id}/estimate/swap_exact_amount_out"; + } + + // Estimates swap amount in given out. + rpc EstimateSwapExactAmountOutWithPrimitiveTypes( + EstimateSwapExactAmountOutWithPrimitiveTypesRequest) + returns (EstimateSwapExactAmountOutResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/{pool_id}/estimate/" + "swap_exact_amount_out_with_primitive_types"; + } + + rpc EstimateSinglePoolSwapExactAmountOut( + EstimateSinglePoolSwapExactAmountOutRequest) + returns (EstimateSwapExactAmountOutResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/{pool_id}/estimate_out/" + "single_pool_swap_exact_amount_out"; + } + + // Returns the total number of pools existing in Osmosis. + rpc NumPools(NumPoolsRequest) returns (NumPoolsResponse) { + option (google.api.http).get = "/osmosis/poolmanager/v1beta1/num_pools"; + } + + // Pool returns the Pool specified by the pool id + rpc Pool(PoolRequest) returns (PoolResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/pools/{pool_id}"; + } + + // AllPools returns all pools on the Osmosis chain sorted by IDs. + rpc AllPools(AllPoolsRequest) returns (AllPoolsResponse) { + option (google.api.http).get = "/osmosis/poolmanager/v1beta1/all-pools"; + } + // ListPoolsByDenom return all pools by denom + rpc ListPoolsByDenom(ListPoolsByDenomRequest) + returns (ListPoolsByDenomResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/list-pools-by-denom"; + } + + // SpotPrice defines a gRPC query handler that returns the spot price given + // a base denomination and a quote denomination. + rpc SpotPrice(SpotPriceRequest) returns (SpotPriceResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/pools/{pool_id}/prices"; + } + + // TotalPoolLiquidity returns the total liquidity of the specified pool. + rpc TotalPoolLiquidity(TotalPoolLiquidityRequest) + returns (TotalPoolLiquidityResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/pools/{pool_id}/total_pool_liquidity"; + } + + // TotalLiquidity returns the total liquidity across all pools. + rpc TotalLiquidity(TotalLiquidityRequest) returns (TotalLiquidityResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/total_liquidity"; + } + + // TotalVolumeForPool returns the total volume of the specified pool. + rpc TotalVolumeForPool(TotalVolumeForPoolRequest) + returns (TotalVolumeForPoolResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/pools/{pool_id}/total_volume"; + } + + // TradingPairTakerFee returns the taker fee for a given set of denoms + rpc TradingPairTakerFee(TradingPairTakerFeeRequest) + returns (TradingPairTakerFeeResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/trading_pair_takerfee"; + } + + // EstimateTradeBasedOnPriceImpact returns an estimated trade based on price + // impact, if a trade cannot be estimated a 0 input and 0 output would be + // returned. + rpc EstimateTradeBasedOnPriceImpact(EstimateTradeBasedOnPriceImpactRequest) + returns (EstimateTradeBasedOnPriceImpactResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/{pool_id}/estimate_trade"; + } +} + +//=============================== Params +message ParamsRequest {} +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } + +//=============================== EstimateSwapExactAmountIn +message EstimateSwapExactAmountInRequest { + reserved 1; + reserved "sender"; + uint64 pool_id = 2 + [ (gogoproto.moretags) = "yaml:\"pool_id\"", deprecated = true ]; + string token_in = 3 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + repeated SwapAmountInRoute routes = 4 [ + (gogoproto.moretags) = "yaml:\"routes\"", + (gogoproto.nullable) = false + ]; +} +message EstimateSwapExactAmountInWithPrimitiveTypesRequest { + uint64 pool_id = 1 + [ (gogoproto.moretags) = "yaml:\"pool_id\"", deprecated = true ]; + string token_in = 2 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + repeated uint64 routes_pool_id = 3 + [ (gogoproto.moretags) = "yaml:\"routes_pool_id\"" ]; + repeated string routes_token_out_denom = 4 + [ (gogoproto.moretags) = "yaml:\"routes_token_out_denom\"" ]; +} + +message EstimateSinglePoolSwapExactAmountInRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in = 2 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + string token_out_denom = 3 + [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; +} + +message EstimateSwapExactAmountInResponse { + string token_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_amount\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== EstimateSwapExactAmountOut +message EstimateSwapExactAmountOutRequest { + reserved 1; + reserved "sender"; + uint64 pool_id = 2 + [ (gogoproto.moretags) = "yaml:\"pool_id\"", deprecated = true ]; + repeated SwapAmountOutRoute routes = 3 [ + (gogoproto.moretags) = "yaml:\"routes\"", + (gogoproto.nullable) = false + ]; + string token_out = 4 [ (gogoproto.moretags) = "yaml:\"token_out\"" ]; +} + +message EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + uint64 pool_id = 1 + [ (gogoproto.moretags) = "yaml:\"pool_id\"", deprecated = true ]; + repeated uint64 routes_pool_id = 2 + [ (gogoproto.moretags) = "yaml:\"routes_pool_id\"" ]; + repeated string routes_token_in_denom = 3 + [ (gogoproto.moretags) = "yaml:\"routes_token_in_denom\"" ]; + string token_out = 4 [ (gogoproto.moretags) = "yaml:\"token_out\"" ]; +} + +message EstimateSinglePoolSwapExactAmountOutRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in_denom = 2 + [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ]; + string token_out = 3 [ (gogoproto.moretags) = "yaml:\"token_out\"" ]; +} + +message EstimateSwapExactAmountOutResponse { + string token_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_amount\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== NumPools +message NumPoolsRequest {} +message NumPoolsResponse { + uint64 num_pools = 1 [ (gogoproto.moretags) = "yaml:\"num_pools\"" ]; +} + +//=============================== Pool +message PoolRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message PoolResponse { + google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "PoolI" ]; +} + +//=============================== AllPools +message AllPoolsRequest {} +message AllPoolsResponse { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; +} + +// ======================================================= +// ListPoolsByDenomRequest +message ListPoolsByDenomRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +message ListPoolsByDenomResponse { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; +} +// ========================================================== +// SpotPriceRequest defines the gRPC request structure for a SpotPrice +// query. +message SpotPriceRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string base_asset_denom = 2 + [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; + string quote_asset_denom = 3 + [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; +} + +// SpotPriceResponse defines the gRPC response structure for a SpotPrice +// query. +message SpotPriceResponse { + // String of the Dec. Ex) 10.203uatom + string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; +} + +//=============================== TotalPoolLiquidity +message TotalPoolLiquidityRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message TotalPoolLiquidityResponse { + repeated cosmos.base.v1beta1.Coin liquidity = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"liquidity\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== TotalLiquidity +message TotalLiquidityRequest {} + +message TotalLiquidityResponse { + repeated cosmos.base.v1beta1.Coin liquidity = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"liquidity\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== TotalVolumeForPool +message TotalVolumeForPoolRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message TotalVolumeForPoolResponse { + repeated cosmos.base.v1beta1.Coin volume = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"volume\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== TradingPairTakerFee +message TradingPairTakerFeeRequest { + string denom_0 = 1 [ (gogoproto.moretags) = "yaml:\"denom_0\"" ]; + string denom_1 = 2 [ (gogoproto.moretags) = "yaml:\"denom_1\"" ]; +} + +message TradingPairTakerFeeResponse { + string taker_fee = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +//=============================== EstimateTradeBasedOnPriceImpact + +// EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a +// trade for Balancer/StableSwap/Concentrated liquidity pool types based on the +// given parameters. +message EstimateTradeBasedOnPriceImpactRequest { + // from_coin is the total amount of tokens that the user wants to sell. + cosmos.base.v1beta1.Coin from_coin = 1 [ (gogoproto.nullable) = false ]; + + // to_coin_denom is the denom identifier of the token that the user wants to + // buy. + string to_coin_denom = 2; + + // pool_id is the identifier of the liquidity pool that the trade will occur + // on. + uint64 pool_id = 3; + + // max_price_impact is the maximum percentage that the user is willing + // to affect the price of the liquidity pool. + string max_price_impact = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // external_price is an optional external price that the user can enter. + // It adjusts the MaxPriceImpact as the SpotPrice of a pool can be changed at + // any time. + string external_price = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// EstimateTradeBasedOnPriceImpactResponse represents the response data +// for an estimated trade based on price impact. If a trade fails to be +// estimated the response would be 0,0 for input_coin and output_coin and will +// not error. +message EstimateTradeBasedOnPriceImpactResponse { + // input_coin is the actual input amount that would be tradeable + // under the specified price impact. + cosmos.base.v1beta1.Coin input_coin = 1 [ (gogoproto.nullable) = false ]; + + // output_coin is the amount of tokens of the ToCoinDenom type + // that will be received for the actual InputCoin trade. + cosmos.base.v1beta1.Coin output_coin = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.yml b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.yml new file mode 100644 index 00000000..1365a282 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/query.yml @@ -0,0 +1,95 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/poolmanager" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/poolmanager/client" +queries: + Params: + proto_wrapper: + query_func: "k.GetParams" + cli: + cmd: "GetParams" + EstimateSwapExactAmountIn: + proto_wrapper: + query_func: "k.EstimateSwapExactAmountIn" + cli: + cmd: "EstimateSwapExactAmountIn" + EstimateSwapExactAmountInWithPrimitiveTypes: + proto_wrapper: + query_func: "k.EstimateSwapExactAmountInWithPrimitiveTypes" + response: "*queryproto.EstimateSwapExactAmountInResponse" + cli: + cmd: "EstimateSwapExactAmountInWithPrimitiveTypes" + EstimateSwapExactAmountOut: + proto_wrapper: + query_func: "k.EstimateSwapExactAmountOut" + cli: + cmd: "EstimateSwapExactAmountOut" + EstimateSwapExactAmountOutWithPrimitiveTypes: + proto_wrapper: + query_func: "k.EstimateSwapExactAmountOutWithPrimitiveTypes" + response: "*queryproto.EstimateSwapExactAmountOutResponse" + cli: + cmd: "EstimateSwapExactAmountOutWithPrimitiveTypes" + EstimateSinglePoolSwapExactAmountIn: + proto_wrapper: + query_func: "k.EstimateSinglePoolSwapExactAmountIn" + response: "*queryproto.EstimateSwapExactAmountInResponse" + cli: + cmd: "EstimateSinglePoolSwapExactAmountIn" + EstimateSinglePoolSwapExactAmountOut: + proto_wrapper: + query_func: "k.EstimateSinglePoolSwapExactAmountOutTEST" + response: "*queryproto.EstimateSwapExactAmountOutResponse" + cli: + cmd: "EstimateSinglePoolSwapExactAmountOut" + NumPools: + proto_wrapper: + query_func: "k.NumPools" + cli: + cmd: "NumPools" + Pool: + proto_wrapper: + query_func: "k.RoutePool" + cli: + cmd: "Pool" + AllPools: + proto_wrapper: + query_func: "k.AllPools" + cli: + cmd: "AllPools" + SpotPrice: + proto_wrapper: + query_func: "k.RouteCalculateSpotPrice" + cli: + cmd: "SpotPrice" + TotalPoolLiquidity: + proto_wrapper: + query_func: "k.TotalPoolLiquidity" + cli: + cmd: "TotalPoolLiquidity" + TotalLiquidity: + proto_wrapper: + query_func: "k.TotalLiquidity" + cli: + cmd: "TotalLiquidity" + TotalVolumeForPool: + proto_wrapper: + query_func: "k.GetTotalVolumeForPool" + cli: + cmd: "TotalVolumeForPool" + EstimateTradeBasedOnPriceImpact: + proto_wrapper: + query_func: "k.EstimateTradeBasedOnPriceImpact" + response: "*queryproto.EstimateTradeBasedOnPriceImpactResponse" + cli: + cmd: "EstimateTradeBasedOnPriceImpact" + TradingPairTakerFee: + proto_wrapper: + query_func: "k.GetTradingPairTakerFee" + cli: + cmd: "TradingPairTakerFee" + ListPoolsByDenom: + proto_wrapper: + query_func: "k.ListPoolsByDenom" + cli: + cmd: "ListPoolsByDenom" diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/swap_route.proto b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/swap_route.proto new file mode 100644 index 00000000..cade7bdf --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/swap_route.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package osmosis.poolmanager.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types"; + +message SwapAmountInRoute { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_out_denom = 2 + [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; +} + +message SwapAmountOutRoute { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in_denom = 2 + [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ]; +} + +message SwapAmountInSplitRoute { + repeated SwapAmountInRoute pools = 1 + [ (gogoproto.moretags) = "yaml:\"pools\"", (gogoproto.nullable) = false ]; + string token_in_amount = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_amount\"", + (gogoproto.nullable) = false + ]; +} + +message SwapAmountOutSplitRoute { + repeated SwapAmountOutRoute pools = 1 + [ (gogoproto.moretags) = "yaml:\"pools\"", (gogoproto.nullable) = false ]; + string token_out_amount = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_amount\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/tracked_volume.proto b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/tracked_volume.proto new file mode 100644 index 00000000..1f47fdb2 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/tracked_volume.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package osmosis.poolmanager.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types"; + +message TrackedVolume { + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} diff --git a/packages/cosmos/proto/osmosis/poolmanager/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/tx.proto new file mode 100644 index 00000000..f5ac4542 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v1beta1/tx.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; +package osmosis.poolmanager.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/poolmanager/v1beta1/swap_route.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/types"; + +service Msg { + rpc SwapExactAmountIn(MsgSwapExactAmountIn) + returns (MsgSwapExactAmountInResponse); + rpc SwapExactAmountOut(MsgSwapExactAmountOut) + returns (MsgSwapExactAmountOutResponse); + rpc SplitRouteSwapExactAmountIn(MsgSplitRouteSwapExactAmountIn) + returns (MsgSplitRouteSwapExactAmountInResponse); + rpc SplitRouteSwapExactAmountOut(MsgSplitRouteSwapExactAmountOut) + returns (MsgSplitRouteSwapExactAmountOutResponse); + rpc SetDenomPairTakerFee(MsgSetDenomPairTakerFee) + returns (MsgSetDenomPairTakerFeeResponse); +} + +// ===================== MsgSwapExactAmountIn +message MsgSwapExactAmountIn { + option (amino.name) = "osmosis/poolmanager/swap-exact-amount-in"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated SwapAmountInRoute routes = 2 [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin token_in = 3 [ + (gogoproto.moretags) = "yaml:\"token_in\"", + (gogoproto.nullable) = false + ]; + string token_out_min_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_min_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSwapExactAmountInResponse { + string token_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgSplitRouteSwapExactAmountIn +message MsgSplitRouteSwapExactAmountIn { + option (amino.name) = "osmosis/poolmanager/split-amount-in"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated SwapAmountInSplitRoute routes = 2 [ (gogoproto.nullable) = false ]; + string token_in_denom = 3 + [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ]; + string token_out_min_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_min_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSplitRouteSwapExactAmountInResponse { + string token_out_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_out_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgSwapExactAmountOut +message MsgSwapExactAmountOut { + option (amino.name) = "osmosis/poolmanager/swap-exact-amount-out"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated SwapAmountOutRoute routes = 2 [ (gogoproto.nullable) = false ]; + string token_in_max_amount = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_max_amount\"", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin token_out = 4 [ + (gogoproto.moretags) = "yaml:\"token_out\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSwapExactAmountOutResponse { + string token_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgSplitRouteSwapExactAmountOut +message MsgSplitRouteSwapExactAmountOut { + option (amino.name) = "osmosis/poolmanager/split-amount-out"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated SwapAmountOutSplitRoute routes = 2 [ (gogoproto.nullable) = false ]; + string token_out_denom = 3 + [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; + string token_in_max_amount = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_max_amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSplitRouteSwapExactAmountOutResponse { + string token_in_amount = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"token_in_amount\"", + (gogoproto.nullable) = false + ]; +} + +// ===================== MsgSetDenomPairTakerFee +message MsgSetDenomPairTakerFee { + option (amino.name) = "osmosis/poolmanager/set-denom-pair-taker-fee"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated DenomPairTakerFee denom_pair_taker_fee = 2 [ + (gogoproto.moretags) = "yaml:\"denom_pair_taker_fee\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSetDenomPairTakerFeeResponse { bool success = 1; } + +message DenomPairTakerFee { + // denom0 and denom1 get automatically lexigographically sorted + // when being stored, so the order of input here does not matter. + string denom0 = 1 [ (gogoproto.moretags) = "yaml:\"denom0\"" ]; + string denom1 = 2 [ (gogoproto.moretags) = "yaml:\"denom1\"" ]; + string taker_fee = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"taker_fee\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/poolmanager/v2/query.proto b/packages/cosmos/proto/osmosis/poolmanager/v2/query.proto new file mode 100644 index 00000000..f715fec0 --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v2/query.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package osmosis.poolmanager.v2; + +import "gogoproto/gogo.proto"; + +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/poolmanager/client/queryprotov2"; + +service Query { + // SpotPriceV2 defines a gRPC query handler that returns the spot price given + // a base denomination and a quote denomination. + // The returned spot price has 36 decimal places. However, some of + // modules perform sig fig rounding so most of the rightmost decimals can be + // zeroes. + rpc SpotPriceV2(SpotPriceRequest) returns (SpotPriceResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v2/pools/{pool_id}/prices"; + } +} + +// SpotPriceRequest defines the gRPC request structure for a SpotPrice +// query. +message SpotPriceRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string base_asset_denom = 2 + [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; + string quote_asset_denom = 3 + [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; +} + +// SpotPriceResponse defines the gRPC response structure for a SpotPrice +// query. +message SpotPriceResponse { + // String of the BigDec. Ex) 10.203uatom + string spot_price = 1 [ + (gogoproto.customtype) = "github.com/osmosis-labs/osmosis/osmomath.BigDec", + (gogoproto.moretags) = "yaml:\"spot_price\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/poolmanager/v2/query.yml b/packages/cosmos/proto/osmosis/poolmanager/v2/query.yml new file mode 100644 index 00000000..ccf0456b --- /dev/null +++ b/packages/cosmos/proto/osmosis/poolmanager/v2/query.yml @@ -0,0 +1,10 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/poolmanager" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/poolmanager/client" +queries: + SpotPrice: + proto_wrapper: + query_func: "k.RouteCalculateSpotPrice" + cli: + cmd: "SpotPrice" diff --git a/packages/cosmos/proto/osmosis/protorev/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/protorev/v1beta1/genesis.proto new file mode 100644 index 00000000..4debe3aa --- /dev/null +++ b/packages/cosmos/proto/osmosis/protorev/v1beta1/genesis.proto @@ -0,0 +1,72 @@ +syntax = "proto3"; +package osmosis.protorev.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/protorev/v1beta1/protorev.proto"; +import "osmosis/protorev/v1beta1/params.proto"; +import "cosmos_proto/cosmos.proto"; + +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/protorev/types"; + +// GenesisState defines the protorev module's genesis state. +message GenesisState { + // Parameters for the protorev module. + Params params = 1 [ (gogoproto.nullable) = false ]; + // Token pair arb routes for the protorev module (hot routes). + repeated TokenPairArbRoutes token_pair_arb_routes = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"token_pair_arb_routes\"" + ]; + // The base denominations being used to create cyclic arbitrage routes via the + // highest liquidity method. + repeated BaseDenom base_denoms = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"base_denoms\"" + ]; + // DEPRECATED: pool_weights are weights that are being used to calculate the + // compute cost of each route. This field is deprecated. + // It is replaced by the `info_by_pool_type` field. + reserved 4; + // The number of days since module genesis. + uint64 days_since_module_genesis = 5 + [ (gogoproto.moretags) = "yaml:\"days_since_module_genesis\"" ]; + // The fees the developer account has accumulated over time. + repeated cosmos.base.v1beta1.Coin developer_fees = 6 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"developer_fees\"" + ]; + // The latest block height that the module has processed. + uint64 latest_block_height = 7 + [ (gogoproto.moretags) = "yaml:\"latest_block_height\"" ]; + // The developer account address of the module. + string developer_address = 8 [ + (cosmos_proto.scalar) = "cosmos.Address", + (gogoproto.moretags) = "yaml:\"developer_address\"" + ]; + // Max pool points per block i.e. the maximum compute time (in ms) + // that protorev can use per block. + uint64 max_pool_points_per_block = 9 + [ (gogoproto.moretags) = "yaml:\"max_pool_points_per_block\"" ]; + // Max pool points per tx i.e. the maximum compute time (in ms) that + // protorev can use per tx. + uint64 max_pool_points_per_tx = 10 + [ (gogoproto.moretags) = "yaml:\"max_pool_points_per_tx\"" ]; + // The number of pool points that have been consumed in the current block. + uint64 point_count_for_block = 11 + [ (gogoproto.moretags) = "yaml:\"point_count_for_block\"" ]; + // All of the profits that have been accumulated by the module. + repeated cosmos.base.v1beta1.Coin profits = 12 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"profits\"" + ]; + // Information that is used to estimate execution time / gas + // consumption of a swap on a given pool type. + InfoByPoolType info_by_pool_type = 13 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"info_by_pool_type\"" + ]; + CyclicArbTracker cyclic_arb_tracker = 14 + [ (gogoproto.moretags) = "yaml:\"cyclic_arb_tracker\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/protorev/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/protorev/v1beta1/gov.proto new file mode 100644 index 00000000..51866ad2 --- /dev/null +++ b/packages/cosmos/proto/osmosis/protorev/v1beta1/gov.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package osmosis.protorev.v1beta1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "osmosis/protorev/v1beta1/protorev.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/protorev/types"; + +// SetProtoRevEnabledProposal is a gov Content type to update whether the +// protorev module is enabled +message SetProtoRevEnabledProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/SetProtoRevEnabledProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + bool enabled = 3; +} + +// SetProtoRevAdminAccountProposal is a gov Content type to set the admin +// account that will receive permissions to alter hot routes and set the +// developer address that will be receiving a share of profits from the module +message SetProtoRevAdminAccountProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/SetProtoRevAdminAccountProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string account = 3; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/protorev/v1beta1/params.proto b/packages/cosmos/proto/osmosis/protorev/v1beta1/params.proto new file mode 100644 index 00000000..443179c1 --- /dev/null +++ b/packages/cosmos/proto/osmosis/protorev/v1beta1/params.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package osmosis.protorev.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/protorev/types"; + +// Params defines the parameters for the module. +message Params { + // Boolean whether the protorev module is enabled. + bool enabled = 1 [ (gogoproto.moretags) = "yaml:\"enabled\"" ]; + // The admin account (settings manager) of the protorev module. + string admin = 2 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/protorev/v1beta1/protorev.proto b/packages/cosmos/proto/osmosis/protorev/v1beta1/protorev.proto new file mode 100644 index 00000000..4c3bca4e --- /dev/null +++ b/packages/cosmos/proto/osmosis/protorev/v1beta1/protorev.proto @@ -0,0 +1,218 @@ +syntax = "proto3"; +package osmosis.protorev.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/poolmanager/v1beta1/genesis.proto"; +import "osmosis/txfees/v1beta1/genesis.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/protorev/types"; + +// TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens +message TokenPairArbRoutes { + option (gogoproto.equal) = true; + + // Stores all of the possible hot paths for a given pair of tokens + repeated Route arb_routes = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"arb_routes\"" + ]; + // Token denomination of the first asset + string token_in = 2 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + // Token denomination of the second asset + string token_out = 3 [ (gogoproto.moretags) = "yaml:\"token_out\"" ]; +} + +// Route is a hot route for a given pair of tokens +message Route { + option (gogoproto.equal) = true; + + // The pool IDs that are traversed in the directed cyclic graph (traversed + // left + // -> right) + repeated Trade trades = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"trades\"" + ]; + // The step size that will be used to find the optimal swap amount in the + // binary search + string step_size = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step_size\"" + ]; +} + +// Trade is a single trade in a route +message Trade { + option (gogoproto.equal) = true; + + // The pool id of the pool that is traded on + uint64 pool = 1 [ (gogoproto.moretags) = "yaml:\"pool\"" ]; + // The denom of the token that is traded + string token_in = 2 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + // The denom of the token that is received + string token_out = 3 [ (gogoproto.moretags) = "yaml:\"token_out\"" ]; +} + +// RouteStatistics contains the number of trades the module has executed after a +// swap on a given route and the profits from the trades +message RouteStatistics { + // profits is the total profit from all trades on this route + repeated cosmos.base.v1beta1.Coin profits = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"profits\"" + ]; + // number_of_trades is the number of trades the module has executed using this + // route + string number_of_trades = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"number_of_trades\"" + ]; + // route is the route that was used (pool ids along the arbitrage route) + repeated uint64 route = 3 [ (gogoproto.moretags) = "yaml:\"route\"" ]; +} + +// PoolWeights contains the weights of all of the different pool types. This +// distinction is made and necessary because the execution time ranges +// significantly between the different pool types. Each weight roughly +// corresponds to the amount of time (in ms) it takes to execute a swap on that +// pool type. +// +// DEPRECATED: This field is deprecated and will be removed in the next +// release. It is replaced by the `info_by_pool_type` field. +message PoolWeights { + // The weight of a stableswap pool + uint64 stable_weight = 1 [ (gogoproto.moretags) = "yaml:\"stable_weight\"" ]; + // The weight of a balancer pool + uint64 balancer_weight = 2 + [ (gogoproto.moretags) = "yaml:\"balancer_weight\"" ]; + // The weight of a concentrated pool + uint64 concentrated_weight = 3 + [ (gogoproto.moretags) = "yaml:\"concentrated_weight\"" ]; + // The weight of a cosmwasm pool + uint64 cosmwasm_weight = 4 + [ (gogoproto.moretags) = "yaml:\"cosmwasm_weight\"" ]; +} + +// InfoByPoolType contains information pertaining to how expensive (in terms of +// gas and time) it is to execute a swap on a given pool type. This distinction +// is made and necessary because the execution time ranges significantly between +// the different pool types. +message InfoByPoolType { + // The stable pool info + StablePoolInfo stable = 1 [ + (gogoproto.moretags) = "yaml:\"stable\"", + (gogoproto.nullable) = false + ]; + // The balancer pool info + BalancerPoolInfo balancer = 2 [ + (gogoproto.moretags) = "yaml:\"balancer\"", + (gogoproto.nullable) = false + ]; + // The concentrated pool info + ConcentratedPoolInfo concentrated = 3 [ + (gogoproto.moretags) = "yaml:\"concentrated\"", + (gogoproto.nullable) = false + ]; + // The cosmwasm pool info + CosmwasmPoolInfo cosmwasm = 4 [ + (gogoproto.moretags) = "yaml:\"cosmwasm\"", + (gogoproto.nullable) = false + ]; +} + +// StablePoolInfo contains meta data pertaining to a stableswap pool type. +message StablePoolInfo { + // The weight of a stableswap pool + uint64 weight = 1 [ (gogoproto.moretags) = "yaml:\"weight\"" ]; +} + +// BalancerPoolInfo contains meta data pertaining to a balancer pool type. +message BalancerPoolInfo { + // The weight of a balancer pool + uint64 weight = 1 [ (gogoproto.moretags) = "yaml:\"weight\"" ]; +} + +// ConcentratedPoolInfo contains meta data pertaining to a concentrated pool +// type. +message ConcentratedPoolInfo { + // The weight of a concentrated pool + uint64 weight = 1 [ (gogoproto.moretags) = "yaml:\"weight\"" ]; + // The maximum number of ticks we can move when rebalancing + uint64 max_ticks_crossed = 2 + [ (gogoproto.moretags) = "yaml:\"max_ticks_crossed\"" ]; +} + +// CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. +message CosmwasmPoolInfo { + // The weight of a cosmwasm pool (by contract address) + repeated WeightMap weight_maps = 1 [ + (gogoproto.moretags) = "yaml:\"weight_maps\"", + (gogoproto.nullable) = false + ]; +} + +// WeightMap maps a contract address to a weight. The weight of an address +// corresponds to the amount of ms required to execute a swap on that contract. +message WeightMap { + // The weight of a cosmwasm pool (by contract address) + uint64 weight = 1 [ (gogoproto.moretags) = "yaml:\"weight\"" ]; + // The contract address + string contract_address = 2 + [ (gogoproto.moretags) = "yaml:\"contract_address\"" ]; +} + +// BaseDenom represents a single base denom that the module uses for its +// arbitrage trades. It contains the denom name alongside the step size of the +// binary search that is used to find the optimal swap amount +message BaseDenom { + // The denom i.e. name of the base denom (ex. uosmo) + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + // The step size of the binary search that is used to find the optimal swap + // amount + string step_size = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step_size\"" + ]; +} + +// BaseDenoms represents all of the base denoms that the module uses for its +// arbitrage trades. +message BaseDenoms { + repeated BaseDenom base_denoms = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"base_denoms\"" + ]; +} + +message AllProtocolRevenue { + osmosis.poolmanager.v1beta1.TakerFeesTracker taker_fees_tracker = 1 [ + (gogoproto.moretags) = "yaml:\"taker_fees_tracker\"", + (gogoproto.nullable) = false + ]; + // osmosis.txfees.v1beta1.TxFeesTracker tx_fees_tracker = 2 [ + // (gogoproto.moretags) = "yaml:\"tx_fees_tracker\"", + // (gogoproto.nullable) = false + // ]; + reserved 2; // Reserve the field number + reserved "tx_fees_tracker"; // Reserve the field name + CyclicArbTracker cyclic_arb_tracker = 3 [ + (gogoproto.moretags) = "yaml:\"cyclic_arb_tracker\"", + (gogoproto.nullable) = false + ]; +} + +message CyclicArbTracker { + repeated cosmos.base.v1beta1.Coin cyclic_arb = 1 + [ (gogoproto.nullable) = false ]; + int64 height_accounting_starts_from = 2 + [ (gogoproto.moretags) = "yaml:\"height_accounting_starts_from\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/protorev/v1beta1/query.proto b/packages/cosmos/proto/osmosis/protorev/v1beta1/query.proto new file mode 100644 index 00000000..2e08e5ce --- /dev/null +++ b/packages/cosmos/proto/osmosis/protorev/v1beta1/query.proto @@ -0,0 +1,343 @@ +syntax = "proto3"; +package osmosis.protorev.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/protorev/v1beta1/params.proto"; +import "osmosis/protorev/v1beta1/protorev.proto"; + +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/protorev/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/protorev/params"; + } + + // GetProtoRevNumberOfTrades queries the number of arbitrage trades the module + // has executed + rpc GetProtoRevNumberOfTrades(QueryGetProtoRevNumberOfTradesRequest) + returns (QueryGetProtoRevNumberOfTradesResponse) { + option (google.api.http).get = "/osmosis/protorev/number_of_trades"; + } + + // GetProtoRevProfitsByDenom queries the profits of the module by denom + rpc GetProtoRevProfitsByDenom(QueryGetProtoRevProfitsByDenomRequest) + returns (QueryGetProtoRevProfitsByDenomResponse) { + option (google.api.http).get = "/osmosis/protorev/profits_by_denom"; + } + + // GetProtoRevAllProfits queries all of the profits from the module + rpc GetProtoRevAllProfits(QueryGetProtoRevAllProfitsRequest) + returns (QueryGetProtoRevAllProfitsResponse) { + option (google.api.http).get = "/osmosis/protorev/all_profits"; + } + + // GetProtoRevStatisticsByRoute queries the number of arbitrages and profits + // that have been executed for a given route + rpc GetProtoRevStatisticsByRoute(QueryGetProtoRevStatisticsByRouteRequest) + returns (QueryGetProtoRevStatisticsByRouteResponse) { + option (google.api.http).get = "/osmosis/protorev/statistics_by_route"; + } + + // GetProtoRevAllRouteStatistics queries all of routes that the module has + // arbitraged against and the number of trades and profits that have been + // accumulated for each route + rpc GetProtoRevAllRouteStatistics(QueryGetProtoRevAllRouteStatisticsRequest) + returns (QueryGetProtoRevAllRouteStatisticsResponse) { + option (google.api.http).get = "/osmosis/protorev/all_route_statistics"; + } + + // GetProtoRevTokenPairArbRoutes queries all of the hot routes that the module + // is currently arbitraging + rpc GetProtoRevTokenPairArbRoutes(QueryGetProtoRevTokenPairArbRoutesRequest) + returns (QueryGetProtoRevTokenPairArbRoutesResponse) { + option (google.api.http).get = "/osmosis/protorev/token_pair_arb_routes"; + } + + // GetProtoRevAdminAccount queries the admin account of the module + rpc GetProtoRevAdminAccount(QueryGetProtoRevAdminAccountRequest) + returns (QueryGetProtoRevAdminAccountResponse) { + option (google.api.http).get = "/osmosis/protorev/admin_account"; + } + + // GetProtoRevDeveloperAccount queries the developer account of the module + rpc GetProtoRevDeveloperAccount(QueryGetProtoRevDeveloperAccountRequest) + returns (QueryGetProtoRevDeveloperAccountResponse) { + option (google.api.http).get = "/osmosis/protorev/developer_account"; + } + + // GetProtoRevInfoByPoolType queries pool type information that is currently + // being utilized by the module + rpc GetProtoRevInfoByPoolType(QueryGetProtoRevInfoByPoolTypeRequest) + returns (QueryGetProtoRevInfoByPoolTypeResponse) { + option (google.api.http).get = "/osmosis/protorev/info_by_pool_type"; + } + + // GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points + // that can be consumed per transaction + rpc GetProtoRevMaxPoolPointsPerTx(QueryGetProtoRevMaxPoolPointsPerTxRequest) + returns (QueryGetProtoRevMaxPoolPointsPerTxResponse) { + option (google.api.http).get = "/osmosis/protorev/max_pool_points_per_tx"; + } + + // GetProtoRevMaxPoolPointsPerBlock queries the maximum number of pool points + // that can consumed per block + rpc GetProtoRevMaxPoolPointsPerBlock( + QueryGetProtoRevMaxPoolPointsPerBlockRequest) + returns (QueryGetProtoRevMaxPoolPointsPerBlockResponse) { + option (google.api.http).get = + "/osmosis/protorev/max_pool_points_per_block"; + } + + // GetProtoRevBaseDenoms queries the base denoms that the module is currently + // utilizing for arbitrage + rpc GetProtoRevBaseDenoms(QueryGetProtoRevBaseDenomsRequest) + returns (QueryGetProtoRevBaseDenomsResponse) { + option (google.api.http).get = "/osmosis/protorev/base_denoms"; + } + + // GetProtoRevEnabled queries whether the module is enabled or not + rpc GetProtoRevEnabled(QueryGetProtoRevEnabledRequest) + returns (QueryGetProtoRevEnabledResponse) { + option (google.api.http).get = "/osmosis/protorev/enabled"; + } + + // GetProtoRevPool queries the pool id used via the highest liquidity method + // for arbitrage route building given a pair of denominations + rpc GetProtoRevPool(QueryGetProtoRevPoolRequest) + returns (QueryGetProtoRevPoolResponse) { + option (google.api.http).get = "/osmosis/protorev/pool"; + } + + // GetAllProtocolRevenue queries all of the protocol revenue that has been + // accumulated by any module + rpc GetAllProtocolRevenue(QueryGetAllProtocolRevenueRequest) + returns (QueryGetAllProtocolRevenueResponse) { + option (google.api.http).get = "/osmosis/protorev/all_protocol_revenue"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"params\"" + ]; +} + +// QueryGetProtoRevNumberOfTradesRequest is request type for the +// Query/GetProtoRevNumberOfTrades RPC method. +message QueryGetProtoRevNumberOfTradesRequest {} + +// QueryGetProtoRevNumberOfTradesResponse is response type for the +// Query/GetProtoRevNumberOfTrades RPC method. +message QueryGetProtoRevNumberOfTradesResponse { + // number_of_trades is the number of trades the module has executed + string number_of_trades = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"number_of_trades\"" + ]; +} + +// QueryGetProtoRevProfitsByDenomRequest is request type for the +// Query/GetProtoRevProfitsByDenom RPC method. +message QueryGetProtoRevProfitsByDenomRequest { + // denom is the denom to query profits by + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryGetProtoRevProfitsByDenomResponse is response type for the +// Query/GetProtoRevProfitsByDenom RPC method. +message QueryGetProtoRevProfitsByDenomResponse { + // profit is the profits of the module by the selected denom + cosmos.base.v1beta1.Coin profit = 1 + [ (gogoproto.moretags) = "yaml:\"profit\"" ]; +} + +// QueryGetProtoRevAllProfitsRequest is request type for the +// Query/GetProtoRevAllProfits RPC method. +message QueryGetProtoRevAllProfitsRequest {} + +// QueryGetProtoRevAllProfitsResponse is response type for the +// Query/GetProtoRevAllProfits RPC method. +message QueryGetProtoRevAllProfitsResponse { + // profits is a list of all of the profits from the module + repeated cosmos.base.v1beta1.Coin profits = 1 [ + (gogoproto.moretags) = "yaml:\"profits\"", + (gogoproto.nullable) = false + ]; +} + +// QueryGetProtoRevStatisticsByPoolRequest is request type for the +// Query/GetProtoRevStatisticsByRoute RPC method. +message QueryGetProtoRevStatisticsByRouteRequest { + // route is the set of pool ids to query statistics by i.e. 1,2,3 + repeated uint64 route = 1 [ (gogoproto.moretags) = "yaml:\"route\"" ]; +} + +// QueryGetProtoRevStatisticsByRouteResponse is response type for the +// Query/GetProtoRevStatisticsByRoute RPC method. +message QueryGetProtoRevStatisticsByRouteResponse { + // statistics contains the number of trades the module has executed after a + // swap on a given pool and the profits from the trades + RouteStatistics statistics = 1 [ + (gogoproto.moretags) = "yaml:\"statistics\"", + (gogoproto.nullable) = false + ]; +} + +// QueryGetProtoRevAllRouteStatisticsRequest is request type for the +// Query/GetProtoRevAllRouteStatistics RPC method. +message QueryGetProtoRevAllRouteStatisticsRequest {} + +// QueryGetProtoRevAllRouteStatisticsResponse is response type for the +// Query/GetProtoRevAllRouteStatistics RPC method. +message QueryGetProtoRevAllRouteStatisticsResponse { + // statistics contains the number of trades/profits the module has executed on + // all routes it has successfully executed a trade on + repeated RouteStatistics statistics = 1 [ + (gogoproto.moretags) = "yaml:\"statistics\"", + (gogoproto.nullable) = false + ]; +} + +// QueryGetProtoRevTokenPairArbRoutesRequest is request type for the +// Query/GetProtoRevTokenPairArbRoutes RPC method. +message QueryGetProtoRevTokenPairArbRoutesRequest {} + +// QueryGetProtoRevTokenPairArbRoutesResponse is response type for the +// Query/GetProtoRevTokenPairArbRoutes RPC method. +message QueryGetProtoRevTokenPairArbRoutesResponse { + // routes is a list of all of the hot routes that the module is currently + // arbitraging + repeated TokenPairArbRoutes routes = 1 [ + (gogoproto.moretags) = "yaml:\"routes\"", + (gogoproto.nullable) = false + ]; +} + +// QueryGetProtoRevAdminAccountRequest is request type for the +// Query/GetProtoRevAdminAccount RPC method. +message QueryGetProtoRevAdminAccountRequest {} + +// QueryGetProtoRevAdminAccountResponse is response type for the +// Query/GetProtoRevAdminAccount RPC method. +message QueryGetProtoRevAdminAccountResponse { + // admin_account is the admin account of the module + string admin_account = 1 [ (gogoproto.moretags) = "yaml:\"admin_account\"" ]; +} + +// QueryGetProtoRevDeveloperAccountRequest is request type for the +// Query/GetProtoRevDeveloperAccount RPC method. +message QueryGetProtoRevDeveloperAccountRequest {} + +// QueryGetProtoRevDeveloperAccountResponse is response type for the +// Query/GetProtoRevDeveloperAccount RPC method. +message QueryGetProtoRevDeveloperAccountResponse { + // developer_account is the developer account of the module + string developer_account = 1 + [ (gogoproto.moretags) = "yaml:\"developer_account\"" ]; +} + +// QueryGetProtoRevInfoByPoolTypeRequest is request type for the +// Query/GetProtoRevInfoByPoolType RPC method. +message QueryGetProtoRevInfoByPoolTypeRequest {} + +// QueryGetProtoRevInfoByPoolTypeResponse is response type for the +// Query/GetProtoRevInfoByPoolType RPC method. +message QueryGetProtoRevInfoByPoolTypeResponse { + // InfoByPoolType contains all information pertaining to how different + // pool types are handled by the module. + InfoByPoolType info_by_pool_type = 1 [ + (gogoproto.moretags) = "yaml:\"info_by_pool_type\"", + (gogoproto.nullable) = false + ]; +} + +// QueryGetProtoRevMaxPoolPointsPerBlockRequest is request type for the +// Query/GetProtoRevMaxPoolPointsPerBlock RPC method. +message QueryGetProtoRevMaxPoolPointsPerBlockRequest {} + +// QueryGetProtoRevMaxPoolPointsPerBlockResponse is response type for the +// Query/GetProtoRevMaxPoolPointsPerBlock RPC method. +message QueryGetProtoRevMaxPoolPointsPerBlockResponse { + // max_pool_points_per_block is the maximum number of pool points that can be + // consumed per block + uint64 max_pool_points_per_block = 1 + [ (gogoproto.moretags) = "yaml:\"max_pool_points_per_block\"" ]; +} + +// QueryGetProtoRevMaxPoolPointsPerTxRequest is request type for the +// Query/GetProtoRevMaxPoolPointsPerTx RPC method. +message QueryGetProtoRevMaxPoolPointsPerTxRequest {} + +// QueryGetProtoRevMaxPoolPointsPerTxResponse is response type for the +// Query/GetProtoRevMaxPoolPointsPerTx RPC method. +message QueryGetProtoRevMaxPoolPointsPerTxResponse { + // max_pool_points_per_tx is the maximum number of pool points that can be + // consumed per transaction + uint64 max_pool_points_per_tx = 1 + [ (gogoproto.moretags) = "yaml:\"max_pool_points_per_tx\"" ]; +} + +// QueryGetProtoRevBaseDenomsRequest is request type for the +// Query/GetProtoRevBaseDenoms RPC method. +message QueryGetProtoRevBaseDenomsRequest {} + +// QueryGetProtoRevBaseDenomsResponse is response type for the +// Query/GetProtoRevBaseDenoms RPC method. +message QueryGetProtoRevBaseDenomsResponse { + // base_denoms is a list of all of the base denoms and step sizes + repeated BaseDenom base_denoms = 1 [ + (gogoproto.moretags) = "yaml:\"base_denoms\"", + (gogoproto.nullable) = false + ]; +} + +// QueryGetProtoRevEnabledRequest is request type for the +// Query/GetProtoRevEnabled RPC method. +message QueryGetProtoRevEnabledRequest {} + +// QueryGetProtoRevEnabledResponse is response type for the +// Query/GetProtoRevEnabled RPC method. +message QueryGetProtoRevEnabledResponse { + // enabled is whether the module is enabled + bool enabled = 1 [ (gogoproto.moretags) = "yaml:\"enabled\"" ]; +} + +// QueryGetProtoRevPoolRequest is request type for the +// Query/GetProtoRevPool RPC method. +message QueryGetProtoRevPoolRequest { + // base_denom is the base denom set in protorev for the denom pair to pool + // mapping + string base_denom = 1 [ (gogoproto.moretags) = "yaml:\"base_denom\"" ]; + // other_denom is the other denom for the denom pair to pool mapping + string other_denom = 2 [ (gogoproto.moretags) = "yaml:\"other_denom\"" ]; +} + +// QueryGetProtoRevPoolResponse is response type for the +// Query/GetProtoRevPool RPC method. +message QueryGetProtoRevPoolResponse { + // pool_id is the pool_id stored for the denom pair + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message QueryGetAllProtocolRevenueRequest {} + +message QueryGetAllProtocolRevenueResponse { + AllProtocolRevenue all_protocol_revenue = 1 [ + (gogoproto.moretags) = "yaml:\"all_protocol_revenue\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/protorev/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/protorev/v1beta1/tx.proto new file mode 100644 index 00000000..2de54c73 --- /dev/null +++ b/packages/cosmos/proto/osmosis/protorev/v1beta1/tx.proto @@ -0,0 +1,170 @@ +syntax = "proto3"; +package osmosis.protorev.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "google/api/annotations.proto"; +import "osmosis/protorev/v1beta1/protorev.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/protorev/types"; + +service Msg { + // SetHotRoutes sets the hot routes that will be explored when creating + // cyclic arbitrage routes. Can only be called by the admin account. + rpc SetHotRoutes(MsgSetHotRoutes) returns (MsgSetHotRoutesResponse) { + option (google.api.http).post = "/osmosis/protorev/set_hot_routes"; + }; + + // SetDeveloperAccount sets the account that can withdraw a portion of the + // profits from the protorev module. This will be Skip's address. + rpc SetDeveloperAccount(MsgSetDeveloperAccount) + returns (MsgSetDeveloperAccountResponse) { + option (google.api.http).post = "/osmosis/protorev/set_developer_account"; + }; + + // SetMaxPoolPointsPerTx sets the maximum number of pool points that can be + // consumed per transaction. Can only be called by the admin account. + rpc SetMaxPoolPointsPerTx(MsgSetMaxPoolPointsPerTx) + returns (MsgSetMaxPoolPointsPerTxResponse) { + option (google.api.http).post = + "/osmosis/protorev/set_max_pool_points_per_tx"; + }; + + // SetMaxPoolPointsPerBlock sets the maximum number of pool points that can be + // consumed per block. Can only be called by the admin account. + rpc SetMaxPoolPointsPerBlock(MsgSetMaxPoolPointsPerBlock) + returns (MsgSetMaxPoolPointsPerBlockResponse) { + option (google.api.http).post = + "/osmosis/protorev/set_max_pool_points_per_block"; + }; + + // SetInfoByPoolType sets the pool type information needed to make smart + // assumptions about swapping on different pool types + rpc SetInfoByPoolType(MsgSetInfoByPoolType) + returns (MsgSetInfoByPoolTypeResponse) { + option (google.api.http).post = "/osmosis/protorev/set_info_by_pool_type"; + }; + + // SetBaseDenoms sets the base denoms that will be used to create cyclic + // arbitrage routes. Can only be called by the admin account. + rpc SetBaseDenoms(MsgSetBaseDenoms) returns (MsgSetBaseDenomsResponse) { + option (google.api.http).post = "/osmosis/protorev/set_base_denoms"; + }; +} + +// MsgSetHotRoutes defines the Msg/SetHotRoutes request type. +message MsgSetHotRoutes { + option (amino.name) = "osmosis/MsgSetHotRoutes"; + + // admin is the account that is authorized to set the hot routes. + string admin = 1 [ + (gogoproto.moretags) = "yaml:\"admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // hot_routes is the list of hot routes to set. + repeated TokenPairArbRoutes hot_routes = 2 [ + (gogoproto.moretags) = "yaml:\"hot_routes\"", + (gogoproto.nullable) = false + ]; +} + +// MsgSetHotRoutesResponse defines the Msg/SetHotRoutes response type. +message MsgSetHotRoutesResponse {} + +// MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. +message MsgSetDeveloperAccount { + option (amino.name) = "osmosis/MsgSetDeveloperAccount"; + + // admin is the account that is authorized to set the developer account. + string admin = 1 [ + (gogoproto.moretags) = "yaml:\"admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // developer_account is the account that will receive a portion of the profits + // from the protorev module. + string developer_account = 2 + [ (gogoproto.moretags) = "yaml:\"developer_account\"" ]; +} + +// MsgSetDeveloperAccountResponse defines the Msg/SetDeveloperAccount response +// type. +message MsgSetDeveloperAccountResponse {} + +// MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. +message MsgSetInfoByPoolType { + option (amino.name) = "osmosis/MsgSetInfoByPoolType"; + + // admin is the account that is authorized to set the pool weights. + string admin = 1 [ + (gogoproto.moretags) = "yaml:\"admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // info_by_pool_type contains information about the pool types. + InfoByPoolType info_by_pool_type = 2 [ + (gogoproto.moretags) = "yaml:\"info_by_pool_type\"", + (gogoproto.nullable) = false + ]; +} + +// MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. +message MsgSetInfoByPoolTypeResponse {} + +// MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. +message MsgSetMaxPoolPointsPerTx { + option (amino.name) = "osmosis/MsgSetMaxPoolPointsPerTx"; + + // admin is the account that is authorized to set the max pool points per tx. + string admin = 1 [ + (gogoproto.moretags) = "yaml:\"admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // max_pool_points_per_tx is the maximum number of pool points that can be + // consumed per transaction. + uint64 max_pool_points_per_tx = 2 + [ (gogoproto.moretags) = "yaml:\"max_pool_points_per_tx\"" ]; +} + +// MsgSetMaxPoolPointsPerTxResponse defines the Msg/SetMaxPoolPointsPerTx +// response type. +message MsgSetMaxPoolPointsPerTxResponse {} + +// MsgSetMaxPoolPointsPerBlock defines the Msg/SetMaxPoolPointsPerBlock request +// type. +message MsgSetMaxPoolPointsPerBlock { + option (amino.name) = "osmosis/MsgSetPoolWeights"; + + // admin is the account that is authorized to set the max pool points per + // block. + string admin = 1 [ + (gogoproto.moretags) = "yaml:\"admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // max_pool_points_per_block is the maximum number of pool points that can be + // consumed per block. + uint64 max_pool_points_per_block = 2 + [ (gogoproto.moretags) = "yaml:\"max_pool_points_per_block\"" ]; +} + +// MsgSetMaxPoolPointsPerBlockResponse defines the +// Msg/SetMaxPoolPointsPerBlock response type. +message MsgSetMaxPoolPointsPerBlockResponse {} + +// MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. +message MsgSetBaseDenoms { + option (amino.name) = "osmosis/MsgSetBaseDenoms"; + + // admin is the account that is authorized to set the base denoms. + string admin = 1 [ + (gogoproto.moretags) = "yaml:\"admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // base_denoms is the list of base denoms to set. + repeated BaseDenom base_denoms = 2 [ + (gogoproto.moretags) = "yaml:\"base_denoms\"", + (gogoproto.nullable) = false + ]; +} + +// MsgSetBaseDenomsResponse defines the Msg/SetBaseDenoms response type. +message MsgSetBaseDenomsResponse {} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/smartaccount/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/genesis.proto new file mode 100644 index 00000000..8014a21b --- /dev/null +++ b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/genesis.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/smartaccount/v1beta1/params.proto"; +import "osmosis/smartaccount/v1beta1/models.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/smart-account/types"; + +// AuthenticatorData represents a genesis exported account with Authenticators. +// The address is used as the key, and the account authenticators are stored in +// the authenticators field. +message AuthenticatorData { + // address is an account address, one address can have many authenticators + string address = 1; + + // authenticators are the account's authenticators, these can be multiple + // types including SignatureVerificationAuthenticator, AllOfAuthenticators and + // CosmWasmAuthenticators. + repeated AccountAuthenticator authenticators = 2 + [ (gogoproto.nullable) = false ]; +} + +// GenesisState defines the authenticator module's genesis state. +message GenesisState { + // params define the parameters for the authenticator module. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // next_authenticator_id is the next available authenticator ID. + uint64 next_authenticator_id = 2; + + // authenticator_data contains the data for multiple accounts, each with their + // authenticators. + repeated AuthenticatorData authenticator_data = 3 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/smartaccount/v1beta1/models.proto b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/models.proto new file mode 100644 index 00000000..aa8975a2 --- /dev/null +++ b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/models.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/smart-account/types"; + +// AccountAuthenticator represents a foundational model for all authenticators. +// It provides extensibility by allowing concrete types to interpret and +// validate transactions based on the encapsulated data. +message AccountAuthenticator { + // ID uniquely identifies the authenticator instance. + uint64 id = 1; + + // Type specifies the category of the AccountAuthenticator. + // This type information is essential for differentiating authenticators + // and ensuring precise data retrieval from the storage layer. + string type = 2; + + // Data is a versatile field used in conjunction with the specific type of + // account authenticator to facilitate complex authentication processes. + // The interpretation of this field is overloaded, enabling multiple + // authenticators to utilize it for their respective purposes. + bytes data = 3; +} diff --git a/packages/cosmos/proto/osmosis/smartaccount/v1beta1/params.proto b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/params.proto new file mode 100644 index 00000000..cebbdee8 --- /dev/null +++ b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/params.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/smart-account/types"; + +// Params defines the parameters for the module. +message Params { + // MaximumUnauthenticatedGas defines the maximum amount of gas that can be + // used to authenticate a transaction in ante handler without having fee payer + // authenticated. + uint64 maximum_unauthenticated_gas = 1 + [ (gogoproto.moretags) = "yaml:\"maximum_unauthenticated_gas\"" ]; + + // IsSmartAccountActive defines the state of the authenticator. + // If set to false, the authenticator module will not be used + // and the classic cosmos sdk authentication will be used instead. + bool is_smart_account_active = 2 + [ (gogoproto.moretags) = "yaml:\"is_smart_account_active\"" ]; + + // CircuitBreakerControllers defines list of addresses that are allowed to + // set is_smart_account_active without going through governance. + repeated string circuit_breaker_controllers = 3 + [ (gogoproto.moretags) = "yaml:\"circuit_breaker_controllers\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/smartaccount/v1beta1/query.proto b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/query.proto new file mode 100644 index 00000000..aa7cc881 --- /dev/null +++ b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/query.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/smartaccount/v1beta1/params.proto"; +import "osmosis/smartaccount/v1beta1/models.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/smart-account/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/smartaccount/params"; + } + + rpc GetAuthenticators(GetAuthenticatorsRequest) + returns (GetAuthenticatorsResponse) { + option (google.api.http).get = + "/osmosis/smartaccount/authenticators/{account}"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. +message GetAuthenticatorsRequest { string account = 1; } + +// MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. +message GetAuthenticatorsResponse { + repeated AccountAuthenticator account_authenticators = 1; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/smartaccount/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/tx.proto new file mode 100644 index 00000000..d3342026 --- /dev/null +++ b/packages/cosmos/proto/osmosis/smartaccount/v1beta1/tx.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/smart-account/types"; + +// Msg defines the Msg service. +service Msg { + rpc AddAuthenticator(MsgAddAuthenticator) + returns (MsgAddAuthenticatorResponse); + rpc RemoveAuthenticator(MsgRemoveAuthenticator) + returns (MsgRemoveAuthenticatorResponse); + + // SetActiveState sets the active state of the authenticator. + // Primarily used for circuit breaking. + rpc SetActiveState(MsgSetActiveState) returns (MsgSetActiveStateResponse); +} + +// MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. +message MsgAddAuthenticator { + string sender = 1; + string type = 2; + bytes data = 3; +} + +// MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. +message MsgAddAuthenticatorResponse { bool success = 1; } + +// MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request +// type. +message MsgRemoveAuthenticator { + string sender = 1; + uint64 id = 2; +} + +// MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response +// type. +message MsgRemoveAuthenticatorResponse { bool success = 1; } + +message MsgSetActiveState { + string sender = 1; + bool active = 2; +} + +message MsgSetActiveStateResponse {} + +// TxExtension allows for additional authenticator-specific data in +// transactions. +message TxExtension { + // selected_authenticators holds the authenticator_id for the chosen + // authenticator per message. + repeated uint64 selected_authenticators = 1; +} diff --git a/packages/cosmos/proto/osmosis/store/v1beta1/tree.proto b/packages/cosmos/proto/osmosis/store/v1beta1/tree.proto new file mode 100644 index 00000000..57a055aa --- /dev/null +++ b/packages/cosmos/proto/osmosis/store/v1beta1/tree.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package osmosis.store.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/osmoutils/sumtree"; + +message Node { repeated Child children = 1; } + +message Child { + bytes index = 1; + string accumulation = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message Leaf { Child leaf = 1; } diff --git a/packages/cosmos/proto/osmosis/superfluid/genesis.proto b/packages/cosmos/proto/osmosis/superfluid/genesis.proto new file mode 100644 index 00000000..1712e4c3 --- /dev/null +++ b/packages/cosmos/proto/osmosis/superfluid/genesis.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package osmosis.superfluid; + +import "gogoproto/gogo.proto"; +import "osmosis/superfluid/superfluid.proto"; +import "osmosis/superfluid/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/superfluid/types"; + +// GenesisState defines the module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + // superfluid_assets defines the registered superfluid assets that have been + // registered via governance. + repeated SuperfluidAsset superfluid_assets = 2 + [ (gogoproto.nullable) = false ]; + // osmo_equivalent_multipliers is the records of osmo equivalent amount of + // each superfluid registered pool, updated every epoch. + repeated OsmoEquivalentMultiplierRecord osmo_equivalent_multipliers = 3 + [ (gogoproto.nullable) = false ]; + // intermediary_accounts is a secondary account for superfluid staking that + // plays an intermediary role between validators and the delegators. + repeated SuperfluidIntermediaryAccount intermediary_accounts = 4 + [ (gogoproto.nullable) = false ]; + repeated LockIdIntermediaryAccountConnection intemediary_account_connections = + 5 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/superfluid/params.proto b/packages/cosmos/proto/osmosis/superfluid/params.proto new file mode 100644 index 00000000..6e044f9f --- /dev/null +++ b/packages/cosmos/proto/osmosis/superfluid/params.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package osmosis.superfluid; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/superfluid/types"; + +// Params holds parameters for the superfluid module +message Params { + // minimum_risk_factor is to be cut on OSMO equivalent value of lp tokens for + // superfluid staking, default: 5%. The minimum risk factor works + // to counter-balance the staked amount on chain's exposure to various asset + // volatilities, and have base staking be 'resistant' to volatility. + string minimum_risk_factor = 1 [ + (gogoproto.moretags) = "yaml:\"minimum_risk_factor\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/superfluid/query.proto b/packages/cosmos/proto/osmosis/superfluid/query.proto new file mode 100644 index 00000000..3d566f3b --- /dev/null +++ b/packages/cosmos/proto/osmosis/superfluid/query.proto @@ -0,0 +1,334 @@ +syntax = "proto3"; +package osmosis.superfluid; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "osmosis/superfluid/superfluid.proto"; +import "osmosis/superfluid/params.proto"; +import "osmosis/lockup/lock.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/superfluid/types"; + +// Query defines the gRPC querier service. +service Query { + // Params returns the total set of superfluid parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/params"; + } + + // Returns superfluid asset type, whether if it's a native asset or an lp + // share. + rpc AssetType(AssetTypeRequest) returns (AssetTypeResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/asset_type"; + } + + // Returns all registered superfluid assets. + rpc AllAssets(AllAssetsRequest) returns (AllAssetsResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/all_assets"; + } + + // Returns the osmo equivalent multiplier used in the most recent epoch. + rpc AssetMultiplier(AssetMultiplierRequest) + returns (AssetMultiplierResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/asset_multiplier"; + } + + // Returns all superfluid intermediary accounts. + rpc AllIntermediaryAccounts(AllIntermediaryAccountsRequest) + returns (AllIntermediaryAccountsResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/all_intermediary_accounts"; + } + + // Returns intermediary account connected to a superfluid staked lock by id + rpc ConnectedIntermediaryAccount(ConnectedIntermediaryAccountRequest) + returns (ConnectedIntermediaryAccountResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/connected_intermediary_account/{lock_id}"; + } + + // Returns the amount of delegations of specific denom for all validators + rpc TotalDelegationByValidatorForDenom( + QueryTotalDelegationByValidatorForDenomRequest) + returns (QueryTotalDelegationByValidatorForDenomResponse) {} + + // Returns the total amount of osmo superfluidly staked. + // Response is denominated in uosmo. + rpc TotalSuperfluidDelegations(TotalSuperfluidDelegationsRequest) + returns (TotalSuperfluidDelegationsResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/all_superfluid_delegations"; + } + + // Returns the coins superfluid delegated for the delegator, validator, denom + // triplet + rpc SuperfluidDelegationAmount(SuperfluidDelegationAmountRequest) + returns (SuperfluidDelegationAmountResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/superfluid_delegation_amount"; + } + + // Returns all the delegated superfluid positions for a specific delegator. + rpc SuperfluidDelegationsByDelegator(SuperfluidDelegationsByDelegatorRequest) + returns (SuperfluidDelegationsByDelegatorResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/" + "superfluid_delegations/{delegator_address}"; + } + + // Returns all the undelegating superfluid positions for a specific delegator. + rpc SuperfluidUndelegationsByDelegator( + SuperfluidUndelegationsByDelegatorRequest) + returns (SuperfluidUndelegationsByDelegatorResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/" + "superfluid_undelegations_by_delegator/{delegator_address}"; + } + + // Returns all the superfluid positions of a specific denom delegated to one + // validator + rpc SuperfluidDelegationsByValidatorDenom( + SuperfluidDelegationsByValidatorDenomRequest) + returns (SuperfluidDelegationsByValidatorDenomResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/superfluid_delegations_by_validator_denom"; + } + + // Returns the amount of a specific denom delegated to a specific validator + // This is labeled an estimate, because the way it calculates the amount can + // lead rounding errors from the true delegated amount + rpc EstimateSuperfluidDelegatedAmountByValidatorDenom( + EstimateSuperfluidDelegatedAmountByValidatorDenomRequest) + returns (EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/" + "estimate_superfluid_delegation_amount_by_validator_denom"; + } + + // Returns the specified delegations for a specific delegator + rpc TotalDelegationByDelegator(QueryTotalDelegationByDelegatorRequest) + returns (QueryTotalDelegationByDelegatorResponse) { + option (google.api.http).get = + "/osmosis/superfluid/v1beta1/" + "total_delegation_by_delegator/{delegator_address}"; + } + + // Returns a list of whitelisted pool ids to unpool. + rpc UnpoolWhitelist(QueryUnpoolWhitelistRequest) + returns (QueryUnpoolWhitelistResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/" + "unpool_whitelist"; + } + + // Returns all of a user's full range CL positions that are superfluid staked. + rpc UserConcentratedSuperfluidPositionsDelegated( + UserConcentratedSuperfluidPositionsDelegatedRequest) + returns (UserConcentratedSuperfluidPositionsDelegatedResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/" + "account_delegated_cl_positions/" + "{delegator_address}"; + } + + rpc UserConcentratedSuperfluidPositionsUndelegating( + UserConcentratedSuperfluidPositionsUndelegatingRequest) + returns (UserConcentratedSuperfluidPositionsUndelegatingResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/" + "account_undelegating_cl_positions/" + "{delegator_address}"; + } + + rpc RestSupply(QueryRestSupplyRequest) returns (QueryRestSupplyResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/supply"; + } +} + +message QueryParamsRequest {} +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message AssetTypeRequest { string denom = 1; }; +message AssetTypeResponse { SuperfluidAssetType asset_type = 1; }; + +message AllAssetsRequest {}; +message AllAssetsResponse { + repeated SuperfluidAsset assets = 1 [ (gogoproto.nullable) = false ]; +}; + +message AssetMultiplierRequest { string denom = 1; }; +message AssetMultiplierResponse { + OsmoEquivalentMultiplierRecord osmo_equivalent_multiplier = 1; +}; + +message SuperfluidIntermediaryAccountInfo { + string denom = 1; + string val_addr = 2; + uint64 gauge_id = 3; + string address = 4; +} +message AllIntermediaryAccountsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +}; +message AllIntermediaryAccountsResponse { + repeated SuperfluidIntermediaryAccountInfo accounts = 1 + [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +}; + +message ConnectedIntermediaryAccountRequest { uint64 lock_id = 1; } +message ConnectedIntermediaryAccountResponse { + SuperfluidIntermediaryAccountInfo account = 1; +} + +message QueryTotalDelegationByValidatorForDenomRequest { string denom = 1; } +message QueryTotalDelegationByValidatorForDenomResponse { + repeated Delegations assets = 1 [ (gogoproto.nullable) = false ]; +} + +message Delegations { + string val_addr = 1; + string amount_sfsd = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount_sfsd\"", + (gogoproto.nullable) = false + ]; + string osmo_equivalent = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"osmo_equivalent\"", + (gogoproto.nullable) = false + ]; +} +message TotalSuperfluidDelegationsRequest {} + +message TotalSuperfluidDelegationsResponse { + string total_delegations = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"total_superfluid_delegations\"", + (gogoproto.nullable) = false + ]; +} + +message SuperfluidDelegationAmountRequest { + string delegator_address = 1; + string validator_address = 2; + string denom = 3; +} + +message SuperfluidDelegationAmountResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message SuperfluidDelegationsByDelegatorRequest { + string delegator_address = 1; +} + +message SuperfluidDelegationsByDelegatorResponse { + repeated SuperfluidDelegationRecord superfluid_delegation_records = 1 + [ (gogoproto.nullable) = false ]; + repeated cosmos.base.v1beta1.Coin total_delegated_coins = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + cosmos.base.v1beta1.Coin total_equivalent_staked_amount = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + +message SuperfluidUndelegationsByDelegatorRequest { + string delegator_address = 1; + string denom = 2; +} + +message SuperfluidUndelegationsByDelegatorResponse { + repeated SuperfluidDelegationRecord superfluid_delegation_records = 1 + [ (gogoproto.nullable) = false ]; + repeated cosmos.base.v1beta1.Coin total_undelegated_coins = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated osmosis.lockup.SyntheticLock synthetic_locks = 3 + [ (gogoproto.nullable) = false ]; +} + +message SuperfluidDelegationsByValidatorDenomRequest { + string validator_address = 1; + string denom = 2; +} + +message SuperfluidDelegationsByValidatorDenomResponse { + repeated SuperfluidDelegationRecord superfluid_delegation_records = 1 + [ (gogoproto.nullable) = false ]; +} + +message EstimateSuperfluidDelegatedAmountByValidatorDenomRequest { + string validator_address = 1; + string denom = 2; +} + +message EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { + repeated cosmos.base.v1beta1.Coin total_delegated_coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message QueryTotalDelegationByDelegatorRequest { string delegator_address = 1; } + +message QueryTotalDelegationByDelegatorResponse { + repeated SuperfluidDelegationRecord superfluid_delegation_records = 1 + [ (gogoproto.nullable) = false ]; + + repeated cosmos.staking.v1beta1.DelegationResponse delegation_response = 2 + [ (gogoproto.nullable) = false ]; + repeated cosmos.base.v1beta1.Coin total_delegated_coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + cosmos.base.v1beta1.Coin total_equivalent_staked_amount = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + +message QueryUnpoolWhitelistRequest {} + +message QueryUnpoolWhitelistResponse { repeated uint64 pool_ids = 1; } + +message UserConcentratedSuperfluidPositionsDelegatedRequest { + string delegator_address = 1; +} + +message UserConcentratedSuperfluidPositionsDelegatedResponse { + repeated ConcentratedPoolUserPositionRecord cl_pool_user_position_records = 1 + [ (gogoproto.nullable) = false ]; +} + +message UserConcentratedSuperfluidPositionsUndelegatingRequest { + string delegator_address = 1; +} + +message UserConcentratedSuperfluidPositionsUndelegatingResponse { + repeated ConcentratedPoolUserPositionRecord cl_pool_user_position_records = 1 + [ (gogoproto.nullable) = false ]; +} + +// THIS QUERY IS TEMPORARY +message QueryRestSupplyRequest { string denom = 1; } + +message QueryRestSupplyResponse { + // amount is the supply of the coin. + cosmos.base.v1beta1.Coin amount = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/superfluid/superfluid.proto b/packages/cosmos/proto/osmosis/superfluid/superfluid.proto new file mode 100644 index 00000000..074eddfe --- /dev/null +++ b/packages/cosmos/proto/osmosis/superfluid/superfluid.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; +package osmosis.superfluid; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/lockup/lock.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/superfluid/types"; + +// SuperfluidAssetType indicates whether the superfluid asset is +// a native token, lp share of a pool, or concentrated share of a pool +enum SuperfluidAssetType { + option (gogoproto.goproto_enum_prefix) = false; + + SuperfluidAssetTypeNative = 0; + SuperfluidAssetTypeLPShare = 1; + SuperfluidAssetTypeConcentratedShare = 2; + // SuperfluidAssetTypeLendingShare = 3; // for now not exist +} + +// SuperfluidAsset stores the pair of superfluid asset type and denom pair +message SuperfluidAsset { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + string denom = 1; + // AssetType indicates whether the superfluid asset is a native token or an lp + // share + SuperfluidAssetType asset_type = 2; +} + +// SuperfluidIntermediaryAccount takes the role of intermediary between LP token +// and OSMO tokens for superfluid staking. The intermediary account is the +// actual account responsible for delegation, not the validator account itself. +message SuperfluidIntermediaryAccount { + // Denom indicates the denom of the superfluid asset. + string denom = 1; + string val_addr = 2; + // perpetual gauge for rewards distribution + uint64 gauge_id = 3; +} + +// The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we +// treat an LP share as having, for all of epoch N. Eventually this is intended +// to be set as the Time-weighted-average-osmo-backing for the entire duration +// of epoch N-1. (Thereby locking what's in use for epoch N as based on the +// prior epochs rewards) However for now, this is not the TWAP but instead the +// spot price at the boundary. For different types of assets in the future, it +// could change. +message OsmoEquivalentMultiplierRecord { + int64 epoch_number = 1; + // superfluid asset denom, can be LP token or native token + string denom = 2; + string multiplier = 3 [ + (gogoproto.moretags) = "yaml:\"multiplier\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// SuperfluidDelegationRecord is a struct used to indicate superfluid +// delegations of an account in the state machine in a user friendly form. +message SuperfluidDelegationRecord { + string delegator_address = 1; + string validator_address = 2; + cosmos.base.v1beta1.Coin delegation_amount = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + cosmos.base.v1beta1.Coin equivalent_staked_amount = 4 + [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; +} + +// LockIdIntermediaryAccountConnection is a struct used to indicate the +// relationship between the underlying lock id and superfluid delegation done +// via lp shares. +message LockIdIntermediaryAccountConnection { + uint64 lock_id = 1; + string intermediary_account = 2; +} + +message UnpoolWhitelistedPools { repeated uint64 ids = 1; } + +message ConcentratedPoolUserPositionRecord { + string validator_address = 1; + uint64 position_id = 2; + uint64 lock_id = 3; + osmosis.lockup.SyntheticLock synthetic_lock = 4 + [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin delegation_amount = 5 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + cosmos.base.v1beta1.Coin equivalent_staked_amount = 6 + [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; +} diff --git a/packages/cosmos/proto/osmosis/superfluid/tx.proto b/packages/cosmos/proto/osmosis/superfluid/tx.proto new file mode 100644 index 00000000..aaf4b56b --- /dev/null +++ b/packages/cosmos/proto/osmosis/superfluid/tx.proto @@ -0,0 +1,283 @@ +syntax = "proto3"; +package osmosis.superfluid; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "osmosis/superfluid/superfluid.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/superfluid/types"; + +// Msg defines the Msg service. +service Msg { + // Execute superfluid delegation for a lockup + rpc SuperfluidDelegate(MsgSuperfluidDelegate) + returns (MsgSuperfluidDelegateResponse); + + // Execute superfluid undelegation for a lockup + rpc SuperfluidUndelegate(MsgSuperfluidUndelegate) + returns (MsgSuperfluidUndelegateResponse); + + // Execute superfluid redelegation for a lockup + // rpc SuperfluidRedelegate(MsgSuperfluidRedelegate) returns + // (MsgSuperfluidRedelegateResponse); + + // For a given lock that is being superfluidly undelegated, + // also unbond the underlying lock. + rpc SuperfluidUnbondLock(MsgSuperfluidUnbondLock) + returns (MsgSuperfluidUnbondLockResponse); + + // Superfluid undelegate and unbond partial amount of the underlying lock. + rpc SuperfluidUndelegateAndUnbondLock(MsgSuperfluidUndelegateAndUnbondLock) + returns (MsgSuperfluidUndelegateAndUnbondLockResponse); + + // Execute lockup lock and superfluid delegation in a single msg + rpc LockAndSuperfluidDelegate(MsgLockAndSuperfluidDelegate) + returns (MsgLockAndSuperfluidDelegateResponse); + + rpc CreateFullRangePositionAndSuperfluidDelegate( + MsgCreateFullRangePositionAndSuperfluidDelegate) + returns (MsgCreateFullRangePositionAndSuperfluidDelegateResponse); + + rpc UnPoolWhitelistedPool(MsgUnPoolWhitelistedPool) + returns (MsgUnPoolWhitelistedPoolResponse); + + rpc UnlockAndMigrateSharesToFullRangeConcentratedPosition( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition) + returns ( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse); + + rpc AddToConcentratedLiquiditySuperfluidPosition( + MsgAddToConcentratedLiquiditySuperfluidPosition) + returns (MsgAddToConcentratedLiquiditySuperfluidPositionResponse); + + // UnbondConvertAndStake breaks all locks / superfluid staked assets, + // converts them to osmo then stakes the osmo to the designated validator. + rpc UnbondConvertAndStake(MsgUnbondConvertAndStake) + returns (MsgUnbondConvertAndStakeResponse); +} + +message MsgSuperfluidDelegate { + option (amino.name) = "osmosis/superfluid-delegate"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 lock_id = 2; + string val_addr = 3; +} +message MsgSuperfluidDelegateResponse {} + +message MsgSuperfluidUndelegate { + option (amino.name) = "osmosis/superfluid-undelegate"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 lock_id = 2; +} +message MsgSuperfluidUndelegateResponse {} + +message MsgSuperfluidUnbondLock { + option (amino.name) = "osmosis/superfluid-unbond-lock"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 lock_id = 2; +} +message MsgSuperfluidUnbondLockResponse {} + +message MsgSuperfluidUndelegateAndUnbondLock { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 lock_id = 2; + // Amount of unlocking coin. + cosmos.base.v1beta1.Coin coin = 3 + [ (gogoproto.moretags) = "yaml:\"coin\"", (gogoproto.nullable) = false ]; +} +message MsgSuperfluidUndelegateAndUnbondLockResponse { + // lock id of the new lock created for the remaining amount. + // returns the original lockid if the unlocked amount is equal to the + // original lock's amount. + uint64 lock_id = 1; +} + +// message MsgSuperfluidRedelegate { +// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +// uint64 lock_id = 2; +// string new_val_addr = 3; +// } +// message MsgSuperfluidRedelegateResponse {} + +// MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, +// and then does a superfluid lock from the newly created lockup, to the +// specified validator addr. +message MsgLockAndSuperfluidDelegate { + option (amino.name) = "osmosis/lock-and-superfluid-delegate"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + string val_addr = 3; +} +message MsgLockAndSuperfluidDelegateResponse { uint64 ID = 1; } + +// MsgCreateFullRangePositionAndSuperfluidDelegate creates a full range position +// in a concentrated liquidity pool, then superfluid delegates. +message MsgCreateFullRangePositionAndSuperfluidDelegate { + option (amino.name) = "osmosis/full-range-and-sf-delegate"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + string val_addr = 3; + uint64 pool_id = 4 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} +message MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + uint64 lockID = 1; + uint64 positionID = 2; +} + +// MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is +// associated with pool pool_id. If pool_id is not approved for unpooling by +// governance, this is a no-op. Unpooling takes the locked gamm shares, and runs +// "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens +// ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new +// lock for every constituent token, with the duration associated with the lock. +// If the lock was unbonding, the new lockup durations should be the time left +// until unbond completion. +message MsgUnPoolWhitelistedPool { + option (amino.name) = "osmosis/unpool-whitelisted-pool"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message MsgUnPoolWhitelistedPoolResponse { + repeated uint64 exited_lock_ids = 1; +} + +// ===================== +// MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition +message MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + option (amino.name) = "osmosis/unlock-and-migrate"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + int64 lock_id = 2 [ (gogoproto.moretags) = "yaml:\"lock_id\"" ]; + cosmos.base.v1beta1.Coin shares_to_migrate = 3 [ + (gogoproto.moretags) = "yaml:\"shares_to_migrate\"", + (gogoproto.nullable) = false + ]; + // token_out_mins indicates minimum token to exit Balancer pool with. + repeated cosmos.base.v1beta1.Coin token_out_mins = 4 [ + (gogoproto.moretags) = "yaml:\"token_out_mins\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + string amount0 = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount0\"", + (gogoproto.nullable) = false + ]; + string amount1 = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount1\"", + (gogoproto.nullable) = false + ]; + string liquidity_created = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"liquidity_created\"", + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp join_time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"join_time\"" + ]; +} + +// ===================== MsgAddToConcentratedLiquiditySuperfluidPosition +message MsgAddToConcentratedLiquiditySuperfluidPosition { + option (amino.name) = "osmosis/add-to-cl-superfluid-position"; + + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin token_desired0 = 3 [ + (gogoproto.moretags) = "yaml:\"token_desired0\"", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin token_desired1 = 4 [ + (gogoproto.moretags) = "yaml:\"token_desired1\"", + (gogoproto.nullable) = false + ]; +} + +message MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + string amount0 = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount0\"", + (gogoproto.nullable) = false + ]; + string amount1 = 3 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"amount1\"", + (gogoproto.nullable) = false + ]; + // new_liquidity is the final liquidity after the add. + // It includes the liquidity that existed before in the position + // and the new liquidity that was added to the position. + string new_liquidity = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"new_liquidity\"", + (gogoproto.nullable) = false + ]; + uint64 lock_id = 4 [ (gogoproto.moretags) = "yaml:\"lock_id\"" ]; +} + +// ===================== MsgUnbondConvertAndStake +message MsgUnbondConvertAndStake { + option (amino.name) = "osmosis/unbond-convert-and-stake"; + + // lock ID to convert and stake. + // lock id with 0 should be provided if converting liquid gamm shares to stake + uint64 lock_id = 1 [ (gogoproto.moretags) = "yaml:\"lock_id\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + // validator address to delegate to. + // If provided empty string, we use the validators returned from + // valset-preference module. + string val_addr = 3; + // min_amt_to_stake indicates the minimum amount to stake after conversion + string min_amt_to_stake = 4 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"min_amt_to_stake\"", + (gogoproto.nullable) = false + ]; + // shares_to_convert indicates shares wanted to stake. + // Note that this field is only used for liquid(unlocked) gamm shares. + // For all other cases, this field would be disregarded. + cosmos.base.v1beta1.Coin shares_to_convert = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"shares_to_convert\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + +message MsgUnbondConvertAndStakeResponse { + string total_amt_staked = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"total_amt_staked\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/superfluid/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/superfluid/v1beta1/gov.proto new file mode 100644 index 00000000..e9aa1cf9 --- /dev/null +++ b/packages/cosmos/proto/osmosis/superfluid/v1beta1/gov.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package osmosis.superfluid.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "osmosis/superfluid/superfluid.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/superfluid/types"; + +// SetSuperfluidAssetsProposal is a gov Content type to update the superfluid +// assets +message SetSuperfluidAssetsProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/set-superfluid-assets-proposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated SuperfluidAsset assets = 3 [ (gogoproto.nullable) = false ]; +} + +// RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid +// assets by denom +message RemoveSuperfluidAssetsProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/del-superfluid-assets-proposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated string superfluid_asset_denoms = 3; +} + +// UpdateUnpoolWhiteListProposal is a gov Content type to update the +// allowed list of pool ids. +message UpdateUnpoolWhiteListProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/update-unpool-whitelist"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated uint64 ids = 3; + bool is_overwrite = 4; +} diff --git a/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto new file mode 100644 index 00000000..f59f025e --- /dev/null +++ b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types"; + +// DenomAuthorityMetadata specifies metadata for addresses that have specific +// capabilities over a token factory denom. Right now there is only one Admin +// permission, but is planned to be extended to the future. +message DenomAuthorityMetadata { + option (gogoproto.equal) = true; + + // Can be empty for no admin, or a valid osmosis address + string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} diff --git a/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/genesis.proto new file mode 100644 index 00000000..58eef152 --- /dev/null +++ b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/genesis.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types"; + +// GenesisState defines the tokenfactory module's genesis state. +message GenesisState { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated GenesisDenom factory_denoms = 2 [ + (gogoproto.moretags) = "yaml:\"factory_denoms\"", + (gogoproto.nullable) = false + ]; +} + +// GenesisDenom defines a tokenfactory denom that is defined within genesis +// state. The structure contains DenomAuthorityMetadata which defines the +// denom's admin. +message GenesisDenom { + option (gogoproto.equal) = true; + + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + DenomAuthorityMetadata authority_metadata = 2 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/params.proto b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/params.proto new file mode 100644 index 00000000..1f90702a --- /dev/null +++ b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/params.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types"; + +// Params defines the parameters for the tokenfactory module. +message Params { + // DenomCreationFee defines the fee to be charged on the creation of a new + // denom. The fee is drawn from the MsgCreateDenom's sender account, and + // transferred to the community pool. + repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", + (gogoproto.nullable) = false + ]; + + // DenomCreationGasConsume defines the gas cost for creating a new denom. + // This is intended as a spam deterrence mechanism. + // + // See: https://github.com/CosmWasm/token-factory/issues/11 + uint64 denom_creation_gas_consume = 2 [ + (gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", + (gogoproto.nullable) = true + ]; +} diff --git a/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/query.proto b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/query.proto new file mode 100644 index 00000000..2b557176 --- /dev/null +++ b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -0,0 +1,111 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the tokenfactory module's + // parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/params"; + } + + // DenomAuthorityMetadata defines a gRPC query method for fetching + // DenomAuthorityMetadata for a particular denom. + rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) + returns (QueryDenomAuthorityMetadataResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/denoms/{denom}/authority_metadata"; + } + + // DenomsFromCreator defines a gRPC query method for fetching all + // denominations created by a specific admin/creator. + rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) + returns (QueryDenomsFromCreatorResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}"; + } + + // BeforeSendHookAddress defines a gRPC query method for + // getting the address registered for the before send hook. + rpc BeforeSendHookAddress(QueryBeforeSendHookAddressRequest) + returns (QueryBeforeSendHookAddressResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/denoms/{denom}/before_send_hook"; + } + + // AllBeforeSendHooksAddresses defines a gRPC query method for + // getting all addresses with before send hook registered. + // The response returns two arrays, an array with a list of denom and an array + // of before send hook addresses. The idx of denom corresponds to before send + // hook addresse's idx. + rpc AllBeforeSendHooksAddresses(QueryAllBeforeSendHooksAddressesRequest) + returns (QueryAllBeforeSendHooksAddressesResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/all_before_send_hooks"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryDenomAuthorityMetadataRequest defines the request structure for the +// DenomAuthorityMetadata gRPC query. +message QueryDenomAuthorityMetadataRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryDenomAuthorityMetadataResponse defines the response structure for the +// DenomAuthorityMetadata gRPC query. +message QueryDenomAuthorityMetadataResponse { + DenomAuthorityMetadata authority_metadata = 1 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} + +// QueryDenomsFromCreatorRequest defines the request structure for the +// DenomsFromCreator gRPC query. +message QueryDenomsFromCreatorRequest { + string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; +} + +// QueryDenomsFromCreatorRequest defines the response structure for the +// DenomsFromCreator gRPC query. +message QueryDenomsFromCreatorResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; +} + +message QueryBeforeSendHookAddressRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryBeforeSendHookAddressResponse defines the response structure for the +// DenomBeforeSendHook gRPC query. +message QueryBeforeSendHookAddressResponse { + string cosmwasm_address = 1 + [ (gogoproto.moretags) = "yaml:\"cosmwasm_address\"" ]; +} + +message QueryAllBeforeSendHooksAddressesRequest {} + +// QueryAllBeforeSendHooksAddressesResponse defines the response structure for +// the AllBeforeSendHooksAddresses gRPC query. +message QueryAllBeforeSendHooksAddressesResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; + repeated string before_send_hook_addresses = 2 + [ (gogoproto.moretags) = "yaml:\"before_send_addresses\"" ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/tx.proto new file mode 100644 index 00000000..e2d24073 --- /dev/null +++ b/packages/cosmos/proto/osmosis/tokenfactory/v1beta1/tx.proto @@ -0,0 +1,149 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/tokenfactory/types"; + +// Msg defines the tokefactory module's gRPC message service. +service Msg { + rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); + rpc Mint(MsgMint) returns (MsgMintResponse); + rpc Burn(MsgBurn) returns (MsgBurnResponse); + rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); + rpc SetDenomMetadata(MsgSetDenomMetadata) + returns (MsgSetDenomMetadataResponse); + rpc SetBeforeSendHook(MsgSetBeforeSendHook) + returns (MsgSetBeforeSendHookResponse); + rpc ForceTransfer(MsgForceTransfer) returns (MsgForceTransferResponse); +} + +// MsgCreateDenom defines the message structure for the CreateDenom gRPC service +// method. It allows an account to create a new denom. It requires a sender +// address and a sub denomination. The (sender_address, sub_denomination) tuple +// must be unique and cannot be re-used. +// +// The resulting denom created is defined as +// . The resulting denom's admin is +// originally set to be the creator, but this can be changed later. The token +// denom does not indicate the current admin. +message MsgCreateDenom { + option (amino.name) = "osmosis/tokenfactory/create-denom"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + // subdenom can be up to 44 "alphanumeric" characters long. + string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; +} + +// MsgCreateDenomResponse is the return value of MsgCreateDenom +// It returns the full string of the newly created denom +message MsgCreateDenomResponse { + string new_token_denom = 1 + [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ]; +} + +// MsgMint is the sdk.Msg type for allowing an admin account to mint +// more of a token. +// Only the admin of the token factory denom has permission to mint unless +// the denom does not have any admin. +message MsgMint { + option (amino.name) = "osmosis/tokenfactory/mint"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string mintToAddress = 3 [ + (gogoproto.moretags) = "yaml:\"mint_to_address\"", + (amino.dont_omitempty) = true + ]; +} + +message MsgMintResponse {} + +// MsgBurn is the sdk.Msg type for allowing an admin account to burn +// a token. +// Only the admin of the token factory denom has permission to burn unless +// the denom does not have any admin. +message MsgBurn { + option (amino.name) = "osmosis/tokenfactory/burn"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string burnFromAddress = 3 [ + (gogoproto.moretags) = "yaml:\"burn_from_address\"", + (amino.dont_omitempty) = true + ]; +} + +message MsgBurnResponse {} + +// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign +// adminship of a denom to a new account +message MsgChangeAdmin { + option (amino.name) = "osmosis/tokenfactory/change-admin"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; +} + +// MsgChangeAdminResponse defines the response structure for an executed +// MsgChangeAdmin message. +message MsgChangeAdminResponse {} + +// MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to +// assign a CosmWasm contract to call with a BeforeSend hook +message MsgSetBeforeSendHook { + option (amino.name) = "osmosis/tokenfactory/set-bef-send-hook"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string cosmwasm_address = 3 [ + (gogoproto.moretags) = "yaml:\"cosmwasm_address\"", + (amino.dont_omitempty) = true + ]; +} + +// MsgSetBeforeSendHookResponse defines the response structure for an executed +// MsgSetBeforeSendHook message. +message MsgSetBeforeSendHookResponse {} + +// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set +// the denom's bank metadata +message MsgSetDenomMetadata { + option (amino.name) = "osmosis/tokenfactory/set-denom-metadata"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.bank.v1beta1.Metadata metadata = 2 [ + (gogoproto.moretags) = "yaml:\"metadata\"", + (gogoproto.nullable) = false + ]; +} + +// MsgSetDenomMetadataResponse defines the response structure for an executed +// MsgSetDenomMetadata message. +message MsgSetDenomMetadataResponse {} + +message MsgForceTransfer { + option (amino.name) = "osmosis/tokenfactory/force-transfer"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string transferFromAddress = 3 + [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; + string transferToAddress = 4 + [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; +} + +message MsgForceTransferResponse {} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/twap/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/twap/v1beta1/genesis.proto new file mode 100644 index 00000000..17bc01cb --- /dev/null +++ b/packages/cosmos/proto/osmosis/twap/v1beta1/genesis.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package osmosis.twap.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/twap/v1beta1/twap_record.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/twap/types"; + +// Params holds parameters for the twap module +message Params { + string prune_epoch_identifier = 1; + google.protobuf.Duration record_history_keep_period = 2 [ + (gogoproto.moretags) = "yaml:\"record_history_keep_period\"", + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false + ]; +} + +// GenesisState defines the twap module's genesis state. +message GenesisState { + // twaps is the collection of all twap records. + repeated TwapRecord twaps = 1 [ (gogoproto.nullable) = false ]; + + // params is the container of twap parameters. + Params params = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/twap/v1beta1/query.proto b/packages/cosmos/proto/osmosis/twap/v1beta1/query.proto new file mode 100644 index 00000000..e592d3e6 --- /dev/null +++ b/packages/cosmos/proto/osmosis/twap/v1beta1/query.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; +package osmosis.twap.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/twap/v1beta1/twap_record.proto"; +import "osmosis/twap/v1beta1/genesis.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/twap/client/queryproto"; + +service Query { + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = "/osmosis/twap/v1beta1/Params"; + } + rpc ArithmeticTwap(ArithmeticTwapRequest) returns (ArithmeticTwapResponse) { + option (google.api.http).get = "/osmosis/twap/v1beta1/ArithmeticTwap"; + } + rpc ArithmeticTwapToNow(ArithmeticTwapToNowRequest) + returns (ArithmeticTwapToNowResponse) { + option (google.api.http).get = "/osmosis/twap/v1beta1/ArithmeticTwapToNow"; + } + rpc GeometricTwap(GeometricTwapRequest) returns (GeometricTwapResponse) { + option (google.api.http).get = "/osmosis/twap/v1beta1/GeometricTwap"; + } + rpc GeometricTwapToNow(GeometricTwapToNowRequest) + returns (GeometricTwapToNowResponse) { + option (google.api.http).get = "/osmosis/twap/v1beta1/GeometricTwapToNow"; + } +} + +message ArithmeticTwapRequest { + uint64 pool_id = 1; + string base_asset = 2; + string quote_asset = 3; + google.protobuf.Timestamp start_time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + google.protobuf.Timestamp end_time = 5 [ + (gogoproto.nullable) = true, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"end_time\"" + ]; +} +message ArithmeticTwapResponse { + string arithmetic_twap = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"arithmetic_twap\"", + (gogoproto.nullable) = false + ]; +} + +message ArithmeticTwapToNowRequest { + uint64 pool_id = 1; + string base_asset = 2; + string quote_asset = 3; + google.protobuf.Timestamp start_time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; +} +message ArithmeticTwapToNowResponse { + string arithmetic_twap = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"arithmetic_twap\"", + (gogoproto.nullable) = false + ]; +} + +message GeometricTwapRequest { + uint64 pool_id = 1; + string base_asset = 2; + string quote_asset = 3; + google.protobuf.Timestamp start_time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + google.protobuf.Timestamp end_time = 5 [ + (gogoproto.nullable) = true, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"end_time\"" + ]; +} +message GeometricTwapResponse { + string geometric_twap = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"geometric_twap\"", + (gogoproto.nullable) = false + ]; +} + +message GeometricTwapToNowRequest { + uint64 pool_id = 1; + string base_asset = 2; + string quote_asset = 3; + google.protobuf.Timestamp start_time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; +} +message GeometricTwapToNowResponse { + string geometric_twap = 1 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"geometric_twap\"", + (gogoproto.nullable) = false + ]; +} + +message ParamsRequest {} +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } diff --git a/packages/cosmos/proto/osmosis/twap/v1beta1/query.yml b/packages/cosmos/proto/osmosis/twap/v1beta1/query.yml new file mode 100644 index 00000000..29825d79 --- /dev/null +++ b/packages/cosmos/proto/osmosis/twap/v1beta1/query.yml @@ -0,0 +1,34 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/twap" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/twap/client" +queries: + ArithmeticTwap: + proto_wrapper: + default_values: + Req.end_time: "ctx.BlockTime()" + query_func: "k.GetArithmeticTwap" + cli: + cmd: "ArithmeticTwap" + ArithmeticTwapToNow: + proto_wrapper: + query_func: "k.GetArithmeticTwapToNow" + cli: + cmd: "ArithmeticTwapToNow" + GeometricTwap: + proto_wrapper: + default_values: + Req.end_time: "ctx.BlockTime()" + query_func: "k.GetGeometricTwap" + cli: + cmd: "ArithmeticTwap" + GeometricTwapToNow: + proto_wrapper: + query_func: "k.GetGeometricTwapToNow" + cli: + cmd: "GeometricTwapToNow" + Params: + proto_wrapper: + query_func: "k.GetParams" + cli: + cmd: "GetArithmeticTwapToNow" diff --git a/packages/cosmos/proto/osmosis/twap/v1beta1/twap_record.proto b/packages/cosmos/proto/osmosis/twap/v1beta1/twap_record.proto new file mode 100644 index 00000000..a36a9be5 --- /dev/null +++ b/packages/cosmos/proto/osmosis/twap/v1beta1/twap_record.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package osmosis.twap.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/twap/types"; + +// A TWAP record should be indexed in state by pool_id, (asset pair), timestamp +// The asset pair assets should be lexicographically sorted. +// Technically (pool_id, asset_0_denom, asset_1_denom, height) do not need to +// appear in the struct however we view this as the wrong performance tradeoff +// given SDK today. Would rather we optimize for readability and correctness, +// than an optimal state storage format. The system bottleneck is elsewhere for +// now. +message TwapRecord { + uint64 pool_id = 1; + // Lexicographically smaller denom of the pair + string asset0_denom = 2; + // Lexicographically larger denom of the pair + string asset1_denom = 3; + // height this record corresponds to, for debugging purposes + int64 height = 4 [ + (gogoproto.moretags) = "yaml:\"record_height\"", + (gogoproto.jsontag) = "record_height" + ]; + // This field should only exist until we have a global registry in the state + // machine, mapping prior block heights within {TIME RANGE} to times. + google.protobuf.Timestamp time = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"record_time\"" + ]; + + // We store the last spot prices in the struct, so that we can interpolate + // accumulator values for times between when accumulator records are stored. + string p0_last_spot_price = 6 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string p1_last_spot_price = 7 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string p0_arithmetic_twap_accumulator = 8 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string p1_arithmetic_twap_accumulator = 9 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string geometric_twap_accumulator = 10 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // This field contains the time in which the last spot price error occurred. + // It is used to alert the caller if they are getting a potentially erroneous + // TWAP, due to an unforeseen underlying error. + google.protobuf.Timestamp last_error_time = 11 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"last_error_time\"" + ]; +} + +// PruningState allows us to spread out the pruning of TWAP records over time, +// instead of pruning all at once at the end of the epoch. +message PruningState { + // is_pruning is true if the pruning process is ongoing. + // This tells the module to continue pruning the TWAP records + // at the EndBlock. + bool is_pruning = 1; + // last_kept_time is the time of the last kept TWAP record. + // This is used to determine all TWAP records that are older than + // last_kept_time and should be pruned. + google.protobuf.Timestamp last_kept_time = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"last_kept_time\"" + ]; + // Deprecated: This field is deprecated. + bytes last_key_seen = 3 [ deprecated = true ]; + // last_seen_pool_id is the pool_id that we will begin pruning in the next + // block. This value starts at the highest pool_id at time of epoch, and + // decreases until it reaches 1. When it reaches 1, the pruning + // process is complete. + uint64 last_seen_pool_id = 4; +} diff --git a/packages/cosmos/proto/osmosis/txfees/v1beta1/feetoken.proto b/packages/cosmos/proto/osmosis/txfees/v1beta1/feetoken.proto new file mode 100644 index 00000000..9b2fe7d9 --- /dev/null +++ b/packages/cosmos/proto/osmosis/txfees/v1beta1/feetoken.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +// FeeToken is a struct that specifies a coin denom, and pool ID pair. +// This marks the token as eligible for use as a tx fee asset in Osmosis. +// Its price in osmo is derived through looking at the provided pool ID. +// The pool ID must have osmo as one of its assets. +message FeeToken { + option (gogoproto.equal) = true; + + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + uint64 poolID = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/txfees/v1beta1/genesis.proto b/packages/cosmos/proto/osmosis/txfees/v1beta1/genesis.proto new file mode 100644 index 00000000..db7d6c8d --- /dev/null +++ b/packages/cosmos/proto/osmosis/txfees/v1beta1/genesis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/txfees/v1beta1/feetoken.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/txfees/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +// GenesisState defines the txfees module's genesis state. +message GenesisState { + string basedenom = 1; + repeated FeeToken feetokens = 2 [ (gogoproto.nullable) = false ]; + + // // KVStore state + // TxFeesTracker txFeesTracker = 3; + reserved 3; + reserved "txFeesTracker"; + + // params is the container of txfees parameters. + Params params = 4 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/txfees/v1beta1/gov.proto b/packages/cosmos/proto/osmosis/txfees/v1beta1/gov.proto new file mode 100644 index 00000000..b431172c --- /dev/null +++ b/packages/cosmos/proto/osmosis/txfees/v1beta1/gov.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; +import "osmosis/txfees/v1beta1/feetoken.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +// UpdateFeeTokenProposal is a gov Content type for adding new whitelisted fee +// token(s). It must specify a denom along with gamm pool ID to use as a spot +// price calculator. It can be used to add new denoms to the whitelist. It can +// also be used to update the Pool to associate with the denom. If Pool ID is +// set to 0, it will remove the denom from the whitelisted set. +message UpdateFeeTokenProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "osmosis/UpdateFeeTokenProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + repeated FeeToken feetokens = 3 [ + (gogoproto.moretags) = "yaml:\"fee_tokens\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/cosmos/proto/osmosis/txfees/v1beta1/params.proto b/packages/cosmos/proto/osmosis/txfees/v1beta1/params.proto new file mode 100644 index 00000000..3f8a7e10 --- /dev/null +++ b/packages/cosmos/proto/osmosis/txfees/v1beta1/params.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +// Params holds parameters for the txfees module +message Params { + repeated string whitelisted_fee_token_setters = 1 [ + (gogoproto.moretags) = "yaml:\"whitelisted_fee_token_setters\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/txfees/v1beta1/query.proto b/packages/cosmos/proto/osmosis/txfees/v1beta1/query.proto new file mode 100644 index 00000000..1d30a0f5 --- /dev/null +++ b/packages/cosmos/proto/osmosis/txfees/v1beta1/query.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; + +import "osmosis/txfees/v1beta1/feetoken.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +service Query { + // FeeTokens returns a list of all the whitelisted fee tokens and their + // corresponding pools. It does not include the BaseDenom, which has its own + // query endpoint + rpc FeeTokens(QueryFeeTokensRequest) returns (QueryFeeTokensResponse) { + option (google.api.http).get = "/osmosis/txfees/v1beta1/fee_tokens"; + } + + // DenomSpotPrice returns all spot prices by each registered token denom. + rpc DenomSpotPrice(QueryDenomSpotPriceRequest) + returns (QueryDenomSpotPriceResponse) { + option (google.api.http).get = + "/osmosis/txfees/v1beta1/spot_price_by_denom"; + } + + // Returns the poolID for a specified denom input. + rpc DenomPoolId(QueryDenomPoolIdRequest) returns (QueryDenomPoolIdResponse) { + option (google.api.http).get = + "/osmosis/txfees/v1beta1/denom_pool_id/{denom}"; + } + + // Returns a list of all base denom tokens and their corresponding pools. + rpc BaseDenom(QueryBaseDenomRequest) returns (QueryBaseDenomResponse) { + option (google.api.http).get = "/osmosis/txfees/v1beta1/base_denom"; + } + + // Returns a list of all base denom tokens and their corresponding pools. + rpc GetEipBaseFee(QueryEipBaseFeeRequest) returns (QueryEipBaseFeeResponse) { + option (google.api.http).get = "/osmosis/txfees/v1beta1/cur_eip_base_fee"; + } +} + +message QueryFeeTokensRequest {} +message QueryFeeTokensResponse { + repeated FeeToken fee_tokens = 1 [ + (gogoproto.moretags) = "yaml:\"fee_tokens\"", + (gogoproto.nullable) = false + ]; +} + +// QueryDenomSpotPriceRequest defines grpc request structure for querying spot +// price for the specified tx fee denom +message QueryDenomSpotPriceRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryDenomSpotPriceRequest defines grpc response structure for querying spot +// price for the specified tx fee denom +message QueryDenomSpotPriceResponse { + uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string spot_price = 2 [ + (gogoproto.moretags) = "yaml:\"spot_price\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message QueryDenomPoolIdRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} +message QueryDenomPoolIdResponse { + uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message QueryBaseDenomRequest {} +message QueryBaseDenomResponse { + string base_denom = 1 [ (gogoproto.moretags) = "yaml:\"base_denom\"" ]; +} + +message QueryEipBaseFeeRequest {} +message QueryEipBaseFeeResponse { + string base_fee = 1 [ + (gogoproto.moretags) = "yaml:\"base_fee\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/txfees/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/txfees/v1beta1/tx.proto new file mode 100644 index 00000000..c96e9638 --- /dev/null +++ b/packages/cosmos/proto/osmosis/txfees/v1beta1/tx.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "osmosis/txfees/v1beta1/feetoken.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +service Msg { + rpc SetFeeTokens(MsgSetFeeTokens) returns (MsgSetFeeTokensResponse); +} + +// ===================== MsgSetFeeTokens +message MsgSetFeeTokens { + option (amino.name) = "osmosis/set-fee-tokens"; + + repeated FeeToken fee_tokens = 1 [ + (gogoproto.moretags) = "yaml:\"fee_tokens\"", + (gogoproto.nullable) = false + ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +} + +message MsgSetFeeTokensResponse {} diff --git a/packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.proto b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.proto new file mode 100644 index 00000000..09dc8903 --- /dev/null +++ b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package osmosis.valsetpref.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "osmosis/valsetpref/v1beta1/state.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/valset-pref/client/queryproto"; +option (gogoproto.goproto_getters_all) = false; + +// Query defines the gRPC querier service. +service Query { + // Returns the list of ValidatorPreferences for the user. + rpc UserValidatorPreferences(UserValidatorPreferencesRequest) + returns (UserValidatorPreferencesResponse) { + option (google.api.http).get = "/osmosis/valset-pref/v1beta1/{address}"; + } +} + +// Request type for UserValidatorPreferences. +message UserValidatorPreferencesRequest { + // user account address + string address = 1; +} + +// Response type the QueryUserValidatorPreferences query request +message UserValidatorPreferencesResponse { + repeated ValidatorPreference preferences = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.yml b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.yml new file mode 100644 index 00000000..a910fbba --- /dev/null +++ b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/query.yml @@ -0,0 +1,10 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v24/x/valset-pref" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v24/x/valset-pref/client" +queries: + UserValidatorPreferences: + proto_wrapper: + query_func: "k.UserValidatorPreferences" + cli: + cmd: "UserValidatorPreferences" diff --git a/packages/cosmos/proto/osmosis/valsetpref/v1beta1/state.proto b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/state.proto new file mode 100644 index 00000000..ab0f1845 --- /dev/null +++ b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/state.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package osmosis.valsetpref.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/valset-pref/types"; +option (gogoproto.goproto_getters_all) = false; + +// ValidatorPreference defines the message structure for +// CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in +// state. If a user does not have a validator set preference list set, and has +// staked, make their preference list default to their current staking +// distribution. +message ValidatorPreference { + // val_oper_address holds the validator address the user wants to delegate + // funds to. + string val_oper_address = 1 + [ (gogoproto.moretags) = "yaml:\"val_oper_address\"" ]; + // weight is decimal between 0 and 1, and they all sum to 1. + string weight = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// ValidatorSetPreferences defines a delegator's validator set preference. +// It contains a list of (validator, percent_allocation) pairs. +// The percent allocation are arranged in decimal notation from 0 to 1 and must +// add up to 1. +message ValidatorSetPreferences { + // preference holds {valAddr, weight} for the user who created it. + repeated ValidatorPreference preferences = 2 [ + (gogoproto.moretags) = "yaml:\"preferences\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/cosmos/proto/osmosis/valsetpref/v1beta1/tx.proto b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/tx.proto new file mode 100644 index 00000000..dec15702 --- /dev/null +++ b/packages/cosmos/proto/osmosis/valsetpref/v1beta1/tx.proto @@ -0,0 +1,165 @@ +syntax = "proto3"; +package osmosis.valsetpref.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/valsetpref/v1beta1/state.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/valset-pref/types"; + +// Msg defines the valset-pref module's gRPC message service. +service Msg { + // SetValidatorSetPreference creates a set of validator preference. + // This message will process both create + update request. + rpc SetValidatorSetPreference(MsgSetValidatorSetPreference) + returns (MsgSetValidatorSetPreferenceResponse); + + // DelegateToValidatorSet gets the owner, coins and delegates to a + // validator-set. + rpc DelegateToValidatorSet(MsgDelegateToValidatorSet) + returns (MsgDelegateToValidatorSetResponse); + + // UndelegateFromValidatorSet gets the owner and coins and undelegates from + // validator-set. The unbonding logic will follow the `Undelegate` logic from + // the sdk. + rpc UndelegateFromValidatorSet(MsgUndelegateFromValidatorSet) + returns (MsgUndelegateFromValidatorSetResponse); + + // UndelegateFromRebalancedValidatorSet undelegates the proivded amount from + // the validator set, but takes into consideration the current delegations + // to the user's validator set to determine the weights assigned to each. + rpc UndelegateFromRebalancedValidatorSet( + MsgUndelegateFromRebalancedValidatorSet) + returns (MsgUndelegateFromRebalancedValidatorSetResponse); + + // RedelegateValidatorSet takes the existing validator set and redelegates to + // a new set. + rpc RedelegateValidatorSet(MsgRedelegateValidatorSet) + returns (MsgRedelegateValidatorSetResponse); + + // WithdrawDelegationRewards allows users to claim rewards from the + // validator-set. + rpc WithdrawDelegationRewards(MsgWithdrawDelegationRewards) + returns (MsgWithdrawDelegationRewardsResponse); + + // DelegateBondedTokens allows users to break the lockup bond and delegate + // osmo tokens to a predefined validator-set. + rpc DelegateBondedTokens(MsgDelegateBondedTokens) + returns (MsgDelegateBondedTokensResponse); +} + +// MsgCreateValidatorSetPreference is a list that holds validator-set. +message MsgSetValidatorSetPreference { + option (amino.name) = "osmosis/MsgSetValidatorSetPreference"; + + // delegator is the user who is trying to create a validator-set. + string delegator = 1 [ (gogoproto.moretags) = "yaml:\"delegator\"" ]; + + // list of {valAddr, weight} to delegate to + repeated ValidatorPreference preferences = 2 [ + (gogoproto.moretags) = "yaml:\"preferences\"", + (gogoproto.nullable) = false + ]; +} + +message MsgSetValidatorSetPreferenceResponse {} + +// MsgDelegateToValidatorSet allows users to delegate to an existing +// validator-set +message MsgDelegateToValidatorSet { + option (amino.name) = "osmosis/MsgDelegateToValidatorSet"; + + // delegator is the user who is trying to delegate. + string delegator = 1 [ (gogoproto.moretags) = "yaml:\"delegator\"" ]; + + // the amount of tokens the user is trying to delegate. + // For ex: delegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, ValC + // -> 0.2} our staking logic would attempt to delegate 5osmo to A , 3osmo to + // B, 2osmo to C. + cosmos.base.v1beta1.Coin coin = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + +message MsgDelegateToValidatorSetResponse {} + +message MsgUndelegateFromValidatorSet { + option (amino.name) = "osmosis/MsgUndelegateFromValidatorSet"; + + // delegator is the user who is trying to undelegate. + string delegator = 1 [ (gogoproto.moretags) = "yaml:\"delegator\"" ]; + + // the amount the user wants to undelegate + // For ex: Undelegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, + // ValC + // -> 0.2} our undelegate logic would attempt to undelegate 5osmo from A , + // 3osmo from B, 2osmo from C + cosmos.base.v1beta1.Coin coin = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + +message MsgUndelegateFromValidatorSetResponse {} + +message MsgUndelegateFromRebalancedValidatorSet { + option (amino.name) = "osmosis/MsgUndelegateFromRebalValset"; + + // delegator is the user who is trying to undelegate. + string delegator = 1 [ (gogoproto.moretags) = "yaml:\"delegator\"" ]; + + // the amount the user wants to undelegate + // For ex: Undelegate 50 osmo with validator-set {ValA -> 0.5, ValB -> 0.5} + // Our undelegate logic would first check the current delegation balance. + // If the user has 90 osmo delegated to ValA and 10 osmo delegated to ValB, + // the rebalanced validator set would be {ValA -> 0.9, ValB -> 0.1} + // So now the 45 osmo would be undelegated from ValA and 5 osmo would be + // undelegated from ValB. + cosmos.base.v1beta1.Coin coin = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + +message MsgUndelegateFromRebalancedValidatorSetResponse {} + +message MsgRedelegateValidatorSet { + option (amino.name) = "osmosis/MsgRedelegateValidatorSet"; + + // delegator is the user who is trying to create a validator-set. + string delegator = 1 [ (gogoproto.moretags) = "yaml:\"delegator\"" ]; + + // list of {valAddr, weight} to delegate to + repeated ValidatorPreference preferences = 2 [ + (gogoproto.moretags) = "yaml:\"preferences\"", + (gogoproto.nullable) = false + ]; +} + +message MsgRedelegateValidatorSetResponse {} + +// MsgWithdrawDelegationRewards allows user to claim staking rewards from the +// validator set. +message MsgWithdrawDelegationRewards { + option (amino.name) = "osmosis/MsgWithdrawDelegationRewards"; + + // delegator is the user who is trying to claim staking rewards. + string delegator = 1 [ (gogoproto.moretags) = "yaml:\"delegator\"" ]; +} + +message MsgWithdrawDelegationRewardsResponse {} + +// MsgDelegateBondedTokens breaks bonded lockup (by ID) of osmo, of +// length <= 2 weeks and takes all that osmo and delegates according to +// delegator's current validator set preference. +message MsgDelegateBondedTokens { + // delegator is the user who is trying to force unbond osmo and delegate. + string delegator = 1 [ (gogoproto.moretags) = "yaml:\"delegator\"" ]; + // lockup id of osmo in the pool + uint64 lockID = 2; +} + +message MsgDelegateBondedTokensResponse {} \ No newline at end of file diff --git a/packages/cosmos/proto/tendermint/abci/types.proto b/packages/cosmos/proto/tendermint/abci/types.proto new file mode 100644 index 00000000..cf9927d7 --- /dev/null +++ b/packages/cosmos/proto/tendermint/abci/types.proto @@ -0,0 +1,444 @@ +syntax = "proto3"; +package tendermint.abci; + +option go_package = "github.com/cometbft/cometbft/abci/types"; + +// For more information on gogo.proto, see: +// https://github.com/cosmos/gogoproto/blob/master/extensions.md +import "tendermint/crypto/proof.proto"; +import "tendermint/types/types.proto"; +import "tendermint/crypto/keys.proto"; +import "tendermint/types/params.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +// This file is copied from http://github.com/tendermint/abci +// NOTE: When using custom types, mind the warnings. +// https://github.com/cosmos/gogoproto/blob/master/custom_types.md#warnings-and-issues + +//---------------------------------------- +// Request types + +message Request { + oneof value { + RequestEcho echo = 1; + RequestFlush flush = 2; + RequestInfo info = 3; + RequestInitChain init_chain = 5; + RequestQuery query = 6; + RequestBeginBlock begin_block = 7; + RequestCheckTx check_tx = 8; + RequestDeliverTx deliver_tx = 9; + RequestEndBlock end_block = 10; + RequestCommit commit = 11; + RequestListSnapshots list_snapshots = 12; + RequestOfferSnapshot offer_snapshot = 13; + RequestLoadSnapshotChunk load_snapshot_chunk = 14; + RequestApplySnapshotChunk apply_snapshot_chunk = 15; + RequestPrepareProposal prepare_proposal = 16; + RequestProcessProposal process_proposal = 17; + } + reserved 4; +} + +message RequestEcho { + string message = 1; +} + +message RequestFlush {} + +message RequestInfo { + string version = 1; + uint64 block_version = 2; + uint64 p2p_version = 3; + string abci_version = 4; +} + +message RequestInitChain { + google.protobuf.Timestamp time = 1 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2; + tendermint.types.ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; +} + +message RequestQuery { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +message RequestBeginBlock { + bytes hash = 1; + tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; + CommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + repeated Misbehavior byzantine_validators = 4 [(gogoproto.nullable) = false]; +} + +enum CheckTxType { + NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; + RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; +} + +message RequestCheckTx { + bytes tx = 1; + CheckTxType type = 2; +} + +message RequestDeliverTx { + bytes tx = 1; +} + +message RequestEndBlock { + int64 height = 1; +} + +message RequestCommit {} + +// lists available snapshots +message RequestListSnapshots {} + +// offers a snapshot to the application +message RequestOfferSnapshot { + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height +} + +// loads a snapshot chunk +message RequestLoadSnapshotChunk { + uint64 height = 1; + uint32 format = 2; + uint32 chunk = 3; +} + +// Applies a snapshot chunk +message RequestApplySnapshotChunk { + uint32 index = 1; + bytes chunk = 2; + string sender = 3; +} + +message RequestPrepareProposal { + // the modified transactions cannot exceed this size. + int64 max_tx_bytes = 1; + // txs is an array of transactions that will be included in a block, + // sent to the app for possible modifications. + repeated bytes txs = 2; + ExtendedCommitInfo local_last_commit = 3 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 4 [(gogoproto.nullable) = false]; + int64 height = 5; + google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes next_validators_hash = 7; + // address of the public key of the validator proposing the block. + bytes proposer_address = 8; +} + +message RequestProcessProposal { + repeated bytes txs = 1; + CommitInfo proposed_last_commit = 2 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 3 [(gogoproto.nullable) = false]; + // hash is the merkle root hash of the fields of the proposed block. + bytes hash = 4; + int64 height = 5; + google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes next_validators_hash = 7; + // address of the public key of the original proposer of the block. + bytes proposer_address = 8; +} + +//---------------------------------------- +// Response types + +message Response { + oneof value { + ResponseException exception = 1; + ResponseEcho echo = 2; + ResponseFlush flush = 3; + ResponseInfo info = 4; + ResponseInitChain init_chain = 6; + ResponseQuery query = 7; + ResponseBeginBlock begin_block = 8; + ResponseCheckTx check_tx = 9; + ResponseDeliverTx deliver_tx = 10; + ResponseEndBlock end_block = 11; + ResponseCommit commit = 12; + ResponseListSnapshots list_snapshots = 13; + ResponseOfferSnapshot offer_snapshot = 14; + ResponseLoadSnapshotChunk load_snapshot_chunk = 15; + ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + ResponsePrepareProposal prepare_proposal = 17; + ResponseProcessProposal process_proposal = 18; + } + reserved 5; +} + +// nondeterministic +message ResponseException { + string error = 1; +} + +message ResponseEcho { + string message = 1; +} + +message ResponseFlush {} + +message ResponseInfo { + string data = 1; + + string version = 2; + uint64 app_version = 3; + + int64 last_block_height = 4; + bytes last_block_app_hash = 5; +} + +message ResponseInitChain { + tendermint.types.ConsensusParams consensus_params = 1; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + bytes app_hash = 3; +} + +message ResponseQuery { + uint32 code = 1; + // bytes data = 2; // use "value" instead. + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + tendermint.crypto.ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +message ResponseBeginBlock { + repeated Event events = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCheckTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; + string sender = 9; + int64 priority = 10; + + // mempool_error is set by CometBFT. + // ABCI applictions creating a ResponseCheckTX should not set mempool_error. + string mempool_error = 11; +} + +message ResponseDeliverTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "events,omitempty" + ]; // nondeterministic + string codespace = 8; +} + +message ResponseEndBlock { + repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; + tendermint.types.ConsensusParams consensus_param_updates = 2; + repeated Event events = 3 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCommit { + // reserve 1 + bytes data = 2; + int64 retain_height = 3; +} + +message ResponseListSnapshots { + repeated Snapshot snapshots = 1; +} + +message ResponseOfferSnapshot { + Result result = 1; + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + } +} + +message ResponseLoadSnapshotChunk { + bytes chunk = 1; +} + +message ResponseApplySnapshotChunk { + Result result = 1; + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + } +} + +message ResponsePrepareProposal { + repeated bytes txs = 1; +} + +message ResponseProcessProposal { + ProposalStatus status = 1; + + enum ProposalStatus { + UNKNOWN = 0; + ACCEPT = 1; + REJECT = 2; + } +} + +//---------------------------------------- +// Misc. + +message CommitInfo { + int32 round = 1; + repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; +} + +message ExtendedCommitInfo { + // The round at which the block proposer decided in the previous height. + int32 round = 1; + // List of validators' addresses in the last validator set with their voting + // information, including vote extensions. + repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false]; +} + +// Event allows application developers to attach additional information to +// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. +// Later, transactions may be queried using these events. +message Event { + string type = 1; + repeated EventAttribute attributes = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "attributes,omitempty" + ]; +} + +// EventAttribute is a single key-value pair, associated with an event. +message EventAttribute { + string key = 1; + string value = 2; + bool index = 3; // nondeterministic +} + +// TxResult contains results of executing the transaction. +// +// One usage is indexing transaction results. +message TxResult { + int64 height = 1; + uint32 index = 2; + bytes tx = 3; + ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; +} + +//---------------------------------------- +// Blockchain Types + +// Validator +message Validator { + bytes address = 1; // The first 20 bytes of SHA256(public key) + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; + int64 power = 3; // The voting power +} + +// ValidatorUpdate +message ValidatorUpdate { + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + int64 power = 2; +} + +// VoteInfo +message VoteInfo { + Validator validator = 1 [(gogoproto.nullable) = false]; + bool signed_last_block = 2; +} + +message ExtendedVoteInfo { + Validator validator = 1 [(gogoproto.nullable) = false]; + bool signed_last_block = 2; + bytes vote_extension = 3; // Reserved for future use +} + +enum MisbehaviorType { + UNKNOWN = 0; + DUPLICATE_VOTE = 1; + LIGHT_CLIENT_ATTACK = 2; +} + +message Misbehavior { + MisbehaviorType type = 1; + // The offending validator + Validator validator = 2 [(gogoproto.nullable) = false]; + // The height when the offense occurred + int64 height = 3; + // The corresponding time where the offense occurred + google.protobuf.Timestamp time = 4 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // Total voting power of the validator set in case the ABCI application does + // not store historical validators. + // https://github.com/tendermint/tendermint/issues/4581 + int64 total_voting_power = 5; +} + +//---------------------------------------- +// State Sync Types + +message Snapshot { + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata +} + +//---------------------------------------- +// Service Definition + +service ABCIApplication { + rpc Echo(RequestEcho) returns (ResponseEcho); + rpc Flush(RequestFlush) returns (ResponseFlush); + rpc Info(RequestInfo) returns (ResponseInfo); + rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); + rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); + rpc Query(RequestQuery) returns (ResponseQuery); + rpc Commit(RequestCommit) returns (ResponseCommit); + rpc InitChain(RequestInitChain) returns (ResponseInitChain); + rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); + rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); + rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); + rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) + returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) + returns (ResponseApplySnapshotChunk); + rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal); + rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal); +} diff --git a/packages/cosmos/proto/tendermint/crypto/keys.proto b/packages/cosmos/proto/tendermint/crypto/keys.proto new file mode 100644 index 00000000..8fa192fa --- /dev/null +++ b/packages/cosmos/proto/tendermint/crypto/keys.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +// PublicKey defines the keys available for use with Validators +message PublicKey { + option (gogoproto.compare) = true; + option (gogoproto.equal) = true; + + oneof sum { + bytes ed25519 = 1; + bytes secp256k1 = 2; + } +} diff --git a/packages/cosmos/proto/tendermint/crypto/proof.proto b/packages/cosmos/proto/tendermint/crypto/proof.proto new file mode 100644 index 00000000..ae72195e --- /dev/null +++ b/packages/cosmos/proto/tendermint/crypto/proof.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +message Proof { + int64 total = 1; + int64 index = 2; + bytes leaf_hash = 3; + repeated bytes aunts = 4; +} + +message ValueOp { + // Encoded in ProofOp.Key. + bytes key = 1; + + // To encode in ProofOp.Data + Proof proof = 2; +} + +message DominoOp { + string key = 1; + string input = 2; + string output = 3; +} + +// ProofOp defines an operation used for calculating Merkle root +// The data could be arbitrary format, providing nessecary data +// for example neighbouring node hash +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/tendermint/libs/bits/types.proto b/packages/cosmos/proto/tendermint/libs/bits/types.proto new file mode 100644 index 00000000..e6afc5e8 --- /dev/null +++ b/packages/cosmos/proto/tendermint/libs/bits/types.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package tendermint.libs.bits; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/libs/bits"; + +message BitArray { + int64 bits = 1; + repeated uint64 elems = 2; +} diff --git a/packages/cosmos/proto/tendermint/p2p/types.proto b/packages/cosmos/proto/tendermint/p2p/types.proto new file mode 100644 index 00000000..157d8ba1 --- /dev/null +++ b/packages/cosmos/proto/tendermint/p2p/types.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package tendermint.p2p; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/p2p"; + +import "gogoproto/gogo.proto"; + +message NetAddress { + string id = 1 [(gogoproto.customname) = "ID"]; + string ip = 2 [(gogoproto.customname) = "IP"]; + uint32 port = 3; +} + +message ProtocolVersion { + uint64 p2p = 1 [(gogoproto.customname) = "P2P"]; + uint64 block = 2; + uint64 app = 3; +} + +message DefaultNodeInfo { + ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false]; + string default_node_id = 2 [(gogoproto.customname) = "DefaultNodeID"]; + string listen_addr = 3; + string network = 4; + string version = 5; + bytes channels = 6; + string moniker = 7; + DefaultNodeInfoOther other = 8 [(gogoproto.nullable) = false]; +} + +message DefaultNodeInfoOther { + string tx_index = 1; + string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"]; +} diff --git a/packages/cosmos/proto/tendermint/types/block.proto b/packages/cosmos/proto/tendermint/types/block.proto new file mode 100644 index 00000000..d531c06a --- /dev/null +++ b/packages/cosmos/proto/tendermint/types/block.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; + +message Block { + Header header = 1 [(gogoproto.nullable) = false]; + Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + Commit last_commit = 4; +} diff --git a/packages/cosmos/proto/tendermint/types/evidence.proto b/packages/cosmos/proto/tendermint/types/evidence.proto new file mode 100644 index 00000000..1f35049b --- /dev/null +++ b/packages/cosmos/proto/tendermint/types/evidence.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/validator.proto"; + +message Evidence { + oneof sum { + DuplicateVoteEvidence duplicate_vote_evidence = 1; + LightClientAttackEvidence light_client_attack_evidence = 2; + } +} + +// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. +message DuplicateVoteEvidence { + tendermint.types.Vote vote_a = 1; + tendermint.types.Vote vote_b = 2; + int64 total_voting_power = 3; + int64 validator_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. +message LightClientAttackEvidence { + tendermint.types.LightBlock conflicting_block = 1; + int64 common_height = 2; + repeated tendermint.types.Validator byzantine_validators = 3; + int64 total_voting_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +message EvidenceList { + repeated Evidence evidence = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmos/proto/tendermint/types/params.proto b/packages/cosmos/proto/tendermint/types/params.proto new file mode 100644 index 00000000..66963eec --- /dev/null +++ b/packages/cosmos/proto/tendermint/types/params.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option (gogoproto.equal_all) = true; + +// ConsensusParams contains consensus critical parameters that determine the +// validity of blocks. +message ConsensusParams { + BlockParams block = 1; + EvidenceParams evidence = 2; + ValidatorParams validator = 3; + VersionParams version = 4; +} + +// BlockParams contains limits on the block size. +message BlockParams { + // Max block size, in bytes. + // Note: must be greater than 0 + int64 max_bytes = 1; + // Max gas per block. + // Note: must be greater or equal to -1 + int64 max_gas = 2; + + reserved 3; // was TimeIotaMs see https://github.com/cometbft/cometbft/pull/5792 +} + +// EvidenceParams determine how we handle evidence of malfeasance. +message EvidenceParams { + // Max age of evidence, in blocks. + // + // The basic formula for calculating this is: MaxAgeDuration / {average block + // time}. + int64 max_age_num_blocks = 1; + + // Max age of evidence, in time. + // + // It should correspond with an app's "unbonding period" or other similar + // mechanism for handling [Nothing-At-Stake + // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + google.protobuf.Duration max_age_duration = 2 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + + // This sets the maximum size of total evidence in bytes that can be committed in a single block. + // and should fall comfortably under the max block bytes. + // Default is 1048576 or 1MB + int64 max_bytes = 3; +} + +// ValidatorParams restrict the public key types validators can use. +// NOTE: uses ABCI pubkey naming, not Amino names. +message ValidatorParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + repeated string pub_key_types = 1; +} + +// VersionParams contains the ABCI application version. +message VersionParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + uint64 app = 1; +} + +// HashedParams is a subset of ConsensusParams. +// +// It is hashed into the Header.ConsensusHash. +message HashedParams { + int64 block_max_bytes = 1; + int64 block_max_gas = 2; +} diff --git a/packages/cosmos/proto/tendermint/types/types.proto b/packages/cosmos/proto/tendermint/types/types.proto new file mode 100644 index 00000000..425f041d --- /dev/null +++ b/packages/cosmos/proto/tendermint/types/types.proto @@ -0,0 +1,157 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/crypto/proof.proto"; +import "tendermint/version/types.proto"; +import "tendermint/types/validator.proto"; + +// BlockIdFlag indicates which BlcokID the signature is for +enum BlockIDFlag { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; + BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; + BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; + BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; +} + +// SignedMsgType is a type of signed message in the consensus. +enum SignedMsgType { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; + // Votes + SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; + SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; + + // Proposals + SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; +} + +// PartsetHeader +message PartSetHeader { + uint32 total = 1; + bytes hash = 2; +} + +message Part { + uint32 index = 1; + bytes bytes = 2; + tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; +} + +// BlockID +message BlockID { + bytes hash = 1; + PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; +} + +// -------------------------------- + +// Header defines the structure of a block header. +message Header { + // basic block info + tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // prev block info + BlockID last_block_id = 5 [(gogoproto.nullable) = false]; + + // hashes of block data + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block +} + +// Data contains the set of transactions included in the block +message Data { + // Txs that will be applied by state @ block.Height+1. + // NOTE: not all txs here are valid. We're just agreeing on the order first. + // This means that block.AppHash does not include these txs. + repeated bytes txs = 1; +} + +// Vote represents a prevote, precommit, or commit vote from validators for +// consensus. +message Vote { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + BlockID block_id = 4 + [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; + bytes signature = 8; +} + +// Commit contains the evidence that a block was committed by a set of validators. +message Commit { + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; +} + +// CommitSig is a part of the Vote included in a Commit. +message CommitSig { + BlockIDFlag block_id_flag = 1; + bytes validator_address = 2; + google.protobuf.Timestamp timestamp = 3 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; +} + +message Proposal { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + int32 pol_round = 4; + BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + google.protobuf.Timestamp timestamp = 6 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; +} + +message SignedHeader { + Header header = 1; + Commit commit = 2; +} + +message LightBlock { + SignedHeader signed_header = 1; + tendermint.types.ValidatorSet validator_set = 2; +} + +message BlockMeta { + BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + int64 block_size = 2; + Header header = 3 [(gogoproto.nullable) = false]; + int64 num_txs = 4; +} + +// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. +message TxProof { + bytes root_hash = 1; + bytes data = 2; + tendermint.crypto.Proof proof = 3; +} diff --git a/packages/cosmos/proto/tendermint/types/validator.proto b/packages/cosmos/proto/tendermint/types/validator.proto new file mode 100644 index 00000000..3e170262 --- /dev/null +++ b/packages/cosmos/proto/tendermint/types/validator.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/crypto/keys.proto"; + +message ValidatorSet { + repeated Validator validators = 1; + Validator proposer = 2; + int64 total_voting_power = 3; +} + +message Validator { + bytes address = 1; + tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +message SimpleValidator { + tendermint.crypto.PublicKey pub_key = 1; + int64 voting_power = 2; +} diff --git a/packages/cosmos/proto/tendermint/version/types.proto b/packages/cosmos/proto/tendermint/version/types.proto new file mode 100644 index 00000000..3b6ef454 --- /dev/null +++ b/packages/cosmos/proto/tendermint/version/types.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package tendermint.version; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/version"; + +import "gogoproto/gogo.proto"; + +// App includes the protocol and software version for the application. +// This information is included in ResponseInfo. The App.Protocol can be +// updated in ResponseEndBlock. +message App { + uint64 protocol = 1; + string software = 2; +} + +// Consensus captures the consensus rules for processing a block in the blockchain, +// including all blockchain data structures and the rules of the application's +// state transition machine. +message Consensus { + option (gogoproto.equal) = true; + + uint64 block = 1; + uint64 app = 2; +} diff --git a/packages/cosmos/proto/tx.proto b/packages/cosmos/proto/tx.proto new file mode 100644 index 00000000..ac24072f --- /dev/null +++ b/packages/cosmos/proto/tx.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/model"; + +service Msg { + rpc CreateConcentratedPool(MsgCreateConcentratedPool) + returns (MsgCreateConcentratedPoolResponse); +} + +// ===================== MsgCreateConcentratedPool +message MsgCreateConcentratedPool { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom0 = 2 [ (gogoproto.moretags) = "yaml:\"denom0\"" ]; + string denom1 = 3 [ (gogoproto.moretags) = "yaml:\"denom1\"" ]; + uint64 tick_spacing = 4 [ (gogoproto.moretags) = "yaml:\"tick_spacing\"" ]; + string spread_factor = 5 [ + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "yaml:\"spread_factor\"", + (gogoproto.nullable) = false + ]; +} + +// Returns a unique poolID to identify the pool with. +message MsgCreateConcentratedPoolResponse { + uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; +} diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index d4a4dfd3..78fabe95 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -26,8 +26,8 @@ import 'reflect-metadata'; import { bech32 } from 'bech32'; import { utils } from 'ethers'; import { AccAddress } from '@terra-money/feather.js'; -import { osmosis } from 'osmojs/osmosis/bundle'; +import { osmosis } from './proto_export/osmosis/bundle'; import { ChainMsg } from './msg'; import * as manifests from './manifests'; import { ChainDataSource, IndexerDataSource } from './datasource'; diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index a8df1b8d..a329636a 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -24,12 +24,14 @@ import { TxRaw, } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'; -import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; -import { MsgTransfer } from 'cosmjs-types/ibc/applications/transfer/v1/tx'; +// import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; import { ChainMsg } from '../../msg'; import * as manifests from '../../manifests'; import { CosmosHubChains } from '../../manifests'; +import { MsgSwapExactAmountIn } from '../../proto_export/osmosis/gamm/v1beta1/tx'; +import { MsgTransfer } from '../../proto_export/ibc/applications/transfer/v1/tx'; +import { MsgSend } from '../../proto_export/cosmos/bank/v1beta1/tx'; import { getBalance, getFees, getTransactions, getNFTBalance } from './queries'; @@ -130,34 +132,37 @@ export class IndexerDataSource extends DataSource { async estimateFee(msgs: ChainMsg[], speed: GasFeeSpeed): Promise { let fromAddress = ''; - const _msgs = msgs.map((m) => { - const messageData = m.toData(); + const _msgs: any[] = []; + for (let index = 0; index < msgs.length; index++) { + const m = msgs[index]; + const messageData = + m.encoding === 'string' ? await m.buildTx() : m.toData(); fromAddress = messageData.from; - if (messageData.typeUrl === '/ibc.applications.transfer.v1.MsgTransfer') { - const msgTransfer = messageData.msgs[0]; - return { - typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', - value: MsgTransfer.encode( - MsgTransfer.fromPartial(msgTransfer.value) - ).finish(), - }; - } - return { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.encode({ - fromAddress: messageData.from, - toAddress: messageData.to, - amount: [ - { - denom: this.manifest.denom, - amount: String( - messageData.amount * Math.pow(10, this.manifest.decimals) - ), - }, - ], - }).finish(), - }; - }); + messageData.msgs.map((msgTransfer: any) => { + if (msgTransfer.typeUrl.includes('MsgTransfer')) { + _msgs.push({ + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.encode( + MsgTransfer.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl.includes('MsgSwapExactAmountIn')) { + _msgs.push({ + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode( + MsgSwapExactAmountIn.fromPartial(msgTransfer.value) + ).finish(), + }); + } else { + _msgs.push({ + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.encode( + MsgSend.fromPartial(msgTransfer.value) + ).finish(), + }); + } + }); + } const _feeAmount = msgs.map((m) => { const messageData = m.toData(); diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index f572d131..5d1002d7 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -10,20 +10,20 @@ import { import { StdTx } from '@cosmjs/amino/build/stdtx'; import { Coin as AminoCoin } from '@cosmjs/amino/build/coins'; import BigNumber from 'bignumber.js'; -import { MsgSend } from 'osmojs/cosmos/bank/v1beta1/tx'; -import { MessageComposer as MessageComposerCosmos } from 'osmojs/cosmos/bank/v1beta1/tx.registry'; -import { AminoConverter as AminoConverterCosmos } from 'osmojs/cosmos/bank/v1beta1/tx.amino'; -import { MsgSwapExactAmountIn } from 'osmojs/osmosis/gamm/v1beta1/tx'; -import { MessageComposer as MessageComposerGamm } from 'osmojs/osmosis/gamm/v1beta1/tx.registry'; -import { AminoConverter as AminoConverterGamm } from 'osmojs/osmosis/gamm/v1beta1/tx.amino'; -import { MsgTransfer } from 'osmojs/ibc/applications/transfer/v1/tx'; -import { MessageComposer as MessageComposerIbc } from 'osmojs/ibc/applications/transfer/v1/tx.registry'; -import { AminoConverter as AminoConverterIbc } from 'osmojs/ibc/applications/transfer/v1/tx.amino'; import Long from 'long'; import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; import { StdSignature } from '@cosmjs/amino'; +import { MsgTransfer } from './proto_export/ibc/applications/transfer/v1/tx'; +import { MessageComposer as MessageComposerIbc } from './proto_export/ibc/applications/transfer/v1/tx.registry'; +import { AminoConverter as AminoConverterIbc } from './proto_export/ibc/applications/transfer/v1/tx.amino'; +import { AminoConverter as AminoConverterCosmos } from './proto_export/cosmos/bank/v1beta1/tx.amino'; +import { MessageComposer as MessageComposerCosmos } from './proto_export/cosmos/bank/v1beta1/tx.registry'; +import { MsgSend } from './proto_export/cosmos/bank/v1beta1/tx'; import type { CosmosProvider } from './chain.provider'; +import { MsgSwapExactAmountIn } from './proto_export/osmosis/gamm/v1beta1/tx'; +import { MessageComposer as MessageComposerGamm } from './proto_export/osmosis/gamm/v1beta1/tx.registry'; +import { AminoConverter as AminoConverterGamm } from './proto_export/osmosis/gamm/v1beta1/tx.amino'; export type MsgBody = { from: string; diff --git a/packages/cosmos/src/proto_export/amino/amino.ts b/packages/cosmos/src/proto_export/amino/amino.ts new file mode 100644 index 00000000..65f8475a --- /dev/null +++ b/packages/cosmos/src/proto_export/amino/amino.ts @@ -0,0 +1,9 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v1.181.1 +// protoc v5.27.1 +// source: amino/amino.proto + +/* eslint-disable */ + +export const protobufPackage = 'amino'; diff --git a/packages/cosmos/src/proto_export/binary.ts b/packages/cosmos/src/proto_export/binary.ts new file mode 100644 index 00000000..0f446167 --- /dev/null +++ b/packages/cosmos/src/proto_export/binary.ts @@ -0,0 +1,534 @@ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- + +// Code generated by the command line utilities is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +import { utf8Length, utf8Read, utf8Write } from './utf8'; +import { + int64ToString, + readInt32, + readUInt32, + uInt64ToString, + varint32read, + varint64read, + writeVarint32, + writeVarint64, + int64FromString, + int64Length, + writeFixed32, + writeByte, + zzDecode, + zzEncode, +} from './varint'; + +export enum WireType { + Varint = 0, + + Fixed64 = 1, + + Bytes = 2, + + Fixed32 = 5, +} + +// Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} + +export class BinaryReader implements IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + + assertBounds(): void { + if (this.pos > this.len) throw new RangeError('premature EOF'); + } + + constructor(buf?: ArrayLike) { + this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0); + this.pos = 0; + this.type = 0; + this.len = this.buf.length; + } + + tag(): [number, WireType, number] { + const tag = this.uint32(), + fieldNo = tag >>> 3, + wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error( + 'illegal tag: field no ' + fieldNo + ' wire type ' + wireType + ); + return [fieldNo, wireType, tag]; + } + + skip(length?: number) { + if (typeof length === 'number') { + if (this.pos + length > this.len) throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + } + + skipType(wireType: number) { + switch (wireType) { + case WireType.Varint: + this.skip(); + break; + case WireType.Fixed64: + this.skip(8); + break; + case WireType.Bytes: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case WireType.Fixed32: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error('invalid wire type ' + wireType + ' at offset ' + this.pos); + } + return this; + } + + uint32(): number { + return varint32read.bind(this)(); + } + + int32(): number { + return this.uint32() | 0; + } + + sint32(): number { + const num = this.uint32(); + return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding + } + + fixed32(): number { + const val = readUInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + sfixed32(): number { + const val = readInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + int64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(int64ToString(lo, hi)); + } + + uint64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(uInt64ToString(lo, hi)); + } + + sint64(): bigint { + let [lo, hi] = varint64read.bind(this)(); + // zig zag + [lo, hi] = zzDecode(lo, hi); + return BigInt(int64ToString(lo, hi)); + } + + fixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(uInt64ToString(lo, hi)); + } + sfixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(int64ToString(lo, hi)); + } + + float(): number { + throw new Error('float not supported'); + } + + double(): number { + throw new Error('double not supported'); + } + + bool(): boolean { + const [lo, hi] = varint64read.bind(this)(); + return lo !== 0 || hi !== 0; + } + + bytes(): Uint8Array { + const len = this.uint32(), + start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + + string(): string { + const bytes = this.bytes(); + return utf8Read(bytes, 0, bytes.length); + } +} + +// Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} + +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} + +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; + len: number; + val: T; + next?: IOp; + + constructor( + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, + len: number, + val: T + ) { + this.fn = fn; + this.len = len; + this.val = val; + } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } +} + +class State { + head: IOp; + tail: IOp; + len: number; + next: State | null; + + constructor(writer: BinaryWriter) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } +} + +export class BinaryWriter implements IBinaryWriter { + len = 0; + head: IOp; + tail: IOp; + states: State | null; + + constructor() { + this.head = new Op(null, 0, 0); + this.tail = this.head; + this.states = null; + } + + static create() { + return new BinaryWriter(); + } + + static alloc(size: number): Uint8Array | number[] { + if (typeof Uint8Array !== 'undefined') { + return pool( + (size) => new Uint8Array(size), + Uint8Array.prototype.subarray + )(size); + } else { + return new Array(size); + } + } + + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, + len: number, + val: T + ) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + } + + finish(): Uint8Array { + let head = this.head.next, + pos = 0; + const buf = BinaryWriter.alloc(this.len); + while (head) { + head.proceed(buf, pos); + pos += head.len; + head = head.next; + } + return buf as Uint8Array; + } + + fork(): BinaryWriter { + this.states = new State(this); + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + return this; + } + + reset(): BinaryWriter { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + } + return this; + } + + ldelim(): BinaryWriter { + const head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + } + + tag(fieldNo: number, type: WireType): BinaryWriter { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + + uint32(value: number): BinaryWriter { + this.len += (this.tail = this.tail.next = + new Op( + writeVarint32, + (value = value >>> 0) < 128 + ? 1 + : value < 16384 + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, + value + )).len; + return this; + } + + int32(value: number): BinaryWriter { + return value < 0 + ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec + : this.uint32(value); + } + + sint32(value: number): BinaryWriter { + return this.uint32(((value << 1) ^ (value >> 31)) >>> 0); + } + + int64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + // uint64 is the same with int64 + uint64 = BinaryWriter.prototype.int64; + + sint64(value: string | number | bigint): BinaryWriter { + let { lo, hi } = int64FromString(value.toString()); + // zig zag + [lo, hi] = zzEncode(lo, hi); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + fixed64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi); + } + + // sfixed64 is the same with fixed64 + sfixed64 = BinaryWriter.prototype.fixed64; + + bool(value: boolean): BinaryWriter { + return this._push(writeByte, 1, value ? 1 : 0); + } + + fixed32(value: number): BinaryWriter { + return this._push(writeFixed32, 4, value >>> 0); + } + + // sfixed32 is the same with fixed32 + sfixed32 = BinaryWriter.prototype.fixed32; + + float(value: number): BinaryWriter { + throw new Error('float not supported' + value); + } + + double(value: number): BinaryWriter { + throw new Error('double not supported' + value); + } + + bytes(value: Uint8Array): BinaryWriter { + const len = value.length >>> 0; + if (!len) return this._push(writeByte, 1, 0); + return this.uint32(len)._push(writeBytes, len, value); + } + + string(value: string): BinaryWriter { + const len = utf8Length(value); + return len + ? this.uint32(len)._push(utf8Write, len, value) + : this._push(writeByte, 1, 0); + } +} + +function writeBytes( + val: Uint8Array | number[], + buf: Uint8Array | number[], + pos: number +) { + if (typeof Uint8Array !== 'undefined') { + (buf as Uint8Array).set(val, pos); + } else { + for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i]; + } +} + +function pool( + alloc: (size: number) => Uint8Array, + slice: (begin?: number, end?: number) => Uint8Array, + size?: number +): (size: number) => Uint8Array { + const SIZE = size || 8192; + const MAX = SIZE >>> 1; + let slab: Uint8Array | null = null; + let offset = SIZE; + return function pool_alloc(size): Uint8Array { + if (size < 1 || size > MAX) return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + const buf: Uint8Array = slice.call(slab, offset, (offset += size)); + if (offset & 7) + // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +function indexOutOfRange(reader: BinaryReader, writeLength?: number) { + return RangeError( + 'index out of range: ' + + reader.pos + + ' + ' + + (writeLength || 1) + + ' > ' + + reader.len + ); +} diff --git a/packages/cosmos/src/proto_export/cosmos/auth/module/v1/module.ts b/packages/cosmos/src/proto_export/cosmos/auth/module/v1/module.ts new file mode 100644 index 00000000..a1719917 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/auth/module/v1/module.ts @@ -0,0 +1,352 @@ +import { BinaryReader, BinaryWriter } from '../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../registry'; +/** Module is the config object for the auth module. */ +export interface Module { + /** bech32_prefix is the bech32 account prefix for the app. */ + bech32Prefix: string; + /** module_account_permissions are module account permissions. */ + moduleAccountPermissions: ModuleAccountPermission[]; + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority: string; +} +export interface ModuleProtoMsg { + typeUrl: '/cosmos.auth.module.v1.Module'; + value: Uint8Array; +} +/** Module is the config object for the auth module. */ +export interface ModuleAmino { + /** bech32_prefix is the bech32 account prefix for the app. */ + bech32_prefix?: string; + /** module_account_permissions are module account permissions. */ + module_account_permissions?: ModuleAccountPermissionAmino[]; + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority?: string; +} +export interface ModuleAminoMsg { + type: 'cosmos-sdk/Module'; + value: ModuleAmino; +} +/** Module is the config object for the auth module. */ +export interface ModuleSDKType { + bech32_prefix: string; + module_account_permissions: ModuleAccountPermissionSDKType[]; + authority: string; +} +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermission { + /** account is the name of the module. */ + account: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions: string[]; +} +export interface ModuleAccountPermissionProtoMsg { + typeUrl: '/cosmos.auth.module.v1.ModuleAccountPermission'; + value: Uint8Array; +} +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermissionAmino { + /** account is the name of the module. */ + account?: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions?: string[]; +} +export interface ModuleAccountPermissionAminoMsg { + type: 'cosmos-sdk/ModuleAccountPermission'; + value: ModuleAccountPermissionAmino; +} +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermissionSDKType { + account: string; + permissions: string[]; +} +function createBaseModule(): Module { + return { + bech32Prefix: '', + moduleAccountPermissions: [], + authority: '', + }; +} +export const Module = { + typeUrl: '/cosmos.auth.module.v1.Module', + aminoType: 'cosmos-sdk/Module', + is(o: any): o is Module { + return ( + o && + (o.$typeUrl === Module.typeUrl || + (typeof o.bech32Prefix === 'string' && + Array.isArray(o.moduleAccountPermissions) && + (!o.moduleAccountPermissions.length || + ModuleAccountPermission.is(o.moduleAccountPermissions[0])) && + typeof o.authority === 'string')) + ); + }, + isSDK(o: any): o is ModuleSDKType { + return ( + o && + (o.$typeUrl === Module.typeUrl || + (typeof o.bech32_prefix === 'string' && + Array.isArray(o.module_account_permissions) && + (!o.module_account_permissions.length || + ModuleAccountPermission.isSDK(o.module_account_permissions[0])) && + typeof o.authority === 'string')) + ); + }, + isAmino(o: any): o is ModuleAmino { + return ( + o && + (o.$typeUrl === Module.typeUrl || + (typeof o.bech32_prefix === 'string' && + Array.isArray(o.module_account_permissions) && + (!o.module_account_permissions.length || + ModuleAccountPermission.isAmino(o.module_account_permissions[0])) && + typeof o.authority === 'string')) + ); + }, + encode( + message: Module, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.bech32Prefix !== '') { + writer.uint32(10).string(message.bech32Prefix); + } + for (const v of message.moduleAccountPermissions) { + ModuleAccountPermission.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.authority !== '') { + writer.uint32(26).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bech32Prefix = reader.string(); + break; + case 2: + message.moduleAccountPermissions.push( + ModuleAccountPermission.decode(reader, reader.uint32()) + ); + break; + case 3: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Module { + const message = createBaseModule(); + message.bech32Prefix = object.bech32Prefix ?? ''; + message.moduleAccountPermissions = + object.moduleAccountPermissions?.map((e) => + ModuleAccountPermission.fromPartial(e) + ) || []; + message.authority = object.authority ?? ''; + return message; + }, + fromAmino(object: ModuleAmino): Module { + const message = createBaseModule(); + if (object.bech32_prefix !== undefined && object.bech32_prefix !== null) { + message.bech32Prefix = object.bech32_prefix; + } + message.moduleAccountPermissions = + object.module_account_permissions?.map((e) => + ModuleAccountPermission.fromAmino(e) + ) || []; + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: Module): ModuleAmino { + const obj: any = {}; + obj.bech32_prefix = + message.bech32Prefix === '' ? undefined : message.bech32Prefix; + if (message.moduleAccountPermissions) { + obj.module_account_permissions = message.moduleAccountPermissions.map( + (e) => (e ? ModuleAccountPermission.toAmino(e) : undefined) + ); + } else { + obj.module_account_permissions = message.moduleAccountPermissions; + } + obj.authority = message.authority === '' ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: ModuleAminoMsg): Module { + return Module.fromAmino(object.value); + }, + toAminoMsg(message: Module): ModuleAminoMsg { + return { + type: 'cosmos-sdk/Module', + value: Module.toAmino(message), + }; + }, + fromProtoMsg(message: ModuleProtoMsg): Module { + return Module.decode(message.value); + }, + toProto(message: Module): Uint8Array { + return Module.encode(message).finish(); + }, + toProtoMsg(message: Module): ModuleProtoMsg { + return { + typeUrl: '/cosmos.auth.module.v1.Module', + value: Module.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Module.typeUrl, Module); +GlobalDecoderRegistry.registerAminoProtoMapping( + Module.aminoType, + Module.typeUrl +); +function createBaseModuleAccountPermission(): ModuleAccountPermission { + return { + account: '', + permissions: [], + }; +} +export const ModuleAccountPermission = { + typeUrl: '/cosmos.auth.module.v1.ModuleAccountPermission', + aminoType: 'cosmos-sdk/ModuleAccountPermission', + is(o: any): o is ModuleAccountPermission { + return ( + o && + (o.$typeUrl === ModuleAccountPermission.typeUrl || + (typeof o.account === 'string' && + Array.isArray(o.permissions) && + (!o.permissions.length || typeof o.permissions[0] === 'string'))) + ); + }, + isSDK(o: any): o is ModuleAccountPermissionSDKType { + return ( + o && + (o.$typeUrl === ModuleAccountPermission.typeUrl || + (typeof o.account === 'string' && + Array.isArray(o.permissions) && + (!o.permissions.length || typeof o.permissions[0] === 'string'))) + ); + }, + isAmino(o: any): o is ModuleAccountPermissionAmino { + return ( + o && + (o.$typeUrl === ModuleAccountPermission.typeUrl || + (typeof o.account === 'string' && + Array.isArray(o.permissions) && + (!o.permissions.length || typeof o.permissions[0] === 'string'))) + ); + }, + encode( + message: ModuleAccountPermission, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.account !== '') { + writer.uint32(10).string(message.account); + } + for (const v of message.permissions) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ModuleAccountPermission { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccountPermission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + message.account = object.account ?? ''; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, + fromAmino(object: ModuleAccountPermissionAmino): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, + toAmino(message: ModuleAccountPermission): ModuleAccountPermissionAmino { + const obj: any = {}; + obj.account = message.account === '' ? undefined : message.account; + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = message.permissions; + } + return obj; + }, + fromAminoMsg( + object: ModuleAccountPermissionAminoMsg + ): ModuleAccountPermission { + return ModuleAccountPermission.fromAmino(object.value); + }, + toAminoMsg( + message: ModuleAccountPermission + ): ModuleAccountPermissionAminoMsg { + return { + type: 'cosmos-sdk/ModuleAccountPermission', + value: ModuleAccountPermission.toAmino(message), + }; + }, + fromProtoMsg( + message: ModuleAccountPermissionProtoMsg + ): ModuleAccountPermission { + return ModuleAccountPermission.decode(message.value); + }, + toProto(message: ModuleAccountPermission): Uint8Array { + return ModuleAccountPermission.encode(message).finish(); + }, + toProtoMsg( + message: ModuleAccountPermission + ): ModuleAccountPermissionProtoMsg { + return { + typeUrl: '/cosmos.auth.module.v1.ModuleAccountPermission', + value: ModuleAccountPermission.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ModuleAccountPermission.typeUrl, + ModuleAccountPermission +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleAccountPermission.aminoType, + ModuleAccountPermission.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos/auth/v1beta1/auth.ts b/packages/cosmos/src/proto_export/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 00000000..f6a30039 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,786 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +import { bytesFromBase64, base64FromBytes } from '../../../helpers'; +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccount { + $typeUrl?: '/cosmos.auth.v1beta1.BaseAccount'; + address: string; + pubKey?: Any; + accountNumber: bigint; + sequence: bigint; +} +export interface BaseAccountProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.BaseAccount'; + value: Uint8Array; +} +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccountAmino { + address?: string; + pub_key?: AnyAmino; + account_number?: string; + sequence?: string; +} +export interface BaseAccountAminoMsg { + type: 'cosmos-sdk/BaseAccount'; + value: BaseAccountAmino; +} +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccountSDKType { + $typeUrl?: '/cosmos.auth.v1beta1.BaseAccount'; + address: string; + pub_key?: AnySDKType; + account_number: bigint; + sequence: bigint; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccount { + $typeUrl?: '/cosmos.auth.v1beta1.ModuleAccount'; + baseAccount?: BaseAccount; + name: string; + permissions: string[]; +} +export interface ModuleAccountProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.ModuleAccount'; + value: Uint8Array; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountAmino { + base_account?: BaseAccountAmino; + name?: string; + permissions?: string[]; +} +export interface ModuleAccountAminoMsg { + type: 'cosmos-sdk/ModuleAccount'; + value: ModuleAccountAmino; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountSDKType { + $typeUrl?: '/cosmos.auth.v1beta1.ModuleAccount'; + base_account?: BaseAccountSDKType; + name: string; + permissions: string[]; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredential { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + moduleName: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivationKeys: Uint8Array[]; +} +export interface ModuleCredentialProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.ModuleCredential'; + value: Uint8Array; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialAmino { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + module_name?: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivation_keys?: string[]; +} +export interface ModuleCredentialAminoMsg { + type: 'cosmos-sdk/ModuleCredential'; + value: ModuleCredentialAmino; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialSDKType { + module_name: string; + derivation_keys: Uint8Array[]; +} +/** Params defines the parameters for the auth module. */ +export interface Params { + maxMemoCharacters: bigint; + txSigLimit: bigint; + txSizeCostPerByte: bigint; + sigVerifyCostEd25519: bigint; + sigVerifyCostSecp256k1: bigint; +} +export interface ParamsProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.Params'; + value: Uint8Array; +} +/** Params defines the parameters for the auth module. */ +export interface ParamsAmino { + max_memo_characters?: string; + tx_sig_limit?: string; + tx_size_cost_per_byte?: string; + sig_verify_cost_ed25519?: string; + sig_verify_cost_secp256k1?: string; +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/x/auth/Params'; + value: ParamsAmino; +} +/** Params defines the parameters for the auth module. */ +export interface ParamsSDKType { + max_memo_characters: bigint; + tx_sig_limit: bigint; + tx_size_cost_per_byte: bigint; + sig_verify_cost_ed25519: bigint; + sig_verify_cost_secp256k1: bigint; +} +function createBaseBaseAccount(): BaseAccount { + return { + $typeUrl: '/cosmos.auth.v1beta1.BaseAccount', + address: '', + pubKey: undefined, + accountNumber: BigInt(0), + sequence: BigInt(0), + }; +} +export const BaseAccount = { + typeUrl: '/cosmos.auth.v1beta1.BaseAccount', + aminoType: 'cosmos-sdk/BaseAccount', + is(o: any): o is BaseAccount { + return ( + o && + (o.$typeUrl === BaseAccount.typeUrl || + (typeof o.address === 'string' && + typeof o.accountNumber === 'bigint' && + typeof o.sequence === 'bigint')) + ); + }, + isSDK(o: any): o is BaseAccountSDKType { + return ( + o && + (o.$typeUrl === BaseAccount.typeUrl || + (typeof o.address === 'string' && + typeof o.account_number === 'bigint' && + typeof o.sequence === 'bigint')) + ); + }, + isAmino(o: any): o is BaseAccountAmino { + return ( + o && + (o.$typeUrl === BaseAccount.typeUrl || + (typeof o.address === 'string' && + typeof o.account_number === 'bigint' && + typeof o.sequence === 'bigint')) + ); + }, + encode( + message: BaseAccount, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(32).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.accountNumber = reader.uint64(); + break; + case 4: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BaseAccount { + const message = createBaseBaseAccount(); + message.address = object.address ?? ''; + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? Any.fromPartial(object.pubKey) + : undefined; + message.accountNumber = + object.accountNumber !== undefined && object.accountNumber !== null + ? BigInt(object.accountNumber.toString()) + : BigInt(0); + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: BaseAccountAmino): BaseAccount { + const message = createBaseBaseAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: BaseAccount): BaseAccountAmino { + const obj: any = {}; + obj.address = message.address === '' ? undefined : message.address; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.account_number = + message.accountNumber !== BigInt(0) + ? message.accountNumber.toString() + : undefined; + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { + return BaseAccount.fromAmino(object.value); + }, + toAminoMsg(message: BaseAccount): BaseAccountAminoMsg { + return { + type: 'cosmos-sdk/BaseAccount', + value: BaseAccount.toAmino(message), + }; + }, + fromProtoMsg(message: BaseAccountProtoMsg): BaseAccount { + return BaseAccount.decode(message.value); + }, + toProto(message: BaseAccount): Uint8Array { + return BaseAccount.encode(message).finish(); + }, + toProtoMsg(message: BaseAccount): BaseAccountProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.BaseAccount', + value: BaseAccount.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(BaseAccount.typeUrl, BaseAccount); +GlobalDecoderRegistry.registerAminoProtoMapping( + BaseAccount.aminoType, + BaseAccount.typeUrl +); +function createBaseModuleAccount(): ModuleAccount { + return { + $typeUrl: '/cosmos.auth.v1beta1.ModuleAccount', + baseAccount: undefined, + name: '', + permissions: [], + }; +} +export const ModuleAccount = { + typeUrl: '/cosmos.auth.v1beta1.ModuleAccount', + aminoType: 'cosmos-sdk/ModuleAccount', + is(o: any): o is ModuleAccount { + return ( + o && + (o.$typeUrl === ModuleAccount.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.permissions) && + (!o.permissions.length || typeof o.permissions[0] === 'string'))) + ); + }, + isSDK(o: any): o is ModuleAccountSDKType { + return ( + o && + (o.$typeUrl === ModuleAccount.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.permissions) && + (!o.permissions.length || typeof o.permissions[0] === 'string'))) + ); + }, + isAmino(o: any): o is ModuleAccountAmino { + return ( + o && + (o.$typeUrl === ModuleAccount.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.permissions) && + (!o.permissions.length || typeof o.permissions[0] === 'string'))) + ); + }, + encode( + message: ModuleAccount, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode( + message.baseAccount, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.name !== '') { + writer.uint32(18).string(message.name); + } + for (const v of message.permissions) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleAccount { + const message = createBaseModuleAccount(); + message.baseAccount = + object.baseAccount !== undefined && object.baseAccount !== null + ? BaseAccount.fromPartial(object.baseAccount) + : undefined; + message.name = object.name ?? ''; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, + fromAmino(object: ModuleAccountAmino): ModuleAccount { + const message = createBaseModuleAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, + toAmino(message: ModuleAccount): ModuleAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount + ? BaseAccount.toAmino(message.baseAccount) + : undefined; + obj.name = message.name === '' ? undefined : message.name; + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = message.permissions; + } + return obj; + }, + fromAminoMsg(object: ModuleAccountAminoMsg): ModuleAccount { + return ModuleAccount.fromAmino(object.value); + }, + toAminoMsg(message: ModuleAccount): ModuleAccountAminoMsg { + return { + type: 'cosmos-sdk/ModuleAccount', + value: ModuleAccount.toAmino(message), + }; + }, + fromProtoMsg(message: ModuleAccountProtoMsg): ModuleAccount { + return ModuleAccount.decode(message.value); + }, + toProto(message: ModuleAccount): Uint8Array { + return ModuleAccount.encode(message).finish(); + }, + toProtoMsg(message: ModuleAccount): ModuleAccountProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.ModuleAccount', + value: ModuleAccount.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(ModuleAccount.typeUrl, ModuleAccount); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleAccount.aminoType, + ModuleAccount.typeUrl +); +function createBaseModuleCredential(): ModuleCredential { + return { + moduleName: '', + derivationKeys: [], + }; +} +export const ModuleCredential = { + typeUrl: '/cosmos.auth.v1beta1.ModuleCredential', + aminoType: 'cosmos-sdk/ModuleCredential', + is(o: any): o is ModuleCredential { + return ( + o && + (o.$typeUrl === ModuleCredential.typeUrl || + (typeof o.moduleName === 'string' && + Array.isArray(o.derivationKeys) && + (!o.derivationKeys.length || + o.derivationKeys[0] instanceof Uint8Array || + typeof o.derivationKeys[0] === 'string'))) + ); + }, + isSDK(o: any): o is ModuleCredentialSDKType { + return ( + o && + (o.$typeUrl === ModuleCredential.typeUrl || + (typeof o.module_name === 'string' && + Array.isArray(o.derivation_keys) && + (!o.derivation_keys.length || + o.derivation_keys[0] instanceof Uint8Array || + typeof o.derivation_keys[0] === 'string'))) + ); + }, + isAmino(o: any): o is ModuleCredentialAmino { + return ( + o && + (o.$typeUrl === ModuleCredential.typeUrl || + (typeof o.module_name === 'string' && + Array.isArray(o.derivation_keys) && + (!o.derivation_keys.length || + o.derivation_keys[0] instanceof Uint8Array || + typeof o.derivation_keys[0] === 'string'))) + ); + }, + encode( + message: ModuleCredential, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.moduleName !== '') { + writer.uint32(10).string(message.moduleName); + } + for (const v of message.derivationKeys) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleCredential { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleCredential(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.derivationKeys.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleCredential { + const message = createBaseModuleCredential(); + message.moduleName = object.moduleName ?? ''; + message.derivationKeys = object.derivationKeys?.map((e) => e) || []; + return message; + }, + fromAmino(object: ModuleCredentialAmino): ModuleCredential { + const message = createBaseModuleCredential(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + message.derivationKeys = + object.derivation_keys?.map((e) => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: ModuleCredential): ModuleCredentialAmino { + const obj: any = {}; + obj.module_name = + message.moduleName === '' ? undefined : message.moduleName; + if (message.derivationKeys) { + obj.derivation_keys = message.derivationKeys.map((e) => + base64FromBytes(e) + ); + } else { + obj.derivation_keys = message.derivationKeys; + } + return obj; + }, + fromAminoMsg(object: ModuleCredentialAminoMsg): ModuleCredential { + return ModuleCredential.fromAmino(object.value); + }, + toAminoMsg(message: ModuleCredential): ModuleCredentialAminoMsg { + return { + type: 'cosmos-sdk/ModuleCredential', + value: ModuleCredential.toAmino(message), + }; + }, + fromProtoMsg(message: ModuleCredentialProtoMsg): ModuleCredential { + return ModuleCredential.decode(message.value); + }, + toProto(message: ModuleCredential): Uint8Array { + return ModuleCredential.encode(message).finish(); + }, + toProtoMsg(message: ModuleCredential): ModuleCredentialProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.ModuleCredential', + value: ModuleCredential.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(ModuleCredential.typeUrl, ModuleCredential); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleCredential.aminoType, + ModuleCredential.typeUrl +); +function createBaseParams(): Params { + return { + maxMemoCharacters: BigInt(0), + txSigLimit: BigInt(0), + txSizeCostPerByte: BigInt(0), + sigVerifyCostEd25519: BigInt(0), + sigVerifyCostSecp256k1: BigInt(0), + }; +} +export const Params = { + typeUrl: '/cosmos.auth.v1beta1.Params', + aminoType: 'cosmos-sdk/x/auth/Params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.maxMemoCharacters === 'bigint' && + typeof o.txSigLimit === 'bigint' && + typeof o.txSizeCostPerByte === 'bigint' && + typeof o.sigVerifyCostEd25519 === 'bigint' && + typeof o.sigVerifyCostSecp256k1 === 'bigint')) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.max_memo_characters === 'bigint' && + typeof o.tx_sig_limit === 'bigint' && + typeof o.tx_size_cost_per_byte === 'bigint' && + typeof o.sig_verify_cost_ed25519 === 'bigint' && + typeof o.sig_verify_cost_secp256k1 === 'bigint')) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.max_memo_characters === 'bigint' && + typeof o.tx_sig_limit === 'bigint' && + typeof o.tx_size_cost_per_byte === 'bigint' && + typeof o.sig_verify_cost_ed25519 === 'bigint' && + typeof o.sig_verify_cost_secp256k1 === 'bigint')) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.maxMemoCharacters !== BigInt(0)) { + writer.uint32(8).uint64(message.maxMemoCharacters); + } + if (message.txSigLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.txSigLimit); + } + if (message.txSizeCostPerByte !== BigInt(0)) { + writer.uint32(24).uint64(message.txSizeCostPerByte); + } + if (message.sigVerifyCostEd25519 !== BigInt(0)) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519); + } + if (message.sigVerifyCostSecp256k1 !== BigInt(0)) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxMemoCharacters = reader.uint64(); + break; + case 2: + message.txSigLimit = reader.uint64(); + break; + case 3: + message.txSizeCostPerByte = reader.uint64(); + break; + case 4: + message.sigVerifyCostEd25519 = reader.uint64(); + break; + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.maxMemoCharacters = + object.maxMemoCharacters !== undefined && + object.maxMemoCharacters !== null + ? BigInt(object.maxMemoCharacters.toString()) + : BigInt(0); + message.txSigLimit = + object.txSigLimit !== undefined && object.txSigLimit !== null + ? BigInt(object.txSigLimit.toString()) + : BigInt(0); + message.txSizeCostPerByte = + object.txSizeCostPerByte !== undefined && + object.txSizeCostPerByte !== null + ? BigInt(object.txSizeCostPerByte.toString()) + : BigInt(0); + message.sigVerifyCostEd25519 = + object.sigVerifyCostEd25519 !== undefined && + object.sigVerifyCostEd25519 !== null + ? BigInt(object.sigVerifyCostEd25519.toString()) + : BigInt(0); + message.sigVerifyCostSecp256k1 = + object.sigVerifyCostSecp256k1 !== undefined && + object.sigVerifyCostSecp256k1 !== null + ? BigInt(object.sigVerifyCostSecp256k1.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if ( + object.max_memo_characters !== undefined && + object.max_memo_characters !== null + ) { + message.maxMemoCharacters = BigInt(object.max_memo_characters); + } + if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { + message.txSigLimit = BigInt(object.tx_sig_limit); + } + if ( + object.tx_size_cost_per_byte !== undefined && + object.tx_size_cost_per_byte !== null + ) { + message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); + } + if ( + object.sig_verify_cost_ed25519 !== undefined && + object.sig_verify_cost_ed25519 !== null + ) { + message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); + } + if ( + object.sig_verify_cost_secp256k1 !== undefined && + object.sig_verify_cost_secp256k1 !== null + ) { + message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.max_memo_characters = + message.maxMemoCharacters !== BigInt(0) + ? message.maxMemoCharacters.toString() + : undefined; + obj.tx_sig_limit = + message.txSigLimit !== BigInt(0) + ? message.txSigLimit.toString() + : undefined; + obj.tx_size_cost_per_byte = + message.txSizeCostPerByte !== BigInt(0) + ? message.txSizeCostPerByte.toString() + : undefined; + obj.sig_verify_cost_ed25519 = + message.sigVerifyCostEd25519 !== BigInt(0) + ? message.sigVerifyCostEd25519.toString() + : undefined; + obj.sig_verify_cost_secp256k1 = + message.sigVerifyCostSecp256k1 !== BigInt(0) + ? message.sigVerifyCostSecp256k1.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/x/auth/Params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/authz.ts b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/authz.ts new file mode 100644 index 00000000..a0723e38 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/authz.ts @@ -0,0 +1,186 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorization { + $typeUrl?: '/cosmos.bank.v1beta1.SendAuthorization'; + spendLimit: Coin[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allowList: string[]; +} +export interface SendAuthorizationProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.SendAuthorization'; + value: Uint8Array; +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorizationAmino { + spend_limit: CoinAmino[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allow_list?: string[]; +} +export interface SendAuthorizationAminoMsg { + type: 'cosmos-sdk/SendAuthorization'; + value: SendAuthorizationAmino; +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorizationSDKType { + $typeUrl?: '/cosmos.bank.v1beta1.SendAuthorization'; + spend_limit: CoinSDKType[]; + allow_list: string[]; +} +function createBaseSendAuthorization(): SendAuthorization { + return { + $typeUrl: '/cosmos.bank.v1beta1.SendAuthorization', + spendLimit: [], + allowList: [], + }; +} +export const SendAuthorization = { + typeUrl: '/cosmos.bank.v1beta1.SendAuthorization', + aminoType: 'cosmos-sdk/SendAuthorization', + is(o: any): o is SendAuthorization { + return ( + o && + (o.$typeUrl === SendAuthorization.typeUrl || + (Array.isArray(o.spendLimit) && + (!o.spendLimit.length || Coin.is(o.spendLimit[0])) && + Array.isArray(o.allowList) && + (!o.allowList.length || typeof o.allowList[0] === 'string'))) + ); + }, + isSDK(o: any): o is SendAuthorizationSDKType { + return ( + o && + (o.$typeUrl === SendAuthorization.typeUrl || + (Array.isArray(o.spend_limit) && + (!o.spend_limit.length || Coin.isSDK(o.spend_limit[0])) && + Array.isArray(o.allow_list) && + (!o.allow_list.length || typeof o.allow_list[0] === 'string'))) + ); + }, + isAmino(o: any): o is SendAuthorizationAmino { + return ( + o && + (o.$typeUrl === SendAuthorization.typeUrl || + (Array.isArray(o.spend_limit) && + (!o.spend_limit.length || Coin.isAmino(o.spend_limit[0])) && + Array.isArray(o.allow_list) && + (!o.allow_list.length || typeof o.allow_list[0] === 'string'))) + ); + }, + encode( + message: SendAuthorization, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.spendLimit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.allowList) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spendLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.allowList.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SendAuthorization { + const message = createBaseSendAuthorization(); + message.spendLimit = + object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; + message.allowList = object.allowList?.map((e) => e) || []; + return message; + }, + fromAmino(object: SendAuthorizationAmino): SendAuthorization { + const message = createBaseSendAuthorization(); + message.spendLimit = + object.spend_limit?.map((e) => Coin.fromAmino(e)) || []; + message.allowList = object.allow_list?.map((e) => e) || []; + return message; + }, + toAmino(message: SendAuthorization): SendAuthorizationAmino { + const obj: any = {}; + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.spend_limit = message.spendLimit; + } + if (message.allowList) { + obj.allow_list = message.allowList.map((e) => e); + } else { + obj.allow_list = message.allowList; + } + return obj; + }, + fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization { + return SendAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: SendAuthorization): SendAuthorizationAminoMsg { + return { + type: 'cosmos-sdk/SendAuthorization', + value: SendAuthorization.toAmino(message), + }; + }, + fromProtoMsg(message: SendAuthorizationProtoMsg): SendAuthorization { + return SendAuthorization.decode(message.value); + }, + toProto(message: SendAuthorization): Uint8Array { + return SendAuthorization.encode(message).finish(); + }, + toProtoMsg(message: SendAuthorization): SendAuthorizationProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.SendAuthorization', + value: SendAuthorization.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SendAuthorization.typeUrl, SendAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping( + SendAuthorization.aminoType, + SendAuthorization.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/bank.ts b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 00000000..3af5a6be --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,1251 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** Params defines the parameters for the bank module. */ +export interface Params { + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Params'; + value: Uint8Array; +} +/** Params defines the parameters for the bank module. */ +export interface ParamsAmino { + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ + send_enabled?: SendEnabledAmino[]; + default_send_enabled?: boolean; +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/x/bank/Params'; + value: ParamsAmino; +} +/** Params defines the parameters for the bank module. */ +export interface ParamsSDKType { + /** @deprecated */ + send_enabled: SendEnabledSDKType[]; + default_send_enabled: boolean; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} +export interface SendEnabledProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.SendEnabled'; + value: Uint8Array; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledAmino { + denom?: string; + enabled?: boolean; +} +export interface SendEnabledAminoMsg { + type: 'cosmos-sdk/SendEnabled'; + value: SendEnabledAmino; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledSDKType { + denom: string; + enabled: boolean; +} +/** Input models transaction input. */ +export interface Input { + address: string; + coins: Coin[]; +} +export interface InputProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Input'; + value: Uint8Array; +} +/** Input models transaction input. */ +export interface InputAmino { + address?: string; + coins: CoinAmino[]; +} +export interface InputAminoMsg { + type: 'cosmos-sdk/Input'; + value: InputAmino; +} +/** Input models transaction input. */ +export interface InputSDKType { + address: string; + coins: CoinSDKType[]; +} +/** Output models transaction outputs. */ +export interface Output { + address: string; + coins: Coin[]; +} +export interface OutputProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Output'; + value: Uint8Array; +} +/** Output models transaction outputs. */ +export interface OutputAmino { + address?: string; + coins: CoinAmino[]; +} +export interface OutputAminoMsg { + type: 'cosmos-sdk/Output'; + value: OutputAmino; +} +/** Output models transaction outputs. */ +export interface OutputSDKType { + address: string; + coins: CoinSDKType[]; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface Supply { + $typeUrl?: '/cosmos.bank.v1beta1.Supply'; + total: Coin[]; +} +export interface SupplyProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Supply'; + value: Uint8Array; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplyAmino { + total: CoinAmino[]; +} +export interface SupplyAminoMsg { + type: 'cosmos-sdk/Supply'; + value: SupplyAmino; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplySDKType { + $typeUrl?: '/cosmos.bank.v1beta1.Supply'; + total: CoinSDKType[]; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 10^exponent base_denom + * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + * exponent = 6, thus: 1 atom = 10^6 uatom). + */ + exponent: number; + /** aliases is a list of string aliases for the given denom */ + aliases: string[]; +} +export interface DenomUnitProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.DenomUnit'; + value: Uint8Array; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitAmino { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom?: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 10^exponent base_denom + * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + * exponent = 6, thus: 1 atom = 10^6 uatom). + */ + exponent?: number; + /** aliases is a list of string aliases for the given denom */ + aliases?: string[]; +} +export interface DenomUnitAminoMsg { + type: 'cosmos-sdk/DenomUnit'; + value: DenomUnitAmino; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitSDKType { + denom: string; + exponent: number; + aliases: string[]; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denomUnits: DenomUnit[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * Since: cosmos-sdk 0.43 + */ + symbol: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uriHash: string; +} +export interface MetadataProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Metadata'; + value: Uint8Array; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataAmino { + description?: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denom_units?: DenomUnitAmino[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base?: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display?: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name?: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * Since: cosmos-sdk 0.43 + */ + symbol?: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri?: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri_hash?: string; +} +export interface MetadataAminoMsg { + type: 'cosmos-sdk/Metadata'; + value: MetadataAmino; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataSDKType { + description: string; + denom_units: DenomUnitSDKType[]; + base: string; + display: string; + name: string; + symbol: string; + uri: string; + uri_hash: string; +} +function createBaseParams(): Params { + return { + sendEnabled: [], + defaultSendEnabled: false, + }; +} +export const Params = { + typeUrl: '/cosmos.bank.v1beta1.Params', + aminoType: 'cosmos-sdk/x/bank/Params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.sendEnabled) && + (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && + typeof o.defaultSendEnabled === 'boolean')) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.send_enabled) && + (!o.send_enabled.length || SendEnabled.isSDK(o.send_enabled[0])) && + typeof o.default_send_enabled === 'boolean')) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.send_enabled) && + (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && + typeof o.default_send_enabled === 'boolean')) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.sendEnabled = + object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; + message.defaultSendEnabled = object.defaultSendEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.sendEnabled = + object.send_enabled?.map((e) => SendEnabled.fromAmino(e)) || []; + if ( + object.default_send_enabled !== undefined && + object.default_send_enabled !== null + ) { + message.defaultSendEnabled = object.default_send_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map((e) => + e ? SendEnabled.toAmino(e) : undefined + ); + } else { + obj.send_enabled = message.sendEnabled; + } + obj.default_send_enabled = + message.defaultSendEnabled === false + ? undefined + : message.defaultSendEnabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/x/bank/Params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); +function createBaseSendEnabled(): SendEnabled { + return { + denom: '', + enabled: false, + }; +} +export const SendEnabled = { + typeUrl: '/cosmos.bank.v1beta1.SendEnabled', + aminoType: 'cosmos-sdk/SendEnabled', + is(o: any): o is SendEnabled { + return ( + o && + (o.$typeUrl === SendEnabled.typeUrl || + (typeof o.denom === 'string' && typeof o.enabled === 'boolean')) + ); + }, + isSDK(o: any): o is SendEnabledSDKType { + return ( + o && + (o.$typeUrl === SendEnabled.typeUrl || + (typeof o.denom === 'string' && typeof o.enabled === 'boolean')) + ); + }, + isAmino(o: any): o is SendEnabledAmino { + return ( + o && + (o.$typeUrl === SendEnabled.typeUrl || + (typeof o.denom === 'string' && typeof o.enabled === 'boolean')) + ); + }, + encode( + message: SendEnabled, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.enabled === true) { + writer.uint32(16).bool(message.enabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SendEnabled { + const message = createBaseSendEnabled(); + message.denom = object.denom ?? ''; + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino(object: SendEnabledAmino): SendEnabled { + const message = createBaseSendEnabled(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino(message: SendEnabled): SendEnabledAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.enabled = message.enabled === false ? undefined : message.enabled; + return obj; + }, + fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled { + return SendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: SendEnabled): SendEnabledAminoMsg { + return { + type: 'cosmos-sdk/SendEnabled', + value: SendEnabled.toAmino(message), + }; + }, + fromProtoMsg(message: SendEnabledProtoMsg): SendEnabled { + return SendEnabled.decode(message.value); + }, + toProto(message: SendEnabled): Uint8Array { + return SendEnabled.encode(message).finish(); + }, + toProtoMsg(message: SendEnabled): SendEnabledProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.SendEnabled', + value: SendEnabled.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SendEnabled.typeUrl, SendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping( + SendEnabled.aminoType, + SendEnabled.typeUrl +); +function createBaseInput(): Input { + return { + address: '', + coins: [], + }; +} +export const Input = { + typeUrl: '/cosmos.bank.v1beta1.Input', + aminoType: 'cosmos-sdk/Input', + is(o: any): o is Input { + return ( + o && + (o.$typeUrl === Input.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is InputSDKType { + return ( + o && + (o.$typeUrl === Input.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is InputAmino { + return ( + o && + (o.$typeUrl === Input.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: Input, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Input { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Input { + const message = createBaseInput(); + message.address = object.address ?? ''; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InputAmino): Input { + const message = createBaseInput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Input): InputAmino { + const obj: any = {}; + obj.address = message.address === '' ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: InputAminoMsg): Input { + return Input.fromAmino(object.value); + }, + toAminoMsg(message: Input): InputAminoMsg { + return { + type: 'cosmos-sdk/Input', + value: Input.toAmino(message), + }; + }, + fromProtoMsg(message: InputProtoMsg): Input { + return Input.decode(message.value); + }, + toProto(message: Input): Uint8Array { + return Input.encode(message).finish(); + }, + toProtoMsg(message: Input): InputProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Input', + value: Input.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Input.typeUrl, Input); +GlobalDecoderRegistry.registerAminoProtoMapping(Input.aminoType, Input.typeUrl); +function createBaseOutput(): Output { + return { + address: '', + coins: [], + }; +} +export const Output = { + typeUrl: '/cosmos.bank.v1beta1.Output', + aminoType: 'cosmos-sdk/Output', + is(o: any): o is Output { + return ( + o && + (o.$typeUrl === Output.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is OutputSDKType { + return ( + o && + (o.$typeUrl === Output.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is OutputAmino { + return ( + o && + (o.$typeUrl === Output.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: Output, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Output { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Output { + const message = createBaseOutput(); + message.address = object.address ?? ''; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OutputAmino): Output { + const message = createBaseOutput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Output): OutputAmino { + const obj: any = {}; + obj.address = message.address === '' ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: OutputAminoMsg): Output { + return Output.fromAmino(object.value); + }, + toAminoMsg(message: Output): OutputAminoMsg { + return { + type: 'cosmos-sdk/Output', + value: Output.toAmino(message), + }; + }, + fromProtoMsg(message: OutputProtoMsg): Output { + return Output.decode(message.value); + }, + toProto(message: Output): Uint8Array { + return Output.encode(message).finish(); + }, + toProtoMsg(message: Output): OutputProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Output', + value: Output.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Output.typeUrl, Output); +GlobalDecoderRegistry.registerAminoProtoMapping( + Output.aminoType, + Output.typeUrl +); +function createBaseSupply(): Supply { + return { + $typeUrl: '/cosmos.bank.v1beta1.Supply', + total: [], + }; +} +export const Supply = { + typeUrl: '/cosmos.bank.v1beta1.Supply', + aminoType: 'cosmos-sdk/Supply', + is(o: any): o is Supply { + return ( + o && + (o.$typeUrl === Supply.typeUrl || + (Array.isArray(o.total) && (!o.total.length || Coin.is(o.total[0])))) + ); + }, + isSDK(o: any): o is SupplySDKType { + return ( + o && + (o.$typeUrl === Supply.typeUrl || + (Array.isArray(o.total) && (!o.total.length || Coin.isSDK(o.total[0])))) + ); + }, + isAmino(o: any): o is SupplyAmino { + return ( + o && + (o.$typeUrl === Supply.typeUrl || + (Array.isArray(o.total) && + (!o.total.length || Coin.isAmino(o.total[0])))) + ); + }, + encode( + message: Supply, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.total) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSupply(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Supply { + const message = createBaseSupply(); + message.total = object.total?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SupplyAmino): Supply { + const message = createBaseSupply(); + message.total = object.total?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Supply): SupplyAmino { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.total = message.total; + } + return obj; + }, + fromAminoMsg(object: SupplyAminoMsg): Supply { + return Supply.fromAmino(object.value); + }, + toAminoMsg(message: Supply): SupplyAminoMsg { + return { + type: 'cosmos-sdk/Supply', + value: Supply.toAmino(message), + }; + }, + fromProtoMsg(message: SupplyProtoMsg): Supply { + return Supply.decode(message.value); + }, + toProto(message: Supply): Uint8Array { + return Supply.encode(message).finish(); + }, + toProtoMsg(message: Supply): SupplyProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Supply', + value: Supply.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Supply.typeUrl, Supply); +GlobalDecoderRegistry.registerAminoProtoMapping( + Supply.aminoType, + Supply.typeUrl +); +function createBaseDenomUnit(): DenomUnit { + return { + denom: '', + exponent: 0, + aliases: [], + }; +} +export const DenomUnit = { + typeUrl: '/cosmos.bank.v1beta1.DenomUnit', + aminoType: 'cosmos-sdk/DenomUnit', + is(o: any): o is DenomUnit { + return ( + o && + (o.$typeUrl === DenomUnit.typeUrl || + (typeof o.denom === 'string' && + typeof o.exponent === 'number' && + Array.isArray(o.aliases) && + (!o.aliases.length || typeof o.aliases[0] === 'string'))) + ); + }, + isSDK(o: any): o is DenomUnitSDKType { + return ( + o && + (o.$typeUrl === DenomUnit.typeUrl || + (typeof o.denom === 'string' && + typeof o.exponent === 'number' && + Array.isArray(o.aliases) && + (!o.aliases.length || typeof o.aliases[0] === 'string'))) + ); + }, + isAmino(o: any): o is DenomUnitAmino { + return ( + o && + (o.$typeUrl === DenomUnit.typeUrl || + (typeof o.denom === 'string' && + typeof o.exponent === 'number' && + Array.isArray(o.aliases) && + (!o.aliases.length || typeof o.aliases[0] === 'string'))) + ); + }, + encode( + message: DenomUnit, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.exponent !== 0) { + writer.uint32(16).uint32(message.exponent); + } + for (const v of message.aliases) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomUnit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomUnit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomUnit { + const message = createBaseDenomUnit(); + message.denom = object.denom ?? ''; + message.exponent = object.exponent ?? 0; + message.aliases = object.aliases?.map((e) => e) || []; + return message; + }, + fromAmino(object: DenomUnitAmino): DenomUnit { + const message = createBaseDenomUnit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + message.aliases = object.aliases?.map((e) => e) || []; + return message; + }, + toAmino(message: DenomUnit): DenomUnitAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + if (message.aliases) { + obj.aliases = message.aliases.map((e) => e); + } else { + obj.aliases = message.aliases; + } + return obj; + }, + fromAminoMsg(object: DenomUnitAminoMsg): DenomUnit { + return DenomUnit.fromAmino(object.value); + }, + toAminoMsg(message: DenomUnit): DenomUnitAminoMsg { + return { + type: 'cosmos-sdk/DenomUnit', + value: DenomUnit.toAmino(message), + }; + }, + fromProtoMsg(message: DenomUnitProtoMsg): DenomUnit { + return DenomUnit.decode(message.value); + }, + toProto(message: DenomUnit): Uint8Array { + return DenomUnit.encode(message).finish(); + }, + toProtoMsg(message: DenomUnit): DenomUnitProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.DenomUnit', + value: DenomUnit.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(DenomUnit.typeUrl, DenomUnit); +GlobalDecoderRegistry.registerAminoProtoMapping( + DenomUnit.aminoType, + DenomUnit.typeUrl +); +function createBaseMetadata(): Metadata { + return { + description: '', + denomUnits: [], + base: '', + display: '', + name: '', + symbol: '', + uri: '', + uriHash: '', + }; +} +export const Metadata = { + typeUrl: '/cosmos.bank.v1beta1.Metadata', + aminoType: 'cosmos-sdk/Metadata', + is(o: any): o is Metadata { + return ( + o && + (o.$typeUrl === Metadata.typeUrl || + (typeof o.description === 'string' && + Array.isArray(o.denomUnits) && + (!o.denomUnits.length || DenomUnit.is(o.denomUnits[0])) && + typeof o.base === 'string' && + typeof o.display === 'string' && + typeof o.name === 'string' && + typeof o.symbol === 'string' && + typeof o.uri === 'string' && + typeof o.uriHash === 'string')) + ); + }, + isSDK(o: any): o is MetadataSDKType { + return ( + o && + (o.$typeUrl === Metadata.typeUrl || + (typeof o.description === 'string' && + Array.isArray(o.denom_units) && + (!o.denom_units.length || DenomUnit.isSDK(o.denom_units[0])) && + typeof o.base === 'string' && + typeof o.display === 'string' && + typeof o.name === 'string' && + typeof o.symbol === 'string' && + typeof o.uri === 'string' && + typeof o.uri_hash === 'string')) + ); + }, + isAmino(o: any): o is MetadataAmino { + return ( + o && + (o.$typeUrl === Metadata.typeUrl || + (typeof o.description === 'string' && + Array.isArray(o.denom_units) && + (!o.denom_units.length || DenomUnit.isAmino(o.denom_units[0])) && + typeof o.base === 'string' && + typeof o.display === 'string' && + typeof o.name === 'string' && + typeof o.symbol === 'string' && + typeof o.uri === 'string' && + typeof o.uri_hash === 'string')) + ); + }, + encode( + message: Metadata, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.description !== '') { + writer.uint32(10).string(message.description); + } + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.base !== '') { + writer.uint32(26).string(message.base); + } + if (message.display !== '') { + writer.uint32(34).string(message.display); + } + if (message.name !== '') { + writer.uint32(42).string(message.name); + } + if (message.symbol !== '') { + writer.uint32(50).string(message.symbol); + } + if (message.uri !== '') { + writer.uint32(58).string(message.uri); + } + if (message.uriHash !== '') { + writer.uint32(66).string(message.uriHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.symbol = reader.string(); + break; + case 7: + message.uri = reader.string(); + break; + case 8: + message.uriHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Metadata { + const message = createBaseMetadata(); + message.description = object.description ?? ''; + message.denomUnits = + object.denomUnits?.map((e) => DenomUnit.fromPartial(e)) || []; + message.base = object.base ?? ''; + message.display = object.display ?? ''; + message.name = object.name ?? ''; + message.symbol = object.symbol ?? ''; + message.uri = object.uri ?? ''; + message.uriHash = object.uriHash ?? ''; + return message; + }, + fromAmino(object: MetadataAmino): Metadata { + const message = createBaseMetadata(); + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomUnits = + object.denom_units?.map((e) => DenomUnit.fromAmino(e)) || []; + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + return message; + }, + toAmino(message: Metadata): MetadataAmino { + const obj: any = {}; + obj.description = + message.description === '' ? undefined : message.description; + if (message.denomUnits) { + obj.denom_units = message.denomUnits.map((e) => + e ? DenomUnit.toAmino(e) : undefined + ); + } else { + obj.denom_units = message.denomUnits; + } + obj.base = message.base === '' ? undefined : message.base; + obj.display = message.display === '' ? undefined : message.display; + obj.name = message.name === '' ? undefined : message.name; + obj.symbol = message.symbol === '' ? undefined : message.symbol; + obj.uri = message.uri === '' ? undefined : message.uri; + obj.uri_hash = message.uriHash === '' ? undefined : message.uriHash; + return obj; + }, + fromAminoMsg(object: MetadataAminoMsg): Metadata { + return Metadata.fromAmino(object.value); + }, + toAminoMsg(message: Metadata): MetadataAminoMsg { + return { + type: 'cosmos-sdk/Metadata', + value: Metadata.toAmino(message), + }; + }, + fromProtoMsg(message: MetadataProtoMsg): Metadata { + return Metadata.decode(message.value); + }, + toProto(message: Metadata): Uint8Array { + return Metadata.encode(message).finish(); + }, + toProtoMsg(message: Metadata): MetadataProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Metadata', + value: Metadata.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Metadata.typeUrl, Metadata); +GlobalDecoderRegistry.registerAminoProtoMapping( + Metadata.aminoType, + Metadata.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.amino.ts new file mode 100644 index 00000000..eb5b32b4 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.amino.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { + MsgSend, + MsgMultiSend, + MsgUpdateParams, + MsgSetSendEnabled, +} from './tx'; +export const AminoConverter = { + '/cosmos.bank.v1beta1.MsgSend': { + aminoType: 'cosmos-sdk/MsgSend', + toAmino: MsgSend.toAmino, + fromAmino: MsgSend.fromAmino, + }, + '/cosmos.bank.v1beta1.MsgMultiSend': { + aminoType: 'cosmos-sdk/MsgMultiSend', + toAmino: MsgMultiSend.toAmino, + fromAmino: MsgMultiSend.fromAmino, + }, + '/cosmos.bank.v1beta1.MsgUpdateParams': { + aminoType: 'cosmos-sdk/x/bank/MsgUpdateParams', + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino, + }, + '/cosmos.bank.v1beta1.MsgSetSendEnabled': { + aminoType: 'cosmos-sdk/MsgSetSendEnabled', + toAmino: MsgSetSendEnabled.toAmino, + fromAmino: MsgSetSendEnabled.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.registry.ts new file mode 100644 index 00000000..30d54584 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.registry.ts @@ -0,0 +1,100 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgSend, + MsgMultiSend, + MsgUpdateParams, + MsgSetSendEnabled, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/cosmos.bank.v1beta1.MsgSend', MsgSend], + ['/cosmos.bank.v1beta1.MsgMultiSend', MsgMultiSend], + ['/cosmos.bank.v1beta1.MsgUpdateParams', MsgUpdateParams], + ['/cosmos.bank.v1beta1.MsgSetSendEnabled', MsgSetSendEnabled], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + send(value: MsgSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.encode(value).finish(), + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', + value: MsgMultiSend.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParams', + value: MsgUpdateParams.encode(value).finish(), + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabled', + value: MsgSetSendEnabled.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + send(value: MsgSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value, + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParams', + value, + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabled', + value, + }; + }, + }, + fromPartial: { + send(value: MsgSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.fromPartial(value), + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', + value: MsgMultiSend.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParams', + value: MsgUpdateParams.fromPartial(value), + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabled', + value: MsgSetSendEnabled.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.ts b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 00000000..b2b3957c --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,1134 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + Input, + InputAmino, + InputSDKType, + Output, + OutputAmino, + OutputSDKType, + Params, + ParamsAmino, + ParamsSDKType, + SendEnabled, + SendEnabledAmino, + SendEnabledSDKType, +} from './bank'; +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +export interface MsgSendProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgSend'; + value: Uint8Array; +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendAmino { + from_address?: string; + to_address?: string; + amount: CoinAmino[]; +} +export interface MsgSendAminoMsg { + type: 'cosmos-sdk/MsgSend'; + value: MsgSendAmino; +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} +export interface MsgSendResponseProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgSendResponse'; + value: Uint8Array; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseAmino {} +export interface MsgSendResponseAminoMsg { + type: 'cosmos-sdk/MsgSendResponse'; + value: MsgSendResponseAmino; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseSDKType {} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSend { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ + inputs: Input[]; + outputs: Output[]; +} +export interface MsgMultiSendProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend'; + value: Uint8Array; +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendAmino { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ + inputs: InputAmino[]; + outputs: OutputAmino[]; +} +export interface MsgMultiSendAminoMsg { + type: 'cosmos-sdk/MsgMultiSend'; + value: MsgMultiSendAmino; +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendSDKType { + inputs: InputSDKType[]; + outputs: OutputSDKType[]; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponse {} +export interface MsgMultiSendResponseProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSendResponse'; + value: Uint8Array; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseAmino {} +export interface MsgMultiSendResponseAminoMsg { + type: 'cosmos-sdk/MsgMultiSendResponse'; + value: MsgMultiSendResponseAmino; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParams'; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: 'cosmos-sdk/x/bank/MsgUpdateParams'; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParamsResponse'; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: 'cosmos-sdk/MsgUpdateParamsResponse'; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabled { + authority: string; + /** send_enabled is the list of entries to add or update. */ + sendEnabled: SendEnabled[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + useDefaultFor: string[]; +} +export interface MsgSetSendEnabledProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabled'; + value: Uint8Array; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledAmino { + authority?: string; + /** send_enabled is the list of entries to add or update. */ + send_enabled?: SendEnabledAmino[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + use_default_for?: string[]; +} +export interface MsgSetSendEnabledAminoMsg { + type: 'cosmos-sdk/MsgSetSendEnabled'; + value: MsgSetSendEnabledAmino; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledSDKType { + authority: string; + send_enabled: SendEnabledSDKType[]; + use_default_for: string[]; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponse {} +export interface MsgSetSendEnabledResponseProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabledResponse'; + value: Uint8Array; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseAmino {} +export interface MsgSetSendEnabledResponseAminoMsg { + type: 'cosmos-sdk/MsgSetSendEnabledResponse'; + value: MsgSetSendEnabledResponseAmino; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseSDKType {} +function createBaseMsgSend(): MsgSend { + return { + fromAddress: '', + toAddress: '', + amount: [], + }; +} +export const MsgSend = { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + aminoType: 'cosmos-sdk/MsgSend', + is(o: any): o is MsgSend { + return ( + o && + (o.$typeUrl === MsgSend.typeUrl || + (typeof o.fromAddress === 'string' && + typeof o.toAddress === 'string' && + Array.isArray(o.amount) && + (!o.amount.length || Coin.is(o.amount[0])))) + ); + }, + isSDK(o: any): o is MsgSendSDKType { + return ( + o && + (o.$typeUrl === MsgSend.typeUrl || + (typeof o.from_address === 'string' && + typeof o.to_address === 'string' && + Array.isArray(o.amount) && + (!o.amount.length || Coin.isSDK(o.amount[0])))) + ); + }, + isAmino(o: any): o is MsgSendAmino { + return ( + o && + (o.$typeUrl === MsgSend.typeUrl || + (typeof o.from_address === 'string' && + typeof o.to_address === 'string' && + Array.isArray(o.amount) && + (!o.amount.length || Coin.isAmino(o.amount[0])))) + ); + }, + encode( + message: MsgSend, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.fromAddress !== '') { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== '') { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSend { + const message = createBaseMsgSend(); + message.fromAddress = object.fromAddress ?? ''; + message.toAddress = object.toAddress ?? ''; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSendAmino): MsgSend { + const message = createBaseMsgSend(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgSend): MsgSendAmino { + const obj: any = {}; + obj.from_address = + message.fromAddress === '' ? undefined : message.fromAddress; + obj.to_address = message.toAddress === '' ? undefined : message.toAddress; + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgSendAminoMsg): MsgSend { + return MsgSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgSend): MsgSendAminoMsg { + return { + type: 'cosmos-sdk/MsgSend', + value: MsgSend.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSendProtoMsg): MsgSend { + return MsgSend.decode(message.value); + }, + toProto(message: MsgSend): Uint8Array { + return MsgSend.encode(message).finish(); + }, + toProtoMsg(message: MsgSend): MsgSendProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSend.typeUrl, MsgSend); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSend.aminoType, + MsgSend.typeUrl +); +function createBaseMsgSendResponse(): MsgSendResponse { + return {}; +} +export const MsgSendResponse = { + typeUrl: '/cosmos.bank.v1beta1.MsgSendResponse', + aminoType: 'cosmos-sdk/MsgSendResponse', + is(o: any): o is MsgSendResponse { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + isSDK(o: any): o is MsgSendResponseSDKType { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgSendResponseAmino { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + encode( + _: MsgSendResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSendResponse { + const message = createBaseMsgSendResponse(); + return message; + }, + fromAmino(_: MsgSendResponseAmino): MsgSendResponse { + const message = createBaseMsgSendResponse(); + return message; + }, + toAmino(_: MsgSendResponse): MsgSendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSendResponseAminoMsg): MsgSendResponse { + return MsgSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSendResponse): MsgSendResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSendResponse', + value: MsgSendResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSendResponseProtoMsg): MsgSendResponse { + return MsgSendResponse.decode(message.value); + }, + toProto(message: MsgSendResponse): Uint8Array { + return MsgSendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendResponse): MsgSendResponseProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSendResponse', + value: MsgSendResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSendResponse.typeUrl, MsgSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSendResponse.aminoType, + MsgSendResponse.typeUrl +); +function createBaseMsgMultiSend(): MsgMultiSend { + return { + inputs: [], + outputs: [], + }; +} +export const MsgMultiSend = { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', + aminoType: 'cosmos-sdk/MsgMultiSend', + is(o: any): o is MsgMultiSend { + return ( + o && + (o.$typeUrl === MsgMultiSend.typeUrl || + (Array.isArray(o.inputs) && + (!o.inputs.length || Input.is(o.inputs[0])) && + Array.isArray(o.outputs) && + (!o.outputs.length || Output.is(o.outputs[0])))) + ); + }, + isSDK(o: any): o is MsgMultiSendSDKType { + return ( + o && + (o.$typeUrl === MsgMultiSend.typeUrl || + (Array.isArray(o.inputs) && + (!o.inputs.length || Input.isSDK(o.inputs[0])) && + Array.isArray(o.outputs) && + (!o.outputs.length || Output.isSDK(o.outputs[0])))) + ); + }, + isAmino(o: any): o is MsgMultiSendAmino { + return ( + o && + (o.$typeUrl === MsgMultiSend.typeUrl || + (Array.isArray(o.inputs) && + (!o.inputs.length || Input.isAmino(o.inputs[0])) && + Array.isArray(o.outputs) && + (!o.outputs.length || Output.isAmino(o.outputs[0])))) + ); + }, + encode( + message: MsgMultiSend, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.inputs) { + Input.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSend { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())); + break; + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map((e) => Input.fromPartial(e)) || []; + message.outputs = object.outputs?.map((e) => Output.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgMultiSendAmino): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map((e) => Input.fromAmino(e)) || []; + message.outputs = object.outputs?.map((e) => Output.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgMultiSend): MsgMultiSendAmino { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map((e) => + e ? Input.toAmino(e) : undefined + ); + } else { + obj.inputs = message.inputs; + } + if (message.outputs) { + obj.outputs = message.outputs.map((e) => + e ? Output.toAmino(e) : undefined + ); + } else { + obj.outputs = message.outputs; + } + return obj; + }, + fromAminoMsg(object: MsgMultiSendAminoMsg): MsgMultiSend { + return MsgMultiSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSend): MsgMultiSendAminoMsg { + return { + type: 'cosmos-sdk/MsgMultiSend', + value: MsgMultiSend.toAmino(message), + }; + }, + fromProtoMsg(message: MsgMultiSendProtoMsg): MsgMultiSend { + return MsgMultiSend.decode(message.value); + }, + toProto(message: MsgMultiSend): Uint8Array { + return MsgMultiSend.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSend): MsgMultiSendProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', + value: MsgMultiSend.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgMultiSend.typeUrl, MsgMultiSend); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgMultiSend.aminoType, + MsgMultiSend.typeUrl +); +function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { + return {}; +} +export const MsgMultiSendResponse = { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSendResponse', + aminoType: 'cosmos-sdk/MsgMultiSendResponse', + is(o: any): o is MsgMultiSendResponse { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + isSDK(o: any): o is MsgMultiSendResponseSDKType { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgMultiSendResponseAmino { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + encode( + _: MsgMultiSendResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgMultiSendResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMultiSendResponseAminoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgMultiSendResponse', + value: MsgMultiSendResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgMultiSendResponseProtoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.decode(message.value); + }, + toProto(message: MsgMultiSendResponse): Uint8Array { + return MsgMultiSendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSendResponse', + value: MsgMultiSendResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgMultiSendResponse.typeUrl, + MsgMultiSendResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgMultiSendResponse.aminoType, + MsgMultiSendResponse.typeUrl +); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: '', + params: Params.fromPartial({}), + }; +} +export const MsgUpdateParams = { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParams', + aminoType: 'cosmos-sdk/x/bank/MsgUpdateParams', + is(o: any): o is MsgUpdateParams { + return ( + o && + (o.$typeUrl === MsgUpdateParams.typeUrl || + (typeof o.authority === 'string' && Params.is(o.params))) + ); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return ( + o && + (o.$typeUrl === MsgUpdateParams.typeUrl || + (typeof o.authority === 'string' && Params.isSDK(o.params))) + ); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return ( + o && + (o.$typeUrl === MsgUpdateParams.typeUrl || + (typeof o.authority === 'string' && Params.isAmino(o.params))) + ); + }, + encode( + message: MsgUpdateParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.authority !== '') { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ''; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === '' ? undefined : message.authority; + obj.params = message.params + ? Params.toAmino(message.params) + : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: 'cosmos-sdk/x/bank/MsgUpdateParams', + value: MsgUpdateParams.toAmino(message), + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParams', + value: MsgUpdateParams.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateParams.aminoType, + MsgUpdateParams.typeUrl +); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParamsResponse', + aminoType: 'cosmos-sdk/MsgUpdateParamsResponse', + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode( + _: MsgUpdateParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUpdateParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgUpdateParamsResponseAminoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgUpdateParamsResponse', + value: MsgUpdateParamsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUpdateParamsResponseProtoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgUpdateParamsResponse', + value: MsgUpdateParamsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUpdateParamsResponse.typeUrl, + MsgUpdateParamsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateParamsResponse.aminoType, + MsgUpdateParamsResponse.typeUrl +); +function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { + return { + authority: '', + sendEnabled: [], + useDefaultFor: [], + }; +} +export const MsgSetSendEnabled = { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabled', + aminoType: 'cosmos-sdk/MsgSetSendEnabled', + is(o: any): o is MsgSetSendEnabled { + return ( + o && + (o.$typeUrl === MsgSetSendEnabled.typeUrl || + (typeof o.authority === 'string' && + Array.isArray(o.sendEnabled) && + (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && + Array.isArray(o.useDefaultFor) && + (!o.useDefaultFor.length || typeof o.useDefaultFor[0] === 'string'))) + ); + }, + isSDK(o: any): o is MsgSetSendEnabledSDKType { + return ( + o && + (o.$typeUrl === MsgSetSendEnabled.typeUrl || + (typeof o.authority === 'string' && + Array.isArray(o.send_enabled) && + (!o.send_enabled.length || SendEnabled.isSDK(o.send_enabled[0])) && + Array.isArray(o.use_default_for) && + (!o.use_default_for.length || + typeof o.use_default_for[0] === 'string'))) + ); + }, + isAmino(o: any): o is MsgSetSendEnabledAmino { + return ( + o && + (o.$typeUrl === MsgSetSendEnabled.typeUrl || + (typeof o.authority === 'string' && + Array.isArray(o.send_enabled) && + (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && + Array.isArray(o.use_default_for) && + (!o.use_default_for.length || + typeof o.use_default_for[0] === 'string'))) + ); + }, + encode( + message: MsgSetSendEnabled, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.authority !== '') { + writer.uint32(10).string(message.authority); + } + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.useDefaultFor) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabled { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 3: + message.useDefaultFor.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + message.authority = object.authority ?? ''; + message.sendEnabled = + object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; + message.useDefaultFor = object.useDefaultFor?.map((e) => e) || []; + return message; + }, + fromAmino(object: MsgSetSendEnabledAmino): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.sendEnabled = + object.send_enabled?.map((e) => SendEnabled.fromAmino(e)) || []; + message.useDefaultFor = object.use_default_for?.map((e) => e) || []; + return message; + }, + toAmino(message: MsgSetSendEnabled): MsgSetSendEnabledAmino { + const obj: any = {}; + obj.authority = message.authority === '' ? undefined : message.authority; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map((e) => + e ? SendEnabled.toAmino(e) : undefined + ); + } else { + obj.send_enabled = message.sendEnabled; + } + if (message.useDefaultFor) { + obj.use_default_for = message.useDefaultFor.map((e) => e); + } else { + obj.use_default_for = message.useDefaultFor; + } + return obj; + }, + fromAminoMsg(object: MsgSetSendEnabledAminoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledAminoMsg { + return { + type: 'cosmos-sdk/MsgSetSendEnabled', + value: MsgSetSendEnabled.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetSendEnabledProtoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.decode(message.value); + }, + toProto(message: MsgSetSendEnabled): Uint8Array { + return MsgSetSendEnabled.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabled', + value: MsgSetSendEnabled.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSetSendEnabled.typeUrl, MsgSetSendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetSendEnabled.aminoType, + MsgSetSendEnabled.typeUrl +); +function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { + return {}; +} +export const MsgSetSendEnabledResponse = { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabledResponse', + aminoType: 'cosmos-sdk/MsgSetSendEnabledResponse', + is(o: any): o is MsgSetSendEnabledResponse { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetSendEnabledResponseSDKType { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetSendEnabledResponseAmino { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + encode( + _: MsgSetSendEnabledResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetSendEnabledResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + fromAmino(_: MsgSetSendEnabledResponseAmino): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + toAmino(_: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetSendEnabledResponseAminoMsg + ): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetSendEnabledResponse + ): MsgSetSendEnabledResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSetSendEnabledResponse', + value: MsgSetSendEnabledResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetSendEnabledResponseProtoMsg + ): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.decode(message.value); + }, + toProto(message: MsgSetSendEnabledResponse): Uint8Array { + return MsgSetSendEnabledResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetSendEnabledResponse + ): MsgSetSendEnabledResponseProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSetSendEnabledResponse', + value: MsgSetSendEnabledResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetSendEnabledResponse.typeUrl, + MsgSetSendEnabledResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetSendEnabledResponse.aminoType, + MsgSetSendEnabledResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos/base/v1beta1/coin.ts b/packages/cosmos/src/proto_export/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..75d93c9d --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,516 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} +export interface CoinProtoMsg { + typeUrl: '/cosmos.base.v1beta1.Coin'; + value: Uint8Array; +} +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface CoinAmino { + denom?: string; + amount: string; +} +export interface CoinAminoMsg { + type: 'cosmos-sdk/Coin'; + value: CoinAmino; +} +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface CoinSDKType { + denom: string; + amount: string; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} +export interface DecCoinProtoMsg { + typeUrl: '/cosmos.base.v1beta1.DecCoin'; + value: Uint8Array; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinAmino { + denom?: string; + amount?: string; +} +export interface DecCoinAminoMsg { + type: 'cosmos-sdk/DecCoin'; + value: DecCoinAmino; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinSDKType { + denom: string; + amount: string; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + int: string; +} +export interface IntProtoProtoMsg { + typeUrl: '/cosmos.base.v1beta1.IntProto'; + value: Uint8Array; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoAmino { + int?: string; +} +export interface IntProtoAminoMsg { + type: 'cosmos-sdk/IntProto'; + value: IntProtoAmino; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoSDKType { + int: string; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + dec: string; +} +export interface DecProtoProtoMsg { + typeUrl: '/cosmos.base.v1beta1.DecProto'; + value: Uint8Array; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoAmino { + dec?: string; +} +export interface DecProtoAminoMsg { + type: 'cosmos-sdk/DecProto'; + value: DecProtoAmino; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoSDKType { + dec: string; +} +function createBaseCoin(): Coin { + return { + denom: '', + amount: '', + }; +} +export const Coin = { + typeUrl: '/cosmos.base.v1beta1.Coin', + aminoType: 'cosmos-sdk/Coin', + is(o: any): o is Coin { + return ( + o && + (o.$typeUrl === Coin.typeUrl || + (typeof o.denom === 'string' && typeof o.amount === 'string')) + ); + }, + isSDK(o: any): o is CoinSDKType { + return ( + o && + (o.$typeUrl === Coin.typeUrl || + (typeof o.denom === 'string' && typeof o.amount === 'string')) + ); + }, + isAmino(o: any): o is CoinAmino { + return ( + o && + (o.$typeUrl === Coin.typeUrl || + (typeof o.denom === 'string' && typeof o.amount === 'string')) + ); + }, + encode( + message: Coin, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.amount !== '') { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Coin { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ''; + message.amount = object.amount ?? ''; + return message; + }, + fromAmino(object: CoinAmino): Coin { + const message = createBaseCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: Coin): CoinAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.amount = message.amount ?? ''; + return obj; + }, + fromAminoMsg(object: CoinAminoMsg): Coin { + return Coin.fromAmino(object.value); + }, + toAminoMsg(message: Coin): CoinAminoMsg { + return { + type: 'cosmos-sdk/Coin', + value: Coin.toAmino(message), + }; + }, + fromProtoMsg(message: CoinProtoMsg): Coin { + return Coin.decode(message.value); + }, + toProto(message: Coin): Uint8Array { + return Coin.encode(message).finish(); + }, + toProtoMsg(message: Coin): CoinProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.Coin', + value: Coin.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Coin.typeUrl, Coin); +GlobalDecoderRegistry.registerAminoProtoMapping(Coin.aminoType, Coin.typeUrl); +function createBaseDecCoin(): DecCoin { + return { + denom: '', + amount: '', + }; +} +export const DecCoin = { + typeUrl: '/cosmos.base.v1beta1.DecCoin', + aminoType: 'cosmos-sdk/DecCoin', + is(o: any): o is DecCoin { + return ( + o && + (o.$typeUrl === DecCoin.typeUrl || + (typeof o.denom === 'string' && typeof o.amount === 'string')) + ); + }, + isSDK(o: any): o is DecCoinSDKType { + return ( + o && + (o.$typeUrl === DecCoin.typeUrl || + (typeof o.denom === 'string' && typeof o.amount === 'string')) + ); + }, + isAmino(o: any): o is DecCoinAmino { + return ( + o && + (o.$typeUrl === DecCoin.typeUrl || + (typeof o.denom === 'string' && typeof o.amount === 'string')) + ); + }, + encode( + message: DecCoin, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.amount !== '') { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecCoin { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ''; + message.amount = object.amount ?? ''; + return message; + }, + fromAmino(object: DecCoinAmino): DecCoin { + const message = createBaseDecCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: DecCoin): DecCoinAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.amount = message.amount === '' ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: DecCoinAminoMsg): DecCoin { + return DecCoin.fromAmino(object.value); + }, + toAminoMsg(message: DecCoin): DecCoinAminoMsg { + return { + type: 'cosmos-sdk/DecCoin', + value: DecCoin.toAmino(message), + }; + }, + fromProtoMsg(message: DecCoinProtoMsg): DecCoin { + return DecCoin.decode(message.value); + }, + toProto(message: DecCoin): Uint8Array { + return DecCoin.encode(message).finish(); + }, + toProtoMsg(message: DecCoin): DecCoinProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.DecCoin', + value: DecCoin.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(DecCoin.typeUrl, DecCoin); +GlobalDecoderRegistry.registerAminoProtoMapping( + DecCoin.aminoType, + DecCoin.typeUrl +); +function createBaseIntProto(): IntProto { + return { + int: '', + }; +} +export const IntProto = { + typeUrl: '/cosmos.base.v1beta1.IntProto', + aminoType: 'cosmos-sdk/IntProto', + is(o: any): o is IntProto { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === 'string'); + }, + isSDK(o: any): o is IntProtoSDKType { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === 'string'); + }, + isAmino(o: any): o is IntProtoAmino { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === 'string'); + }, + encode( + message: IntProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.int !== '') { + writer.uint32(10).string(message.int); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IntProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ''; + return message; + }, + fromAmino(object: IntProtoAmino): IntProto { + const message = createBaseIntProto(); + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } + return message; + }, + toAmino(message: IntProto): IntProtoAmino { + const obj: any = {}; + obj.int = message.int === '' ? undefined : message.int; + return obj; + }, + fromAminoMsg(object: IntProtoAminoMsg): IntProto { + return IntProto.fromAmino(object.value); + }, + toAminoMsg(message: IntProto): IntProtoAminoMsg { + return { + type: 'cosmos-sdk/IntProto', + value: IntProto.toAmino(message), + }; + }, + fromProtoMsg(message: IntProtoProtoMsg): IntProto { + return IntProto.decode(message.value); + }, + toProto(message: IntProto): Uint8Array { + return IntProto.encode(message).finish(); + }, + toProtoMsg(message: IntProto): IntProtoProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.IntProto', + value: IntProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(IntProto.typeUrl, IntProto); +GlobalDecoderRegistry.registerAminoProtoMapping( + IntProto.aminoType, + IntProto.typeUrl +); +function createBaseDecProto(): DecProto { + return { + dec: '', + }; +} +export const DecProto = { + typeUrl: '/cosmos.base.v1beta1.DecProto', + aminoType: 'cosmos-sdk/DecProto', + is(o: any): o is DecProto { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === 'string'); + }, + isSDK(o: any): o is DecProtoSDKType { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === 'string'); + }, + isAmino(o: any): o is DecProtoAmino { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === 'string'); + }, + encode( + message: DecProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.dec !== '') { + writer.uint32(10).string(message.dec); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ''; + return message; + }, + fromAmino(object: DecProtoAmino): DecProto { + const message = createBaseDecProto(); + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } + return message; + }, + toAmino(message: DecProto): DecProtoAmino { + const obj: any = {}; + obj.dec = message.dec === '' ? undefined : message.dec; + return obj; + }, + fromAminoMsg(object: DecProtoAminoMsg): DecProto { + return DecProto.fromAmino(object.value); + }, + toAminoMsg(message: DecProto): DecProtoAminoMsg { + return { + type: 'cosmos-sdk/DecProto', + value: DecProto.toAmino(message), + }; + }, + fromProtoMsg(message: DecProtoProtoMsg): DecProto { + return DecProto.decode(message.value); + }, + toProto(message: DecProto): Uint8Array { + return DecProto.encode(message).finish(); + }, + toProtoMsg(message: DecProto): DecProtoProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.DecProto', + value: DecProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(DecProto.typeUrl, DecProto); +GlobalDecoderRegistry.registerAminoProtoMapping( + DecProto.aminoType, + DecProto.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos/bundle.ts b/packages/cosmos/src/proto_export/cosmos/bundle.ts new file mode 100644 index 00000000..e49e4335 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/bundle.ts @@ -0,0 +1,154 @@ +/* eslint-disable @typescript-eslint/no-namespace */ +//@ts-nocheck +import * as _2 from './auth/module/v1/module'; +import * as _3 from './auth/v1beta1/auth'; +import * as _4 from './auth/v1beta1/genesis'; +import * as _5 from './auth/v1beta1/query'; +import * as _6 from './auth/v1beta1/tx'; +import * as _13 from './bank/module/v1/module'; +import * as _14 from './bank/v1beta1/authz'; +import * as _15 from './bank/v1beta1/bank'; +import * as _16 from './bank/v1beta1/genesis'; +import * as _17 from './bank/v1beta1/query'; +import * as _18 from './bank/v1beta1/tx'; +import * as _19 from './base/abci/v1beta1/abci'; +import * as _20 from './base/node/v1beta1/query'; +import * as _21 from './base/query/v1beta1/pagination'; +import * as _22 from './base/reflection/v2alpha1/reflection'; +import * as _23 from './base/v1beta1/coin'; +import * as _67 from './upgrade/module/v1/module'; +import * as _68 from './upgrade/v1beta1/query'; +import * as _69 from './upgrade/v1beta1/tx'; +import * as _70 from './upgrade/v1beta1/upgrade'; +import * as _240 from './auth/v1beta1/tx.amino'; +import * as _242 from './bank/v1beta1/tx.amino'; +import * as _247 from './upgrade/v1beta1/tx.amino'; +import * as _248 from './auth/v1beta1/tx.registry'; +import * as _250 from './bank/v1beta1/tx.registry'; +import * as _255 from './upgrade/v1beta1/tx.registry'; +import * as _256 from './auth/v1beta1/query.lcd'; +import * as _258 from './bank/v1beta1/query.lcd'; +import * as _259 from './base/node/v1beta1/query.lcd'; +import * as _265 from './upgrade/v1beta1/query.lcd'; +import * as _266 from './auth/v1beta1/query.rpc.Query'; +import * as _268 from './bank/v1beta1/query.rpc.Query'; +import * as _269 from './base/node/v1beta1/query.rpc.Service'; +import * as _276 from './upgrade/v1beta1/query.rpc.Query'; +import * as _277 from './auth/v1beta1/tx.rpc.msg'; +import * as _279 from './bank/v1beta1/tx.rpc.msg'; +import * as _284 from './upgrade/v1beta1/tx.rpc.msg'; +import * as _415 from './lcd'; +import * as _416 from './rpc.query'; +import * as _417 from './rpc.tx'; +export namespace cosmos { + export namespace auth { + export namespace module { + export const v1 = { + ..._2, + }; + } + export const v1beta1 = { + ..._3, + ..._4, + ..._5, + ..._6, + ..._240, + ..._248, + ..._256, + ..._266, + ..._277, + }; + } + export namespace bank { + export namespace module { + export const v1 = { + ..._13, + }; + } + export const v1beta1 = { + ..._14, + ..._15, + ..._16, + ..._17, + ..._18, + ..._242, + ..._250, + ..._258, + ..._268, + ..._279, + }; + } + export namespace base { + export namespace abci { + export const v1beta1 = { + ..._19, + }; + } + export namespace node { + export const v1beta1 = { + ..._20, + ..._259, + ..._269, + }; + } + export namespace query { + export const v1beta1 = { + ..._21, + }; + } + export namespace reflection { + export const v2alpha1 = { + ..._22, + }; + } + export const v1beta1 = { + ..._23, + }; + } + export namespace capability { + export namespace module { + export const v1 = { + ..._24, + }; + } + } + export namespace consensus { + export namespace module { + export const v1 = { + ..._25, + }; + } + export const v1 = { + ..._26, + ..._27, + ..._243, + ..._251, + ..._260, + ..._270, + ..._280, + }; + } + export namespace upgrade { + // eslint-disable-next-line @typescript-eslint/no-namespace + export namespace module { + export const v1 = { + ..._67, + }; + } + export const v1beta1 = { + ..._68, + ..._69, + ..._70, + ..._247, + ..._255, + ..._265, + ..._276, + ..._284, + }; + } + export const ClientFactory = { + ..._415, + ..._416, + ..._417, + }; +} diff --git a/packages/cosmos/src/proto_export/cosmos/client.ts b/packages/cosmos/src/proto_export/cosmos/client.ts new file mode 100644 index 00000000..e71c0ebf --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/client.ts @@ -0,0 +1,52 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing'; +import { AminoTypes, SigningStargateClient } from '@cosmjs/stargate'; +import { HttpEndpoint } from '@cosmjs/tendermint-rpc'; + +import * as cosmosAuthV1beta1TxRegistry from './auth/v1beta1/tx.registry'; +import * as cosmosBankV1beta1TxRegistry from './bank/v1beta1/tx.registry'; +import * as cosmosUpgradeV1beta1TxRegistry from './upgrade/v1beta1/tx.registry'; +import * as cosmosAuthV1beta1TxAmino from './auth/v1beta1/tx.amino'; +import * as cosmosBankV1beta1TxAmino from './bank/v1beta1/tx.amino'; +import * as cosmosUpgradeV1beta1TxAmino from './upgrade/v1beta1/tx.amino'; +export const cosmosAminoConverters = { + ...cosmosAuthV1beta1TxAmino.AminoConverter, + ...cosmosBankV1beta1TxAmino.AminoConverter, + ...cosmosUpgradeV1beta1TxAmino.AminoConverter, +}; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...cosmosAuthV1beta1TxRegistry.registry, + ...cosmosBankV1beta1TxRegistry.registry, + ...cosmosUpgradeV1beta1TxRegistry.registry, +]; +export const getSigningCosmosClientOptions = (): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...cosmosProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...cosmosAminoConverters, + }); + return { + registry, + aminoTypes, + }; +}; +export const getSigningCosmosClient = async ({ + rpcEndpoint, + signer, +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +}) => { + const { registry, aminoTypes } = getSigningCosmosClientOptions(); + const client = await SigningStargateClient.connectWithSigner( + rpcEndpoint, + signer, + { + registry: registry as any, + aminoTypes, + } + ); + return client; +}; diff --git a/packages/cosmos/src/proto_export/cosmos/lcd.ts b/packages/cosmos/src/proto_export/cosmos/lcd.ts new file mode 100644 index 00000000..15da4076 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/lcd.ts @@ -0,0 +1,34 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; +export const createLCDClient = async ({ + restEndpoint, +}: { + restEndpoint: string; +}) => { + const requestClient = new LCDClient({ + restEndpoint, + }); + return { + cosmos: { + auth: { + v1beta1: new (await import('./auth/v1beta1/query.lcd')).LCDQueryClient({ + requestClient, + }), + }, + bank: { + v1beta1: new (await import('./bank/v1beta1/query.lcd')).LCDQueryClient({ + requestClient, + }), + }, + base: { + node: { + v1beta1: new ( + await import('./base/node/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + }, + }, + }; +}; diff --git a/packages/cosmos/src/proto_export/cosmos/msg/v1/msg.ts b/packages/cosmos/src/proto_export/cosmos/msg/v1/msg.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/cosmos/src/proto_export/cosmos/rpc.query.ts b/packages/cosmos/src/proto_export/cosmos/rpc.query.ts new file mode 100644 index 00000000..1605b28f --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/rpc.query.ts @@ -0,0 +1,37 @@ +//@ts-nocheck +import { connectComet, HttpEndpoint } from '@cosmjs/tendermint-rpc'; +import { QueryClient } from '@cosmjs/stargate'; +export const createRPCQueryClient = async ({ + rpcEndpoint, +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await connectComet(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: ( + await import('./auth/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + bank: { + v1beta1: ( + await import('./bank/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + base: { + node: { + v1beta1: ( + await import('./base/node/v1beta1/query.rpc.Service') + ).createRpcQueryExtension(client), + }, + }, + upgrade: { + v1beta1: ( + await import('./upgrade/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + }, + }; +}; diff --git a/packages/cosmos/src/proto_export/cosmos/rpc.tx.ts b/packages/cosmos/src/proto_export/cosmos/rpc.tx.ts new file mode 100644 index 00000000..07459f2e --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/rpc.tx.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { Rpc } from '../helpers'; +export const createRPCMsgClient = async ({ rpc }: { rpc: Rpc }) => ({ + cosmos: { + auth: { + v1beta1: new (await import('./auth/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + authz: { + v1beta1: new (await import('./authz/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + bank: { + v1beta1: new (await import('./bank/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + consensus: { + v1: new (await import('./consensus/v1/tx.rpc.msg')).MsgClientImpl(rpc), + }, + distribution: { + v1beta1: new ( + await import('./distribution/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + gov: { + v1beta1: new (await import('./gov/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + staking: { + v1beta1: new (await import('./staking/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + upgrade: { + v1beta1: new (await import('./upgrade/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + }, +}); diff --git a/packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/tx.ts b/packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 00000000..3cc5bada --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,529 @@ +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { Plan, PlanAmino, PlanSDKType } from './upgrade'; +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** plan is the upgrade plan. */ + plan: Plan; +} +export interface MsgSoftwareUpgradeProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade'; + value: Uint8Array; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** plan is the upgrade plan. */ + plan: PlanAmino; +} +export interface MsgSoftwareUpgradeAminoMsg { + type: 'cosmos-sdk/MsgSoftwareUpgrade'; + value: MsgSoftwareUpgradeAmino; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeSDKType { + authority: string; + plan: PlanSDKType; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponse {} +export interface MsgSoftwareUpgradeResponseProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse'; + value: Uint8Array; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseAmino {} +export interface MsgSoftwareUpgradeResponseAminoMsg { + type: 'cosmos-sdk/MsgSoftwareUpgradeResponse'; + value: MsgSoftwareUpgradeResponseAmino; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseSDKType {} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; +} +export interface MsgCancelUpgradeProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade'; + value: Uint8Array; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; +} +export interface MsgCancelUpgradeAminoMsg { + type: 'cosmos-sdk/MsgCancelUpgrade'; + value: MsgCancelUpgradeAmino; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeSDKType { + authority: string; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponse {} +export interface MsgCancelUpgradeResponseProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse'; + value: Uint8Array; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseAmino {} +export interface MsgCancelUpgradeResponseAminoMsg { + type: 'cosmos-sdk/MsgCancelUpgradeResponse'; + value: MsgCancelUpgradeResponseAmino; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseSDKType {} +function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { + return { + authority: '', + plan: Plan.fromPartial({}), + }; +} +export const MsgSoftwareUpgrade = { + typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', + aminoType: 'cosmos-sdk/MsgSoftwareUpgrade', + is(o: any): o is MsgSoftwareUpgrade { + return ( + o && + (o.$typeUrl === MsgSoftwareUpgrade.typeUrl || + (typeof o.authority === 'string' && Plan.is(o.plan))) + ); + }, + isSDK(o: any): o is MsgSoftwareUpgradeSDKType { + return ( + o && + (o.$typeUrl === MsgSoftwareUpgrade.typeUrl || + (typeof o.authority === 'string' && Plan.isSDK(o.plan))) + ); + }, + isAmino(o: any): o is MsgSoftwareUpgradeAmino { + return ( + o && + (o.$typeUrl === MsgSoftwareUpgrade.typeUrl || + (typeof o.authority === 'string' && Plan.isAmino(o.plan))) + ); + }, + encode( + message: MsgSoftwareUpgrade, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.authority !== '') { + writer.uint32(10).string(message.authority); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSoftwareUpgrade { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + message.authority = object.authority ?? ''; + message.plan = + object.plan !== undefined && object.plan !== null + ? Plan.fromPartial(object.plan) + : undefined; + return message; + }, + fromAmino(object: MsgSoftwareUpgradeAmino): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority === '' ? undefined : message.authority; + obj.plan = message.plan + ? Plan.toAmino(message.plan) + : Plan.toAmino(Plan.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeAminoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAminoMsg { + return { + type: 'cosmos-sdk/MsgSoftwareUpgrade', + value: MsgSoftwareUpgrade.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeProtoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgSoftwareUpgrade): Uint8Array { + return MsgSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', + value: MsgSoftwareUpgrade.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSoftwareUpgrade.typeUrl, MsgSoftwareUpgrade); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSoftwareUpgrade.aminoType, + MsgSoftwareUpgrade.typeUrl +); +function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { + return {}; +} +export const MsgSoftwareUpgradeResponse = { + typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse', + aminoType: 'cosmos-sdk/MsgSoftwareUpgradeResponse', + is(o: any): o is MsgSoftwareUpgradeResponse { + return o && o.$typeUrl === MsgSoftwareUpgradeResponse.typeUrl; + }, + isSDK(o: any): o is MsgSoftwareUpgradeResponseSDKType { + return o && o.$typeUrl === MsgSoftwareUpgradeResponse.typeUrl; + }, + isAmino(o: any): o is MsgSoftwareUpgradeResponseAmino { + return o && o.$typeUrl === MsgSoftwareUpgradeResponse.typeUrl; + }, + encode( + _: MsgSoftwareUpgradeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSoftwareUpgradeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgSoftwareUpgradeResponseAmino): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSoftwareUpgradeResponseAminoMsg + ): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSoftwareUpgradeResponse + ): MsgSoftwareUpgradeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSoftwareUpgradeResponse', + value: MsgSoftwareUpgradeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSoftwareUpgradeResponseProtoMsg + ): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgSoftwareUpgradeResponse): Uint8Array { + return MsgSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSoftwareUpgradeResponse + ): MsgSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse', + value: MsgSoftwareUpgradeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSoftwareUpgradeResponse.typeUrl, + MsgSoftwareUpgradeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSoftwareUpgradeResponse.aminoType, + MsgSoftwareUpgradeResponse.typeUrl +); +function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { + return { + authority: '', + }; +} +export const MsgCancelUpgrade = { + typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade', + aminoType: 'cosmos-sdk/MsgCancelUpgrade', + is(o: any): o is MsgCancelUpgrade { + return ( + o && + (o.$typeUrl === MsgCancelUpgrade.typeUrl || + typeof o.authority === 'string') + ); + }, + isSDK(o: any): o is MsgCancelUpgradeSDKType { + return ( + o && + (o.$typeUrl === MsgCancelUpgrade.typeUrl || + typeof o.authority === 'string') + ); + }, + isAmino(o: any): o is MsgCancelUpgradeAmino { + return ( + o && + (o.$typeUrl === MsgCancelUpgrade.typeUrl || + typeof o.authority === 'string') + ); + }, + encode( + message: MsgCancelUpgrade, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.authority !== '') { + writer.uint32(10).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + message.authority = object.authority ?? ''; + return message; + }, + fromAmino(object: MsgCancelUpgradeAmino): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgCancelUpgrade): MsgCancelUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority === '' ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeAminoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeAminoMsg { + return { + type: 'cosmos-sdk/MsgCancelUpgrade', + value: MsgCancelUpgrade.toAmino(message), + }; + }, + fromProtoMsg(message: MsgCancelUpgradeProtoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.decode(message.value); + }, + toProto(message: MsgCancelUpgrade): Uint8Array { + return MsgCancelUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade', + value: MsgCancelUpgrade.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgCancelUpgrade.typeUrl, MsgCancelUpgrade); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCancelUpgrade.aminoType, + MsgCancelUpgrade.typeUrl +); +function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { + return {}; +} +export const MsgCancelUpgradeResponse = { + typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse', + aminoType: 'cosmos-sdk/MsgCancelUpgradeResponse', + is(o: any): o is MsgCancelUpgradeResponse { + return o && o.$typeUrl === MsgCancelUpgradeResponse.typeUrl; + }, + isSDK(o: any): o is MsgCancelUpgradeResponseSDKType { + return o && o.$typeUrl === MsgCancelUpgradeResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelUpgradeResponseAmino { + return o && o.$typeUrl === MsgCancelUpgradeResponse.typeUrl; + }, + encode( + _: MsgCancelUpgradeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCancelUpgradeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + fromAmino(_: MsgCancelUpgradeResponseAmino): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + toAmino(_: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgCancelUpgradeResponseAminoMsg + ): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCancelUpgradeResponse + ): MsgCancelUpgradeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgCancelUpgradeResponse', + value: MsgCancelUpgradeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCancelUpgradeResponseProtoMsg + ): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.decode(message.value); + }, + toProto(message: MsgCancelUpgradeResponse): Uint8Array { + return MsgCancelUpgradeResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCancelUpgradeResponse + ): MsgCancelUpgradeResponseProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse', + value: MsgCancelUpgradeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCancelUpgradeResponse.typeUrl, + MsgCancelUpgradeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCancelUpgradeResponse.aminoType, + MsgCancelUpgradeResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/upgrade.ts b/packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 00000000..3ab9b8ae --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,810 @@ +//@ts-nocheck +import { Timestamp } from '../../../google/protobuf/timestamp'; +import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { toTimestamp, fromTimestamp } from '../../../helpers'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + time: Date; + /** The height at which the upgrade must be performed. */ + height: bigint; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgradedClientState?: Any; +} +export interface PlanProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.Plan'; + value: Uint8Array; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanAmino { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name?: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + time: string; + /** The height at which the upgrade must be performed. */ + height?: string; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info?: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgraded_client_state?: AnyAmino; +} +export interface PlanAminoMsg { + type: 'cosmos-sdk/Plan'; + value: PlanAmino; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanSDKType { + name: string; + /** @deprecated */ + time: Date; + height: bigint; + info: string; + /** @deprecated */ + upgraded_client_state?: AnySDKType; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposal { + $typeUrl?: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal'; + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; + /** plan of the proposal */ + plan: Plan; +} +export interface SoftwareUpgradeProposalProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal'; + value: Uint8Array; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposalAmino { + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; + /** plan of the proposal */ + plan: PlanAmino; +} +export interface SoftwareUpgradeProposalAminoMsg { + type: 'cosmos-sdk/SoftwareUpgradeProposal'; + value: SoftwareUpgradeProposalAmino; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposalSDKType { + $typeUrl?: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal'; + title: string; + description: string; + plan: PlanSDKType; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposal { + $typeUrl?: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal'; + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; +} +export interface CancelSoftwareUpgradeProposalProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal'; + value: Uint8Array; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposalAmino { + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; +} +export interface CancelSoftwareUpgradeProposalAminoMsg { + type: 'cosmos-sdk/CancelSoftwareUpgradeProposal'; + value: CancelSoftwareUpgradeProposalAmino; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposalSDKType { + $typeUrl?: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal'; + title: string; + description: string; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: bigint; +} +export interface ModuleVersionProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.ModuleVersion'; + value: Uint8Array; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionAmino { + /** name of the app module */ + name?: string; + /** consensus version of the app module */ + version?: string; +} +export interface ModuleVersionAminoMsg { + type: 'cosmos-sdk/ModuleVersion'; + value: ModuleVersionAmino; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionSDKType { + name: string; + version: bigint; +} +function createBasePlan(): Plan { + return { + name: '', + time: new Date(), + height: BigInt(0), + info: '', + upgradedClientState: undefined, + }; +} +export const Plan = { + typeUrl: '/cosmos.upgrade.v1beta1.Plan', + aminoType: 'cosmos-sdk/Plan', + is(o: any): o is Plan { + return ( + o && + (o.$typeUrl === Plan.typeUrl || + (typeof o.name === 'string' && + Timestamp.is(o.time) && + typeof o.height === 'bigint' && + typeof o.info === 'string')) + ); + }, + isSDK(o: any): o is PlanSDKType { + return ( + o && + (o.$typeUrl === Plan.typeUrl || + (typeof o.name === 'string' && + Timestamp.isSDK(o.time) && + typeof o.height === 'bigint' && + typeof o.info === 'string')) + ); + }, + isAmino(o: any): o is PlanAmino { + return ( + o && + (o.$typeUrl === Plan.typeUrl || + (typeof o.name === 'string' && + Timestamp.isAmino(o.time) && + typeof o.height === 'bigint' && + typeof o.info === 'string')) + ); + }, + encode( + message: Plan, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode( + toTimestamp(message.time), + writer.uint32(18).fork() + ).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.info !== '') { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode( + message.upgradedClientState, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Plan { + const message = createBasePlan(); + message.name = object.name ?? ''; + message.time = object.time ?? undefined; + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0); + message.info = object.info ?? ''; + message.upgradedClientState = + object.upgradedClientState !== undefined && + object.upgradedClientState !== null + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, + fromAmino(object: PlanAmino): Plan { + const message = createBasePlan(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if ( + object.upgraded_client_state !== undefined && + object.upgraded_client_state !== null + ) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: Plan): PlanAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.time = message.time + ? Timestamp.toAmino(toTimestamp(message.time)) + : new Date(); + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.info = message.info === '' ? undefined : message.info; + obj.upgraded_client_state = message.upgradedClientState + ? Any.toAmino(message.upgradedClientState) + : undefined; + return obj; + }, + fromAminoMsg(object: PlanAminoMsg): Plan { + return Plan.fromAmino(object.value); + }, + toAminoMsg(message: Plan): PlanAminoMsg { + return { + type: 'cosmos-sdk/Plan', + value: Plan.toAmino(message), + }; + }, + fromProtoMsg(message: PlanProtoMsg): Plan { + return Plan.decode(message.value); + }, + toProto(message: Plan): Uint8Array { + return Plan.encode(message).finish(); + }, + toProtoMsg(message: Plan): PlanProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.Plan', + value: Plan.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Plan.typeUrl, Plan); +GlobalDecoderRegistry.registerAminoProtoMapping(Plan.aminoType, Plan.typeUrl); +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { + $typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', + title: '', + description: '', + plan: Plan.fromPartial({}), + }; +} +export const SoftwareUpgradeProposal = { + typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', + aminoType: 'cosmos-sdk/SoftwareUpgradeProposal', + is(o: any): o is SoftwareUpgradeProposal { + return ( + o && + (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Plan.is(o.plan))) + ); + }, + isSDK(o: any): o is SoftwareUpgradeProposalSDKType { + return ( + o && + (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Plan.isSDK(o.plan))) + ); + }, + isAmino(o: any): o is SoftwareUpgradeProposalAmino { + return ( + o && + (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Plan.isAmino(o.plan))) + ); + }, + encode( + message: SoftwareUpgradeProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SoftwareUpgradeProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.plan = + object.plan !== undefined && object.plan !== null + ? Plan.fromPartial(object.plan) + : undefined; + return message; + }, + fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + obj.plan = message.plan + ? Plan.toAmino(message.plan) + : Plan.toAmino(Plan.fromPartial({})); + return obj; + }, + fromAminoMsg( + object: SoftwareUpgradeProposalAminoMsg + ): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg( + message: SoftwareUpgradeProposal + ): SoftwareUpgradeProposalAminoMsg { + return { + type: 'cosmos-sdk/SoftwareUpgradeProposal', + value: SoftwareUpgradeProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: SoftwareUpgradeProposalProtoMsg + ): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: SoftwareUpgradeProposal): Uint8Array { + return SoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg( + message: SoftwareUpgradeProposal + ): SoftwareUpgradeProposalProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', + value: SoftwareUpgradeProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SoftwareUpgradeProposal.typeUrl, + SoftwareUpgradeProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SoftwareUpgradeProposal.aminoType, + SoftwareUpgradeProposal.typeUrl +); +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { + $typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', + title: '', + description: '', + }; +} +export const CancelSoftwareUpgradeProposal = { + typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', + aminoType: 'cosmos-sdk/CancelSoftwareUpgradeProposal', + is(o: any): o is CancelSoftwareUpgradeProposal { + return ( + o && + (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || + (typeof o.title === 'string' && typeof o.description === 'string')) + ); + }, + isSDK(o: any): o is CancelSoftwareUpgradeProposalSDKType { + return ( + o && + (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || + (typeof o.title === 'string' && typeof o.description === 'string')) + ); + }, + isAmino(o: any): o is CancelSoftwareUpgradeProposalAmino { + return ( + o && + (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || + (typeof o.title === 'string' && typeof o.description === 'string')) + ); + }, + encode( + message: CancelSoftwareUpgradeProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CancelSoftwareUpgradeProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + return message; + }, + fromAmino( + object: CancelSoftwareUpgradeProposalAmino + ): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino( + message: CancelSoftwareUpgradeProposal + ): CancelSoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + return obj; + }, + fromAminoMsg( + object: CancelSoftwareUpgradeProposalAminoMsg + ): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg( + message: CancelSoftwareUpgradeProposal + ): CancelSoftwareUpgradeProposalAminoMsg { + return { + type: 'cosmos-sdk/CancelSoftwareUpgradeProposal', + value: CancelSoftwareUpgradeProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: CancelSoftwareUpgradeProposalProtoMsg + ): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: CancelSoftwareUpgradeProposal): Uint8Array { + return CancelSoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg( + message: CancelSoftwareUpgradeProposal + ): CancelSoftwareUpgradeProposalProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', + value: CancelSoftwareUpgradeProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + CancelSoftwareUpgradeProposal.typeUrl, + CancelSoftwareUpgradeProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + CancelSoftwareUpgradeProposal.aminoType, + CancelSoftwareUpgradeProposal.typeUrl +); +function createBaseModuleVersion(): ModuleVersion { + return { + name: '', + version: BigInt(0), + }; +} +export const ModuleVersion = { + typeUrl: '/cosmos.upgrade.v1beta1.ModuleVersion', + aminoType: 'cosmos-sdk/ModuleVersion', + is(o: any): o is ModuleVersion { + return ( + o && + (o.$typeUrl === ModuleVersion.typeUrl || + (typeof o.name === 'string' && typeof o.version === 'bigint')) + ); + }, + isSDK(o: any): o is ModuleVersionSDKType { + return ( + o && + (o.$typeUrl === ModuleVersion.typeUrl || + (typeof o.name === 'string' && typeof o.version === 'bigint')) + ); + }, + isAmino(o: any): o is ModuleVersionAmino { + return ( + o && + (o.$typeUrl === ModuleVersion.typeUrl || + (typeof o.name === 'string' && typeof o.version === 'bigint')) + ); + }, + encode( + message: ModuleVersion, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.version !== BigInt(0)) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ''; + message.version = + object.version !== undefined && object.version !== null + ? BigInt(object.version.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: ModuleVersionAmino): ModuleVersion { + const message = createBaseModuleVersion(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + return message; + }, + toAmino(message: ModuleVersion): ModuleVersionAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.version = + message.version !== BigInt(0) ? message.version.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { + return ModuleVersion.fromAmino(object.value); + }, + toAminoMsg(message: ModuleVersion): ModuleVersionAminoMsg { + return { + type: 'cosmos-sdk/ModuleVersion', + value: ModuleVersion.toAmino(message), + }; + }, + fromProtoMsg(message: ModuleVersionProtoMsg): ModuleVersion { + return ModuleVersion.decode(message.value); + }, + toProto(message: ModuleVersion): Uint8Array { + return ModuleVersion.encode(message).finish(); + }, + toProtoMsg(message: ModuleVersion): ModuleVersionProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.ModuleVersion', + value: ModuleVersion.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(ModuleVersion.typeUrl, ModuleVersion); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleVersion.aminoType, + ModuleVersion.typeUrl +); diff --git a/packages/cosmos/src/proto_export/cosmos_proto/bundle.ts b/packages/cosmos/src/proto_export/cosmos_proto/bundle.ts new file mode 100644 index 00000000..8912a8a7 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos_proto/bundle.ts @@ -0,0 +1,5 @@ +//@ts-nocheck +import * as _223 from './cosmos'; +export const cosmos_proto = { + ..._223, +}; diff --git a/packages/cosmos/src/proto_export/cosmos_proto/cosmos.ts b/packages/cosmos/src/proto_export/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..b01af197 --- /dev/null +++ b/packages/cosmos/src/proto_export/cosmos_proto/cosmos.ts @@ -0,0 +1,416 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../binary'; +import { GlobalDecoderRegistry } from '../registry'; +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} +export const ScalarTypeSDKType = ScalarType; +export const ScalarTypeAmino = ScalarType; +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case 'SCALAR_TYPE_UNSPECIFIED': + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case 'SCALAR_TYPE_STRING': + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case 'SCALAR_TYPE_BYTES': + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case 'UNRECOGNIZED': + default: + return ScalarType.UNRECOGNIZED; + } +} +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return 'SCALAR_TYPE_UNSPECIFIED'; + case ScalarType.SCALAR_TYPE_STRING: + return 'SCALAR_TYPE_STRING'; + case ScalarType.SCALAR_TYPE_BYTES: + return 'SCALAR_TYPE_BYTES'; + case ScalarType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} +export interface InterfaceDescriptorProtoMsg { + typeUrl: '/cosmos_proto.InterfaceDescriptor'; + value: Uint8Array; +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptorAmino { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name?: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description?: string; +} +export interface InterfaceDescriptorAminoMsg { + type: '/cosmos_proto.InterfaceDescriptor'; + value: InterfaceDescriptorAmino; +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptorSDKType { + name: string; + description: string; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} +export interface ScalarDescriptorProtoMsg { + typeUrl: '/cosmos_proto.ScalarDescriptor'; + value: Uint8Array; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptorAmino { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name?: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description?: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + field_type?: ScalarType[]; +} +export interface ScalarDescriptorAminoMsg { + type: '/cosmos_proto.ScalarDescriptor'; + value: ScalarDescriptorAmino; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptorSDKType { + name: string; + description: string; + field_type: ScalarType[]; +} +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { + name: '', + description: '', + }; +} +export const InterfaceDescriptor = { + typeUrl: '/cosmos_proto.InterfaceDescriptor', + is(o: any): o is InterfaceDescriptor { + return ( + o && + (o.$typeUrl === InterfaceDescriptor.typeUrl || + (typeof o.name === 'string' && typeof o.description === 'string')) + ); + }, + isSDK(o: any): o is InterfaceDescriptorSDKType { + return ( + o && + (o.$typeUrl === InterfaceDescriptor.typeUrl || + (typeof o.name === 'string' && typeof o.description === 'string')) + ); + }, + isAmino(o: any): o is InterfaceDescriptorAmino { + return ( + o && + (o.$typeUrl === InterfaceDescriptor.typeUrl || + (typeof o.name === 'string' && typeof o.description === 'string')) + ); + }, + encode( + message: InterfaceDescriptor, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): InterfaceDescriptor { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ''; + message.description = object.description ?? ''; + return message; + }, + fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.description = + message.description === '' ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { + return InterfaceDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: InterfaceDescriptorProtoMsg): InterfaceDescriptor { + return InterfaceDescriptor.decode(message.value); + }, + toProto(message: InterfaceDescriptor): Uint8Array { + return InterfaceDescriptor.encode(message).finish(); + }, + toProtoMsg(message: InterfaceDescriptor): InterfaceDescriptorProtoMsg { + return { + typeUrl: '/cosmos_proto.InterfaceDescriptor', + value: InterfaceDescriptor.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + InterfaceDescriptor.typeUrl, + InterfaceDescriptor +); +function createBaseScalarDescriptor(): ScalarDescriptor { + return { + name: '', + description: '', + fieldType: [], + }; +} +export const ScalarDescriptor = { + typeUrl: '/cosmos_proto.ScalarDescriptor', + is(o: any): o is ScalarDescriptor { + return ( + o && + (o.$typeUrl === ScalarDescriptor.typeUrl || + (typeof o.name === 'string' && + typeof o.description === 'string' && + Array.isArray(o.fieldType))) + ); + }, + isSDK(o: any): o is ScalarDescriptorSDKType { + return ( + o && + (o.$typeUrl === ScalarDescriptor.typeUrl || + (typeof o.name === 'string' && + typeof o.description === 'string' && + Array.isArray(o.field_type))) + ); + }, + isAmino(o: any): o is ScalarDescriptorAmino { + return ( + o && + (o.$typeUrl === ScalarDescriptor.typeUrl || + (typeof o.name === 'string' && + typeof o.description === 'string' && + Array.isArray(o.field_type))) + ); + }, + encode( + message: ScalarDescriptor, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ScalarDescriptor { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ''; + message.description = object.description ?? ''; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, + fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.fieldType = object.field_type?.map((e) => e) || []; + return message; + }, + toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.description = + message.description === '' ? undefined : message.description; + if (message.fieldType) { + obj.field_type = message.fieldType.map((e) => e); + } else { + obj.field_type = message.fieldType; + } + return obj; + }, + fromAminoMsg(object: ScalarDescriptorAminoMsg): ScalarDescriptor { + return ScalarDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: ScalarDescriptorProtoMsg): ScalarDescriptor { + return ScalarDescriptor.decode(message.value); + }, + toProto(message: ScalarDescriptor): Uint8Array { + return ScalarDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ScalarDescriptor): ScalarDescriptorProtoMsg { + return { + typeUrl: '/cosmos_proto.ScalarDescriptor', + value: ScalarDescriptor.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(ScalarDescriptor.typeUrl, ScalarDescriptor); diff --git a/packages/cosmos/src/proto_export/gogoproto/bundle.ts b/packages/cosmos/src/proto_export/gogoproto/bundle.ts new file mode 100644 index 00000000..fa269aa4 --- /dev/null +++ b/packages/cosmos/src/proto_export/gogoproto/bundle.ts @@ -0,0 +1,5 @@ +//@ts-nocheck +import * as _224 from './gogo'; +export const gogoproto = { + ..._224, +}; diff --git a/packages/cosmos/src/proto_export/gogoproto/gogo.ts b/packages/cosmos/src/proto_export/gogoproto/gogo.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/packages/cosmos/src/proto_export/gogoproto/gogo.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/cosmos/src/proto_export/google/api/annotations.ts b/packages/cosmos/src/proto_export/google/api/annotations.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/packages/cosmos/src/proto_export/google/api/annotations.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/cosmos/src/proto_export/google/api/http.ts b/packages/cosmos/src/proto_export/google/api/http.ts new file mode 100644 index 00000000..877d3d3c --- /dev/null +++ b/packages/cosmos/src/proto_export/google/api/http.ts @@ -0,0 +1,1477 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} +export interface HttpProtoMsg { + typeUrl: '/google.api.Http'; + value: Uint8Array; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpAmino { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules?: HttpRuleAmino[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion?: boolean; +} +export interface HttpAminoMsg { + type: '/google.api.Http'; + value: HttpAmino; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpSDKType { + rules: HttpRuleSDKType[]; + fully_decode_reserved_expansion: boolean; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPattern; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} +export interface HttpRuleProtoMsg { + typeUrl: '/google.api.HttpRule'; + value: Uint8Array; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleAmino { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector?: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPatternAmino; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body?: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + response_body?: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings?: HttpRuleAmino[]; +} +export interface HttpRuleAminoMsg { + type: '/google.api.HttpRule'; + value: HttpRuleAmino; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleSDKType { + selector: string; + get?: string; + put?: string; + post?: string; + delete?: string; + patch?: string; + custom?: CustomHttpPatternSDKType; + body: string; + response_body: string; + additional_bindings: HttpRuleSDKType[]; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} +export interface CustomHttpPatternProtoMsg { + typeUrl: '/google.api.CustomHttpPattern'; + value: Uint8Array; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternAmino { + /** The name of this custom HTTP verb. */ + kind?: string; + /** The path matched by this custom verb. */ + path?: string; +} +export interface CustomHttpPatternAminoMsg { + type: '/google.api.CustomHttpPattern'; + value: CustomHttpPatternAmino; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternSDKType { + kind: string; + path: string; +} +function createBaseHttp(): Http { + return { + rules: [], + fullyDecodeReservedExpansion: false, + }; +} +export const Http = { + typeUrl: '/google.api.Http', + is(o: any): o is Http { + return ( + o && + (o.$typeUrl === Http.typeUrl || + (Array.isArray(o.rules) && + (!o.rules.length || HttpRule.is(o.rules[0])) && + typeof o.fullyDecodeReservedExpansion === 'boolean')) + ); + }, + isSDK(o: any): o is HttpSDKType { + return ( + o && + (o.$typeUrl === Http.typeUrl || + (Array.isArray(o.rules) && + (!o.rules.length || HttpRule.isSDK(o.rules[0])) && + typeof o.fully_decode_reserved_expansion === 'boolean')) + ); + }, + isAmino(o: any): o is HttpAmino { + return ( + o && + (o.$typeUrl === Http.typeUrl || + (Array.isArray(o.rules) && + (!o.rules.length || HttpRule.isAmino(o.rules[0])) && + typeof o.fully_decode_reserved_expansion === 'boolean')) + ); + }, + encode( + message: Http, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Http { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = + object.fullyDecodeReservedExpansion ?? false; + return message; + }, + fromAmino(object: HttpAmino): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromAmino(e)) || []; + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fullyDecodeReservedExpansion = + object.fully_decode_reserved_expansion; + } + return message; + }, + toAmino(message: Http): HttpAmino { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? HttpRule.toAmino(e) : undefined + ); + } else { + obj.rules = message.rules; + } + obj.fully_decode_reserved_expansion = + message.fullyDecodeReservedExpansion === false + ? undefined + : message.fullyDecodeReservedExpansion; + return obj; + }, + fromAminoMsg(object: HttpAminoMsg): Http { + return Http.fromAmino(object.value); + }, + fromProtoMsg(message: HttpProtoMsg): Http { + return Http.decode(message.value); + }, + toProto(message: Http): Uint8Array { + return Http.encode(message).finish(); + }, + toProtoMsg(message: Http): HttpProtoMsg { + return { + typeUrl: '/google.api.Http', + value: Http.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Http.typeUrl, Http); +function createBaseHttpRule(): HttpRule { + return { + selector: '', + get: undefined, + put: undefined, + post: undefined, + delete: undefined, + patch: undefined, + custom: undefined, + body: '', + responseBody: '', + additionalBindings: [], + }; +} +export const HttpRule = { + typeUrl: '/google.api.HttpRule', + is(o: any): o is HttpRule { + return ( + o && + (o.$typeUrl === HttpRule.typeUrl || + (typeof o.selector === 'string' && + typeof o.body === 'string' && + typeof o.responseBody === 'string' && + Array.isArray(o.additionalBindings) && + (!o.additionalBindings.length || + HttpRule.is(o.additionalBindings[0])))) + ); + }, + isSDK(o: any): o is HttpRuleSDKType { + return ( + o && + (o.$typeUrl === HttpRule.typeUrl || + (typeof o.selector === 'string' && + typeof o.body === 'string' && + typeof o.response_body === 'string' && + Array.isArray(o.additional_bindings) && + (!o.additional_bindings.length || + HttpRule.isSDK(o.additional_bindings[0])))) + ); + }, + isAmino(o: any): o is HttpRuleAmino { + return ( + o && + (o.$typeUrl === HttpRule.typeUrl || + (typeof o.selector === 'string' && + typeof o.body === 'string' && + typeof o.response_body === 'string' && + Array.isArray(o.additional_bindings) && + (!o.additional_bindings.length || + HttpRule.isAmino(o.additional_bindings[0])))) + ); + }, + encode( + message: HttpRule, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.selector !== '') { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode( + message.custom, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.body !== '') { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== '') { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HttpRule { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + message.additionalBindings.push( + HttpRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ''; + message.get = object.get ?? undefined; + message.put = object.put ?? undefined; + message.post = object.post ?? undefined; + message.delete = object.delete ?? undefined; + message.patch = object.patch ?? undefined; + message.custom = + object.custom !== undefined && object.custom !== null + ? CustomHttpPattern.fromPartial(object.custom) + : undefined; + message.body = object.body ?? ''; + message.responseBody = object.responseBody ?? ''; + message.additionalBindings = + object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HttpRuleAmino): HttpRule { + const message = createBaseHttpRule(); + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromAmino(object.custom); + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.responseBody = object.response_body; + } + message.additionalBindings = + object.additional_bindings?.map((e) => HttpRule.fromAmino(e)) || []; + return message; + }, + toAmino(message: HttpRule): HttpRuleAmino { + const obj: any = {}; + obj.selector = message.selector === '' ? undefined : message.selector; + obj.get = message.get === null ? undefined : message.get; + obj.put = message.put === null ? undefined : message.put; + obj.post = message.post === null ? undefined : message.post; + obj.delete = message.delete === null ? undefined : message.delete; + obj.patch = message.patch === null ? undefined : message.patch; + obj.custom = message.custom + ? CustomHttpPattern.toAmino(message.custom) + : undefined; + obj.body = message.body === '' ? undefined : message.body; + obj.response_body = + message.responseBody === '' ? undefined : message.responseBody; + if (message.additionalBindings) { + obj.additional_bindings = message.additionalBindings.map((e) => + e ? HttpRule.toAmino(e) : undefined + ); + } else { + obj.additional_bindings = message.additionalBindings; + } + return obj; + }, + fromAminoMsg(object: HttpRuleAminoMsg): HttpRule { + return HttpRule.fromAmino(object.value); + }, + fromProtoMsg(message: HttpRuleProtoMsg): HttpRule { + return HttpRule.decode(message.value); + }, + toProto(message: HttpRule): Uint8Array { + return HttpRule.encode(message).finish(); + }, + toProtoMsg(message: HttpRule): HttpRuleProtoMsg { + return { + typeUrl: '/google.api.HttpRule', + value: HttpRule.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(HttpRule.typeUrl, HttpRule); +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { + kind: '', + path: '', + }; +} +export const CustomHttpPattern = { + typeUrl: '/google.api.CustomHttpPattern', + is(o: any): o is CustomHttpPattern { + return ( + o && + (o.$typeUrl === CustomHttpPattern.typeUrl || + (typeof o.kind === 'string' && typeof o.path === 'string')) + ); + }, + isSDK(o: any): o is CustomHttpPatternSDKType { + return ( + o && + (o.$typeUrl === CustomHttpPattern.typeUrl || + (typeof o.kind === 'string' && typeof o.path === 'string')) + ); + }, + isAmino(o: any): o is CustomHttpPatternAmino { + return ( + o && + (o.$typeUrl === CustomHttpPattern.typeUrl || + (typeof o.kind === 'string' && typeof o.path === 'string')) + ); + }, + encode( + message: CustomHttpPattern, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.kind !== '') { + writer.uint32(10).string(message.kind); + } + if (message.path !== '') { + writer.uint32(18).string(message.path); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ''; + message.path = object.path ?? ''; + return message; + }, + fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + return message; + }, + toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { + const obj: any = {}; + obj.kind = message.kind === '' ? undefined : message.kind; + obj.path = message.path === '' ? undefined : message.path; + return obj; + }, + fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern { + return CustomHttpPattern.fromAmino(object.value); + }, + fromProtoMsg(message: CustomHttpPatternProtoMsg): CustomHttpPattern { + return CustomHttpPattern.decode(message.value); + }, + toProto(message: CustomHttpPattern): Uint8Array { + return CustomHttpPattern.encode(message).finish(); + }, + toProtoMsg(message: CustomHttpPattern): CustomHttpPatternProtoMsg { + return { + typeUrl: '/google.api.CustomHttpPattern', + value: CustomHttpPattern.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(CustomHttpPattern.typeUrl, CustomHttpPattern); diff --git a/packages/cosmos/src/proto_export/google/bundle.ts b/packages/cosmos/src/proto_export/google/bundle.ts new file mode 100644 index 00000000..5dcc856b --- /dev/null +++ b/packages/cosmos/src/proto_export/google/bundle.ts @@ -0,0 +1,13 @@ +//@ts-nocheck +import * as _236 from './protobuf/any'; +import * as _237 from './protobuf/duration'; +import * as _238 from './protobuf/timestamp'; +import * as _239 from './protobuf/descriptor'; +export namespace google { + export const protobuf = { + ..._236, + ..._237, + ..._238, + ..._239, + }; +} diff --git a/packages/cosmos/src/proto_export/google/protobuf/any.ts b/packages/cosmos/src/proto_export/google/protobuf/any.ts new file mode 100644 index 00000000..ed4638ba --- /dev/null +++ b/packages/cosmos/src/proto_export/google/protobuf/any.ts @@ -0,0 +1,427 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + $typeUrl?: '/google.protobuf.Any' | string; + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} +export interface AnyProtoMsg { + typeUrl: '/google.protobuf.Any'; + value: Uint8Array; +} +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnyAmino { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + type: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: any; +} +export interface AnyAminoMsg { + type: string; + value: AnyAmino; +} +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnySDKType { + $typeUrl?: '/google.protobuf.Any' | string; + type_url: string; + value: Uint8Array; +} +function createBaseAny(): Any { + return { + $typeUrl: '/google.protobuf.Any', + typeUrl: '', + value: new Uint8Array(), + }; +} +export const Any = { + typeUrl: '/google.protobuf.Any', + is(o: any): o is Any { + return ( + o && + (o.$typeUrl === Any.typeUrl || + (typeof o.typeUrl === 'string' && + (o.value instanceof Uint8Array || typeof o.value === 'string'))) + ); + }, + isSDK(o: any): o is AnySDKType { + return ( + o && + (o.$typeUrl === Any.typeUrl || + (typeof o.type_url === 'string' && + (o.value instanceof Uint8Array || typeof o.value === 'string'))) + ); + }, + isAmino(o: any): o is AnyAmino { + return ( + o && + (o.$typeUrl === Any.typeUrl || + (typeof o.type === 'string' && + (o.value instanceof Uint8Array || typeof o.value === 'string'))) + ); + }, + encode( + message: Any, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.typeUrl !== '') { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ''; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: AnyAmino): Any { + return { + typeUrl: object.type, + value: object.value, + }; + }, + toAmino(message: Any): AnyAmino { + const obj: any = {}; + obj.type = message.typeUrl; + obj.value = message.value; + return obj; + }, + fromAminoMsg(object: AnyAminoMsg): Any { + return Any.fromAmino(object.value); + }, + fromProtoMsg(message: AnyProtoMsg): Any { + return Any.decode(message.value); + }, + toProto(message: Any): Uint8Array { + return Any.encode(message).finish(); + }, + toProtoMsg(message: Any): AnyProtoMsg { + return { + typeUrl: '/google.protobuf.Any', + value: Any.encode(message).finish(), + }; + }, +}; diff --git a/packages/cosmos/src/proto_export/google/protobuf/descriptor.ts b/packages/cosmos/src/proto_export/google/protobuf/descriptor.ts new file mode 100644 index 00000000..6d39128e --- /dev/null +++ b/packages/cosmos/src/proto_export/google/protobuf/descriptor.ts @@ -0,0 +1,6947 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +import { isSet, bytesFromBase64, base64FromBytes } from '../../helpers'; +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_TypeSDKType = FieldDescriptorProto_Type; +export const FieldDescriptorProto_TypeAmino = FieldDescriptorProto_Type; +export function fieldDescriptorProto_TypeFromJSON( + object: any +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case 'TYPE_DOUBLE': + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case 'TYPE_FLOAT': + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case 'TYPE_INT64': + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case 'TYPE_UINT64': + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case 'TYPE_INT32': + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case 'TYPE_FIXED64': + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case 'TYPE_FIXED32': + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case 'TYPE_BOOL': + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case 'TYPE_STRING': + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case 'TYPE_GROUP': + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case 'TYPE_MESSAGE': + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case 'TYPE_BYTES': + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case 'TYPE_UINT32': + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case 'TYPE_ENUM': + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case 'TYPE_SFIXED32': + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case 'TYPE_SFIXED64': + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case 'TYPE_SINT32': + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case 'TYPE_SINT64': + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case 'UNRECOGNIZED': + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return 'TYPE_DOUBLE'; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return 'TYPE_FLOAT'; + case FieldDescriptorProto_Type.TYPE_INT64: + return 'TYPE_INT64'; + case FieldDescriptorProto_Type.TYPE_UINT64: + return 'TYPE_UINT64'; + case FieldDescriptorProto_Type.TYPE_INT32: + return 'TYPE_INT32'; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return 'TYPE_FIXED64'; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return 'TYPE_FIXED32'; + case FieldDescriptorProto_Type.TYPE_BOOL: + return 'TYPE_BOOL'; + case FieldDescriptorProto_Type.TYPE_STRING: + return 'TYPE_STRING'; + case FieldDescriptorProto_Type.TYPE_GROUP: + return 'TYPE_GROUP'; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return 'TYPE_MESSAGE'; + case FieldDescriptorProto_Type.TYPE_BYTES: + return 'TYPE_BYTES'; + case FieldDescriptorProto_Type.TYPE_UINT32: + return 'TYPE_UINT32'; + case FieldDescriptorProto_Type.TYPE_ENUM: + return 'TYPE_ENUM'; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return 'TYPE_SFIXED32'; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return 'TYPE_SFIXED64'; + case FieldDescriptorProto_Type.TYPE_SINT32: + return 'TYPE_SINT32'; + case FieldDescriptorProto_Type.TYPE_SINT64: + return 'TYPE_SINT64'; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_LabelSDKType = FieldDescriptorProto_Label; +export const FieldDescriptorProto_LabelAmino = FieldDescriptorProto_Label; +export function fieldDescriptorProto_LabelFromJSON( + object: any +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case 'LABEL_OPTIONAL': + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case 'LABEL_REQUIRED': + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case 'LABEL_REPEATED': + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case 'UNRECOGNIZED': + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return 'LABEL_OPTIONAL'; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return 'LABEL_REQUIRED'; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return 'LABEL_REPEATED'; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** + * SPEED - Generate complete code for parsing, serialization, + * etc. + */ + SPEED = 1, + /** CODE_SIZE - Use ReflectionOps to implement these methods. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} +export const FileOptions_OptimizeModeSDKType = FileOptions_OptimizeMode; +export const FileOptions_OptimizeModeAmino = FileOptions_OptimizeMode; +export function fileOptions_OptimizeModeFromJSON( + object: any +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case 'SPEED': + return FileOptions_OptimizeMode.SPEED; + case 2: + case 'CODE_SIZE': + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case 'LITE_RUNTIME': + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case 'UNRECOGNIZED': + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return 'SPEED'; + case FileOptions_OptimizeMode.CODE_SIZE: + return 'CODE_SIZE'; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return 'LITE_RUNTIME'; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_CTypeSDKType = FieldOptions_CType; +export const FieldOptions_CTypeAmino = FieldOptions_CType; +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case 'STRING': + return FieldOptions_CType.STRING; + case 1: + case 'CORD': + return FieldOptions_CType.CORD; + case 2: + case 'STRING_PIECE': + return FieldOptions_CType.STRING_PIECE; + case -1: + case 'UNRECOGNIZED': + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return 'STRING'; + case FieldOptions_CType.CORD: + return 'CORD'; + case FieldOptions_CType.STRING_PIECE: + return 'STRING_PIECE'; + case FieldOptions_CType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_JSTypeSDKType = FieldOptions_JSType; +export const FieldOptions_JSTypeAmino = FieldOptions_JSType; +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case 'JS_NORMAL': + return FieldOptions_JSType.JS_NORMAL; + case 1: + case 'JS_STRING': + return FieldOptions_JSType.JS_STRING; + case 2: + case 'JS_NUMBER': + return FieldOptions_JSType.JS_NUMBER; + case -1: + case 'UNRECOGNIZED': + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return 'JS_NORMAL'; + case FieldOptions_JSType.JS_STRING: + return 'JS_STRING'; + case FieldOptions_JSType.JS_NUMBER: + return 'JS_NUMBER'; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} +export const MethodOptions_IdempotencyLevelSDKType = + MethodOptions_IdempotencyLevel; +export const MethodOptions_IdempotencyLevelAmino = + MethodOptions_IdempotencyLevel; +export function methodOptions_IdempotencyLevelFromJSON( + object: any +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case 'IDEMPOTENCY_UNKNOWN': + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case 'NO_SIDE_EFFECTS': + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case 'IDEMPOTENT': + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case 'UNRECOGNIZED': + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return 'IDEMPOTENCY_UNKNOWN'; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return 'NO_SIDE_EFFECTS'; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return 'IDEMPOTENT'; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} +export interface FileDescriptorSetProtoMsg { + typeUrl: '/google.protobuf.FileDescriptorSet'; + value: Uint8Array; +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSetAmino { + file?: FileDescriptorProtoAmino[]; +} +export interface FileDescriptorSetAminoMsg { + type: '/google.protobuf.FileDescriptorSet'; + value: FileDescriptorSetAmino; +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSetSDKType { + file: FileDescriptorProtoSDKType[]; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} +export interface FileDescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.FileDescriptorProto'; + value: Uint8Array; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProtoAmino { + /** file name, relative to root of source tree */ + name?: string; + package?: string; + /** Names of files imported by this file. */ + dependency?: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency?: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency?: number[]; + /** All top-level definitions in this file. */ + message_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + service?: ServiceDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; + options?: FileOptionsAmino; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + source_code_info?: SourceCodeInfoAmino; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax?: string; +} +export interface FileDescriptorProtoAminoMsg { + type: '/google.protobuf.FileDescriptorProto'; + value: FileDescriptorProtoAmino; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProtoSDKType { + name: string; + package: string; + dependency: string[]; + public_dependency: number[]; + weak_dependency: number[]; + message_type: DescriptorProtoSDKType[]; + enum_type: EnumDescriptorProtoSDKType[]; + service: ServiceDescriptorProtoSDKType[]; + extension: FieldDescriptorProtoSDKType[]; + options?: FileOptionsSDKType; + source_code_info?: SourceCodeInfoSDKType; + syntax: string; +} +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} +export interface DescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.DescriptorProto'; + value: Uint8Array; +} +/** Describes a message type. */ +export interface DescriptorProtoAmino { + name?: string; + field?: FieldDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; + nested_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + extension_range?: DescriptorProto_ExtensionRangeAmino[]; + oneof_decl?: OneofDescriptorProtoAmino[]; + options?: MessageOptionsAmino; + reserved_range?: DescriptorProto_ReservedRangeAmino[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name?: string[]; +} +export interface DescriptorProtoAminoMsg { + type: '/google.protobuf.DescriptorProto'; + value: DescriptorProtoAmino; +} +/** Describes a message type. */ +export interface DescriptorProtoSDKType { + name: string; + field: FieldDescriptorProtoSDKType[]; + extension: FieldDescriptorProtoSDKType[]; + nested_type: DescriptorProtoSDKType[]; + enum_type: EnumDescriptorProtoSDKType[]; + extension_range: DescriptorProto_ExtensionRangeSDKType[]; + oneof_decl: OneofDescriptorProtoSDKType[]; + options?: MessageOptionsSDKType; + reserved_range: DescriptorProto_ReservedRangeSDKType[]; + reserved_name: string[]; +} +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptions; +} +export interface DescriptorProto_ExtensionRangeProtoMsg { + typeUrl: '/google.protobuf.ExtensionRange'; + value: Uint8Array; +} +export interface DescriptorProto_ExtensionRangeAmino { + /** Inclusive. */ + start?: number; + /** Exclusive. */ + end?: number; + options?: ExtensionRangeOptionsAmino; +} +export interface DescriptorProto_ExtensionRangeAminoMsg { + type: '/google.protobuf.ExtensionRange'; + value: DescriptorProto_ExtensionRangeAmino; +} +export interface DescriptorProto_ExtensionRangeSDKType { + start: number; + end: number; + options?: ExtensionRangeOptionsSDKType; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} +export interface DescriptorProto_ReservedRangeProtoMsg { + typeUrl: '/google.protobuf.ReservedRange'; + value: Uint8Array; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRangeAmino { + /** Inclusive. */ + start?: number; + /** Exclusive. */ + end?: number; +} +export interface DescriptorProto_ReservedRangeAminoMsg { + type: '/google.protobuf.ReservedRange'; + value: DescriptorProto_ReservedRangeAmino; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRangeSDKType { + start: number; + end: number; +} +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ExtensionRangeOptionsProtoMsg { + typeUrl: '/google.protobuf.ExtensionRangeOptions'; + value: Uint8Array; +} +export interface ExtensionRangeOptionsAmino { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface ExtensionRangeOptionsAminoMsg { + type: '/google.protobuf.ExtensionRangeOptions'; + value: ExtensionRangeOptionsAmino; +} +export interface ExtensionRangeOptionsSDKType { + uninterpreted_option: UninterpretedOptionSDKType[]; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: FieldOptions; +} +export interface FieldDescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.FieldDescriptorProto'; + value: Uint8Array; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProtoAmino { + name?: string; + number?: number; + label?: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type?: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + type_name?: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee?: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + default_value?: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index?: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + json_name?: string; + options?: FieldOptionsAmino; +} +export interface FieldDescriptorProtoAminoMsg { + type: '/google.protobuf.FieldDescriptorProto'; + value: FieldDescriptorProtoAmino; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProtoSDKType { + name: string; + number: number; + label: FieldDescriptorProto_Label; + type: FieldDescriptorProto_Type; + type_name: string; + extendee: string; + default_value: string; + oneof_index: number; + json_name: string; + options?: FieldOptionsSDKType; +} +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} +export interface OneofDescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.OneofDescriptorProto'; + value: Uint8Array; +} +/** Describes a oneof. */ +export interface OneofDescriptorProtoAmino { + name?: string; + options?: OneofOptionsAmino; +} +export interface OneofDescriptorProtoAminoMsg { + type: '/google.protobuf.OneofDescriptorProto'; + value: OneofDescriptorProtoAmino; +} +/** Describes a oneof. */ +export interface OneofDescriptorProtoSDKType { + name: string; + options?: OneofOptionsSDKType; +} +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} +export interface EnumDescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.EnumDescriptorProto'; + value: Uint8Array; +} +/** Describes an enum type. */ +export interface EnumDescriptorProtoAmino { + name?: string; + value?: EnumValueDescriptorProtoAmino[]; + options?: EnumOptionsAmino; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reserved_range?: EnumDescriptorProto_EnumReservedRangeAmino[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name?: string[]; +} +export interface EnumDescriptorProtoAminoMsg { + type: '/google.protobuf.EnumDescriptorProto'; + value: EnumDescriptorProtoAmino; +} +/** Describes an enum type. */ +export interface EnumDescriptorProtoSDKType { + name: string; + value: EnumValueDescriptorProtoSDKType[]; + options?: EnumOptionsSDKType; + reserved_range: EnumDescriptorProto_EnumReservedRangeSDKType[]; + reserved_name: string[]; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} +export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { + typeUrl: '/google.protobuf.EnumReservedRange'; + value: Uint8Array; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRangeAmino { + /** Inclusive. */ + start?: number; + /** Inclusive. */ + end?: number; +} +export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { + type: '/google.protobuf.EnumReservedRange'; + value: EnumDescriptorProto_EnumReservedRangeAmino; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRangeSDKType { + start: number; + end: number; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} +export interface EnumValueDescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.EnumValueDescriptorProto'; + value: Uint8Array; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProtoAmino { + name?: string; + number?: number; + options?: EnumValueOptionsAmino; +} +export interface EnumValueDescriptorProtoAminoMsg { + type: '/google.protobuf.EnumValueDescriptorProto'; + value: EnumValueDescriptorProtoAmino; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProtoSDKType { + name: string; + number: number; + options?: EnumValueOptionsSDKType; +} +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} +export interface ServiceDescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.ServiceDescriptorProto'; + value: Uint8Array; +} +/** Describes a service. */ +export interface ServiceDescriptorProtoAmino { + name?: string; + method?: MethodDescriptorProtoAmino[]; + options?: ServiceOptionsAmino; +} +export interface ServiceDescriptorProtoAminoMsg { + type: '/google.protobuf.ServiceDescriptorProto'; + value: ServiceDescriptorProtoAmino; +} +/** Describes a service. */ +export interface ServiceDescriptorProtoSDKType { + name: string; + method: MethodDescriptorProtoSDKType[]; + options?: ServiceOptionsSDKType; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} +export interface MethodDescriptorProtoProtoMsg { + typeUrl: '/google.protobuf.MethodDescriptorProto'; + value: Uint8Array; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProtoAmino { + name?: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type?: string; + output_type?: string; + options?: MethodOptionsAmino; + /** Identifies if client streams multiple client messages */ + client_streaming?: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming?: boolean; +} +export interface MethodDescriptorProtoAminoMsg { + type: '/google.protobuf.MethodDescriptorProto'; + value: MethodDescriptorProtoAmino; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProtoSDKType { + name: string; + input_type: string; + output_type: string; + options?: MethodOptionsSDKType; + client_streaming: boolean; + server_streaming: boolean; +} +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + javaOuterClassname: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** This option does nothing. */ + /** @deprecated */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FileOptionsProtoMsg { + typeUrl: '/google.protobuf.FileOptions'; + value: Uint8Array; +} +export interface FileOptionsAmino { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + java_package?: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + java_outer_classname?: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + java_multiple_files?: boolean; + /** This option does nothing. */ + /** @deprecated */ + java_generate_equals_and_hash?: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + java_string_check_utf8?: boolean; + optimize_for?: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + go_package?: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated?: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas?: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix?: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace?: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swift_prefix?: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix?: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + php_namespace?: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + php_metadata_namespace?: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + ruby_package?: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface FileOptionsAminoMsg { + type: '/google.protobuf.FileOptions'; + value: FileOptionsAmino; +} +export interface FileOptionsSDKType { + java_package: string; + java_outer_classname: string; + java_multiple_files: boolean; + /** @deprecated */ + java_generate_equals_and_hash: boolean; + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + go_package: string; + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + deprecated: boolean; + cc_enable_arenas: boolean; + objc_class_prefix: string; + csharp_namespace: string; + swift_prefix: string; + php_class_prefix: string; + php_namespace: string; + php_metadata_namespace: string; + ruby_package: string; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MessageOptionsProtoMsg { + typeUrl: '/google.protobuf.MessageOptions'; + value: Uint8Array; +} +export interface MessageOptionsAmino { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + message_set_wire_format?: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + no_standard_descriptor_accessor?: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated?: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + map_entry?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface MessageOptionsAminoMsg { + type: '/google.protobuf.MessageOptions'; + value: MessageOptionsAmino; +} +export interface MessageOptionsSDKType { + message_set_wire_format: boolean; + no_standard_descriptor_accessor: boolean; + deprecated: boolean; + map_entry: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FieldOptionsProtoMsg { + typeUrl: '/google.protobuf.FieldOptions'; + value: Uint8Array; +} +export interface FieldOptionsAmino { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype?: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed?: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype?: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy?: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated?: boolean; + /** For Google-internal migration only. Do not use. */ + weak?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface FieldOptionsAminoMsg { + type: '/google.protobuf.FieldOptions'; + value: FieldOptionsAmino; +} +export interface FieldOptionsSDKType { + ctype: FieldOptions_CType; + packed: boolean; + jstype: FieldOptions_JSType; + lazy: boolean; + deprecated: boolean; + weak: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface OneofOptionsProtoMsg { + typeUrl: '/google.protobuf.OneofOptions'; + value: Uint8Array; +} +export interface OneofOptionsAmino { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface OneofOptionsAminoMsg { + type: '/google.protobuf.OneofOptions'; + value: OneofOptionsAmino; +} +export interface OneofOptionsSDKType { + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumOptionsProtoMsg { + typeUrl: '/google.protobuf.EnumOptions'; + value: Uint8Array; +} +export interface EnumOptionsAmino { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias?: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface EnumOptionsAminoMsg { + type: '/google.protobuf.EnumOptions'; + value: EnumOptionsAmino; +} +export interface EnumOptionsSDKType { + allow_alias: boolean; + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumValueOptionsProtoMsg { + typeUrl: '/google.protobuf.EnumValueOptions'; + value: Uint8Array; +} +export interface EnumValueOptionsAmino { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface EnumValueOptionsAminoMsg { + type: '/google.protobuf.EnumValueOptions'; + value: EnumValueOptionsAmino; +} +export interface EnumValueOptionsSDKType { + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ServiceOptionsProtoMsg { + typeUrl: '/google.protobuf.ServiceOptions'; + value: Uint8Array; +} +export interface ServiceOptionsAmino { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface ServiceOptionsAminoMsg { + type: '/google.protobuf.ServiceOptions'; + value: ServiceOptionsAmino; +} +export interface ServiceOptionsSDKType { + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MethodOptionsProtoMsg { + typeUrl: '/google.protobuf.MethodOptions'; + value: Uint8Array; +} +export interface MethodOptionsAmino { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated?: boolean; + idempotency_level?: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface MethodOptionsAminoMsg { + type: '/google.protobuf.MethodOptions'; + value: MethodOptionsAmino; +} +export interface MethodOptionsSDKType { + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: bigint; + negativeIntValue: bigint; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} +export interface UninterpretedOptionProtoMsg { + typeUrl: '/google.protobuf.UninterpretedOption'; + value: Uint8Array; +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOptionAmino { + name?: UninterpretedOption_NamePartAmino[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value?: string; + positive_int_value?: string; + negative_int_value?: string; + double_value?: number; + string_value?: string; + aggregate_value?: string; +} +export interface UninterpretedOptionAminoMsg { + type: '/google.protobuf.UninterpretedOption'; + value: UninterpretedOptionAmino; +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOptionSDKType { + name: UninterpretedOption_NamePartSDKType[]; + identifier_value: string; + positive_int_value: bigint; + negative_int_value: bigint; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} +export interface UninterpretedOption_NamePartProtoMsg { + typeUrl: '/google.protobuf.NamePart'; + value: Uint8Array; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePartAmino { + name_part?: string; + is_extension?: boolean; +} +export interface UninterpretedOption_NamePartAminoMsg { + type: '/google.protobuf.NamePart'; + value: UninterpretedOption_NamePartAmino; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePartSDKType { + name_part: string; + is_extension: boolean; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} +export interface SourceCodeInfoProtoMsg { + typeUrl: '/google.protobuf.SourceCodeInfo'; + value: Uint8Array; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoAmino { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location?: SourceCodeInfo_LocationAmino[]; +} +export interface SourceCodeInfoAminoMsg { + type: '/google.protobuf.SourceCodeInfo'; + value: SourceCodeInfoAmino; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoSDKType { + location: SourceCodeInfo_LocationSDKType[]; +} +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} +export interface SourceCodeInfo_LocationProtoMsg { + typeUrl: '/google.protobuf.Location'; + value: Uint8Array; +} +export interface SourceCodeInfo_LocationAmino { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path?: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span?: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments?: string[]; +} +export interface SourceCodeInfo_LocationAminoMsg { + type: '/google.protobuf.Location'; + value: SourceCodeInfo_LocationAmino; +} +export interface SourceCodeInfo_LocationSDKType { + path: number[]; + span: number[]; + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} +export interface GeneratedCodeInfoProtoMsg { + typeUrl: '/google.protobuf.GeneratedCodeInfo'; + value: Uint8Array; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfoAmino { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation?: GeneratedCodeInfo_AnnotationAmino[]; +} +export interface GeneratedCodeInfoAminoMsg { + type: '/google.protobuf.GeneratedCodeInfo'; + value: GeneratedCodeInfoAmino; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfoSDKType { + annotation: GeneratedCodeInfo_AnnotationSDKType[]; +} +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} +export interface GeneratedCodeInfo_AnnotationProtoMsg { + typeUrl: '/google.protobuf.Annotation'; + value: Uint8Array; +} +export interface GeneratedCodeInfo_AnnotationAmino { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path?: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file?: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin?: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end?: number; +} +export interface GeneratedCodeInfo_AnnotationAminoMsg { + type: '/google.protobuf.Annotation'; + value: GeneratedCodeInfo_AnnotationAmino; +} +export interface GeneratedCodeInfo_AnnotationSDKType { + path: number[]; + source_file: string; + begin: number; + end: number; +} +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { + file: [], + }; +} +export const FileDescriptorSet = { + typeUrl: '/google.protobuf.FileDescriptorSet', + is(o: any): o is FileDescriptorSet { + return ( + o && + (o.$typeUrl === FileDescriptorSet.typeUrl || + (Array.isArray(o.file) && + (!o.file.length || FileDescriptorProto.is(o.file[0])))) + ); + }, + isSDK(o: any): o is FileDescriptorSetSDKType { + return ( + o && + (o.$typeUrl === FileDescriptorSet.typeUrl || + (Array.isArray(o.file) && + (!o.file.length || FileDescriptorProto.isSDK(o.file[0])))) + ); + }, + isAmino(o: any): o is FileDescriptorSetAmino { + return ( + o && + (o.$typeUrl === FileDescriptorSet.typeUrl || + (Array.isArray(o.file) && + (!o.file.length || FileDescriptorProto.isAmino(o.file[0])))) + ); + }, + encode( + message: FileDescriptorSet, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = + object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = + object.file?.map((e) => FileDescriptorProto.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.file = message.file; + } + return obj; + }, + fromAminoMsg(object: FileDescriptorSetAminoMsg): FileDescriptorSet { + return FileDescriptorSet.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorSetProtoMsg): FileDescriptorSet { + return FileDescriptorSet.decode(message.value); + }, + toProto(message: FileDescriptorSet): Uint8Array { + return FileDescriptorSet.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorSet): FileDescriptorSetProtoMsg { + return { + typeUrl: '/google.protobuf.FileDescriptorSet', + value: FileDescriptorSet.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(FileDescriptorSet.typeUrl, FileDescriptorSet); +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: '', + package: '', + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: '', + }; +} +export const FileDescriptorProto = { + typeUrl: '/google.protobuf.FileDescriptorProto', + is(o: any): o is FileDescriptorProto { + return ( + o && + (o.$typeUrl === FileDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.package === 'string' && + Array.isArray(o.dependency) && + (!o.dependency.length || typeof o.dependency[0] === 'string') && + Array.isArray(o.publicDependency) && + (!o.publicDependency.length || + typeof o.publicDependency[0] === 'number') && + Array.isArray(o.weakDependency) && + (!o.weakDependency.length || + typeof o.weakDependency[0] === 'number') && + Array.isArray(o.messageType) && + (!o.messageType.length || DescriptorProto.is(o.messageType[0])) && + Array.isArray(o.enumType) && + (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && + Array.isArray(o.service) && + (!o.service.length || ServiceDescriptorProto.is(o.service[0])) && + Array.isArray(o.extension) && + (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && + typeof o.syntax === 'string')) + ); + }, + isSDK(o: any): o is FileDescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === FileDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.package === 'string' && + Array.isArray(o.dependency) && + (!o.dependency.length || typeof o.dependency[0] === 'string') && + Array.isArray(o.public_dependency) && + (!o.public_dependency.length || + typeof o.public_dependency[0] === 'number') && + Array.isArray(o.weak_dependency) && + (!o.weak_dependency.length || + typeof o.weak_dependency[0] === 'number') && + Array.isArray(o.message_type) && + (!o.message_type.length || + DescriptorProto.isSDK(o.message_type[0])) && + Array.isArray(o.enum_type) && + (!o.enum_type.length || EnumDescriptorProto.isSDK(o.enum_type[0])) && + Array.isArray(o.service) && + (!o.service.length || ServiceDescriptorProto.isSDK(o.service[0])) && + Array.isArray(o.extension) && + (!o.extension.length || FieldDescriptorProto.isSDK(o.extension[0])) && + typeof o.syntax === 'string')) + ); + }, + isAmino(o: any): o is FileDescriptorProtoAmino { + return ( + o && + (o.$typeUrl === FileDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.package === 'string' && + Array.isArray(o.dependency) && + (!o.dependency.length || typeof o.dependency[0] === 'string') && + Array.isArray(o.public_dependency) && + (!o.public_dependency.length || + typeof o.public_dependency[0] === 'number') && + Array.isArray(o.weak_dependency) && + (!o.weak_dependency.length || + typeof o.weak_dependency[0] === 'number') && + Array.isArray(o.message_type) && + (!o.message_type.length || + DescriptorProto.isAmino(o.message_type[0])) && + Array.isArray(o.enum_type) && + (!o.enum_type.length || + EnumDescriptorProto.isAmino(o.enum_type[0])) && + Array.isArray(o.service) && + (!o.service.length || ServiceDescriptorProto.isAmino(o.service[0])) && + Array.isArray(o.extension) && + (!o.extension.length || + FieldDescriptorProto.isAmino(o.extension[0])) && + typeof o.syntax === 'string')) + ); + }, + encode( + message: FileDescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.package !== '') { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode( + message.sourceCodeInfo, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.syntax !== '') { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): FileDescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.enumType.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ''; + message.package = object.package ?? ''; + message.dependency = object.dependency?.map((e) => e) || []; + message.publicDependency = object.publicDependency?.map((e) => e) || []; + message.weakDependency = object.weakDependency?.map((e) => e) || []; + message.messageType = + object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.service = + object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? FileOptions.fromPartial(object.options) + : undefined; + message.sourceCodeInfo = + object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null + ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) + : undefined; + message.syntax = object.syntax ?? ''; + return message; + }, + fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } + message.dependency = object.dependency?.map((e) => e) || []; + message.publicDependency = object.public_dependency?.map((e) => e) || []; + message.weakDependency = object.weak_dependency?.map((e) => e) || []; + message.messageType = + object.message_type?.map((e) => DescriptorProto.fromAmino(e)) || []; + message.enumType = + object.enum_type?.map((e) => EnumDescriptorProto.fromAmino(e)) || []; + message.service = + object.service?.map((e) => ServiceDescriptorProto.fromAmino(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromAmino(object.options); + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.sourceCodeInfo = SourceCodeInfo.fromAmino( + object.source_code_info + ); + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } + return message; + }, + toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.package = message.package === '' ? undefined : message.package; + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = message.dependency; + } + if (message.publicDependency) { + obj.public_dependency = message.publicDependency.map((e) => e); + } else { + obj.public_dependency = message.publicDependency; + } + if (message.weakDependency) { + obj.weak_dependency = message.weakDependency.map((e) => e); + } else { + obj.weak_dependency = message.weakDependency; + } + if (message.messageType) { + obj.message_type = message.messageType.map((e) => + e ? DescriptorProto.toAmino(e) : undefined + ); + } else { + obj.message_type = message.messageType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map((e) => + e ? EnumDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.enum_type = message.enumType; + } + if (message.service) { + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.service = message.service; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.extension = message.extension; + } + obj.options = message.options + ? FileOptions.toAmino(message.options) + : undefined; + obj.source_code_info = message.sourceCodeInfo + ? SourceCodeInfo.toAmino(message.sourceCodeInfo) + : undefined; + obj.syntax = message.syntax === '' ? undefined : message.syntax; + return obj; + }, + fromAminoMsg(object: FileDescriptorProtoAminoMsg): FileDescriptorProto { + return FileDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorProtoProtoMsg): FileDescriptorProto { + return FileDescriptorProto.decode(message.value); + }, + toProto(message: FileDescriptorProto): Uint8Array { + return FileDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorProto): FileDescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.FileDescriptorProto', + value: FileDescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + FileDescriptorProto.typeUrl, + FileDescriptorProto +); +function createBaseDescriptorProto(): DescriptorProto { + return { + name: '', + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} +export const DescriptorProto = { + typeUrl: '/google.protobuf.DescriptorProto', + is(o: any): o is DescriptorProto { + return ( + o && + (o.$typeUrl === DescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.field) && + (!o.field.length || FieldDescriptorProto.is(o.field[0])) && + Array.isArray(o.extension) && + (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && + Array.isArray(o.nestedType) && + (!o.nestedType.length || DescriptorProto.is(o.nestedType[0])) && + Array.isArray(o.enumType) && + (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && + Array.isArray(o.extensionRange) && + (!o.extensionRange.length || + DescriptorProto_ExtensionRange.is(o.extensionRange[0])) && + Array.isArray(o.oneofDecl) && + (!o.oneofDecl.length || OneofDescriptorProto.is(o.oneofDecl[0])) && + Array.isArray(o.reservedRange) && + (!o.reservedRange.length || + DescriptorProto_ReservedRange.is(o.reservedRange[0])) && + Array.isArray(o.reservedName) && + (!o.reservedName.length || typeof o.reservedName[0] === 'string'))) + ); + }, + isSDK(o: any): o is DescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === DescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.field) && + (!o.field.length || FieldDescriptorProto.isSDK(o.field[0])) && + Array.isArray(o.extension) && + (!o.extension.length || FieldDescriptorProto.isSDK(o.extension[0])) && + Array.isArray(o.nested_type) && + (!o.nested_type.length || DescriptorProto.isSDK(o.nested_type[0])) && + Array.isArray(o.enum_type) && + (!o.enum_type.length || EnumDescriptorProto.isSDK(o.enum_type[0])) && + Array.isArray(o.extension_range) && + (!o.extension_range.length || + DescriptorProto_ExtensionRange.isSDK(o.extension_range[0])) && + Array.isArray(o.oneof_decl) && + (!o.oneof_decl.length || + OneofDescriptorProto.isSDK(o.oneof_decl[0])) && + Array.isArray(o.reserved_range) && + (!o.reserved_range.length || + DescriptorProto_ReservedRange.isSDK(o.reserved_range[0])) && + Array.isArray(o.reserved_name) && + (!o.reserved_name.length || typeof o.reserved_name[0] === 'string'))) + ); + }, + isAmino(o: any): o is DescriptorProtoAmino { + return ( + o && + (o.$typeUrl === DescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.field) && + (!o.field.length || FieldDescriptorProto.isAmino(o.field[0])) && + Array.isArray(o.extension) && + (!o.extension.length || + FieldDescriptorProto.isAmino(o.extension[0])) && + Array.isArray(o.nested_type) && + (!o.nested_type.length || + DescriptorProto.isAmino(o.nested_type[0])) && + Array.isArray(o.enum_type) && + (!o.enum_type.length || + EnumDescriptorProto.isAmino(o.enum_type[0])) && + Array.isArray(o.extension_range) && + (!o.extension_range.length || + DescriptorProto_ExtensionRange.isAmino(o.extension_range[0])) && + Array.isArray(o.oneof_decl) && + (!o.oneof_decl.length || + OneofDescriptorProto.isAmino(o.oneof_decl[0])) && + Array.isArray(o.reserved_range) && + (!o.reserved_range.length || + DescriptorProto_ReservedRange.isAmino(o.reserved_range[0])) && + Array.isArray(o.reserved_name) && + (!o.reserved_name.length || typeof o.reserved_name[0] === 'string'))) + ); + }, + encode( + message: DescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.nestedType.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 4: + message.enumType.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.extensionRange.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) + ); + break; + case 8: + message.oneofDecl.push( + OneofDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()) + ); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ''; + message.field = + object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = + object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = + object.extensionRange?.map((e) => + DescriptorProto_ExtensionRange.fromPartial(e) + ) || []; + message.oneofDecl = + object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? MessageOptions.fromPartial(object.options) + : undefined; + message.reservedRange = + object.reservedRange?.map((e) => + DescriptorProto_ReservedRange.fromPartial(e) + ) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, + fromAmino(object: DescriptorProtoAmino): DescriptorProto { + const message = createBaseDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.field = + object.field?.map((e) => FieldDescriptorProto.fromAmino(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromAmino(e)) || []; + message.nestedType = + object.nested_type?.map((e) => DescriptorProto.fromAmino(e)) || []; + message.enumType = + object.enum_type?.map((e) => EnumDescriptorProto.fromAmino(e)) || []; + message.extensionRange = + object.extension_range?.map((e) => + DescriptorProto_ExtensionRange.fromAmino(e) + ) || []; + message.oneofDecl = + object.oneof_decl?.map((e) => OneofDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromAmino(object.options); + } + message.reservedRange = + object.reserved_range?.map((e) => + DescriptorProto_ReservedRange.fromAmino(e) + ) || []; + message.reservedName = object.reserved_name?.map((e) => e) || []; + return message; + }, + toAmino(message: DescriptorProto): DescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + if (message.field) { + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.field = message.field; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.extension = message.extension; + } + if (message.nestedType) { + obj.nested_type = message.nestedType.map((e) => + e ? DescriptorProto.toAmino(e) : undefined + ); + } else { + obj.nested_type = message.nestedType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map((e) => + e ? EnumDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.enum_type = message.enumType; + } + if (message.extensionRange) { + obj.extension_range = message.extensionRange.map((e) => + e ? DescriptorProto_ExtensionRange.toAmino(e) : undefined + ); + } else { + obj.extension_range = message.extensionRange; + } + if (message.oneofDecl) { + obj.oneof_decl = message.oneofDecl.map((e) => + e ? OneofDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.oneof_decl = message.oneofDecl; + } + obj.options = message.options + ? MessageOptions.toAmino(message.options) + : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map((e) => + e ? DescriptorProto_ReservedRange.toAmino(e) : undefined + ); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map((e) => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: DescriptorProtoAminoMsg): DescriptorProto { + return DescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProtoProtoMsg): DescriptorProto { + return DescriptorProto.decode(message.value); + }, + toProto(message: DescriptorProto): Uint8Array { + return DescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto): DescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.DescriptorProto', + value: DescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(DescriptorProto.typeUrl, DescriptorProto); +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { + start: 0, + end: 0, + options: undefined, + }; +} +export const DescriptorProto_ExtensionRange = { + typeUrl: '/google.protobuf.ExtensionRange', + is(o: any): o is DescriptorProto_ExtensionRange { + return ( + o && + (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + isSDK(o: any): o is DescriptorProto_ExtensionRangeSDKType { + return ( + o && + (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + isAmino(o: any): o is DescriptorProto_ExtensionRangeAmino { + return ( + o && + (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + encode( + message: DescriptorProto_ExtensionRange, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): DescriptorProto_ExtensionRange { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = + object.options !== undefined && object.options !== null + ? ExtensionRangeOptions.fromPartial(object.options) + : undefined; + return message; + }, + fromAmino( + object: DescriptorProto_ExtensionRangeAmino + ): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromAmino(object.options); + } + return message; + }, + toAmino( + message: DescriptorProto_ExtensionRange + ): DescriptorProto_ExtensionRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + obj.options = message.options + ? ExtensionRangeOptions.toAmino(message.options) + : undefined; + return obj; + }, + fromAminoMsg( + object: DescriptorProto_ExtensionRangeAminoMsg + ): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromAmino(object.value); + }, + fromProtoMsg( + message: DescriptorProto_ExtensionRangeProtoMsg + ): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.decode(message.value); + }, + toProto(message: DescriptorProto_ExtensionRange): Uint8Array { + return DescriptorProto_ExtensionRange.encode(message).finish(); + }, + toProtoMsg( + message: DescriptorProto_ExtensionRange + ): DescriptorProto_ExtensionRangeProtoMsg { + return { + typeUrl: '/google.protobuf.ExtensionRange', + value: DescriptorProto_ExtensionRange.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + DescriptorProto_ExtensionRange.typeUrl, + DescriptorProto_ExtensionRange +); +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { + start: 0, + end: 0, + }; +} +export const DescriptorProto_ReservedRange = { + typeUrl: '/google.protobuf.ReservedRange', + is(o: any): o is DescriptorProto_ReservedRange { + return ( + o && + (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + isSDK(o: any): o is DescriptorProto_ReservedRangeSDKType { + return ( + o && + (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + isAmino(o: any): o is DescriptorProto_ReservedRangeAmino { + return ( + o && + (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + encode( + message: DescriptorProto_ReservedRange, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): DescriptorProto_ReservedRange { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino( + object: DescriptorProto_ReservedRangeAmino + ): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino( + message: DescriptorProto_ReservedRange + ): DescriptorProto_ReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg( + object: DescriptorProto_ReservedRangeAminoMsg + ): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromAmino(object.value); + }, + fromProtoMsg( + message: DescriptorProto_ReservedRangeProtoMsg + ): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.decode(message.value); + }, + toProto(message: DescriptorProto_ReservedRange): Uint8Array { + return DescriptorProto_ReservedRange.encode(message).finish(); + }, + toProtoMsg( + message: DescriptorProto_ReservedRange + ): DescriptorProto_ReservedRangeProtoMsg { + return { + typeUrl: '/google.protobuf.ReservedRange', + value: DescriptorProto_ReservedRange.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + DescriptorProto_ReservedRange.typeUrl, + DescriptorProto_ReservedRange +); +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { + uninterpretedOption: [], + }; +} +export const ExtensionRangeOptions = { + typeUrl: '/google.protobuf.ExtensionRangeOptions', + is(o: any): o is ExtensionRangeOptions { + return ( + o && + (o.$typeUrl === ExtensionRangeOptions.typeUrl || + (Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is ExtensionRangeOptionsSDKType { + return ( + o && + (o.$typeUrl === ExtensionRangeOptions.typeUrl || + (Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is ExtensionRangeOptionsAmino { + return ( + o && + (o.$typeUrl === ExtensionRangeOptions.typeUrl || + (Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: ExtensionRangeOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ExtensionRangeOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: ExtensionRangeOptionsAminoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionRangeOptionsProtoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.decode(message.value); + }, + toProto(message: ExtensionRangeOptions): Uint8Array { + return ExtensionRangeOptions.encode(message).finish(); + }, + toProtoMsg(message: ExtensionRangeOptions): ExtensionRangeOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.ExtensionRangeOptions', + value: ExtensionRangeOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ExtensionRangeOptions.typeUrl, + ExtensionRangeOptions +); +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: '', + number: 0, + label: 1, + type: 1, + typeName: '', + extendee: '', + defaultValue: '', + oneofIndex: 0, + jsonName: '', + options: undefined, + }; +} +export const FieldDescriptorProto = { + typeUrl: '/google.protobuf.FieldDescriptorProto', + is(o: any): o is FieldDescriptorProto { + return ( + o && + (o.$typeUrl === FieldDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.number === 'number' && + isSet(o.label) && + isSet(o.type) && + typeof o.typeName === 'string' && + typeof o.extendee === 'string' && + typeof o.defaultValue === 'string' && + typeof o.oneofIndex === 'number' && + typeof o.jsonName === 'string')) + ); + }, + isSDK(o: any): o is FieldDescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === FieldDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.number === 'number' && + isSet(o.label) && + isSet(o.type) && + typeof o.type_name === 'string' && + typeof o.extendee === 'string' && + typeof o.default_value === 'string' && + typeof o.oneof_index === 'number' && + typeof o.json_name === 'string')) + ); + }, + isAmino(o: any): o is FieldDescriptorProtoAmino { + return ( + o && + (o.$typeUrl === FieldDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.number === 'number' && + isSet(o.label) && + isSet(o.type) && + typeof o.type_name === 'string' && + typeof o.extendee === 'string' && + typeof o.default_value === 'string' && + typeof o.oneof_index === 'number' && + typeof o.json_name === 'string')) + ); + }, + encode( + message: FieldDescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== '') { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== '') { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== '') { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== '') { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): FieldDescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ''; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ''; + message.extendee = object.extendee ?? ''; + message.defaultValue = object.defaultValue ?? ''; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ''; + message.options = + object.options !== undefined && object.options !== null + ? FieldOptions.fromPartial(object.options) + : undefined; + return message; + }, + fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.typeName = object.type_name; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneofIndex = object.oneof_index; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.jsonName = object.json_name; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.label = message.label === 1 ? undefined : message.label; + obj.type = message.type === 1 ? undefined : message.type; + obj.type_name = message.typeName === '' ? undefined : message.typeName; + obj.extendee = message.extendee === '' ? undefined : message.extendee; + obj.default_value = + message.defaultValue === '' ? undefined : message.defaultValue; + obj.oneof_index = message.oneofIndex === 0 ? undefined : message.oneofIndex; + obj.json_name = message.jsonName === '' ? undefined : message.jsonName; + obj.options = message.options + ? FieldOptions.toAmino(message.options) + : undefined; + return obj; + }, + fromAminoMsg(object: FieldDescriptorProtoAminoMsg): FieldDescriptorProto { + return FieldDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FieldDescriptorProtoProtoMsg): FieldDescriptorProto { + return FieldDescriptorProto.decode(message.value); + }, + toProto(message: FieldDescriptorProto): Uint8Array { + return FieldDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FieldDescriptorProto): FieldDescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.FieldDescriptorProto', + value: FieldDescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + FieldDescriptorProto.typeUrl, + FieldDescriptorProto +); +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { + name: '', + options: undefined, + }; +} +export const OneofDescriptorProto = { + typeUrl: '/google.protobuf.OneofDescriptorProto', + is(o: any): o is OneofDescriptorProto { + return ( + o && + (o.$typeUrl === OneofDescriptorProto.typeUrl || + typeof o.name === 'string') + ); + }, + isSDK(o: any): o is OneofDescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === OneofDescriptorProto.typeUrl || + typeof o.name === 'string') + ); + }, + isAmino(o: any): o is OneofDescriptorProtoAmino { + return ( + o && + (o.$typeUrl === OneofDescriptorProto.typeUrl || + typeof o.name === 'string') + ); + }, + encode( + message: OneofDescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): OneofDescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ''; + message.options = + object.options !== undefined && object.options !== null + ? OneofOptions.fromPartial(object.options) + : undefined; + return message; + }, + fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.options = message.options + ? OneofOptions.toAmino(message.options) + : undefined; + return obj; + }, + fromAminoMsg(object: OneofDescriptorProtoAminoMsg): OneofDescriptorProto { + return OneofDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: OneofDescriptorProtoProtoMsg): OneofDescriptorProto { + return OneofDescriptorProto.decode(message.value); + }, + toProto(message: OneofDescriptorProto): Uint8Array { + return OneofDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: OneofDescriptorProto): OneofDescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.OneofDescriptorProto', + value: OneofDescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + OneofDescriptorProto.typeUrl, + OneofDescriptorProto +); +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { + name: '', + value: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} +export const EnumDescriptorProto = { + typeUrl: '/google.protobuf.EnumDescriptorProto', + is(o: any): o is EnumDescriptorProto { + return ( + o && + (o.$typeUrl === EnumDescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.value) && + (!o.value.length || EnumValueDescriptorProto.is(o.value[0])) && + Array.isArray(o.reservedRange) && + (!o.reservedRange.length || + EnumDescriptorProto_EnumReservedRange.is(o.reservedRange[0])) && + Array.isArray(o.reservedName) && + (!o.reservedName.length || typeof o.reservedName[0] === 'string'))) + ); + }, + isSDK(o: any): o is EnumDescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === EnumDescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.value) && + (!o.value.length || EnumValueDescriptorProto.isSDK(o.value[0])) && + Array.isArray(o.reserved_range) && + (!o.reserved_range.length || + EnumDescriptorProto_EnumReservedRange.isSDK(o.reserved_range[0])) && + Array.isArray(o.reserved_name) && + (!o.reserved_name.length || typeof o.reserved_name[0] === 'string'))) + ); + }, + isAmino(o: any): o is EnumDescriptorProtoAmino { + return ( + o && + (o.$typeUrl === EnumDescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.value) && + (!o.value.length || EnumValueDescriptorProto.isAmino(o.value[0])) && + Array.isArray(o.reserved_range) && + (!o.reserved_range.length || + EnumDescriptorProto_EnumReservedRange.isAmino( + o.reserved_range[0] + )) && + Array.isArray(o.reserved_name) && + (!o.reserved_name.length || typeof o.reserved_name[0] === 'string'))) + ); + }, + encode( + message: EnumDescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): EnumDescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32() + ) + ); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ''; + message.value = + object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? EnumOptions.fromPartial(object.options) + : undefined; + message.reservedRange = + object.reservedRange?.map((e) => + EnumDescriptorProto_EnumReservedRange.fromPartial(e) + ) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, + fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.value = + object.value?.map((e) => EnumValueDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromAmino(object.options); + } + message.reservedRange = + object.reserved_range?.map((e) => + EnumDescriptorProto_EnumReservedRange.fromAmino(e) + ) || []; + message.reservedName = object.reserved_name?.map((e) => e) || []; + return message; + }, + toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + if (message.value) { + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.value = message.value; + } + obj.options = message.options + ? EnumOptions.toAmino(message.options) + : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toAmino(e) : undefined + ); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map((e) => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: EnumDescriptorProtoAminoMsg): EnumDescriptorProto { + return EnumDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: EnumDescriptorProtoProtoMsg): EnumDescriptorProto { + return EnumDescriptorProto.decode(message.value); + }, + toProto(message: EnumDescriptorProto): Uint8Array { + return EnumDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: EnumDescriptorProto): EnumDescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.EnumDescriptorProto', + value: EnumDescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + EnumDescriptorProto.typeUrl, + EnumDescriptorProto +); +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { + start: 0, + end: 0, + }; +} +export const EnumDescriptorProto_EnumReservedRange = { + typeUrl: '/google.protobuf.EnumReservedRange', + is(o: any): o is EnumDescriptorProto_EnumReservedRange { + return ( + o && + (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + isSDK(o: any): o is EnumDescriptorProto_EnumReservedRangeSDKType { + return ( + o && + (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + isAmino(o: any): o is EnumDescriptorProto_EnumReservedRangeAmino { + return ( + o && + (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || + (typeof o.start === 'number' && typeof o.end === 'number')) + ); + }, + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): EnumDescriptorProto_EnumReservedRange { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino( + object: EnumDescriptorProto_EnumReservedRangeAmino + ): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino( + message: EnumDescriptorProto_EnumReservedRange + ): EnumDescriptorProto_EnumReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg( + object: EnumDescriptorProto_EnumReservedRangeAminoMsg + ): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromAmino(object.value); + }, + fromProtoMsg( + message: EnumDescriptorProto_EnumReservedRangeProtoMsg + ): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.decode(message.value); + }, + toProto(message: EnumDescriptorProto_EnumReservedRange): Uint8Array { + return EnumDescriptorProto_EnumReservedRange.encode(message).finish(); + }, + toProtoMsg( + message: EnumDescriptorProto_EnumReservedRange + ): EnumDescriptorProto_EnumReservedRangeProtoMsg { + return { + typeUrl: '/google.protobuf.EnumReservedRange', + value: EnumDescriptorProto_EnumReservedRange.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + EnumDescriptorProto_EnumReservedRange.typeUrl, + EnumDescriptorProto_EnumReservedRange +); +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { + name: '', + number: 0, + options: undefined, + }; +} +export const EnumValueDescriptorProto = { + typeUrl: '/google.protobuf.EnumValueDescriptorProto', + is(o: any): o is EnumValueDescriptorProto { + return ( + o && + (o.$typeUrl === EnumValueDescriptorProto.typeUrl || + (typeof o.name === 'string' && typeof o.number === 'number')) + ); + }, + isSDK(o: any): o is EnumValueDescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === EnumValueDescriptorProto.typeUrl || + (typeof o.name === 'string' && typeof o.number === 'number')) + ); + }, + isAmino(o: any): o is EnumValueDescriptorProtoAmino { + return ( + o && + (o.$typeUrl === EnumValueDescriptorProto.typeUrl || + (typeof o.name === 'string' && typeof o.number === 'number')) + ); + }, + encode( + message: EnumValueDescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): EnumValueDescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ''; + message.number = object.number ?? 0; + message.options = + object.options !== undefined && object.options !== null + ? EnumValueOptions.fromPartial(object.options) + : undefined; + return message; + }, + fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.options = message.options + ? EnumValueOptions.toAmino(message.options) + : undefined; + return obj; + }, + fromAminoMsg( + object: EnumValueDescriptorProtoAminoMsg + ): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg( + message: EnumValueDescriptorProtoProtoMsg + ): EnumValueDescriptorProto { + return EnumValueDescriptorProto.decode(message.value); + }, + toProto(message: EnumValueDescriptorProto): Uint8Array { + return EnumValueDescriptorProto.encode(message).finish(); + }, + toProtoMsg( + message: EnumValueDescriptorProto + ): EnumValueDescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.EnumValueDescriptorProto', + value: EnumValueDescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + EnumValueDescriptorProto.typeUrl, + EnumValueDescriptorProto +); +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { + name: '', + method: [], + options: undefined, + }; +} +export const ServiceDescriptorProto = { + typeUrl: '/google.protobuf.ServiceDescriptorProto', + is(o: any): o is ServiceDescriptorProto { + return ( + o && + (o.$typeUrl === ServiceDescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.method) && + (!o.method.length || MethodDescriptorProto.is(o.method[0])))) + ); + }, + isSDK(o: any): o is ServiceDescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === ServiceDescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.method) && + (!o.method.length || MethodDescriptorProto.isSDK(o.method[0])))) + ); + }, + isAmino(o: any): o is ServiceDescriptorProtoAmino { + return ( + o && + (o.$typeUrl === ServiceDescriptorProto.typeUrl || + (typeof o.name === 'string' && + Array.isArray(o.method) && + (!o.method.length || MethodDescriptorProto.isAmino(o.method[0])))) + ); + }, + encode( + message: ServiceDescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ServiceDescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ''; + message.method = + object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? ServiceOptions.fromPartial(object.options) + : undefined; + return message; + }, + fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.method = + object.method?.map((e) => MethodDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + if (message.method) { + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toAmino(e) : undefined + ); + } else { + obj.method = message.method; + } + obj.options = message.options + ? ServiceOptions.toAmino(message.options) + : undefined; + return obj; + }, + fromAminoMsg(object: ServiceDescriptorProtoAminoMsg): ServiceDescriptorProto { + return ServiceDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg( + message: ServiceDescriptorProtoProtoMsg + ): ServiceDescriptorProto { + return ServiceDescriptorProto.decode(message.value); + }, + toProto(message: ServiceDescriptorProto): Uint8Array { + return ServiceDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: ServiceDescriptorProto): ServiceDescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.ServiceDescriptorProto', + value: ServiceDescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ServiceDescriptorProto.typeUrl, + ServiceDescriptorProto +); +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: '', + inputType: '', + outputType: '', + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} +export const MethodDescriptorProto = { + typeUrl: '/google.protobuf.MethodDescriptorProto', + is(o: any): o is MethodDescriptorProto { + return ( + o && + (o.$typeUrl === MethodDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.inputType === 'string' && + typeof o.outputType === 'string' && + typeof o.clientStreaming === 'boolean' && + typeof o.serverStreaming === 'boolean')) + ); + }, + isSDK(o: any): o is MethodDescriptorProtoSDKType { + return ( + o && + (o.$typeUrl === MethodDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.input_type === 'string' && + typeof o.output_type === 'string' && + typeof o.client_streaming === 'boolean' && + typeof o.server_streaming === 'boolean')) + ); + }, + isAmino(o: any): o is MethodDescriptorProtoAmino { + return ( + o && + (o.$typeUrl === MethodDescriptorProto.typeUrl || + (typeof o.name === 'string' && + typeof o.input_type === 'string' && + typeof o.output_type === 'string' && + typeof o.client_streaming === 'boolean' && + typeof o.server_streaming === 'boolean')) + ); + }, + encode( + message: MethodDescriptorProto, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } + if (message.inputType !== '') { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== '') { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MethodDescriptorProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ''; + message.inputType = object.inputType ?? ''; + message.outputType = object.outputType ?? ''; + message.options = + object.options !== undefined && object.options !== null + ? MethodOptions.fromPartial(object.options) + : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, + fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.inputType = object.input_type; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.outputType = object.output_type; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromAmino(object.options); + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.clientStreaming = object.client_streaming; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.serverStreaming = object.server_streaming; + } + return message; + }, + toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === '' ? undefined : message.name; + obj.input_type = message.inputType === '' ? undefined : message.inputType; + obj.output_type = + message.outputType === '' ? undefined : message.outputType; + obj.options = message.options + ? MethodOptions.toAmino(message.options) + : undefined; + obj.client_streaming = + message.clientStreaming === false ? undefined : message.clientStreaming; + obj.server_streaming = + message.serverStreaming === false ? undefined : message.serverStreaming; + return obj; + }, + fromAminoMsg(object: MethodDescriptorProtoAminoMsg): MethodDescriptorProto { + return MethodDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: MethodDescriptorProtoProtoMsg): MethodDescriptorProto { + return MethodDescriptorProto.decode(message.value); + }, + toProto(message: MethodDescriptorProto): Uint8Array { + return MethodDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: MethodDescriptorProto): MethodDescriptorProtoProtoMsg { + return { + typeUrl: '/google.protobuf.MethodDescriptorProto', + value: MethodDescriptorProto.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MethodDescriptorProto.typeUrl, + MethodDescriptorProto +); +function createBaseFileOptions(): FileOptions { + return { + javaPackage: '', + javaOuterClassname: '', + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: '', + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: '', + csharpNamespace: '', + swiftPrefix: '', + phpClassPrefix: '', + phpNamespace: '', + phpMetadataNamespace: '', + rubyPackage: '', + uninterpretedOption: [], + }; +} +export const FileOptions = { + typeUrl: '/google.protobuf.FileOptions', + is(o: any): o is FileOptions { + return ( + o && + (o.$typeUrl === FileOptions.typeUrl || + (typeof o.javaPackage === 'string' && + typeof o.javaOuterClassname === 'string' && + typeof o.javaMultipleFiles === 'boolean' && + typeof o.javaGenerateEqualsAndHash === 'boolean' && + typeof o.javaStringCheckUtf8 === 'boolean' && + isSet(o.optimizeFor) && + typeof o.goPackage === 'string' && + typeof o.ccGenericServices === 'boolean' && + typeof o.javaGenericServices === 'boolean' && + typeof o.pyGenericServices === 'boolean' && + typeof o.phpGenericServices === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.ccEnableArenas === 'boolean' && + typeof o.objcClassPrefix === 'string' && + typeof o.csharpNamespace === 'string' && + typeof o.swiftPrefix === 'string' && + typeof o.phpClassPrefix === 'string' && + typeof o.phpNamespace === 'string' && + typeof o.phpMetadataNamespace === 'string' && + typeof o.rubyPackage === 'string' && + Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is FileOptionsSDKType { + return ( + o && + (o.$typeUrl === FileOptions.typeUrl || + (typeof o.java_package === 'string' && + typeof o.java_outer_classname === 'string' && + typeof o.java_multiple_files === 'boolean' && + typeof o.java_generate_equals_and_hash === 'boolean' && + typeof o.java_string_check_utf8 === 'boolean' && + isSet(o.optimize_for) && + typeof o.go_package === 'string' && + typeof o.cc_generic_services === 'boolean' && + typeof o.java_generic_services === 'boolean' && + typeof o.py_generic_services === 'boolean' && + typeof o.php_generic_services === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.cc_enable_arenas === 'boolean' && + typeof o.objc_class_prefix === 'string' && + typeof o.csharp_namespace === 'string' && + typeof o.swift_prefix === 'string' && + typeof o.php_class_prefix === 'string' && + typeof o.php_namespace === 'string' && + typeof o.php_metadata_namespace === 'string' && + typeof o.ruby_package === 'string' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is FileOptionsAmino { + return ( + o && + (o.$typeUrl === FileOptions.typeUrl || + (typeof o.java_package === 'string' && + typeof o.java_outer_classname === 'string' && + typeof o.java_multiple_files === 'boolean' && + typeof o.java_generate_equals_and_hash === 'boolean' && + typeof o.java_string_check_utf8 === 'boolean' && + isSet(o.optimize_for) && + typeof o.go_package === 'string' && + typeof o.cc_generic_services === 'boolean' && + typeof o.java_generic_services === 'boolean' && + typeof o.py_generic_services === 'boolean' && + typeof o.php_generic_services === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.cc_enable_arenas === 'boolean' && + typeof o.objc_class_prefix === 'string' && + typeof o.csharp_namespace === 'string' && + typeof o.swift_prefix === 'string' && + typeof o.php_class_prefix === 'string' && + typeof o.php_namespace === 'string' && + typeof o.php_metadata_namespace === 'string' && + typeof o.ruby_package === 'string' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: FileOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.javaPackage !== '') { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== '') { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== '') { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== '') { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== '') { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== '') { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== '') { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== '') { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== '') { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== '') { + writer.uint32(362).string(message.rubyPackage); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32() as any; + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ''; + message.javaOuterClassname = object.javaOuterClassname ?? ''; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = + object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ''; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.phpGenericServices = object.phpGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? false; + message.objcClassPrefix = object.objcClassPrefix ?? ''; + message.csharpNamespace = object.csharpNamespace ?? ''; + message.swiftPrefix = object.swiftPrefix ?? ''; + message.phpClassPrefix = object.phpClassPrefix ?? ''; + message.phpNamespace = object.phpNamespace ?? ''; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ''; + message.rubyPackage = object.rubyPackage ?? ''; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: FileOptionsAmino): FileOptions { + const message = createBaseFileOptions(); + if (object.java_package !== undefined && object.java_package !== null) { + message.javaPackage = object.java_package; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.javaOuterClassname = object.java_outer_classname; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.javaMultipleFiles = object.java_multiple_files; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.javaStringCheckUtf8 = object.java_string_check_utf8; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimizeFor = object.optimize_for; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.goPackage = object.go_package; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.ccGenericServices = object.cc_generic_services; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.javaGenericServices = object.java_generic_services; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.pyGenericServices = object.py_generic_services; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.phpGenericServices = object.php_generic_services; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.ccEnableArenas = object.cc_enable_arenas; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objcClassPrefix = object.objc_class_prefix; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharpNamespace = object.csharp_namespace; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swiftPrefix = object.swift_prefix; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.phpClassPrefix = object.php_class_prefix; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.phpNamespace = object.php_namespace; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.phpMetadataNamespace = object.php_metadata_namespace; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.rubyPackage = object.ruby_package; + } + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: FileOptions): FileOptionsAmino { + const obj: any = {}; + obj.java_package = + message.javaPackage === '' ? undefined : message.javaPackage; + obj.java_outer_classname = + message.javaOuterClassname === '' + ? undefined + : message.javaOuterClassname; + obj.java_multiple_files = + message.javaMultipleFiles === false + ? undefined + : message.javaMultipleFiles; + obj.java_generate_equals_and_hash = + message.javaGenerateEqualsAndHash === false + ? undefined + : message.javaGenerateEqualsAndHash; + obj.java_string_check_utf8 = + message.javaStringCheckUtf8 === false + ? undefined + : message.javaStringCheckUtf8; + obj.optimize_for = + message.optimizeFor === 1 ? undefined : message.optimizeFor; + obj.go_package = message.goPackage === '' ? undefined : message.goPackage; + obj.cc_generic_services = + message.ccGenericServices === false + ? undefined + : message.ccGenericServices; + obj.java_generic_services = + message.javaGenericServices === false + ? undefined + : message.javaGenericServices; + obj.py_generic_services = + message.pyGenericServices === false + ? undefined + : message.pyGenericServices; + obj.php_generic_services = + message.phpGenericServices === false + ? undefined + : message.phpGenericServices; + obj.deprecated = + message.deprecated === false ? undefined : message.deprecated; + obj.cc_enable_arenas = + message.ccEnableArenas === false ? undefined : message.ccEnableArenas; + obj.objc_class_prefix = + message.objcClassPrefix === '' ? undefined : message.objcClassPrefix; + obj.csharp_namespace = + message.csharpNamespace === '' ? undefined : message.csharpNamespace; + obj.swift_prefix = + message.swiftPrefix === '' ? undefined : message.swiftPrefix; + obj.php_class_prefix = + message.phpClassPrefix === '' ? undefined : message.phpClassPrefix; + obj.php_namespace = + message.phpNamespace === '' ? undefined : message.phpNamespace; + obj.php_metadata_namespace = + message.phpMetadataNamespace === '' + ? undefined + : message.phpMetadataNamespace; + obj.ruby_package = + message.rubyPackage === '' ? undefined : message.rubyPackage; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FileOptionsAminoMsg): FileOptions { + return FileOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FileOptionsProtoMsg): FileOptions { + return FileOptions.decode(message.value); + }, + toProto(message: FileOptions): Uint8Array { + return FileOptions.encode(message).finish(); + }, + toProtoMsg(message: FileOptions): FileOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.FileOptions', + value: FileOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(FileOptions.typeUrl, FileOptions); +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} +export const MessageOptions = { + typeUrl: '/google.protobuf.MessageOptions', + is(o: any): o is MessageOptions { + return ( + o && + (o.$typeUrl === MessageOptions.typeUrl || + (typeof o.messageSetWireFormat === 'boolean' && + typeof o.noStandardDescriptorAccessor === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.mapEntry === 'boolean' && + Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is MessageOptionsSDKType { + return ( + o && + (o.$typeUrl === MessageOptions.typeUrl || + (typeof o.message_set_wire_format === 'boolean' && + typeof o.no_standard_descriptor_accessor === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.map_entry === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is MessageOptionsAmino { + return ( + o && + (o.$typeUrl === MessageOptions.typeUrl || + (typeof o.message_set_wire_format === 'boolean' && + typeof o.no_standard_descriptor_accessor === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.map_entry === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: MessageOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = + object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: MessageOptionsAmino): MessageOptions { + const message = createBaseMessageOptions(); + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.messageSetWireFormat = object.message_set_wire_format; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.noStandardDescriptorAccessor = + object.no_standard_descriptor_accessor; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.mapEntry = object.map_entry; + } + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: MessageOptions): MessageOptionsAmino { + const obj: any = {}; + obj.message_set_wire_format = + message.messageSetWireFormat === false + ? undefined + : message.messageSetWireFormat; + obj.no_standard_descriptor_accessor = + message.noStandardDescriptorAccessor === false + ? undefined + : message.noStandardDescriptorAccessor; + obj.deprecated = + message.deprecated === false ? undefined : message.deprecated; + obj.map_entry = message.mapEntry === false ? undefined : message.mapEntry; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MessageOptionsAminoMsg): MessageOptions { + return MessageOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MessageOptionsProtoMsg): MessageOptions { + return MessageOptions.decode(message.value); + }, + toProto(message: MessageOptions): Uint8Array { + return MessageOptions.encode(message).finish(); + }, + toProtoMsg(message: MessageOptions): MessageOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.MessageOptions', + value: MessageOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MessageOptions.typeUrl, MessageOptions); +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 1, + packed: false, + jstype: 1, + lazy: false, + deprecated: false, + weak: false, + uninterpretedOption: [], + }; +} +export const FieldOptions = { + typeUrl: '/google.protobuf.FieldOptions', + is(o: any): o is FieldOptions { + return ( + o && + (o.$typeUrl === FieldOptions.typeUrl || + (isSet(o.ctype) && + typeof o.packed === 'boolean' && + isSet(o.jstype) && + typeof o.lazy === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.weak === 'boolean' && + Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is FieldOptionsSDKType { + return ( + o && + (o.$typeUrl === FieldOptions.typeUrl || + (isSet(o.ctype) && + typeof o.packed === 'boolean' && + isSet(o.jstype) && + typeof o.lazy === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.weak === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is FieldOptionsAmino { + return ( + o && + (o.$typeUrl === FieldOptions.typeUrl || + (isSet(o.ctype) && + typeof o.packed === 'boolean' && + isSet(o.jstype) && + typeof o.lazy === 'boolean' && + typeof o.deprecated === 'boolean' && + typeof o.weak === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: FieldOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.ctype !== 1) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 1) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 1; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 1; + message.lazy = object.lazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: FieldOptionsAmino): FieldOptions { + const message = createBaseFieldOptions(); + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: FieldOptions): FieldOptionsAmino { + const obj: any = {}; + obj.ctype = message.ctype === 1 ? undefined : message.ctype; + obj.packed = message.packed === false ? undefined : message.packed; + obj.jstype = message.jstype === 1 ? undefined : message.jstype; + obj.lazy = message.lazy === false ? undefined : message.lazy; + obj.deprecated = + message.deprecated === false ? undefined : message.deprecated; + obj.weak = message.weak === false ? undefined : message.weak; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FieldOptionsAminoMsg): FieldOptions { + return FieldOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptionsProtoMsg): FieldOptions { + return FieldOptions.decode(message.value); + }, + toProto(message: FieldOptions): Uint8Array { + return FieldOptions.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions): FieldOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.FieldOptions', + value: FieldOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(FieldOptions.typeUrl, FieldOptions); +function createBaseOneofOptions(): OneofOptions { + return { + uninterpretedOption: [], + }; +} +export const OneofOptions = { + typeUrl: '/google.protobuf.OneofOptions', + is(o: any): o is OneofOptions { + return ( + o && + (o.$typeUrl === OneofOptions.typeUrl || + (Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is OneofOptionsSDKType { + return ( + o && + (o.$typeUrl === OneofOptions.typeUrl || + (Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is OneofOptionsAmino { + return ( + o && + (o.$typeUrl === OneofOptions.typeUrl || + (Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: OneofOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: OneofOptionsAmino): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: OneofOptions): OneofOptionsAmino { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: OneofOptionsAminoMsg): OneofOptions { + return OneofOptions.fromAmino(object.value); + }, + fromProtoMsg(message: OneofOptionsProtoMsg): OneofOptions { + return OneofOptions.decode(message.value); + }, + toProto(message: OneofOptions): Uint8Array { + return OneofOptions.encode(message).finish(); + }, + toProtoMsg(message: OneofOptions): OneofOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.OneofOptions', + value: OneofOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(OneofOptions.typeUrl, OneofOptions); +function createBaseEnumOptions(): EnumOptions { + return { + allowAlias: false, + deprecated: false, + uninterpretedOption: [], + }; +} +export const EnumOptions = { + typeUrl: '/google.protobuf.EnumOptions', + is(o: any): o is EnumOptions { + return ( + o && + (o.$typeUrl === EnumOptions.typeUrl || + (typeof o.allowAlias === 'boolean' && + typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is EnumOptionsSDKType { + return ( + o && + (o.$typeUrl === EnumOptions.typeUrl || + (typeof o.allow_alias === 'boolean' && + typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is EnumOptionsAmino { + return ( + o && + (o.$typeUrl === EnumOptions.typeUrl || + (typeof o.allow_alias === 'boolean' && + typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: EnumOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.allowAlias === true) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: EnumOptionsAmino): EnumOptions { + const message = createBaseEnumOptions(); + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allowAlias = object.allow_alias; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: EnumOptions): EnumOptionsAmino { + const obj: any = {}; + obj.allow_alias = + message.allowAlias === false ? undefined : message.allowAlias; + obj.deprecated = + message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumOptionsAminoMsg): EnumOptions { + return EnumOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumOptionsProtoMsg): EnumOptions { + return EnumOptions.decode(message.value); + }, + toProto(message: EnumOptions): Uint8Array { + return EnumOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumOptions): EnumOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.EnumOptions', + value: EnumOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(EnumOptions.typeUrl, EnumOptions); +function createBaseEnumValueOptions(): EnumValueOptions { + return { + deprecated: false, + uninterpretedOption: [], + }; +} +export const EnumValueOptions = { + typeUrl: '/google.protobuf.EnumValueOptions', + is(o: any): o is EnumValueOptions { + return ( + o && + (o.$typeUrl === EnumValueOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is EnumValueOptionsSDKType { + return ( + o && + (o.$typeUrl === EnumValueOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is EnumValueOptionsAmino { + return ( + o && + (o.$typeUrl === EnumValueOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: EnumValueOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { + const message = createBaseEnumValueOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: EnumValueOptions): EnumValueOptionsAmino { + const obj: any = {}; + obj.deprecated = + message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumValueOptionsAminoMsg): EnumValueOptions { + return EnumValueOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumValueOptionsProtoMsg): EnumValueOptions { + return EnumValueOptions.decode(message.value); + }, + toProto(message: EnumValueOptions): Uint8Array { + return EnumValueOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumValueOptions): EnumValueOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.EnumValueOptions', + value: EnumValueOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(EnumValueOptions.typeUrl, EnumValueOptions); +function createBaseServiceOptions(): ServiceOptions { + return { + deprecated: false, + uninterpretedOption: [], + }; +} +export const ServiceOptions = { + typeUrl: '/google.protobuf.ServiceOptions', + is(o: any): o is ServiceOptions { + return ( + o && + (o.$typeUrl === ServiceOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is ServiceOptionsSDKType { + return ( + o && + (o.$typeUrl === ServiceOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is ServiceOptionsAmino { + return ( + o && + (o.$typeUrl === ServiceOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: ServiceOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: ServiceOptionsAmino): ServiceOptions { + const message = createBaseServiceOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: ServiceOptions): ServiceOptionsAmino { + const obj: any = {}; + obj.deprecated = + message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: ServiceOptionsAminoMsg): ServiceOptions { + return ServiceOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceOptionsProtoMsg): ServiceOptions { + return ServiceOptions.decode(message.value); + }, + toProto(message: ServiceOptions): Uint8Array { + return ServiceOptions.encode(message).finish(); + }, + toProtoMsg(message: ServiceOptions): ServiceOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.ServiceOptions', + value: ServiceOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(ServiceOptions.typeUrl, ServiceOptions); +function createBaseMethodOptions(): MethodOptions { + return { + deprecated: false, + idempotencyLevel: 1, + uninterpretedOption: [], + }; +} +export const MethodOptions = { + typeUrl: '/google.protobuf.MethodOptions', + is(o: any): o is MethodOptions { + return ( + o && + (o.$typeUrl === MethodOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + isSet(o.idempotencyLevel) && + Array.isArray(o.uninterpretedOption) && + (!o.uninterpretedOption.length || + UninterpretedOption.is(o.uninterpretedOption[0])))) + ); + }, + isSDK(o: any): o is MethodOptionsSDKType { + return ( + o && + (o.$typeUrl === MethodOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + isSet(o.idempotency_level) && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isSDK(o.uninterpreted_option[0])))) + ); + }, + isAmino(o: any): o is MethodOptionsAmino { + return ( + o && + (o.$typeUrl === MethodOptions.typeUrl || + (typeof o.deprecated === 'boolean' && + isSet(o.idempotency_level) && + Array.isArray(o.uninterpreted_option) && + (!o.uninterpreted_option.length || + UninterpretedOption.isAmino(o.uninterpreted_option[0])))) + ); + }, + encode( + message: MethodOptions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== 1) { + writer.uint32(272).int32(message.idempotencyLevel); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32() as any; + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 1; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: MethodOptionsAmino): MethodOptions { + const message = createBaseMethodOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotencyLevel = object.idempotency_level; + } + message.uninterpretedOption = + object.uninterpreted_option?.map((e) => + UninterpretedOption.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: MethodOptions): MethodOptionsAmino { + const obj: any = {}; + obj.deprecated = + message.deprecated === false ? undefined : message.deprecated; + obj.idempotency_level = + message.idempotencyLevel === 1 ? undefined : message.idempotencyLevel; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toAmino(e) : undefined + ); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MethodOptionsAminoMsg): MethodOptions { + return MethodOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MethodOptionsProtoMsg): MethodOptions { + return MethodOptions.decode(message.value); + }, + toProto(message: MethodOptions): Uint8Array { + return MethodOptions.encode(message).finish(); + }, + toProtoMsg(message: MethodOptions): MethodOptionsProtoMsg { + return { + typeUrl: '/google.protobuf.MethodOptions', + value: MethodOptions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MethodOptions.typeUrl, MethodOptions); +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: '', + positiveIntValue: BigInt(0), + negativeIntValue: BigInt(0), + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: '', + }; +} +export const UninterpretedOption = { + typeUrl: '/google.protobuf.UninterpretedOption', + is(o: any): o is UninterpretedOption { + return ( + o && + (o.$typeUrl === UninterpretedOption.typeUrl || + (Array.isArray(o.name) && + (!o.name.length || UninterpretedOption_NamePart.is(o.name[0])) && + typeof o.identifierValue === 'string' && + typeof o.positiveIntValue === 'bigint' && + typeof o.negativeIntValue === 'bigint' && + typeof o.doubleValue === 'number' && + (o.stringValue instanceof Uint8Array || + typeof o.stringValue === 'string') && + typeof o.aggregateValue === 'string')) + ); + }, + isSDK(o: any): o is UninterpretedOptionSDKType { + return ( + o && + (o.$typeUrl === UninterpretedOption.typeUrl || + (Array.isArray(o.name) && + (!o.name.length || UninterpretedOption_NamePart.isSDK(o.name[0])) && + typeof o.identifier_value === 'string' && + typeof o.positive_int_value === 'bigint' && + typeof o.negative_int_value === 'bigint' && + typeof o.double_value === 'number' && + (o.string_value instanceof Uint8Array || + typeof o.string_value === 'string') && + typeof o.aggregate_value === 'string')) + ); + }, + isAmino(o: any): o is UninterpretedOptionAmino { + return ( + o && + (o.$typeUrl === UninterpretedOption.typeUrl || + (Array.isArray(o.name) && + (!o.name.length || UninterpretedOption_NamePart.isAmino(o.name[0])) && + typeof o.identifier_value === 'string' && + typeof o.positive_int_value === 'bigint' && + typeof o.negative_int_value === 'bigint' && + typeof o.double_value === 'number' && + (o.string_value instanceof Uint8Array || + typeof o.string_value === 'string') && + typeof o.aggregate_value === 'string')) + ); + }, + encode( + message: UninterpretedOption, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.identifierValue !== '') { + writer.uint32(26).string(message.identifierValue); + } + if (message.positiveIntValue !== BigInt(0)) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== BigInt(0)) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== '') { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UninterpretedOption { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()) + ); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = + object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || + []; + message.identifierValue = object.identifierValue ?? ''; + message.positiveIntValue = + object.positiveIntValue !== undefined && object.positiveIntValue !== null + ? BigInt(object.positiveIntValue.toString()) + : BigInt(0); + message.negativeIntValue = + object.negativeIntValue !== undefined && object.negativeIntValue !== null + ? BigInt(object.negativeIntValue.toString()) + : BigInt(0); + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ''; + return message; + }, + fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = + object.name?.map((e) => UninterpretedOption_NamePart.fromAmino(e)) || []; + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifierValue = object.identifier_value; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positiveIntValue = BigInt(object.positive_int_value); + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negativeIntValue = BigInt(object.negative_int_value); + } + if (object.double_value !== undefined && object.double_value !== null) { + message.doubleValue = object.double_value; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.stringValue = bytesFromBase64(object.string_value); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregateValue = object.aggregate_value; + } + return message; + }, + toAmino(message: UninterpretedOption): UninterpretedOptionAmino { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toAmino(e) : undefined + ); + } else { + obj.name = message.name; + } + obj.identifier_value = + message.identifierValue === '' ? undefined : message.identifierValue; + obj.positive_int_value = + message.positiveIntValue !== BigInt(0) + ? message.positiveIntValue.toString() + : undefined; + obj.negative_int_value = + message.negativeIntValue !== BigInt(0) + ? message.negativeIntValue.toString() + : undefined; + obj.double_value = + message.doubleValue === 0 ? undefined : message.doubleValue; + obj.string_value = message.stringValue + ? base64FromBytes(message.stringValue) + : undefined; + obj.aggregate_value = + message.aggregateValue === '' ? undefined : message.aggregateValue; + return obj; + }, + fromAminoMsg(object: UninterpretedOptionAminoMsg): UninterpretedOption { + return UninterpretedOption.fromAmino(object.value); + }, + fromProtoMsg(message: UninterpretedOptionProtoMsg): UninterpretedOption { + return UninterpretedOption.decode(message.value); + }, + toProto(message: UninterpretedOption): Uint8Array { + return UninterpretedOption.encode(message).finish(); + }, + toProtoMsg(message: UninterpretedOption): UninterpretedOptionProtoMsg { + return { + typeUrl: '/google.protobuf.UninterpretedOption', + value: UninterpretedOption.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + UninterpretedOption.typeUrl, + UninterpretedOption +); +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { + namePart: '', + isExtension: false, + }; +} +export const UninterpretedOption_NamePart = { + typeUrl: '/google.protobuf.NamePart', + is(o: any): o is UninterpretedOption_NamePart { + return ( + o && + (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || + (typeof o.namePart === 'string' && typeof o.isExtension === 'boolean')) + ); + }, + isSDK(o: any): o is UninterpretedOption_NamePartSDKType { + return ( + o && + (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || + (typeof o.name_part === 'string' && + typeof o.is_extension === 'boolean')) + ); + }, + isAmino(o: any): o is UninterpretedOption_NamePartAmino { + return ( + o && + (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || + (typeof o.name_part === 'string' && + typeof o.is_extension === 'boolean')) + ); + }, + encode( + message: UninterpretedOption_NamePart, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.namePart !== '') { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UninterpretedOption_NamePart { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ''; + message.isExtension = object.isExtension ?? false; + return message; + }, + fromAmino( + object: UninterpretedOption_NamePartAmino + ): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + if (object.name_part !== undefined && object.name_part !== null) { + message.namePart = object.name_part; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.isExtension = object.is_extension; + } + return message; + }, + toAmino( + message: UninterpretedOption_NamePart + ): UninterpretedOption_NamePartAmino { + const obj: any = {}; + obj.name_part = message.namePart === '' ? undefined : message.namePart; + obj.is_extension = + message.isExtension === false ? undefined : message.isExtension; + return obj; + }, + fromAminoMsg( + object: UninterpretedOption_NamePartAminoMsg + ): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromAmino(object.value); + }, + fromProtoMsg( + message: UninterpretedOption_NamePartProtoMsg + ): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.decode(message.value); + }, + toProto(message: UninterpretedOption_NamePart): Uint8Array { + return UninterpretedOption_NamePart.encode(message).finish(); + }, + toProtoMsg( + message: UninterpretedOption_NamePart + ): UninterpretedOption_NamePartProtoMsg { + return { + typeUrl: '/google.protobuf.NamePart', + value: UninterpretedOption_NamePart.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + UninterpretedOption_NamePart.typeUrl, + UninterpretedOption_NamePart +); +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { + location: [], + }; +} +export const SourceCodeInfo = { + typeUrl: '/google.protobuf.SourceCodeInfo', + is(o: any): o is SourceCodeInfo { + return ( + o && + (o.$typeUrl === SourceCodeInfo.typeUrl || + (Array.isArray(o.location) && + (!o.location.length || SourceCodeInfo_Location.is(o.location[0])))) + ); + }, + isSDK(o: any): o is SourceCodeInfoSDKType { + return ( + o && + (o.$typeUrl === SourceCodeInfo.typeUrl || + (Array.isArray(o.location) && + (!o.location.length || SourceCodeInfo_Location.isSDK(o.location[0])))) + ); + }, + isAmino(o: any): o is SourceCodeInfoAmino { + return ( + o && + (o.$typeUrl === SourceCodeInfo.typeUrl || + (Array.isArray(o.location) && + (!o.location.length || + SourceCodeInfo_Location.isAmino(o.location[0])))) + ); + }, + encode( + message: SourceCodeInfo, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = + object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = + object.location?.map((e) => SourceCodeInfo_Location.fromAmino(e)) || []; + return message; + }, + toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toAmino(e) : undefined + ); + } else { + obj.location = message.location; + } + return obj; + }, + fromAminoMsg(object: SourceCodeInfoAminoMsg): SourceCodeInfo { + return SourceCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: SourceCodeInfoProtoMsg): SourceCodeInfo { + return SourceCodeInfo.decode(message.value); + }, + toProto(message: SourceCodeInfo): Uint8Array { + return SourceCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: SourceCodeInfo): SourceCodeInfoProtoMsg { + return { + typeUrl: '/google.protobuf.SourceCodeInfo', + value: SourceCodeInfo.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SourceCodeInfo.typeUrl, SourceCodeInfo); +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { + path: [], + span: [], + leadingComments: '', + trailingComments: '', + leadingDetachedComments: [], + }; +} +export const SourceCodeInfo_Location = { + typeUrl: '/google.protobuf.Location', + is(o: any): o is SourceCodeInfo_Location { + return ( + o && + (o.$typeUrl === SourceCodeInfo_Location.typeUrl || + (Array.isArray(o.path) && + (!o.path.length || typeof o.path[0] === 'number') && + Array.isArray(o.span) && + (!o.span.length || typeof o.span[0] === 'number') && + typeof o.leadingComments === 'string' && + typeof o.trailingComments === 'string' && + Array.isArray(o.leadingDetachedComments) && + (!o.leadingDetachedComments.length || + typeof o.leadingDetachedComments[0] === 'string'))) + ); + }, + isSDK(o: any): o is SourceCodeInfo_LocationSDKType { + return ( + o && + (o.$typeUrl === SourceCodeInfo_Location.typeUrl || + (Array.isArray(o.path) && + (!o.path.length || typeof o.path[0] === 'number') && + Array.isArray(o.span) && + (!o.span.length || typeof o.span[0] === 'number') && + typeof o.leading_comments === 'string' && + typeof o.trailing_comments === 'string' && + Array.isArray(o.leading_detached_comments) && + (!o.leading_detached_comments.length || + typeof o.leading_detached_comments[0] === 'string'))) + ); + }, + isAmino(o: any): o is SourceCodeInfo_LocationAmino { + return ( + o && + (o.$typeUrl === SourceCodeInfo_Location.typeUrl || + (Array.isArray(o.path) && + (!o.path.length || typeof o.path[0] === 'number') && + Array.isArray(o.span) && + (!o.span.length || typeof o.span[0] === 'number') && + typeof o.leading_comments === 'string' && + typeof o.trailing_comments === 'string' && + Array.isArray(o.leading_detached_comments) && + (!o.leading_detached_comments.length || + typeof o.leading_detached_comments[0] === 'string'))) + ); + }, + encode( + message: SourceCodeInfo_Location, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leadingComments !== '') { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== '') { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SourceCodeInfo_Location { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map((e) => e) || []; + message.span = object.span?.map((e) => e) || []; + message.leadingComments = object.leadingComments ?? ''; + message.trailingComments = object.trailingComments ?? ''; + message.leadingDetachedComments = + object.leadingDetachedComments?.map((e) => e) || []; + return message; + }, + fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map((e) => e) || []; + message.span = object.span?.map((e) => e) || []; + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leadingComments = object.leading_comments; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailingComments = object.trailing_comments; + } + message.leadingDetachedComments = + object.leading_detached_comments?.map((e) => e) || []; + return message; + }, + toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = message.path; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = message.span; + } + obj.leading_comments = + message.leadingComments === '' ? undefined : message.leadingComments; + obj.trailing_comments = + message.trailingComments === '' ? undefined : message.trailingComments; + if (message.leadingDetachedComments) { + obj.leading_detached_comments = message.leadingDetachedComments.map( + (e) => e + ); + } else { + obj.leading_detached_comments = message.leadingDetachedComments; + } + return obj; + }, + fromAminoMsg( + object: SourceCodeInfo_LocationAminoMsg + ): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromAmino(object.value); + }, + fromProtoMsg( + message: SourceCodeInfo_LocationProtoMsg + ): SourceCodeInfo_Location { + return SourceCodeInfo_Location.decode(message.value); + }, + toProto(message: SourceCodeInfo_Location): Uint8Array { + return SourceCodeInfo_Location.encode(message).finish(); + }, + toProtoMsg( + message: SourceCodeInfo_Location + ): SourceCodeInfo_LocationProtoMsg { + return { + typeUrl: '/google.protobuf.Location', + value: SourceCodeInfo_Location.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SourceCodeInfo_Location.typeUrl, + SourceCodeInfo_Location +); +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { + annotation: [], + }; +} +export const GeneratedCodeInfo = { + typeUrl: '/google.protobuf.GeneratedCodeInfo', + is(o: any): o is GeneratedCodeInfo { + return ( + o && + (o.$typeUrl === GeneratedCodeInfo.typeUrl || + (Array.isArray(o.annotation) && + (!o.annotation.length || + GeneratedCodeInfo_Annotation.is(o.annotation[0])))) + ); + }, + isSDK(o: any): o is GeneratedCodeInfoSDKType { + return ( + o && + (o.$typeUrl === GeneratedCodeInfo.typeUrl || + (Array.isArray(o.annotation) && + (!o.annotation.length || + GeneratedCodeInfo_Annotation.isSDK(o.annotation[0])))) + ); + }, + isAmino(o: any): o is GeneratedCodeInfoAmino { + return ( + o && + (o.$typeUrl === GeneratedCodeInfo.typeUrl || + (Array.isArray(o.annotation) && + (!o.annotation.length || + GeneratedCodeInfo_Annotation.isAmino(o.annotation[0])))) + ); + }, + encode( + message: GeneratedCodeInfo, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = + object.annotation?.map((e) => + GeneratedCodeInfo_Annotation.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = + object.annotation?.map((e) => + GeneratedCodeInfo_Annotation.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toAmino(e) : undefined + ); + } else { + obj.annotation = message.annotation; + } + return obj; + }, + fromAminoMsg(object: GeneratedCodeInfoAminoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: GeneratedCodeInfoProtoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.decode(message.value); + }, + toProto(message: GeneratedCodeInfo): Uint8Array { + return GeneratedCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: GeneratedCodeInfo): GeneratedCodeInfoProtoMsg { + return { + typeUrl: '/google.protobuf.GeneratedCodeInfo', + value: GeneratedCodeInfo.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GeneratedCodeInfo.typeUrl, GeneratedCodeInfo); +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { + path: [], + sourceFile: '', + begin: 0, + end: 0, + }; +} +export const GeneratedCodeInfo_Annotation = { + typeUrl: '/google.protobuf.Annotation', + is(o: any): o is GeneratedCodeInfo_Annotation { + return ( + o && + (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || + (Array.isArray(o.path) && + (!o.path.length || typeof o.path[0] === 'number') && + typeof o.sourceFile === 'string' && + typeof o.begin === 'number' && + typeof o.end === 'number')) + ); + }, + isSDK(o: any): o is GeneratedCodeInfo_AnnotationSDKType { + return ( + o && + (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || + (Array.isArray(o.path) && + (!o.path.length || typeof o.path[0] === 'number') && + typeof o.source_file === 'string' && + typeof o.begin === 'number' && + typeof o.end === 'number')) + ); + }, + isAmino(o: any): o is GeneratedCodeInfo_AnnotationAmino { + return ( + o && + (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || + (Array.isArray(o.path) && + (!o.path.length || typeof o.path[0] === 'number') && + typeof o.source_file === 'string' && + typeof o.begin === 'number' && + typeof o.end === 'number')) + ); + }, + encode( + message: GeneratedCodeInfo_Annotation, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== '') { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): GeneratedCodeInfo_Annotation { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map((e) => e) || []; + message.sourceFile = object.sourceFile ?? ''; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino( + object: GeneratedCodeInfo_AnnotationAmino + ): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map((e) => e) || []; + if (object.source_file !== undefined && object.source_file !== null) { + message.sourceFile = object.source_file; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino( + message: GeneratedCodeInfo_Annotation + ): GeneratedCodeInfo_AnnotationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = message.path; + } + obj.source_file = + message.sourceFile === '' ? undefined : message.sourceFile; + obj.begin = message.begin === 0 ? undefined : message.begin; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg( + object: GeneratedCodeInfo_AnnotationAminoMsg + ): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromAmino(object.value); + }, + fromProtoMsg( + message: GeneratedCodeInfo_AnnotationProtoMsg + ): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.decode(message.value); + }, + toProto(message: GeneratedCodeInfo_Annotation): Uint8Array { + return GeneratedCodeInfo_Annotation.encode(message).finish(); + }, + toProtoMsg( + message: GeneratedCodeInfo_Annotation + ): GeneratedCodeInfo_AnnotationProtoMsg { + return { + typeUrl: '/google.protobuf.Annotation', + value: GeneratedCodeInfo_Annotation.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + GeneratedCodeInfo_Annotation.typeUrl, + GeneratedCodeInfo_Annotation +); diff --git a/packages/cosmos/src/proto_export/google/protobuf/duration.ts b/packages/cosmos/src/proto_export/google/protobuf/duration.ts new file mode 100644 index 00000000..b3472143 --- /dev/null +++ b/packages/cosmos/src/proto_export/google/protobuf/duration.ts @@ -0,0 +1,314 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} +export interface DurationProtoMsg { + typeUrl: '/google.protobuf.Duration'; + value: Uint8Array; +} +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export type DurationAmino = string; +export interface DurationAminoMsg { + type: '/google.protobuf.Duration'; + value: DurationAmino; +} +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface DurationSDKType { + seconds: bigint; + nanos: number; +} +function createBaseDuration(): Duration { + return { + seconds: BigInt(0), + nanos: 0, + }; +} +export const Duration = { + typeUrl: '/google.protobuf.Duration', + is(o: any): o is Duration { + return ( + o && + (o.$typeUrl === Duration.typeUrl || + (typeof o.seconds === 'bigint' && typeof o.nanos === 'number')) + ); + }, + isSDK(o: any): o is DurationSDKType { + return ( + o && + (o.$typeUrl === Duration.typeUrl || + (typeof o.seconds === 'bigint' && typeof o.nanos === 'number')) + ); + }, + isAmino(o: any): o is DurationAmino { + return ( + o && + (o.$typeUrl === Duration.typeUrl || + (typeof o.seconds === 'bigint' && typeof o.nanos === 'number')) + ); + }, + encode( + message: Duration, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Duration { + const message = createBaseDuration(); + message.seconds = + object.seconds !== undefined && object.seconds !== null + ? BigInt(object.seconds.toString()) + : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: DurationAmino): Duration { + const value = BigInt(object); + return { + seconds: value / BigInt('1000000000'), + nanos: Number(value % BigInt('1000000000')), + }; + }, + toAmino(message: Duration): DurationAmino { + return ( + message.seconds * BigInt('1000000000') + + BigInt(message.nanos) + ).toString(); + }, + fromAminoMsg(object: DurationAminoMsg): Duration { + return Duration.fromAmino(object.value); + }, + fromProtoMsg(message: DurationProtoMsg): Duration { + return Duration.decode(message.value); + }, + toProto(message: Duration): Uint8Array { + return Duration.encode(message).finish(); + }, + toProtoMsg(message: Duration): DurationProtoMsg { + return { + typeUrl: '/google.protobuf.Duration', + value: Duration.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Duration.typeUrl, Duration); diff --git a/packages/cosmos/src/proto_export/google/protobuf/timestamp.ts b/packages/cosmos/src/proto_export/google/protobuf/timestamp.ts new file mode 100644 index 00000000..ee9c0f2b --- /dev/null +++ b/packages/cosmos/src/proto_export/google/protobuf/timestamp.ts @@ -0,0 +1,380 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { fromJsonTimestamp, fromTimestamp } from '../../helpers'; +import { GlobalDecoderRegistry } from '../../registry'; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} +export interface TimestampProtoMsg { + typeUrl: '/google.protobuf.Timestamp'; + value: Uint8Array; +} +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export type TimestampAmino = string; +export interface TimestampAminoMsg { + type: '/google.protobuf.Timestamp'; + value: TimestampAmino; +} +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface TimestampSDKType { + seconds: bigint; + nanos: number; +} +function createBaseTimestamp(): Timestamp { + return { + seconds: BigInt(0), + nanos: 0, + }; +} +export const Timestamp = { + typeUrl: '/google.protobuf.Timestamp', + is(o: any): o is Timestamp { + return ( + o && + (o.$typeUrl === Timestamp.typeUrl || + (typeof o.seconds === 'bigint' && typeof o.nanos === 'number')) + ); + }, + isSDK(o: any): o is TimestampSDKType { + return ( + o && + (o.$typeUrl === Timestamp.typeUrl || + (typeof o.seconds === 'bigint' && typeof o.nanos === 'number')) + ); + }, + isAmino(o: any): o is TimestampAmino { + return ( + o && + (o.$typeUrl === Timestamp.typeUrl || + (typeof o.seconds === 'bigint' && typeof o.nanos === 'number')) + ); + }, + encode( + message: Timestamp, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Timestamp { + const message = createBaseTimestamp(); + message.seconds = + object.seconds !== undefined && object.seconds !== null + ? BigInt(object.seconds.toString()) + : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: TimestampAmino): Timestamp { + return fromJsonTimestamp(object); + }, + toAmino(message: Timestamp): TimestampAmino { + return fromTimestamp(message) + .toISOString() + .replace(/\.\d+Z$/, 'Z'); + }, + fromAminoMsg(object: TimestampAminoMsg): Timestamp { + return Timestamp.fromAmino(object.value); + }, + fromProtoMsg(message: TimestampProtoMsg): Timestamp { + return Timestamp.decode(message.value); + }, + toProto(message: Timestamp): Uint8Array { + return Timestamp.encode(message).finish(); + }, + toProtoMsg(message: Timestamp): TimestampProtoMsg { + return { + typeUrl: '/google.protobuf.Timestamp', + value: Timestamp.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Timestamp.typeUrl, Timestamp); diff --git a/packages/cosmos/src/proto_export/helpers.ts b/packages/cosmos/src/proto_export/helpers.ts new file mode 100644 index 00000000..ee2a2d87 --- /dev/null +++ b/packages/cosmos/src/proto_export/helpers.ts @@ -0,0 +1,254 @@ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +declare let self: any | undefined; +declare let window: any | undefined; +declare let global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== 'undefined') return globalThis; + if (typeof self !== 'undefined') return self; + if (typeof window !== 'undefined') return window; + if (typeof global !== 'undefined') return global; + throw 'Unable to locate global object'; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')); + +export function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')); + +export function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return btoa(bin.join('')); +} + +export interface AminoHeight { + readonly revision_number?: string; + readonly revision_height?: string; +} + +export function omitDefault( + input: T +): T | undefined { + if (typeof input === 'string') { + return input === '' ? undefined : input; + } + + if (typeof input === 'number') { + return input === 0 ? undefined : input; + } + + if (typeof input === 'boolean') { + return input === false ? undefined : input; + } + + if (typeof input === 'bigint') { + return input === BigInt(0) ? undefined : input; + } + + throw new Error(`Got unsupported type ${typeof input}`); +} + +interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + + nanos: number; +} + +export function toDuration(duration: string): Duration { + return { + seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)), + nanos: parseInt(duration) % 1000000000, + }; +} + +export function fromDuration(duration: Duration): string { + return ( + parseInt(duration.seconds.toString()) * 1000000000 + + duration.nanos + ).toString(); +} + +export function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export function isObject(value: any): boolean { + return typeof value === 'object' && value !== null; +} + +export interface PageRequest { + key: Uint8Array; + offset: bigint; + limit: bigint; + countTotal: boolean; + reverse: boolean; +} + +export interface PageRequestParams { + 'pagination.key'?: string; + 'pagination.offset'?: string; + 'pagination.limit'?: string; + 'pagination.count_total'?: boolean; + 'pagination.reverse'?: boolean; +} + +export interface Params { + params: PageRequestParams; +} + +export const setPaginationParams = ( + options: Params, + pagination?: PageRequest +) => { + if (!pagination) { + return options; + } + + if (typeof pagination?.countTotal !== 'undefined') { + options.params['pagination.count_total'] = pagination.countTotal; + } + if (typeof pagination?.key !== 'undefined') { + // String to Uint8Array + // let uint8arr = new Uint8Array(Buffer.from(data,'base64')); + + // Uint8Array to String + options.params['pagination.key'] = Buffer.from(pagination.key).toString( + 'base64' + ); + } + if (typeof pagination?.limit !== 'undefined') { + options.params['pagination.limit'] = pagination.limit.toString(); + } + if (typeof pagination?.offset !== 'undefined') { + options.params['pagination.offset'] = pagination.offset.toString(); + } + if (typeof pagination?.reverse !== 'undefined') { + options.params['pagination.reverse'] = pagination.reverse; + } + + return options; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | bigint + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + >; + +export interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + + nanos: number; +} + +export function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1000) * 1000000; + return { + seconds, + nanos, + }; +} + +export function fromTimestamp(t: Timestamp): Date { + let millis = Number(t.seconds) * 1000; + millis += t.nanos / 1000000; + return new Date(millis); +} + +const timestampFromJSON = (object: any): Timestamp => { + return { + seconds: isSet(object.seconds) + ? BigInt(object.seconds.toString()) + : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; +}; + +export function fromJsonTimestamp(o: any): Timestamp { + if (o instanceof Date) { + return toTimestamp(o); + } else if (typeof o === 'string') { + return toTimestamp(new Date(o)); + } else { + return timestampFromJSON(o); + } +} + +function numberToLong(number: number) { + return BigInt(Math.trunc(number)); +} diff --git a/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/transfer.ts b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/transfer.ts new file mode 100644 index 00000000..1b8b5481 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/transfer.ts @@ -0,0 +1,331 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../registry'; +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTrace { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path: string; + /** base denomination of the relayed fungible token. */ + baseDenom: string; +} +export interface DenomTraceProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.DenomTrace'; + value: Uint8Array; +} +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTraceAmino { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path?: string; + /** base denomination of the relayed fungible token. */ + base_denom?: string; +} +export interface DenomTraceAminoMsg { + type: 'cosmos-sdk/DenomTrace'; + value: DenomTraceAmino; +} +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTraceSDKType { + path: string; + base_denom: string; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface Params { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + sendEnabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receiveEnabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.Params'; + value: Uint8Array; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface ParamsAmino { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + send_enabled?: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receive_enabled?: boolean; +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/Params'; + value: ParamsAmino; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface ParamsSDKType { + send_enabled: boolean; + receive_enabled: boolean; +} +function createBaseDenomTrace(): DenomTrace { + return { + path: '', + baseDenom: '', + }; +} +export const DenomTrace = { + typeUrl: '/ibc.applications.transfer.v1.DenomTrace', + aminoType: 'cosmos-sdk/DenomTrace', + is(o: any): o is DenomTrace { + return ( + o && + (o.$typeUrl === DenomTrace.typeUrl || + (typeof o.path === 'string' && typeof o.baseDenom === 'string')) + ); + }, + isSDK(o: any): o is DenomTraceSDKType { + return ( + o && + (o.$typeUrl === DenomTrace.typeUrl || + (typeof o.path === 'string' && typeof o.base_denom === 'string')) + ); + }, + isAmino(o: any): o is DenomTraceAmino { + return ( + o && + (o.$typeUrl === DenomTrace.typeUrl || + (typeof o.path === 'string' && typeof o.base_denom === 'string')) + ); + }, + encode( + message: DenomTrace, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.path !== '') { + writer.uint32(10).string(message.path); + } + if (message.baseDenom !== '') { + writer.uint32(18).string(message.baseDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomTrace { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomTrace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.baseDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomTrace { + const message = createBaseDenomTrace(); + message.path = object.path ?? ''; + message.baseDenom = object.baseDenom ?? ''; + return message; + }, + fromAmino(object: DenomTraceAmino): DenomTrace { + const message = createBaseDenomTrace(); + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; + }, + toAmino(message: DenomTrace): DenomTraceAmino { + const obj: any = {}; + obj.path = message.path === '' ? undefined : message.path; + obj.base_denom = message.baseDenom === '' ? undefined : message.baseDenom; + return obj; + }, + fromAminoMsg(object: DenomTraceAminoMsg): DenomTrace { + return DenomTrace.fromAmino(object.value); + }, + toAminoMsg(message: DenomTrace): DenomTraceAminoMsg { + return { + type: 'cosmos-sdk/DenomTrace', + value: DenomTrace.toAmino(message), + }; + }, + fromProtoMsg(message: DenomTraceProtoMsg): DenomTrace { + return DenomTrace.decode(message.value); + }, + toProto(message: DenomTrace): Uint8Array { + return DenomTrace.encode(message).finish(); + }, + toProtoMsg(message: DenomTrace): DenomTraceProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.DenomTrace', + value: DenomTrace.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(DenomTrace.typeUrl, DenomTrace); +GlobalDecoderRegistry.registerAminoProtoMapping( + DenomTrace.aminoType, + DenomTrace.typeUrl +); +function createBaseParams(): Params { + return { + sendEnabled: false, + receiveEnabled: false, + }; +} +export const Params = { + typeUrl: '/ibc.applications.transfer.v1.Params', + aminoType: 'cosmos-sdk/Params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.sendEnabled === 'boolean' && + typeof o.receiveEnabled === 'boolean')) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.send_enabled === 'boolean' && + typeof o.receive_enabled === 'boolean')) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.send_enabled === 'boolean' && + typeof o.receive_enabled === 'boolean')) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sendEnabled === true) { + writer.uint32(8).bool(message.sendEnabled); + } + if (message.receiveEnabled === true) { + writer.uint32(16).bool(message.receiveEnabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled = reader.bool(); + break; + case 2: + message.receiveEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled ?? false; + message.receiveEnabled = object.receiveEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.send_enabled !== undefined && object.send_enabled !== null) { + message.sendEnabled = object.send_enabled; + } + if ( + object.receive_enabled !== undefined && + object.receive_enabled !== null + ) { + message.receiveEnabled = object.receive_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.send_enabled = + message.sendEnabled === false ? undefined : message.sendEnabled; + obj.receive_enabled = + message.receiveEnabled === false ? undefined : message.receiveEnabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/Params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.amino.ts b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.amino.ts new file mode 100644 index 00000000..ec181246 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgTransfer, MsgUpdateParams } from './tx'; +export const AminoConverter = { + '/ibc.applications.transfer.v1.MsgTransfer': { + aminoType: 'cosmos-sdk/MsgTransfer', + toAmino: MsgTransfer.toAmino, + fromAmino: MsgTransfer.fromAmino, + }, + '/ibc.applications.transfer.v1.MsgUpdateParams': { + aminoType: 'cosmos-sdk/MsgUpdateParams', + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.registry.ts b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.registry.ts new file mode 100644 index 00000000..38cc411f --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.registry.ts @@ -0,0 +1,57 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { MsgTransfer, MsgUpdateParams } from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/ibc.applications.transfer.v1.MsgTransfer', MsgTransfer], + ['/ibc.applications.transfer.v1.MsgUpdateParams', MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + transfer(value: MsgTransfer) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams', + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + transfer(value: MsgTransfer) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams', + value, + }; + }, + }, + fromPartial: { + transfer(value: MsgTransfer) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams', + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.ts b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 00000000..725e1b54 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,717 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../../cosmos/base/v1beta1/coin'; +import { + Height, + HeightAmino, + HeightSDKType, + Params, + ParamsAmino, + ParamsSDKType, +} from '../../../core/client/v1/client'; +import { BinaryReader, BinaryWriter } from '../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../registry'; +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransfer { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** the tokens to be transferred */ + token: Coin; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: Height; + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: bigint; + /** optional memo */ + memo: string; +} +export interface MsgTransferProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer'; + value: Uint8Array; +} +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransferAmino { + /** the port on which the packet will be sent */ + source_port?: string; + /** the channel by which the packet will be sent */ + source_channel?: string; + /** the tokens to be transferred */ + token: CoinAmino; + /** the sender address */ + sender?: string; + /** the recipient address on the destination chain */ + receiver?: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeout_height: HeightAmino; + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeout_timestamp?: string; + /** optional memo */ + memo?: string; +} +export interface MsgTransferAminoMsg { + type: 'cosmos-sdk/MsgTransfer'; + value: MsgTransferAmino; +} +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransferSDKType { + source_port: string; + source_channel: string; + token: CoinSDKType; + sender: string; + receiver: string; + timeout_height: HeightSDKType; + timeout_timestamp: bigint; + memo: string; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse { + /** sequence number of the transfer packet sent */ + sequence: bigint; +} +export interface MsgTransferResponseProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.MsgTransferResponse'; + value: Uint8Array; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseAmino { + /** sequence number of the transfer packet sent */ + sequence?: string; +} +export interface MsgTransferResponseAminoMsg { + type: 'cosmos-sdk/MsgTransferResponse'; + value: MsgTransferResponseAmino; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseSDKType { + sequence: bigint; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams'; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: 'cosmos-sdk/MsgUpdateParams'; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParamsResponse'; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: 'cosmos-sdk/MsgUpdateParamsResponse'; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgTransfer(): MsgTransfer { + return { + sourcePort: '', + sourceChannel: '', + token: Coin.fromPartial({}), + sender: '', + receiver: '', + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0), + memo: '', + }; +} +export const MsgTransfer = { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + aminoType: 'cosmos-sdk/MsgTransfer', + is(o: any): o is MsgTransfer { + return ( + o && + (o.$typeUrl === MsgTransfer.typeUrl || + (typeof o.sourcePort === 'string' && + typeof o.sourceChannel === 'string' && + Coin.is(o.token) && + typeof o.sender === 'string' && + typeof o.receiver === 'string' && + Height.is(o.timeoutHeight) && + typeof o.timeoutTimestamp === 'bigint' && + typeof o.memo === 'string')) + ); + }, + isSDK(o: any): o is MsgTransferSDKType { + return ( + o && + (o.$typeUrl === MsgTransfer.typeUrl || + (typeof o.source_port === 'string' && + typeof o.source_channel === 'string' && + Coin.isSDK(o.token) && + typeof o.sender === 'string' && + typeof o.receiver === 'string' && + Height.isSDK(o.timeout_height) && + typeof o.timeout_timestamp === 'bigint' && + typeof o.memo === 'string')) + ); + }, + isAmino(o: any): o is MsgTransferAmino { + return ( + o && + (o.$typeUrl === MsgTransfer.typeUrl || + (typeof o.source_port === 'string' && + typeof o.source_channel === 'string' && + Coin.isAmino(o.token) && + typeof o.sender === 'string' && + typeof o.receiver === 'string' && + Height.isAmino(o.timeout_height) && + typeof o.timeout_timestamp === 'bigint' && + typeof o.memo === 'string')) + ); + }, + encode( + message: MsgTransfer, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sourcePort !== '') { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== '') { + writer.uint32(18).string(message.sourceChannel); + } + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(26).fork()).ldelim(); + } + if (message.sender !== '') { + writer.uint32(34).string(message.sender); + } + if (message.receiver !== '') { + writer.uint32(42).string(message.receiver); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(56).uint64(message.timeoutTimestamp); + } + if (message.memo !== '') { + writer.uint32(66).string(message.memo); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.token = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64(); + break; + case 8: + message.memo = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTransfer { + const message = createBaseMsgTransfer(); + message.sourcePort = object.sourcePort ?? ''; + message.sourceChannel = object.sourceChannel ?? ''; + message.token = + object.token !== undefined && object.token !== null + ? Coin.fromPartial(object.token) + : undefined; + message.sender = object.sender ?? ''; + message.receiver = object.receiver ?? ''; + message.timeoutHeight = + object.timeoutHeight !== undefined && object.timeoutHeight !== null + ? Height.fromPartial(object.timeoutHeight) + : undefined; + message.timeoutTimestamp = + object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null + ? BigInt(object.timeoutTimestamp.toString()) + : BigInt(0); + message.memo = object.memo ?? ''; + return message; + }, + fromAmino(object: MsgTransferAmino): MsgTransfer { + const message = createBaseMsgTransfer(); + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if ( + object.timeout_timestamp !== undefined && + object.timeout_timestamp !== null + ) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; + }, + toAmino(message: MsgTransfer): MsgTransferAmino { + const obj: any = {}; + obj.source_port = + message.sourcePort === '' ? undefined : message.sourcePort; + obj.source_channel = + message.sourceChannel === '' ? undefined : message.sourceChannel; + obj.token = message.token + ? Coin.toAmino(message.token) + : Coin.toAmino(Coin.fromPartial({})); + obj.sender = message.sender === '' ? undefined : message.sender; + obj.receiver = message.receiver === '' ? undefined : message.receiver; + obj.timeout_height = message.timeoutHeight + ? Height.toAmino(message.timeoutHeight) + : {}; + obj.timeout_timestamp = + message.timeoutTimestamp !== BigInt(0) + ? message.timeoutTimestamp.toString() + : undefined; + obj.memo = message.memo === '' ? undefined : message.memo; + return obj; + }, + fromAminoMsg(object: MsgTransferAminoMsg): MsgTransfer { + return MsgTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransfer): MsgTransferAminoMsg { + return { + type: 'cosmos-sdk/MsgTransfer', + value: MsgTransfer.toAmino(message), + }; + }, + fromProtoMsg(message: MsgTransferProtoMsg): MsgTransfer { + return MsgTransfer.decode(message.value); + }, + toProto(message: MsgTransfer): Uint8Array { + return MsgTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgTransfer): MsgTransferProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgTransfer.typeUrl, MsgTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTransfer.aminoType, + MsgTransfer.typeUrl +); +function createBaseMsgTransferResponse(): MsgTransferResponse { + return { + sequence: BigInt(0), + }; +} +export const MsgTransferResponse = { + typeUrl: '/ibc.applications.transfer.v1.MsgTransferResponse', + aminoType: 'cosmos-sdk/MsgTransferResponse', + is(o: any): o is MsgTransferResponse { + return ( + o && + (o.$typeUrl === MsgTransferResponse.typeUrl || + typeof o.sequence === 'bigint') + ); + }, + isSDK(o: any): o is MsgTransferResponseSDKType { + return ( + o && + (o.$typeUrl === MsgTransferResponse.typeUrl || + typeof o.sequence === 'bigint') + ); + }, + isAmino(o: any): o is MsgTransferResponseAmino { + return ( + o && + (o.$typeUrl === MsgTransferResponse.typeUrl || + typeof o.sequence === 'bigint') + ); + }, + encode( + message: MsgTransferResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgTransferResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgTransferResponseAmino): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: MsgTransferResponse): MsgTransferResponseAmino { + const obj: any = {}; + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgTransferResponseAminoMsg): MsgTransferResponse { + return MsgTransferResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferResponse): MsgTransferResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgTransferResponse', + value: MsgTransferResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgTransferResponseProtoMsg): MsgTransferResponse { + return MsgTransferResponse.decode(message.value); + }, + toProto(message: MsgTransferResponse): Uint8Array { + return MsgTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferResponse): MsgTransferResponseProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransferResponse', + value: MsgTransferResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgTransferResponse.typeUrl, + MsgTransferResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTransferResponse.aminoType, + MsgTransferResponse.typeUrl +); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: '', + params: Params.fromPartial({}), + }; +} +export const MsgUpdateParams = { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams', + aminoType: 'cosmos-sdk/MsgUpdateParams', + is(o: any): o is MsgUpdateParams { + return ( + o && + (o.$typeUrl === MsgUpdateParams.typeUrl || + (typeof o.signer === 'string' && Params.is(o.params))) + ); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return ( + o && + (o.$typeUrl === MsgUpdateParams.typeUrl || + (typeof o.signer === 'string' && Params.isSDK(o.params))) + ); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return ( + o && + (o.$typeUrl === MsgUpdateParams.typeUrl || + (typeof o.signer === 'string' && Params.isAmino(o.params))) + ); + }, + encode( + message: MsgUpdateParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.signer !== '') { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ''; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === '' ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: 'cosmos-sdk/MsgUpdateParams', + value: MsgUpdateParams.toAmino(message), + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams', + value: MsgUpdateParams.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateParams.aminoType, + MsgUpdateParams.typeUrl +); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParamsResponse', + aminoType: 'cosmos-sdk/MsgUpdateParamsResponse', + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode( + _: MsgUpdateParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUpdateParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgUpdateParamsResponseAminoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgUpdateParamsResponse', + value: MsgUpdateParamsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUpdateParamsResponseProtoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParamsResponse', + value: MsgUpdateParamsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUpdateParamsResponse.typeUrl, + MsgUpdateParamsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateParamsResponse.aminoType, + MsgUpdateParamsResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/ibc/applications/transfer/v2/packet.ts b/packages/cosmos/src/proto_export/ibc/applications/transfer/v2/packet.ts new file mode 100644 index 00000000..291f0b08 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/applications/transfer/v2/packet.ts @@ -0,0 +1,233 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../registry'; +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketData { + /** the token denomination to be transferred */ + denom: string; + /** the token amount to be transferred */ + amount: string; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** optional memo */ + memo: string; +} +export interface FungibleTokenPacketDataProtoMsg { + typeUrl: '/ibc.applications.transfer.v2.FungibleTokenPacketData'; + value: Uint8Array; +} +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketDataAmino { + /** the token denomination to be transferred */ + denom?: string; + /** the token amount to be transferred */ + amount?: string; + /** the sender address */ + sender?: string; + /** the recipient address on the destination chain */ + receiver?: string; + /** optional memo */ + memo?: string; +} +export interface FungibleTokenPacketDataAminoMsg { + type: 'cosmos-sdk/FungibleTokenPacketData'; + value: FungibleTokenPacketDataAmino; +} +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketDataSDKType { + denom: string; + amount: string; + sender: string; + receiver: string; + memo: string; +} +function createBaseFungibleTokenPacketData(): FungibleTokenPacketData { + return { + denom: '', + amount: '', + sender: '', + receiver: '', + memo: '', + }; +} +export const FungibleTokenPacketData = { + typeUrl: '/ibc.applications.transfer.v2.FungibleTokenPacketData', + aminoType: 'cosmos-sdk/FungibleTokenPacketData', + is(o: any): o is FungibleTokenPacketData { + return ( + o && + (o.$typeUrl === FungibleTokenPacketData.typeUrl || + (typeof o.denom === 'string' && + typeof o.amount === 'string' && + typeof o.sender === 'string' && + typeof o.receiver === 'string' && + typeof o.memo === 'string')) + ); + }, + isSDK(o: any): o is FungibleTokenPacketDataSDKType { + return ( + o && + (o.$typeUrl === FungibleTokenPacketData.typeUrl || + (typeof o.denom === 'string' && + typeof o.amount === 'string' && + typeof o.sender === 'string' && + typeof o.receiver === 'string' && + typeof o.memo === 'string')) + ); + }, + isAmino(o: any): o is FungibleTokenPacketDataAmino { + return ( + o && + (o.$typeUrl === FungibleTokenPacketData.typeUrl || + (typeof o.denom === 'string' && + typeof o.amount === 'string' && + typeof o.sender === 'string' && + typeof o.receiver === 'string' && + typeof o.memo === 'string')) + ); + }, + encode( + message: FungibleTokenPacketData, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.amount !== '') { + writer.uint32(18).string(message.amount); + } + if (message.sender !== '') { + writer.uint32(26).string(message.sender); + } + if (message.receiver !== '') { + writer.uint32(34).string(message.receiver); + } + if (message.memo !== '') { + writer.uint32(42).string(message.memo); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): FungibleTokenPacketData { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFungibleTokenPacketData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + case 5: + message.memo = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): FungibleTokenPacketData { + const message = createBaseFungibleTokenPacketData(); + message.denom = object.denom ?? ''; + message.amount = object.amount ?? ''; + message.sender = object.sender ?? ''; + message.receiver = object.receiver ?? ''; + message.memo = object.memo ?? ''; + return message; + }, + fromAmino(object: FungibleTokenPacketDataAmino): FungibleTokenPacketData { + const message = createBaseFungibleTokenPacketData(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; + }, + toAmino(message: FungibleTokenPacketData): FungibleTokenPacketDataAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.amount = message.amount === '' ? undefined : message.amount; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.receiver = message.receiver === '' ? undefined : message.receiver; + obj.memo = message.memo === '' ? undefined : message.memo; + return obj; + }, + fromAminoMsg( + object: FungibleTokenPacketDataAminoMsg + ): FungibleTokenPacketData { + return FungibleTokenPacketData.fromAmino(object.value); + }, + toAminoMsg( + message: FungibleTokenPacketData + ): FungibleTokenPacketDataAminoMsg { + return { + type: 'cosmos-sdk/FungibleTokenPacketData', + value: FungibleTokenPacketData.toAmino(message), + }; + }, + fromProtoMsg( + message: FungibleTokenPacketDataProtoMsg + ): FungibleTokenPacketData { + return FungibleTokenPacketData.decode(message.value); + }, + toProto(message: FungibleTokenPacketData): Uint8Array { + return FungibleTokenPacketData.encode(message).finish(); + }, + toProtoMsg( + message: FungibleTokenPacketData + ): FungibleTokenPacketDataProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v2.FungibleTokenPacketData', + value: FungibleTokenPacketData.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + FungibleTokenPacketData.typeUrl, + FungibleTokenPacketData +); +GlobalDecoderRegistry.registerAminoProtoMapping( + FungibleTokenPacketData.aminoType, + FungibleTokenPacketData.typeUrl +); diff --git a/packages/cosmos/src/proto_export/ibc/bundle.ts b/packages/cosmos/src/proto_export/ibc/bundle.ts new file mode 100644 index 00000000..05aed927 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/bundle.ts @@ -0,0 +1,31 @@ +//@ts-nocheck + +import * as _93 from './applications/transfer/v1/transfer'; +import * as _94 from './applications/transfer/v1/tx'; +import * as _95 from './applications/transfer/v2/packet'; +import * as _101 from './core/client/v1/client'; +import * as _288 from './applications/transfer/v1/tx.amino'; +import * as _296 from './applications/transfer/v1/tx.registry'; +import * as _418 from './lcd'; +import * as _419 from './rpc.query'; +import * as _420 from './rpc.tx'; +export namespace ibc { + export namespace applications { + export namespace transfer { + export const v1 = { + ..._93, + ..._94, + ..._288, + ..._296, + }; + export const v2 = { + ..._95, + }; + } + } + export const ClientFactory = { + ..._418, + ..._419, + ..._420, + }; +} diff --git a/packages/cosmos/src/proto_export/ibc/client.ts b/packages/cosmos/src/proto_export/ibc/client.ts new file mode 100644 index 00000000..c05a4c99 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/client.ts @@ -0,0 +1,56 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing'; +import { + defaultRegistryTypes, + AminoTypes, + SigningStargateClient, +} from '@cosmjs/stargate'; +import { HttpEndpoint } from '@cosmjs/tendermint-rpc'; + +import * as ibcApplicationsTransferV1TxRegistry from './applications/transfer/v1/tx.registry'; +import * as ibcApplicationsTransferV1TxAmino from './applications/transfer/v1/tx.amino'; +export const ibcAminoConverters = { + ...ibcApplicationsTransferV1TxAmino.AminoConverter, +}; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...ibcApplicationsTransferV1TxRegistry.registry, +]; +export const getSigningIbcClientOptions = ({ + defaultTypes = defaultRegistryTypes, +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...ibcProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...ibcAminoConverters, + }); + return { + registry, + aminoTypes, + }; +}; +export const getSigningIbcClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes, +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { registry, aminoTypes } = getSigningIbcClientOptions({ + defaultTypes, + }); + const client = await SigningStargateClient.connectWithSigner( + rpcEndpoint, + signer, + { + registry: registry as any, + aminoTypes, + } + ); + return client; +}; diff --git a/packages/cosmos/src/proto_export/ibc/core/client/v1/client.ts b/packages/cosmos/src/proto_export/ibc/core/client/v1/client.ts new file mode 100644 index 00000000..275c2729 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/core/client/v1/client.ts @@ -0,0 +1,1294 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from '../../../../google/protobuf/any'; +import { + Plan, + PlanAmino, + PlanSDKType, +} from '../../../../cosmos/upgrade/v1beta1/upgrade'; +import { BinaryReader, BinaryWriter } from '../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../registry'; +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState?: Any; +} +export interface IdentifiedClientStateProtoMsg { + typeUrl: '/ibc.core.client.v1.IdentifiedClientState'; + value: Uint8Array; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateAmino { + /** client identifier */ + client_id?: string; + /** client state */ + client_state?: AnyAmino; +} +export interface IdentifiedClientStateAminoMsg { + type: 'cosmos-sdk/IdentifiedClientState'; + value: IdentifiedClientStateAmino; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateSDKType { + client_id: string; + client_state?: AnySDKType; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: Height; + /** consensus state */ + consensusState?: Any; +} +export interface ConsensusStateWithHeightProtoMsg { + typeUrl: '/ibc.core.client.v1.ConsensusStateWithHeight'; + value: Uint8Array; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightAmino { + /** consensus state height */ + height?: HeightAmino; + /** consensus state */ + consensus_state?: AnyAmino; +} +export interface ConsensusStateWithHeightAminoMsg { + type: 'cosmos-sdk/ConsensusStateWithHeight'; + value: ConsensusStateWithHeightAmino; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightSDKType { + height: HeightSDKType; + consensus_state?: AnySDKType; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} +export interface ClientConsensusStatesProtoMsg { + typeUrl: '/ibc.core.client.v1.ClientConsensusStates'; + value: Uint8Array; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesAmino { + /** client identifier */ + client_id?: string; + /** consensus states and their heights associated with the client */ + consensus_states?: ConsensusStateWithHeightAmino[]; +} +export interface ClientConsensusStatesAminoMsg { + type: 'cosmos-sdk/ClientConsensusStates'; + value: ClientConsensusStatesAmino; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesSDKType { + client_id: string; + consensus_states: ConsensusStateWithHeightSDKType[]; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: bigint; + /** the height within the given revision */ + revisionHeight: bigint; +} +export interface HeightProtoMsg { + typeUrl: '/ibc.core.client.v1.Height'; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number?: string; + /** the height within the given revision */ + revision_height?: string; +} +export interface HeightAminoMsg { + type: 'cosmos-sdk/Height'; + value: HeightAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightSDKType { + revision_number: bigint; + revision_height: bigint; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: '/ibc.core.client.v1.Params'; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowed_clients?: string[]; +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/Params'; + value: ParamsAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsSDKType { + allowed_clients: string[]; +} +/** + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. + */ +/** @deprecated */ +export interface ClientUpdateProposal { + $typeUrl?: '/ibc.core.client.v1.ClientUpdateProposal'; + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string; +} +export interface ClientUpdateProposalProtoMsg { + typeUrl: '/ibc.core.client.v1.ClientUpdateProposal'; + value: Uint8Array; +} +/** + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. + */ +/** @deprecated */ +export interface ClientUpdateProposalAmino { + /** the title of the update proposal */ + title?: string; + /** the description of the proposal */ + description?: string; + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substitute_client_id?: string; +} +export interface ClientUpdateProposalAminoMsg { + type: 'cosmos-sdk/ClientUpdateProposal'; + value: ClientUpdateProposalAmino; +} +/** + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. + */ +/** @deprecated */ +export interface ClientUpdateProposalSDKType { + $typeUrl?: '/ibc.core.client.v1.ClientUpdateProposal'; + title: string; + description: string; + subject_client_id: string; + substitute_client_id: string; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. + */ +/** @deprecated */ +export interface UpgradeProposal { + $typeUrl?: '/ibc.core.client.v1.UpgradeProposal'; + title: string; + description: string; + plan: Plan; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgradedClientState?: Any; +} +export interface UpgradeProposalProtoMsg { + typeUrl: '/ibc.core.client.v1.UpgradeProposal'; + value: Uint8Array; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. + */ +/** @deprecated */ +export interface UpgradeProposalAmino { + title?: string; + description?: string; + plan?: PlanAmino; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgraded_client_state?: AnyAmino; +} +export interface UpgradeProposalAminoMsg { + type: 'cosmos-sdk/UpgradeProposal'; + value: UpgradeProposalAmino; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. + */ +/** @deprecated */ +export interface UpgradeProposalSDKType { + $typeUrl?: '/ibc.core.client.v1.UpgradeProposal'; + title: string; + description: string; + plan: PlanSDKType; + upgraded_client_state?: AnySDKType; +} +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { + clientId: '', + clientState: undefined, + }; +} +export const IdentifiedClientState = { + typeUrl: '/ibc.core.client.v1.IdentifiedClientState', + aminoType: 'cosmos-sdk/IdentifiedClientState', + is(o: any): o is IdentifiedClientState { + return ( + o && + (o.$typeUrl === IdentifiedClientState.typeUrl || + typeof o.clientId === 'string') + ); + }, + isSDK(o: any): o is IdentifiedClientStateSDKType { + return ( + o && + (o.$typeUrl === IdentifiedClientState.typeUrl || + typeof o.client_id === 'string') + ); + }, + isAmino(o: any): o is IdentifiedClientStateAmino { + return ( + o && + (o.$typeUrl === IdentifiedClientState.typeUrl || + typeof o.client_id === 'string') + ); + }, + encode( + message: IdentifiedClientState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.clientId !== '') { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): IdentifiedClientState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ''; + message.clientState = + object.clientState !== undefined && object.clientState !== null + ? Any.fromPartial(object.clientState) + : undefined; + return message; + }, + fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; + }, + toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { + const obj: any = {}; + obj.client_id = message.clientId === '' ? undefined : message.clientId; + obj.client_state = message.clientState + ? Any.toAmino(message.clientState) + : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedClientStateAminoMsg): IdentifiedClientState { + return IdentifiedClientState.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedClientState): IdentifiedClientStateAminoMsg { + return { + type: 'cosmos-sdk/IdentifiedClientState', + value: IdentifiedClientState.toAmino(message), + }; + }, + fromProtoMsg(message: IdentifiedClientStateProtoMsg): IdentifiedClientState { + return IdentifiedClientState.decode(message.value); + }, + toProto(message: IdentifiedClientState): Uint8Array { + return IdentifiedClientState.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedClientState): IdentifiedClientStateProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.IdentifiedClientState', + value: IdentifiedClientState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + IdentifiedClientState.typeUrl, + IdentifiedClientState +); +GlobalDecoderRegistry.registerAminoProtoMapping( + IdentifiedClientState.aminoType, + IdentifiedClientState.typeUrl +); +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { + height: Height.fromPartial({}), + consensusState: undefined, + }; +} +export const ConsensusStateWithHeight = { + typeUrl: '/ibc.core.client.v1.ConsensusStateWithHeight', + aminoType: 'cosmos-sdk/ConsensusStateWithHeight', + is(o: any): o is ConsensusStateWithHeight { + return ( + o && + (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.is(o.height)) + ); + }, + isSDK(o: any): o is ConsensusStateWithHeightSDKType { + return ( + o && + (o.$typeUrl === ConsensusStateWithHeight.typeUrl || + Height.isSDK(o.height)) + ); + }, + isAmino(o: any): o is ConsensusStateWithHeightAmino { + return ( + o && + (o.$typeUrl === ConsensusStateWithHeight.typeUrl || + Height.isAmino(o.height)) + ); + }, + encode( + message: ConsensusStateWithHeight, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ConsensusStateWithHeight { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = + object.height !== undefined && object.height !== null + ? Height.fromPartial(object.height) + : undefined; + message.consensusState = + object.consensusState !== undefined && object.consensusState !== null + ? Any.fromPartial(object.consensusState) + : undefined; + return message; + }, + fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if ( + object.consensus_state !== undefined && + object.consensus_state !== null + ) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : undefined; + obj.consensus_state = message.consensusState + ? Any.toAmino(message.consensusState) + : undefined; + return obj; + }, + fromAminoMsg( + object: ConsensusStateWithHeightAminoMsg + ): ConsensusStateWithHeight { + return ConsensusStateWithHeight.fromAmino(object.value); + }, + toAminoMsg( + message: ConsensusStateWithHeight + ): ConsensusStateWithHeightAminoMsg { + return { + type: 'cosmos-sdk/ConsensusStateWithHeight', + value: ConsensusStateWithHeight.toAmino(message), + }; + }, + fromProtoMsg( + message: ConsensusStateWithHeightProtoMsg + ): ConsensusStateWithHeight { + return ConsensusStateWithHeight.decode(message.value); + }, + toProto(message: ConsensusStateWithHeight): Uint8Array { + return ConsensusStateWithHeight.encode(message).finish(); + }, + toProtoMsg( + message: ConsensusStateWithHeight + ): ConsensusStateWithHeightProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.ConsensusStateWithHeight', + value: ConsensusStateWithHeight.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ConsensusStateWithHeight.typeUrl, + ConsensusStateWithHeight +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ConsensusStateWithHeight.aminoType, + ConsensusStateWithHeight.typeUrl +); +function createBaseClientConsensusStates(): ClientConsensusStates { + return { + clientId: '', + consensusStates: [], + }; +} +export const ClientConsensusStates = { + typeUrl: '/ibc.core.client.v1.ClientConsensusStates', + aminoType: 'cosmos-sdk/ClientConsensusStates', + is(o: any): o is ClientConsensusStates { + return ( + o && + (o.$typeUrl === ClientConsensusStates.typeUrl || + (typeof o.clientId === 'string' && + Array.isArray(o.consensusStates) && + (!o.consensusStates.length || + ConsensusStateWithHeight.is(o.consensusStates[0])))) + ); + }, + isSDK(o: any): o is ClientConsensusStatesSDKType { + return ( + o && + (o.$typeUrl === ClientConsensusStates.typeUrl || + (typeof o.client_id === 'string' && + Array.isArray(o.consensus_states) && + (!o.consensus_states.length || + ConsensusStateWithHeight.isSDK(o.consensus_states[0])))) + ); + }, + isAmino(o: any): o is ClientConsensusStatesAmino { + return ( + o && + (o.$typeUrl === ClientConsensusStates.typeUrl || + (typeof o.client_id === 'string' && + Array.isArray(o.consensus_states) && + (!o.consensus_states.length || + ConsensusStateWithHeight.isAmino(o.consensus_states[0])))) + ); + }, + encode( + message: ClientConsensusStates, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.clientId !== '') { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ClientConsensusStates { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push( + ConsensusStateWithHeight.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ''; + message.consensusStates = + object.consensusStates?.map((e) => + ConsensusStateWithHeight.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.consensusStates = + object.consensus_states?.map((e) => + ConsensusStateWithHeight.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { + const obj: any = {}; + obj.client_id = message.clientId === '' ? undefined : message.clientId; + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map((e) => + e ? ConsensusStateWithHeight.toAmino(e) : undefined + ); + } else { + obj.consensus_states = message.consensusStates; + } + return obj; + }, + fromAminoMsg(object: ClientConsensusStatesAminoMsg): ClientConsensusStates { + return ClientConsensusStates.fromAmino(object.value); + }, + toAminoMsg(message: ClientConsensusStates): ClientConsensusStatesAminoMsg { + return { + type: 'cosmos-sdk/ClientConsensusStates', + value: ClientConsensusStates.toAmino(message), + }; + }, + fromProtoMsg(message: ClientConsensusStatesProtoMsg): ClientConsensusStates { + return ClientConsensusStates.decode(message.value); + }, + toProto(message: ClientConsensusStates): Uint8Array { + return ClientConsensusStates.encode(message).finish(); + }, + toProtoMsg(message: ClientConsensusStates): ClientConsensusStatesProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.ClientConsensusStates', + value: ClientConsensusStates.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ClientConsensusStates.typeUrl, + ClientConsensusStates +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ClientConsensusStates.aminoType, + ClientConsensusStates.typeUrl +); +function createBaseHeight(): Height { + return { + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), + }; +} +export const Height = { + typeUrl: '/ibc.core.client.v1.Height', + aminoType: 'cosmos-sdk/Height', + is(o: any): o is Height { + return ( + o && + (o.$typeUrl === Height.typeUrl || + (typeof o.revisionNumber === 'bigint' && + typeof o.revisionHeight === 'bigint')) + ); + }, + isSDK(o: any): o is HeightSDKType { + return ( + o && + (o.$typeUrl === Height.typeUrl || + (typeof o.revision_number === 'bigint' && + typeof o.revision_height === 'bigint')) + ); + }, + isAmino(o: any): o is HeightAmino { + return ( + o && + (o.$typeUrl === Height.typeUrl || + (typeof o.revision_number === 'bigint' && + typeof o.revision_height === 'bigint')) + ); + }, + encode( + message: Height, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Height { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Height { + const message = createBaseHeight(); + message.revisionNumber = + object.revisionNumber !== undefined && object.revisionNumber !== null + ? BigInt(object.revisionNumber.toString()) + : BigInt(0); + message.revisionHeight = + object.revisionHeight !== undefined && object.revisionHeight !== null + ? BigInt(object.revisionHeight.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: HeightAmino): Height { + return { + revisionNumber: BigInt(object.revision_number || '0'), + revisionHeight: BigInt(object.revision_height || '0'), + }; + }, + toAmino(message: Height): HeightAmino { + const obj: any = {}; + obj.revision_number = + message.revisionNumber !== BigInt(0) + ? message.revisionNumber.toString() + : undefined; + obj.revision_height = + message.revisionHeight !== BigInt(0) + ? message.revisionHeight.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: HeightAminoMsg): Height { + return Height.fromAmino(object.value); + }, + toAminoMsg(message: Height): HeightAminoMsg { + return { + type: 'cosmos-sdk/Height', + value: Height.toAmino(message), + }; + }, + fromProtoMsg(message: HeightProtoMsg): Height { + return Height.decode(message.value); + }, + toProto(message: Height): Uint8Array { + return Height.encode(message).finish(); + }, + toProtoMsg(message: Height): HeightProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.Height', + value: Height.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Height.typeUrl, Height); +GlobalDecoderRegistry.registerAminoProtoMapping( + Height.aminoType, + Height.typeUrl +); +function createBaseParams(): Params { + return { + allowedClients: [], + }; +} +export const Params = { + typeUrl: '/ibc.core.client.v1.Params', + aminoType: 'cosmos-sdk/Params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.allowedClients) && + (!o.allowedClients.length || + typeof o.allowedClients[0] === 'string'))) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.allowed_clients) && + (!o.allowed_clients.length || + typeof o.allowed_clients[0] === 'string'))) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.allowed_clients) && + (!o.allowed_clients.length || + typeof o.allowed_clients[0] === 'string'))) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map((e) => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedClients = object.allowed_clients?.map((e) => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedClients) { + obj.allowed_clients = message.allowedClients.map((e) => e); + } else { + obj.allowed_clients = message.allowedClients; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/Params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { + $typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', + title: '', + description: '', + subjectClientId: '', + substituteClientId: '', + }; +} +export const ClientUpdateProposal = { + typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', + aminoType: 'cosmos-sdk/ClientUpdateProposal', + is(o: any): o is ClientUpdateProposal { + return ( + o && + (o.$typeUrl === ClientUpdateProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.subjectClientId === 'string' && + typeof o.substituteClientId === 'string')) + ); + }, + isSDK(o: any): o is ClientUpdateProposalSDKType { + return ( + o && + (o.$typeUrl === ClientUpdateProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.subject_client_id === 'string' && + typeof o.substitute_client_id === 'string')) + ); + }, + isAmino(o: any): o is ClientUpdateProposalAmino { + return ( + o && + (o.$typeUrl === ClientUpdateProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.subject_client_id === 'string' && + typeof o.substitute_client_id === 'string')) + ); + }, + encode( + message: ClientUpdateProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== '') { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== '') { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ClientUpdateProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.subjectClientId = object.subjectClientId ?? ''; + message.substituteClientId = object.substituteClientId ?? ''; + return message; + }, + fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if ( + object.subject_client_id !== undefined && + object.subject_client_id !== null + ) { + message.subjectClientId = object.subject_client_id; + } + if ( + object.substitute_client_id !== undefined && + object.substitute_client_id !== null + ) { + message.substituteClientId = object.substitute_client_id; + } + return message; + }, + toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + obj.subject_client_id = + message.subjectClientId === '' ? undefined : message.subjectClientId; + obj.substitute_client_id = + message.substituteClientId === '' + ? undefined + : message.substituteClientId; + return obj; + }, + fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { + return ClientUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { + return { + type: 'cosmos-sdk/ClientUpdateProposal', + value: ClientUpdateProposal.toAmino(message), + }; + }, + fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { + return ClientUpdateProposal.decode(message.value); + }, + toProto(message: ClientUpdateProposal): Uint8Array { + return ClientUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: ClientUpdateProposal): ClientUpdateProposalProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', + value: ClientUpdateProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ClientUpdateProposal.typeUrl, + ClientUpdateProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ClientUpdateProposal.aminoType, + ClientUpdateProposal.typeUrl +); +function createBaseUpgradeProposal(): UpgradeProposal { + return { + $typeUrl: '/ibc.core.client.v1.UpgradeProposal', + title: '', + description: '', + plan: Plan.fromPartial({}), + upgradedClientState: undefined, + }; +} +export const UpgradeProposal = { + typeUrl: '/ibc.core.client.v1.UpgradeProposal', + aminoType: 'cosmos-sdk/UpgradeProposal', + is(o: any): o is UpgradeProposal { + return ( + o && + (o.$typeUrl === UpgradeProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Plan.is(o.plan))) + ); + }, + isSDK(o: any): o is UpgradeProposalSDKType { + return ( + o && + (o.$typeUrl === UpgradeProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Plan.isSDK(o.plan))) + ); + }, + isAmino(o: any): o is UpgradeProposalAmino { + return ( + o && + (o.$typeUrl === UpgradeProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Plan.isAmino(o.plan))) + ); + }, + encode( + message: UpgradeProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode( + message.upgradedClientState, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.plan = + object.plan !== undefined && object.plan !== null + ? Plan.fromPartial(object.plan) + : undefined; + message.upgradedClientState = + object.upgradedClientState !== undefined && + object.upgradedClientState !== null + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, + fromAmino(object: UpgradeProposalAmino): UpgradeProposal { + const message = createBaseUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if ( + object.upgraded_client_state !== undefined && + object.upgraded_client_state !== null + ) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: UpgradeProposal): UpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState + ? Any.toAmino(message.upgradedClientState) + : undefined; + return obj; + }, + fromAminoMsg(object: UpgradeProposalAminoMsg): UpgradeProposal { + return UpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { + return { + type: 'cosmos-sdk/UpgradeProposal', + value: UpgradeProposal.toAmino(message), + }; + }, + fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { + return UpgradeProposal.decode(message.value); + }, + toProto(message: UpgradeProposal): Uint8Array { + return UpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: UpgradeProposal): UpgradeProposalProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.UpgradeProposal', + value: UpgradeProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(UpgradeProposal.typeUrl, UpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping( + UpgradeProposal.aminoType, + UpgradeProposal.typeUrl +); diff --git a/packages/cosmos/src/proto_export/ibc/lcd.ts b/packages/cosmos/src/proto_export/ibc/lcd.ts new file mode 100644 index 00000000..55a87d79 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/lcd.ts @@ -0,0 +1,153 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; +export const createLCDClient = async ({ + restEndpoint, +}: { + restEndpoint: string; +}) => { + const requestClient = new LCDClient({ + restEndpoint, + }); + return { + cosmos: { + auth: { + v1beta1: new ( + await import('../cosmos/auth/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + authz: { + v1beta1: new ( + await import('../cosmos/authz/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + bank: { + v1beta1: new ( + await import('../cosmos/bank/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + base: { + node: { + v1beta1: new ( + await import('../cosmos/base/node/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + }, + consensus: { + v1: new ( + await import('../cosmos/consensus/v1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + distribution: { + v1beta1: new ( + await import('../cosmos/distribution/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + gov: { + v1beta1: new ( + await import('../cosmos/gov/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + staking: { + v1beta1: new ( + await import('../cosmos/staking/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + tx: { + v1beta1: new ( + await import('../cosmos/tx/v1beta1/service.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + upgrade: { + v1beta1: new ( + await import('../cosmos/upgrade/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + }, + ibc: { + applications: { + fee: { + v1: new ( + await import('./applications/fee/v1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + interchain_accounts: { + controller: { + v1: new ( + await import( + './applications/interchain_accounts/controller/v1/query.lcd' + ) + ).LCDQueryClient({ + requestClient, + }), + }, + host: { + v1: new ( + await import( + './applications/interchain_accounts/host/v1/query.lcd' + ) + ).LCDQueryClient({ + requestClient, + }), + }, + }, + transfer: { + v1: new ( + await import('./applications/transfer/v1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + }, + core: { + channel: { + v1: new (await import('./core/channel/v1/query.lcd')).LCDQueryClient({ + requestClient, + }), + }, + client: { + v1: new (await import('./core/client/v1/query.lcd')).LCDQueryClient({ + requestClient, + }), + }, + connection: { + v1: new ( + await import('./core/connection/v1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + }, + lightclients: { + wasm: { + v1: new ( + await import('./lightclients/wasm/v1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + }, + }, + }; +}; diff --git a/packages/cosmos/src/proto_export/ibc/rpc.query.ts b/packages/cosmos/src/proto_export/ibc/rpc.query.ts new file mode 100644 index 00000000..11dd9051 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/rpc.query.ts @@ -0,0 +1,128 @@ +//@ts-nocheck +import { connectComet, HttpEndpoint } from '@cosmjs/tendermint-rpc'; +import { QueryClient } from '@cosmjs/stargate'; +export const createRPCQueryClient = async ({ + rpcEndpoint, +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await connectComet(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: ( + await import('../cosmos/auth/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + authz: { + v1beta1: ( + await import('../cosmos/authz/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + bank: { + v1beta1: ( + await import('../cosmos/bank/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + base: { + node: { + v1beta1: ( + await import('../cosmos/base/node/v1beta1/query.rpc.Service') + ).createRpcQueryExtension(client), + }, + }, + consensus: { + v1: ( + await import('../cosmos/consensus/v1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + distribution: { + v1beta1: ( + await import('../cosmos/distribution/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + gov: { + v1beta1: ( + await import('../cosmos/gov/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + orm: { + query: { + v1alpha1: ( + await import('../cosmos/orm/query/v1alpha1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + }, + staking: { + v1beta1: ( + await import('../cosmos/staking/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + tx: { + v1beta1: ( + await import('../cosmos/tx/v1beta1/service.rpc.Service') + ).createRpcQueryExtension(client), + }, + upgrade: { + v1beta1: ( + await import('../cosmos/upgrade/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + }, + ibc: { + applications: { + fee: { + v1: ( + await import('./applications/fee/v1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + interchain_accounts: { + controller: { + v1: ( + await import( + './applications/interchain_accounts/controller/v1/query.rpc.Query' + ) + ).createRpcQueryExtension(client), + }, + host: { + v1: ( + await import( + './applications/interchain_accounts/host/v1/query.rpc.Query' + ) + ).createRpcQueryExtension(client), + }, + }, + transfer: { + v1: ( + await import('./applications/transfer/v1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + }, + core: { + channel: { + v1: ( + await import('./core/channel/v1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + client: { + v1: ( + await import('./core/client/v1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + connection: { + v1: ( + await import('./core/connection/v1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + }, + lightclients: { + wasm: { + v1: ( + await import('./lightclients/wasm/v1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + }, + }, + }; +}; diff --git a/packages/cosmos/src/proto_export/ibc/rpc.tx.ts b/packages/cosmos/src/proto_export/ibc/rpc.tx.ts new file mode 100644 index 00000000..ba39f874 --- /dev/null +++ b/packages/cosmos/src/proto_export/ibc/rpc.tx.ts @@ -0,0 +1,100 @@ +//@ts-nocheck +import { Rpc } from '../helpers'; +export const createRPCMsgClient = async ({ rpc }: { rpc: Rpc }) => ({ + cosmos: { + auth: { + v1beta1: new ( + await import('../cosmos/auth/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + authz: { + v1beta1: new ( + await import('../cosmos/authz/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + bank: { + v1beta1: new ( + await import('../cosmos/bank/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + consensus: { + v1: new (await import('../cosmos/consensus/v1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + distribution: { + v1beta1: new ( + await import('../cosmos/distribution/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + gov: { + v1beta1: new ( + await import('../cosmos/gov/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + staking: { + v1beta1: new ( + await import('../cosmos/staking/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + upgrade: { + v1beta1: new ( + await import('../cosmos/upgrade/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + }, + ibc: { + applications: { + fee: { + v1: new ( + await import('./applications/fee/v1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + interchain_accounts: { + controller: { + v1: new ( + await import( + './applications/interchain_accounts/controller/v1/tx.rpc.msg' + ) + ).MsgClientImpl(rpc), + }, + host: { + v1: new ( + await import( + './applications/interchain_accounts/host/v1/tx.rpc.msg' + ) + ).MsgClientImpl(rpc), + }, + }, + transfer: { + v1: new ( + await import('./applications/transfer/v1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + }, + core: { + channel: { + v1: new (await import('./core/channel/v1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + client: { + v1: new (await import('./core/client/v1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + connection: { + v1: new (await import('./core/connection/v1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + }, + lightclients: { + wasm: { + v1: new ( + await import('./lightclients/wasm/v1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + }, + }, +}); diff --git a/packages/cosmos/src/proto_export/osmosis/bundle.ts b/packages/cosmos/src/proto_export/osmosis/bundle.ts new file mode 100644 index 00000000..2af15855 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/bundle.ts @@ -0,0 +1,271 @@ +//@ts-nocheck +import * as _126 from './concentratedliquidity/params'; +import * as _144 from './gamm/poolmodels/balancer/v1beta1/tx'; +import * as _145 from './gamm/poolmodels/stableswap/v1beta1/stableswap_pool'; +import * as _146 from './gamm/poolmodels/stableswap/v1beta1/tx'; +import * as _147 from './gamm/v1beta1/balancerPool'; +import * as _152 from './gamm/v1beta1/tx'; +import * as _154 from './ibchooks/genesis'; +import * as _155 from './ibchooks/params'; +import * as _156 from './ibchooks/tx'; +import * as _160 from './incentives/gauge'; +import * as _166 from './incentives/tx'; +import * as _167 from './lockup/genesis'; +import * as _168 from './lockup/lock'; +import * as _169 from './lockup/params'; +import * as _170 from './lockup/query'; +import * as _171 from './lockup/tx'; +import * as _180 from './poolmanager/v1beta1/genesis'; +import * as _182 from './poolmanager/v1beta1/module_route'; +import * as _184 from './poolmanager/v1beta1/swap_route'; +import * as _186 from './poolmanager/v1beta1/tx'; +import * as _187 from './poolmanager/v2/query'; +import * as _188 from './protorev/v1beta1/genesis'; +import * as _189 from './protorev/v1beta1/gov'; +import * as _190 from './protorev/v1beta1/params'; +import * as _191 from './protorev/v1beta1/protorev'; +import * as _192 from './protorev/v1beta1/query'; +import * as _193 from './protorev/v1beta1/tx'; +import * as _194 from './smartaccount/v1beta1/genesis'; +import * as _195 from './smartaccount/v1beta1/models'; +import * as _196 from './smartaccount/v1beta1/params'; +import * as _197 from './smartaccount/v1beta1/query'; +import * as _198 from './smartaccount/v1beta1/tx'; +import * as _203 from './superfluid/superfluid'; +import * as _204 from './superfluid/tx'; +import * as _205 from './tokenfactory/v1beta1/authorityMetadata'; +import * as _206 from './tokenfactory/v1beta1/genesis'; +import * as _207 from './tokenfactory/v1beta1/params'; +import * as _208 from './tokenfactory/v1beta1/query'; +import * as _209 from './tokenfactory/v1beta1/tx'; +import * as _213 from './txfees/v1beta1/feetoken'; +import * as _214 from './txfees/v1beta1/genesis'; +import * as _215 from './txfees/v1beta1/gov'; +import * as _216 from './txfees/v1beta1/params'; +import * as _217 from './txfees/v1beta1/query'; +import * as _218 from './txfees/v1beta1/tx'; +import * as _219 from './valsetpref/v1beta1/query'; +import * as _220 from './valsetpref/v1beta1/state'; +import * as _221 from './valsetpref/v1beta1/tx'; +import * as _330 from './concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino'; +import * as _331 from './concentratedliquidity/v1beta1/tx.amino'; +import * as _332 from './gamm/poolmodels/balancer/v1beta1/tx.amino'; +import * as _333 from './gamm/poolmodels/stableswap/v1beta1/tx.amino'; +import * as _334 from './gamm/v1beta1/tx.amino'; +import * as _335 from './ibchooks/tx.amino'; +import * as _336 from './incentives/tx.amino'; +import * as _337 from './lockup/tx.amino'; +import * as _338 from './poolmanager/v1beta1/tx.amino'; +import * as _339 from './protorev/v1beta1/tx.amino'; +import * as _340 from './smartaccount/v1beta1/tx.amino'; +import * as _341 from './superfluid/tx.amino'; +import * as _342 from './tokenfactory/v1beta1/tx.amino'; +import * as _343 from './txfees/v1beta1/tx.amino'; +import * as _344 from './valsetpref/v1beta1/tx.amino'; +import * as _345 from './concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry'; +import * as _346 from './concentratedliquidity/v1beta1/tx.registry'; +import * as _347 from './gamm/poolmodels/balancer/v1beta1/tx.registry'; +import * as _348 from './gamm/poolmodels/stableswap/v1beta1/tx.registry'; +import * as _349 from './gamm/v1beta1/tx.registry'; +import * as _350 from './ibchooks/tx.registry'; +import * as _351 from './incentives/tx.registry'; +import * as _352 from './lockup/tx.registry'; +import * as _353 from './poolmanager/v1beta1/tx.registry'; +import * as _354 from './protorev/v1beta1/tx.registry'; +import * as _355 from './smartaccount/v1beta1/tx.registry'; +import * as _356 from './superfluid/tx.registry'; +import * as _357 from './tokenfactory/v1beta1/tx.registry'; +import * as _358 from './txfees/v1beta1/tx.registry'; +import * as _359 from './valsetpref/v1beta1/tx.registry'; +import * as _368 from './lockup/query.lcd'; +import * as _372 from './poolmanager/v2/query.lcd'; +import * as _373 from './protorev/v1beta1/query.lcd'; +import * as _374 from './smartaccount/v1beta1/query.lcd'; +import * as _376 from './tokenfactory/v1beta1/query.lcd'; +import * as _378 from './txfees/v1beta1/query.lcd'; +import * as _379 from './valsetpref/v1beta1/query.lcd'; +import * as _388 from './lockup/query.rpc.Query'; +import * as _392 from './poolmanager/v2/query.rpc.Query'; +import * as _393 from './protorev/v1beta1/query.rpc.Query'; +import * as _394 from './smartaccount/v1beta1/query.rpc.Query'; +import * as _396 from './tokenfactory/v1beta1/query.rpc.Query'; +import * as _398 from './txfees/v1beta1/query.rpc.Query'; +import * as _399 from './valsetpref/v1beta1/query.rpc.Query'; +import * as _400 from './concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg'; +import * as _402 from './gamm/poolmodels/balancer/v1beta1/tx.rpc.msg'; +import * as _403 from './gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg'; +import * as _404 from './gamm/v1beta1/tx.rpc.msg'; +import * as _405 from './ibchooks/tx.rpc.msg'; +import * as _406 from './incentives/tx.rpc.msg'; +import * as _407 from './lockup/tx.rpc.msg'; +import * as _408 from './poolmanager/v1beta1/tx.rpc.msg'; +import * as _409 from './protorev/v1beta1/tx.rpc.msg'; +import * as _410 from './smartaccount/v1beta1/tx.rpc.msg'; +import * as _411 from './superfluid/tx.rpc.msg'; +import * as _412 from './tokenfactory/v1beta1/tx.rpc.msg'; +import * as _413 from './txfees/v1beta1/tx.rpc.msg'; +import * as _414 from './valsetpref/v1beta1/tx.rpc.msg'; +import * as _424 from './lcd'; +import * as _425 from './rpc.query'; +import * as _426 from './rpc.tx'; +export namespace osmosis { + export const concentratedliquidity = { + ..._126, + poolmodel: { + concentrated: { + v1beta1: { + ..._330, + ..._345, + ..._400, + }, + }, + }, + v1beta1: { + ..._331, + ..._346, + }, + }; + export namespace gamm { + export namespace poolmodels { + export namespace balancer { + export const v1beta1 = { + ..._144, + ..._332, + ..._347, + ..._402, + }; + } + } + export const v1beta1 = { + ..._147, + ..._152, + ..._334, + ..._349, + ..._404, + }; + } + export const ibchooks = { + ..._154, + ..._155, + ..._156, + ..._335, + ..._350, + ..._405, + }; + export const incentives = { + ..._160, + ..._166, + ..._336, + ..._351, + ..._406, + }; + export const lockup = { + ..._167, + ..._168, + ..._169, + ..._170, + ..._171, + ..._337, + ..._352, + ..._368, + ..._388, + ..._407, + }; + export namespace poolmanager { + export const v1beta1 = { + ..._180, + ..._184, + ..._186, + ..._338, + ..._353, + ..._408, + }; + export const v2 = { + ..._187, + ..._372, + ..._392, + }; + } + export namespace protorev { + export const v1beta1 = { + ..._188, + ..._189, + ..._190, + ..._191, + ..._192, + ..._193, + ..._339, + ..._354, + ..._373, + ..._393, + ..._409, + }; + } + export namespace smartaccount { + export const v1beta1 = { + ..._194, + ..._195, + ..._196, + ..._197, + ..._198, + ..._340, + ..._355, + ..._374, + ..._394, + ..._410, + }; + } + export const superfluid = { + ..._203, + ..._204, + ..._341, + ..._356, + ..._411, + }; + export namespace tokenfactory { + export const v1beta1 = { + ..._205, + ..._206, + ..._207, + ..._208, + ..._209, + ..._342, + ..._357, + ..._376, + ..._396, + ..._412, + }; + } + export namespace txfees { + export const v1beta1 = { + ..._213, + ..._214, + ..._215, + ..._216, + ..._217, + ..._218, + ..._343, + ..._358, + ..._378, + ..._398, + ..._413, + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._219, + ..._220, + ..._221, + ..._344, + ..._359, + ..._379, + ..._399, + ..._414, + }; + } + export const ClientFactory = { + ..._424, + ..._425, + ..._426, + }; +} diff --git a/packages/cosmos/src/proto_export/osmosis/client.ts b/packages/cosmos/src/proto_export/osmosis/client.ts new file mode 100644 index 00000000..fa74deaa --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/client.ts @@ -0,0 +1,112 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing'; +import { + defaultRegistryTypes, + AminoTypes, + SigningStargateClient, +} from '@cosmjs/stargate'; +import { HttpEndpoint } from '@cosmjs/tendermint-rpc'; + +import * as osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry from './concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry'; +import * as osmosisConcentratedliquidityV1beta1TxRegistry from './concentratedliquidity/v1beta1/tx.registry'; +import * as osmosisGammPoolmodelsBalancerV1beta1TxRegistry from './gamm/poolmodels/balancer/v1beta1/tx.registry'; +import * as osmosisGammPoolmodelsStableswapV1beta1TxRegistry from './gamm/poolmodels/stableswap/v1beta1/tx.registry'; +import * as osmosisGammV1beta1TxRegistry from './gamm/v1beta1/tx.registry'; +import * as osmosisIbchooksTxRegistry from './ibchooks/tx.registry'; +import * as osmosisIncentivesTxRegistry from './incentives/tx.registry'; +import * as osmosisLockupTxRegistry from './lockup/tx.registry'; +import * as osmosisPoolmanagerV1beta1TxRegistry from './poolmanager/v1beta1/tx.registry'; +import * as osmosisProtorevV1beta1TxRegistry from './protorev/v1beta1/tx.registry'; +import * as osmosisSmartaccountV1beta1TxRegistry from './smartaccount/v1beta1/tx.registry'; +import * as osmosisSuperfluidTxRegistry from './superfluid/tx.registry'; +import * as osmosisTokenfactoryV1beta1TxRegistry from './tokenfactory/v1beta1/tx.registry'; +import * as osmosisTxfeesV1beta1TxRegistry from './txfees/v1beta1/tx.registry'; +import * as osmosisValsetprefV1beta1TxRegistry from './valsetpref/v1beta1/tx.registry'; +import * as osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino from './concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino'; +import * as osmosisConcentratedliquidityV1beta1TxAmino from './concentratedliquidity/v1beta1/tx.amino'; +import * as osmosisGammPoolmodelsBalancerV1beta1TxAmino from './gamm/poolmodels/balancer/v1beta1/tx.amino'; +import * as osmosisGammPoolmodelsStableswapV1beta1TxAmino from './gamm/poolmodels/stableswap/v1beta1/tx.amino'; +import * as osmosisGammV1beta1TxAmino from './gamm/v1beta1/tx.amino'; +import * as osmosisIbchooksTxAmino from './ibchooks/tx.amino'; +import * as osmosisIncentivesTxAmino from './incentives/tx.amino'; +import * as osmosisLockupTxAmino from './lockup/tx.amino'; +import * as osmosisPoolmanagerV1beta1TxAmino from './poolmanager/v1beta1/tx.amino'; +import * as osmosisProtorevV1beta1TxAmino from './protorev/v1beta1/tx.amino'; +import * as osmosisSmartaccountV1beta1TxAmino from './smartaccount/v1beta1/tx.amino'; +import * as osmosisSuperfluidTxAmino from './superfluid/tx.amino'; +import * as osmosisTokenfactoryV1beta1TxAmino from './tokenfactory/v1beta1/tx.amino'; +import * as osmosisTxfeesV1beta1TxAmino from './txfees/v1beta1/tx.amino'; +import * as osmosisValsetprefV1beta1TxAmino from './valsetpref/v1beta1/tx.amino'; +export const osmosisAminoConverters = { + ...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino.AminoConverter, + ...osmosisConcentratedliquidityV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsBalancerV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsStableswapV1beta1TxAmino.AminoConverter, + ...osmosisGammV1beta1TxAmino.AminoConverter, + ...osmosisIbchooksTxAmino.AminoConverter, + ...osmosisIncentivesTxAmino.AminoConverter, + ...osmosisLockupTxAmino.AminoConverter, + ...osmosisPoolmanagerV1beta1TxAmino.AminoConverter, + ...osmosisProtorevV1beta1TxAmino.AminoConverter, + ...osmosisSmartaccountV1beta1TxAmino.AminoConverter, + ...osmosisSuperfluidTxAmino.AminoConverter, + ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter, + ...osmosisTxfeesV1beta1TxAmino.AminoConverter, + ...osmosisValsetprefV1beta1TxAmino.AminoConverter, +}; +export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry.registry, + ...osmosisConcentratedliquidityV1beta1TxRegistry.registry, + ...osmosisGammPoolmodelsBalancerV1beta1TxRegistry.registry, + ...osmosisGammPoolmodelsStableswapV1beta1TxRegistry.registry, + ...osmosisGammV1beta1TxRegistry.registry, + ...osmosisIbchooksTxRegistry.registry, + ...osmosisIncentivesTxRegistry.registry, + ...osmosisLockupTxRegistry.registry, + ...osmosisPoolmanagerV1beta1TxRegistry.registry, + ...osmosisProtorevV1beta1TxRegistry.registry, + ...osmosisSmartaccountV1beta1TxRegistry.registry, + ...osmosisSuperfluidTxRegistry.registry, + ...osmosisTokenfactoryV1beta1TxRegistry.registry, + ...osmosisTxfeesV1beta1TxRegistry.registry, + ...osmosisValsetprefV1beta1TxRegistry.registry, +]; +export const getSigningOsmosisClientOptions = ({ + defaultTypes = defaultRegistryTypes, +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...osmosisProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...osmosisAminoConverters, + }); + return { + registry, + aminoTypes, + }; +}; +export const getSigningOsmosisClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes, +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { registry, aminoTypes } = getSigningOsmosisClientOptions({ + defaultTypes, + }); + const client = await SigningStargateClient.connectWithSigner( + rpcEndpoint, + signer, + { + registry: registry as any, + aminoTypes, + } + ); + return client; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/params.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/params.ts new file mode 100644 index 00000000..42952618 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/params.ts @@ -0,0 +1,426 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { + Duration, + DurationAmino, + DurationSDKType, +} from '../../google/protobuf/duration'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +export interface Params { + /** + * authorized_tick_spacing is an array of uint64s that represents the tick + * spacing values concentrated-liquidity pools can be created with. For + * example, an authorized_tick_spacing of [1, 10, 30] allows for pools + * to be created with tick spacing of 1, 10, or 30. + */ + authorizedTickSpacing: bigint[]; + authorizedSpreadFactors: string[]; + /** + * balancer_shares_reward_discount is the rate by which incentives flowing + * from CL to Balancer pools will be discounted to encourage LPs to migrate. + * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full + * range CL LPs. + * This field can range from (0,1]. If set to 1, it indicates that all + * incentives stay at cl pool. + */ + balancerSharesRewardDiscount: string; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a pool. We limit the quote assets to a small set for + * the purposes of having convenient price increments stemming from tick to + * price conversion. These increments are in a human readable magnitude only + * for token1 as a quote. For limit orders in the future, this will be a + * desirable property in terms of UX as to allow users to set limit orders at + * prices in terms of token1 (quote asset) that are easy to reason about. + */ + authorizedQuoteDenoms: string[]; + authorizedUptimes: Duration[]; + /** + * is_permissionless_pool_creation_enabled is a boolean that determines if + * concentrated liquidity pools can be created via message. At launch, + * we consider allowing only governance to create pools, and then later + * allowing permissionless pool creation by switching this flag to true + * with a governance proposal. + */ + isPermissionlessPoolCreationEnabled: boolean; + /** + * unrestricted_pool_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless supercharged pool + * creation, like pool_creation_enabled, restricted quote assets, no + * double creation of pools, etc. + */ + unrestrictedPoolCreatorWhitelist: string[]; + hookGasLimit: bigint; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.Params'; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * authorized_tick_spacing is an array of uint64s that represents the tick + * spacing values concentrated-liquidity pools can be created with. For + * example, an authorized_tick_spacing of [1, 10, 30] allows for pools + * to be created with tick spacing of 1, 10, or 30. + */ + authorized_tick_spacing?: string[]; + authorized_spread_factors?: string[]; + /** + * balancer_shares_reward_discount is the rate by which incentives flowing + * from CL to Balancer pools will be discounted to encourage LPs to migrate. + * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full + * range CL LPs. + * This field can range from (0,1]. If set to 1, it indicates that all + * incentives stay at cl pool. + */ + balancer_shares_reward_discount?: string; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a pool. We limit the quote assets to a small set for + * the purposes of having convenient price increments stemming from tick to + * price conversion. These increments are in a human readable magnitude only + * for token1 as a quote. For limit orders in the future, this will be a + * desirable property in terms of UX as to allow users to set limit orders at + * prices in terms of token1 (quote asset) that are easy to reason about. + */ + authorized_quote_denoms?: string[]; + authorized_uptimes?: DurationAmino[]; + /** + * is_permissionless_pool_creation_enabled is a boolean that determines if + * concentrated liquidity pools can be created via message. At launch, + * we consider allowing only governance to create pools, and then later + * allowing permissionless pool creation by switching this flag to true + * with a governance proposal. + */ + is_permissionless_pool_creation_enabled?: boolean; + /** + * unrestricted_pool_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless supercharged pool + * creation, like pool_creation_enabled, restricted quote assets, no + * double creation of pools, etc. + */ + unrestricted_pool_creator_whitelist?: string[]; + hook_gas_limit?: string; +} +export interface ParamsAminoMsg { + type: 'osmosis/concentratedliquidity/params'; + value: ParamsAmino; +} +export interface ParamsSDKType { + authorized_tick_spacing: bigint[]; + authorized_spread_factors: string[]; + balancer_shares_reward_discount: string; + authorized_quote_denoms: string[]; + authorized_uptimes: DurationSDKType[]; + is_permissionless_pool_creation_enabled: boolean; + unrestricted_pool_creator_whitelist: string[]; + hook_gas_limit: bigint; +} +function createBaseParams(): Params { + return { + authorizedTickSpacing: [], + authorizedSpreadFactors: [], + balancerSharesRewardDiscount: '', + authorizedQuoteDenoms: [], + authorizedUptimes: [], + isPermissionlessPoolCreationEnabled: false, + unrestrictedPoolCreatorWhitelist: [], + hookGasLimit: BigInt(0), + }; +} +export const Params = { + typeUrl: '/osmosis.concentratedliquidity.Params', + aminoType: 'osmosis/concentratedliquidity/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.authorizedTickSpacing) && + (!o.authorizedTickSpacing.length || + typeof o.authorizedTickSpacing[0] === 'bigint') && + Array.isArray(o.authorizedSpreadFactors) && + (!o.authorizedSpreadFactors.length || + typeof o.authorizedSpreadFactors[0] === 'string') && + typeof o.balancerSharesRewardDiscount === 'string' && + Array.isArray(o.authorizedQuoteDenoms) && + (!o.authorizedQuoteDenoms.length || + typeof o.authorizedQuoteDenoms[0] === 'string') && + Array.isArray(o.authorizedUptimes) && + (!o.authorizedUptimes.length || + Duration.is(o.authorizedUptimes[0])) && + typeof o.isPermissionlessPoolCreationEnabled === 'boolean' && + Array.isArray(o.unrestrictedPoolCreatorWhitelist) && + (!o.unrestrictedPoolCreatorWhitelist.length || + typeof o.unrestrictedPoolCreatorWhitelist[0] === 'string') && + typeof o.hookGasLimit === 'bigint')) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.authorized_tick_spacing) && + (!o.authorized_tick_spacing.length || + typeof o.authorized_tick_spacing[0] === 'bigint') && + Array.isArray(o.authorized_spread_factors) && + (!o.authorized_spread_factors.length || + typeof o.authorized_spread_factors[0] === 'string') && + typeof o.balancer_shares_reward_discount === 'string' && + Array.isArray(o.authorized_quote_denoms) && + (!o.authorized_quote_denoms.length || + typeof o.authorized_quote_denoms[0] === 'string') && + Array.isArray(o.authorized_uptimes) && + (!o.authorized_uptimes.length || + Duration.isSDK(o.authorized_uptimes[0])) && + typeof o.is_permissionless_pool_creation_enabled === 'boolean' && + Array.isArray(o.unrestricted_pool_creator_whitelist) && + (!o.unrestricted_pool_creator_whitelist.length || + typeof o.unrestricted_pool_creator_whitelist[0] === 'string') && + typeof o.hook_gas_limit === 'bigint')) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.authorized_tick_spacing) && + (!o.authorized_tick_spacing.length || + typeof o.authorized_tick_spacing[0] === 'bigint') && + Array.isArray(o.authorized_spread_factors) && + (!o.authorized_spread_factors.length || + typeof o.authorized_spread_factors[0] === 'string') && + typeof o.balancer_shares_reward_discount === 'string' && + Array.isArray(o.authorized_quote_denoms) && + (!o.authorized_quote_denoms.length || + typeof o.authorized_quote_denoms[0] === 'string') && + Array.isArray(o.authorized_uptimes) && + (!o.authorized_uptimes.length || + Duration.isAmino(o.authorized_uptimes[0])) && + typeof o.is_permissionless_pool_creation_enabled === 'boolean' && + Array.isArray(o.unrestricted_pool_creator_whitelist) && + (!o.unrestricted_pool_creator_whitelist.length || + typeof o.unrestricted_pool_creator_whitelist[0] === 'string') && + typeof o.hook_gas_limit === 'bigint')) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.authorizedTickSpacing) { + writer.uint64(v); + } + writer.ldelim(); + for (const v of message.authorizedSpreadFactors) { + writer.uint32(18).string(Decimal.fromUserInput(v!, 18).atomics); + } + if (message.balancerSharesRewardDiscount !== '') { + writer + .uint32(26) + .string( + Decimal.fromUserInput(message.balancerSharesRewardDiscount, 18) + .atomics + ); + } + for (const v of message.authorizedQuoteDenoms) { + writer.uint32(34).string(v!); + } + for (const v of message.authorizedUptimes) { + Duration.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.isPermissionlessPoolCreationEnabled === true) { + writer.uint32(48).bool(message.isPermissionlessPoolCreationEnabled); + } + for (const v of message.unrestrictedPoolCreatorWhitelist) { + writer.uint32(58).string(v!); + } + if (message.hookGasLimit !== BigInt(0)) { + writer.uint32(64).uint64(message.hookGasLimit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.authorizedTickSpacing.push(reader.uint64()); + } + } else { + message.authorizedTickSpacing.push(reader.uint64()); + } + break; + case 2: + message.authorizedSpreadFactors.push( + Decimal.fromAtomics(reader.string(), 18).toString() + ); + break; + case 3: + message.balancerSharesRewardDiscount = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 4: + message.authorizedQuoteDenoms.push(reader.string()); + break; + case 5: + message.authorizedUptimes.push( + Duration.decode(reader, reader.uint32()) + ); + break; + case 6: + message.isPermissionlessPoolCreationEnabled = reader.bool(); + break; + case 7: + message.unrestrictedPoolCreatorWhitelist.push(reader.string()); + break; + case 8: + message.hookGasLimit = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.authorizedTickSpacing = + object.authorizedTickSpacing?.map((e) => BigInt(e.toString())) || []; + message.authorizedSpreadFactors = + object.authorizedSpreadFactors?.map((e) => e) || []; + message.balancerSharesRewardDiscount = + object.balancerSharesRewardDiscount ?? ''; + message.authorizedQuoteDenoms = + object.authorizedQuoteDenoms?.map((e) => e) || []; + message.authorizedUptimes = + object.authorizedUptimes?.map((e) => Duration.fromPartial(e)) || []; + message.isPermissionlessPoolCreationEnabled = + object.isPermissionlessPoolCreationEnabled ?? false; + message.unrestrictedPoolCreatorWhitelist = + object.unrestrictedPoolCreatorWhitelist?.map((e) => e) || []; + message.hookGasLimit = + object.hookGasLimit !== undefined && object.hookGasLimit !== null + ? BigInt(object.hookGasLimit.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.authorizedTickSpacing = + object.authorized_tick_spacing?.map((e) => BigInt(e)) || []; + message.authorizedSpreadFactors = + object.authorized_spread_factors?.map((e) => e) || []; + if ( + object.balancer_shares_reward_discount !== undefined && + object.balancer_shares_reward_discount !== null + ) { + message.balancerSharesRewardDiscount = + object.balancer_shares_reward_discount; + } + message.authorizedQuoteDenoms = + object.authorized_quote_denoms?.map((e) => e) || []; + message.authorizedUptimes = + object.authorized_uptimes?.map((e) => Duration.fromAmino(e)) || []; + if ( + object.is_permissionless_pool_creation_enabled !== undefined && + object.is_permissionless_pool_creation_enabled !== null + ) { + message.isPermissionlessPoolCreationEnabled = + object.is_permissionless_pool_creation_enabled; + } + message.unrestrictedPoolCreatorWhitelist = + object.unrestricted_pool_creator_whitelist?.map((e) => e) || []; + if (object.hook_gas_limit !== undefined && object.hook_gas_limit !== null) { + message.hookGasLimit = BigInt(object.hook_gas_limit); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.authorizedTickSpacing) { + obj.authorized_tick_spacing = message.authorizedTickSpacing.map((e) => + e.toString() + ); + } else { + obj.authorized_tick_spacing = message.authorizedTickSpacing; + } + if (message.authorizedSpreadFactors) { + obj.authorized_spread_factors = message.authorizedSpreadFactors.map( + (e) => e + ); + } else { + obj.authorized_spread_factors = message.authorizedSpreadFactors; + } + obj.balancer_shares_reward_discount = + message.balancerSharesRewardDiscount === '' + ? undefined + : message.balancerSharesRewardDiscount; + if (message.authorizedQuoteDenoms) { + obj.authorized_quote_denoms = message.authorizedQuoteDenoms.map((e) => e); + } else { + obj.authorized_quote_denoms = message.authorizedQuoteDenoms; + } + if (message.authorizedUptimes) { + obj.authorized_uptimes = message.authorizedUptimes.map((e) => + e ? Duration.toAmino(e) : undefined + ); + } else { + obj.authorized_uptimes = message.authorizedUptimes; + } + obj.is_permissionless_pool_creation_enabled = + message.isPermissionlessPoolCreationEnabled === false + ? undefined + : message.isPermissionlessPoolCreationEnabled; + if (message.unrestrictedPoolCreatorWhitelist) { + obj.unrestricted_pool_creator_whitelist = + message.unrestrictedPoolCreatorWhitelist.map((e) => e); + } else { + obj.unrestricted_pool_creator_whitelist = + message.unrestrictedPoolCreatorWhitelist; + } + obj.hook_gas_limit = + message.hookGasLimit !== BigInt(0) + ? message.hookGasLimit.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/concentratedliquidity/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts new file mode 100644 index 00000000..cb1b2043 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts @@ -0,0 +1,11 @@ +//@ts-nocheck +import { MsgCreateConcentratedPool } from './tx'; +export const AminoConverter = { + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool': + { + aminoType: + 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool', + toAmino: MsgCreateConcentratedPool.toAmino, + fromAmino: MsgCreateConcentratedPool.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts new file mode 100644 index 00000000..8f2e1fc0 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { MsgCreateConcentratedPool } from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + MsgCreateConcentratedPool, + ], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createConcentratedPool(value: MsgCreateConcentratedPool) { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value: MsgCreateConcentratedPool.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createConcentratedPool(value: MsgCreateConcentratedPool) { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value, + }; + }, + }, + fromPartial: { + createConcentratedPool(value: MsgCreateConcentratedPool) { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value: MsgCreateConcentratedPool.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..f0917e0c --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,36 @@ +//@ts-nocheck +import { Rpc } from '../../../../../helpers'; +import { BinaryReader } from '../../../../../binary'; + +import { + MsgCreateConcentratedPool, + MsgCreateConcentratedPoolResponse, +} from './tx'; +export interface Msg { + createConcentratedPool( + request: MsgCreateConcentratedPool + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createConcentratedPool = this.createConcentratedPool.bind(this); + } + createConcentratedPool( + request: MsgCreateConcentratedPool + ): Promise { + const data = MsgCreateConcentratedPool.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.Msg', + 'CreateConcentratedPool', + data + ); + return promise.then((data) => + MsgCreateConcentratedPoolResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts new file mode 100644 index 00000000..49343261 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts @@ -0,0 +1,375 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { BinaryReader, BinaryWriter } from '../../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../../registry'; +/** ===================== MsgCreateConcentratedPool */ +export interface MsgCreateConcentratedPool { + sender: string; + denom0: string; + denom1: string; + tickSpacing: bigint; + spreadFactor: string; +} +export interface MsgCreateConcentratedPoolProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool'; + value: Uint8Array; +} +/** ===================== MsgCreateConcentratedPool */ +export interface MsgCreateConcentratedPoolAmino { + sender?: string; + denom0?: string; + denom1?: string; + tick_spacing?: string; + spread_factor?: string; +} +export interface MsgCreateConcentratedPoolAminoMsg { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool'; + value: MsgCreateConcentratedPoolAmino; +} +/** ===================== MsgCreateConcentratedPool */ +export interface MsgCreateConcentratedPoolSDKType { + sender: string; + denom0: string; + denom1: string; + tick_spacing: bigint; + spread_factor: string; +} +/** Returns a unique poolID to identify the pool with. */ +export interface MsgCreateConcentratedPoolResponse { + poolId: bigint; +} +export interface MsgCreateConcentratedPoolResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse'; + value: Uint8Array; +} +/** Returns a unique poolID to identify the pool with. */ +export interface MsgCreateConcentratedPoolResponseAmino { + pool_id?: string; +} +export interface MsgCreateConcentratedPoolResponseAminoMsg { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response'; + value: MsgCreateConcentratedPoolResponseAmino; +} +/** Returns a unique poolID to identify the pool with. */ +export interface MsgCreateConcentratedPoolResponseSDKType { + pool_id: bigint; +} +function createBaseMsgCreateConcentratedPool(): MsgCreateConcentratedPool { + return { + sender: '', + denom0: '', + denom1: '', + tickSpacing: BigInt(0), + spreadFactor: '', + }; +} +export const MsgCreateConcentratedPool = { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + aminoType: + 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool', + is(o: any): o is MsgCreateConcentratedPool { + return ( + o && + (o.$typeUrl === MsgCreateConcentratedPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom0 === 'string' && + typeof o.denom1 === 'string' && + typeof o.tickSpacing === 'bigint' && + typeof o.spreadFactor === 'string')) + ); + }, + isSDK(o: any): o is MsgCreateConcentratedPoolSDKType { + return ( + o && + (o.$typeUrl === MsgCreateConcentratedPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom0 === 'string' && + typeof o.denom1 === 'string' && + typeof o.tick_spacing === 'bigint' && + typeof o.spread_factor === 'string')) + ); + }, + isAmino(o: any): o is MsgCreateConcentratedPoolAmino { + return ( + o && + (o.$typeUrl === MsgCreateConcentratedPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom0 === 'string' && + typeof o.denom1 === 'string' && + typeof o.tick_spacing === 'bigint' && + typeof o.spread_factor === 'string')) + ); + }, + encode( + message: MsgCreateConcentratedPool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.denom0 !== '') { + writer.uint32(18).string(message.denom0); + } + if (message.denom1 !== '') { + writer.uint32(26).string(message.denom1); + } + if (message.tickSpacing !== BigInt(0)) { + writer.uint32(32).uint64(message.tickSpacing); + } + if (message.spreadFactor !== '') { + writer + .uint32(42) + .string(Decimal.fromUserInput(message.spreadFactor, 18).atomics); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateConcentratedPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateConcentratedPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom0 = reader.string(); + break; + case 3: + message.denom1 = reader.string(); + break; + case 4: + message.tickSpacing = reader.uint64(); + break; + case 5: + message.spreadFactor = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreateConcentratedPool { + const message = createBaseMsgCreateConcentratedPool(); + message.sender = object.sender ?? ''; + message.denom0 = object.denom0 ?? ''; + message.denom1 = object.denom1 ?? ''; + message.tickSpacing = + object.tickSpacing !== undefined && object.tickSpacing !== null + ? BigInt(object.tickSpacing.toString()) + : BigInt(0); + message.spreadFactor = object.spreadFactor ?? ''; + return message; + }, + fromAmino(object: MsgCreateConcentratedPoolAmino): MsgCreateConcentratedPool { + const message = createBaseMsgCreateConcentratedPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + return message; + }, + toAmino(message: MsgCreateConcentratedPool): MsgCreateConcentratedPoolAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.denom0 = message.denom0 === '' ? undefined : message.denom0; + obj.denom1 = message.denom1 === '' ? undefined : message.denom1; + obj.tick_spacing = + message.tickSpacing !== BigInt(0) + ? message.tickSpacing.toString() + : undefined; + obj.spread_factor = + message.spreadFactor === '' ? undefined : message.spreadFactor; + return obj; + }, + fromAminoMsg( + object: MsgCreateConcentratedPoolAminoMsg + ): MsgCreateConcentratedPool { + return MsgCreateConcentratedPool.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCreateConcentratedPool + ): MsgCreateConcentratedPoolAminoMsg { + return { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool', + value: MsgCreateConcentratedPool.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateConcentratedPoolProtoMsg + ): MsgCreateConcentratedPool { + return MsgCreateConcentratedPool.decode(message.value); + }, + toProto(message: MsgCreateConcentratedPool): Uint8Array { + return MsgCreateConcentratedPool.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreateConcentratedPool + ): MsgCreateConcentratedPoolProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value: MsgCreateConcentratedPool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateConcentratedPool.typeUrl, + MsgCreateConcentratedPool +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateConcentratedPool.aminoType, + MsgCreateConcentratedPool.typeUrl +); +function createBaseMsgCreateConcentratedPoolResponse(): MsgCreateConcentratedPoolResponse { + return { + poolId: BigInt(0), + }; +} +export const MsgCreateConcentratedPoolResponse = { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse', + aminoType: + 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response', + is(o: any): o is MsgCreateConcentratedPoolResponse { + return ( + o && + (o.$typeUrl === MsgCreateConcentratedPoolResponse.typeUrl || + typeof o.poolId === 'bigint') + ); + }, + isSDK(o: any): o is MsgCreateConcentratedPoolResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCreateConcentratedPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + isAmino(o: any): o is MsgCreateConcentratedPoolResponseAmino { + return ( + o && + (o.$typeUrl === MsgCreateConcentratedPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + encode( + message: MsgCreateConcentratedPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateConcentratedPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateConcentratedPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreateConcentratedPoolResponse { + const message = createBaseMsgCreateConcentratedPoolResponse(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgCreateConcentratedPoolResponseAmino + ): MsgCreateConcentratedPoolResponse { + const message = createBaseMsgCreateConcentratedPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino( + message: MsgCreateConcentratedPoolResponse + ): MsgCreateConcentratedPoolResponseAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgCreateConcentratedPoolResponseAminoMsg + ): MsgCreateConcentratedPoolResponse { + return MsgCreateConcentratedPoolResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCreateConcentratedPoolResponse + ): MsgCreateConcentratedPoolResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response', + value: MsgCreateConcentratedPoolResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateConcentratedPoolResponseProtoMsg + ): MsgCreateConcentratedPoolResponse { + return MsgCreateConcentratedPoolResponse.decode(message.value); + }, + toProto(message: MsgCreateConcentratedPoolResponse): Uint8Array { + return MsgCreateConcentratedPoolResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreateConcentratedPoolResponse + ): MsgCreateConcentratedPoolResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse', + value: MsgCreateConcentratedPoolResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateConcentratedPoolResponse.typeUrl, + MsgCreateConcentratedPoolResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateConcentratedPoolResponse.aminoType, + MsgCreateConcentratedPoolResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.amino.ts new file mode 100644 index 00000000..b1bfedd7 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.amino.ts @@ -0,0 +1,41 @@ +//@ts-nocheck +import { + MsgCreatePosition, + MsgWithdrawPosition, + MsgAddToPosition, + MsgCollectSpreadRewards, + MsgCollectIncentives, + MsgTransferPositions, +} from './tx'; +export const AminoConverter = { + '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition': { + aminoType: 'osmosis/cl-create-position', + toAmino: MsgCreatePosition.toAmino, + fromAmino: MsgCreatePosition.fromAmino, + }, + '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition': { + aminoType: 'osmosis/cl-withdraw-position', + toAmino: MsgWithdrawPosition.toAmino, + fromAmino: MsgWithdrawPosition.fromAmino, + }, + '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition': { + aminoType: 'osmosis/cl-add-to-position', + toAmino: MsgAddToPosition.toAmino, + fromAmino: MsgAddToPosition.fromAmino, + }, + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards': { + aminoType: 'osmosis/cl-col-sp-rewards', + toAmino: MsgCollectSpreadRewards.toAmino, + fromAmino: MsgCollectSpreadRewards.fromAmino, + }, + '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives': { + aminoType: 'osmosis/cl-collect-incentives', + toAmino: MsgCollectIncentives.toAmino, + fromAmino: MsgCollectIncentives.fromAmino, + }, + '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions': { + aminoType: 'osmosis/cl-transfer-positions', + toAmino: MsgTransferPositions.toAmino, + fromAmino: MsgTransferPositions.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.registry.ts new file mode 100644 index 00000000..7c576723 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.registry.ts @@ -0,0 +1,158 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgCreatePosition, + MsgWithdrawPosition, + MsgAddToPosition, + MsgCollectSpreadRewards, + MsgCollectIncentives, + MsgTransferPositions, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + MsgCreatePosition, + ], + [ + '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + MsgWithdrawPosition, + ], + ['/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', MsgAddToPosition], + [ + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + MsgCollectSpreadRewards, + ], + [ + '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + MsgCollectIncentives, + ], + [ + '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + MsgTransferPositions, + ], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createPosition(value: MsgCreatePosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value: MsgCreatePosition.encode(value).finish(), + }; + }, + withdrawPosition(value: MsgWithdrawPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value: MsgWithdrawPosition.encode(value).finish(), + }; + }, + addToPosition(value: MsgAddToPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value: MsgAddToPosition.encode(value).finish(), + }; + }, + collectSpreadRewards(value: MsgCollectSpreadRewards) { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value: MsgCollectSpreadRewards.encode(value).finish(), + }; + }, + collectIncentives(value: MsgCollectIncentives) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + value: MsgCollectIncentives.encode(value).finish(), + }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + value: MsgTransferPositions.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createPosition(value: MsgCreatePosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value, + }; + }, + withdrawPosition(value: MsgWithdrawPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value, + }; + }, + addToPosition(value: MsgAddToPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value, + }; + }, + collectSpreadRewards(value: MsgCollectSpreadRewards) { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value, + }; + }, + collectIncentives(value: MsgCollectIncentives) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + value, + }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + value, + }; + }, + }, + fromPartial: { + createPosition(value: MsgCreatePosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value: MsgCreatePosition.fromPartial(value), + }; + }, + withdrawPosition(value: MsgWithdrawPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value: MsgWithdrawPosition.fromPartial(value), + }; + }, + addToPosition(value: MsgAddToPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value: MsgAddToPosition.fromPartial(value), + }; + }, + collectSpreadRewards(value: MsgCollectSpreadRewards) { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value: MsgCollectSpreadRewards.fromPartial(value), + }; + }, + collectIncentives(value: MsgCollectIncentives) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + value: MsgCollectIncentives.fromPartial(value), + }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + value: MsgTransferPositions.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.ts new file mode 100644 index 00000000..68349c4c --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/concentratedliquidity/v1beta1/tx.ts @@ -0,0 +1,2574 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** ===================== MsgCreatePosition */ +export interface MsgCreatePosition { + poolId: bigint; + sender: string; + lowerTick: bigint; + upperTick: bigint; + /** + * tokens_provided is the amount of tokens provided for the position. + * It must at a minimum be of length 1 (for a single sided position) + * and at a maximum be of length 2 (for a position that straddles the current + * tick). + */ + tokensProvided: Coin[]; + tokenMinAmount0: string; + tokenMinAmount1: string; +} +export interface MsgCreatePositionProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition'; + value: Uint8Array; +} +/** ===================== MsgCreatePosition */ +export interface MsgCreatePositionAmino { + pool_id?: string; + sender?: string; + lower_tick?: string; + upper_tick?: string; + /** + * tokens_provided is the amount of tokens provided for the position. + * It must at a minimum be of length 1 (for a single sided position) + * and at a maximum be of length 2 (for a position that straddles the current + * tick). + */ + tokens_provided?: CoinAmino[]; + token_min_amount0?: string; + token_min_amount1?: string; +} +export interface MsgCreatePositionAminoMsg { + type: 'osmosis/cl-create-position'; + value: MsgCreatePositionAmino; +} +/** ===================== MsgCreatePosition */ +export interface MsgCreatePositionSDKType { + pool_id: bigint; + sender: string; + lower_tick: bigint; + upper_tick: bigint; + tokens_provided: CoinSDKType[]; + token_min_amount0: string; + token_min_amount1: string; +} +export interface MsgCreatePositionResponse { + positionId: bigint; + amount0: string; + amount1: string; + liquidityCreated: string; + /** + * the lower and upper tick are in the response because there are + * instances in which multiple ticks represent the same price, so + * we may move their provided tick to the canonical tick that represents + * the same price. + */ + lowerTick: bigint; + upperTick: bigint; +} +export interface MsgCreatePositionResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePositionResponse'; + value: Uint8Array; +} +export interface MsgCreatePositionResponseAmino { + position_id?: string; + amount0?: string; + amount1?: string; + liquidity_created?: string; + /** + * the lower and upper tick are in the response because there are + * instances in which multiple ticks represent the same price, so + * we may move their provided tick to the canonical tick that represents + * the same price. + */ + lower_tick?: string; + upper_tick?: string; +} +export interface MsgCreatePositionResponseAminoMsg { + type: 'osmosis/concentratedliquidity/create-position-response'; + value: MsgCreatePositionResponseAmino; +} +export interface MsgCreatePositionResponseSDKType { + position_id: bigint; + amount0: string; + amount1: string; + liquidity_created: string; + lower_tick: bigint; + upper_tick: bigint; +} +/** ===================== MsgAddToPosition */ +export interface MsgAddToPosition { + positionId: bigint; + sender: string; + /** amount0 represents the amount of token0 willing to put in. */ + amount0: string; + /** amount1 represents the amount of token1 willing to put in. */ + amount1: string; + /** + * token_min_amount0 represents the minimum amount of token0 desired from the + * new position being created. Note that this field indicates the min amount0 + * corresponding to the liquidity that is being added, not the total + * liquidity of the position. + */ + tokenMinAmount0: string; + /** + * token_min_amount1 represents the minimum amount of token1 desired from the + * new position being created. Note that this field indicates the min amount1 + * corresponding to the liquidity that is being added, not the total + * liquidity of the position. + */ + tokenMinAmount1: string; +} +export interface MsgAddToPositionProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition'; + value: Uint8Array; +} +/** ===================== MsgAddToPosition */ +export interface MsgAddToPositionAmino { + position_id?: string; + sender?: string; + /** amount0 represents the amount of token0 willing to put in. */ + amount0?: string; + /** amount1 represents the amount of token1 willing to put in. */ + amount1?: string; + /** + * token_min_amount0 represents the minimum amount of token0 desired from the + * new position being created. Note that this field indicates the min amount0 + * corresponding to the liquidity that is being added, not the total + * liquidity of the position. + */ + token_min_amount0?: string; + /** + * token_min_amount1 represents the minimum amount of token1 desired from the + * new position being created. Note that this field indicates the min amount1 + * corresponding to the liquidity that is being added, not the total + * liquidity of the position. + */ + token_min_amount1?: string; +} +export interface MsgAddToPositionAminoMsg { + type: 'osmosis/cl-add-to-position'; + value: MsgAddToPositionAmino; +} +/** ===================== MsgAddToPosition */ +export interface MsgAddToPositionSDKType { + position_id: bigint; + sender: string; + amount0: string; + amount1: string; + token_min_amount0: string; + token_min_amount1: string; +} +export interface MsgAddToPositionResponse { + positionId: bigint; + amount0: string; + amount1: string; +} +export interface MsgAddToPositionResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPositionResponse'; + value: Uint8Array; +} +export interface MsgAddToPositionResponseAmino { + position_id?: string; + amount0?: string; + amount1?: string; +} +export interface MsgAddToPositionResponseAminoMsg { + type: 'osmosis/concentratedliquidity/add-to-position-response'; + value: MsgAddToPositionResponseAmino; +} +export interface MsgAddToPositionResponseSDKType { + position_id: bigint; + amount0: string; + amount1: string; +} +/** ===================== MsgWithdrawPosition */ +export interface MsgWithdrawPosition { + positionId: bigint; + sender: string; + liquidityAmount: string; +} +export interface MsgWithdrawPositionProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition'; + value: Uint8Array; +} +/** ===================== MsgWithdrawPosition */ +export interface MsgWithdrawPositionAmino { + position_id?: string; + sender?: string; + liquidity_amount?: string; +} +export interface MsgWithdrawPositionAminoMsg { + type: 'osmosis/cl-withdraw-position'; + value: MsgWithdrawPositionAmino; +} +/** ===================== MsgWithdrawPosition */ +export interface MsgWithdrawPositionSDKType { + position_id: bigint; + sender: string; + liquidity_amount: string; +} +export interface MsgWithdrawPositionResponse { + amount0: string; + amount1: string; +} +export interface MsgWithdrawPositionResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPositionResponse'; + value: Uint8Array; +} +export interface MsgWithdrawPositionResponseAmino { + amount0?: string; + amount1?: string; +} +export interface MsgWithdrawPositionResponseAminoMsg { + type: 'osmosis/concentratedliquidity/withdraw-position-response'; + value: MsgWithdrawPositionResponseAmino; +} +export interface MsgWithdrawPositionResponseSDKType { + amount0: string; + amount1: string; +} +/** ===================== MsgCollectSpreadRewards */ +export interface MsgCollectSpreadRewards { + positionIds: bigint[]; + sender: string; +} +export interface MsgCollectSpreadRewardsProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards'; + value: Uint8Array; +} +/** ===================== MsgCollectSpreadRewards */ +export interface MsgCollectSpreadRewardsAmino { + position_ids?: string[]; + sender?: string; +} +export interface MsgCollectSpreadRewardsAminoMsg { + type: 'osmosis/cl-col-sp-rewards'; + value: MsgCollectSpreadRewardsAmino; +} +/** ===================== MsgCollectSpreadRewards */ +export interface MsgCollectSpreadRewardsSDKType { + position_ids: bigint[]; + sender: string; +} +export interface MsgCollectSpreadRewardsResponse { + collectedSpreadRewards: Coin[]; +} +export interface MsgCollectSpreadRewardsResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse'; + value: Uint8Array; +} +export interface MsgCollectSpreadRewardsResponseAmino { + collected_spread_rewards?: CoinAmino[]; +} +export interface MsgCollectSpreadRewardsResponseAminoMsg { + type: 'osmosis/concentratedliquidity/collect-spread-rewards-response'; + value: MsgCollectSpreadRewardsResponseAmino; +} +export interface MsgCollectSpreadRewardsResponseSDKType { + collected_spread_rewards: CoinSDKType[]; +} +/** ===================== MsgCollectIncentives */ +export interface MsgCollectIncentives { + positionIds: bigint[]; + sender: string; +} +export interface MsgCollectIncentivesProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives'; + value: Uint8Array; +} +/** ===================== MsgCollectIncentives */ +export interface MsgCollectIncentivesAmino { + position_ids?: string[]; + sender?: string; +} +export interface MsgCollectIncentivesAminoMsg { + type: 'osmosis/cl-collect-incentives'; + value: MsgCollectIncentivesAmino; +} +/** ===================== MsgCollectIncentives */ +export interface MsgCollectIncentivesSDKType { + position_ids: bigint[]; + sender: string; +} +export interface MsgCollectIncentivesResponse { + collectedIncentives: Coin[]; + forfeitedIncentives: Coin[]; +} +export interface MsgCollectIncentivesResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse'; + value: Uint8Array; +} +export interface MsgCollectIncentivesResponseAmino { + collected_incentives?: CoinAmino[]; + forfeited_incentives?: CoinAmino[]; +} +export interface MsgCollectIncentivesResponseAminoMsg { + type: 'osmosis/concentratedliquidity/collect-incentives-response'; + value: MsgCollectIncentivesResponseAmino; +} +export interface MsgCollectIncentivesResponseSDKType { + collected_incentives: CoinSDKType[]; + forfeited_incentives: CoinSDKType[]; +} +/** ===================== MsgFungifyChargedPositions */ +export interface MsgFungifyChargedPositions { + positionIds: bigint[]; + sender: string; +} +export interface MsgFungifyChargedPositionsProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions'; + value: Uint8Array; +} +/** ===================== MsgFungifyChargedPositions */ +export interface MsgFungifyChargedPositionsAmino { + position_ids?: string[]; + sender?: string; +} +export interface MsgFungifyChargedPositionsAminoMsg { + type: 'osmosis/cl-fungify-charged-positions'; + value: MsgFungifyChargedPositionsAmino; +} +/** ===================== MsgFungifyChargedPositions */ +export interface MsgFungifyChargedPositionsSDKType { + position_ids: bigint[]; + sender: string; +} +export interface MsgFungifyChargedPositionsResponse { + newPositionId: bigint; +} +export interface MsgFungifyChargedPositionsResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositionsResponse'; + value: Uint8Array; +} +export interface MsgFungifyChargedPositionsResponseAmino { + new_position_id?: string; +} +export interface MsgFungifyChargedPositionsResponseAminoMsg { + type: 'osmosis/concentratedliquidity/fungify-charged-positions-response'; + value: MsgFungifyChargedPositionsResponseAmino; +} +export interface MsgFungifyChargedPositionsResponseSDKType { + new_position_id: bigint; +} +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositions { + positionIds: bigint[]; + sender: string; + newOwner: string; +} +export interface MsgTransferPositionsProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions'; + value: Uint8Array; +} +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositionsAmino { + position_ids?: string[]; + sender?: string; + new_owner?: string; +} +export interface MsgTransferPositionsAminoMsg { + type: 'osmosis/cl-transfer-positions'; + value: MsgTransferPositionsAmino; +} +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositionsSDKType { + position_ids: bigint[]; + sender: string; + new_owner: string; +} +export interface MsgTransferPositionsResponse {} +export interface MsgTransferPositionsResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse'; + value: Uint8Array; +} +export interface MsgTransferPositionsResponseAmino {} +export interface MsgTransferPositionsResponseAminoMsg { + type: 'osmosis/concentratedliquidity/transfer-positions-response'; + value: MsgTransferPositionsResponseAmino; +} +export interface MsgTransferPositionsResponseSDKType {} +function createBaseMsgCreatePosition(): MsgCreatePosition { + return { + poolId: BigInt(0), + sender: '', + lowerTick: BigInt(0), + upperTick: BigInt(0), + tokensProvided: [], + tokenMinAmount0: '', + tokenMinAmount1: '', + }; +} +export const MsgCreatePosition = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + aminoType: 'osmosis/cl-create-position', + is(o: any): o is MsgCreatePosition { + return ( + o && + (o.$typeUrl === MsgCreatePosition.typeUrl || + (typeof o.poolId === 'bigint' && + typeof o.sender === 'string' && + typeof o.lowerTick === 'bigint' && + typeof o.upperTick === 'bigint' && + Array.isArray(o.tokensProvided) && + (!o.tokensProvided.length || Coin.is(o.tokensProvided[0])) && + typeof o.tokenMinAmount0 === 'string' && + typeof o.tokenMinAmount1 === 'string')) + ); + }, + isSDK(o: any): o is MsgCreatePositionSDKType { + return ( + o && + (o.$typeUrl === MsgCreatePosition.typeUrl || + (typeof o.pool_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.lower_tick === 'bigint' && + typeof o.upper_tick === 'bigint' && + Array.isArray(o.tokens_provided) && + (!o.tokens_provided.length || Coin.isSDK(o.tokens_provided[0])) && + typeof o.token_min_amount0 === 'string' && + typeof o.token_min_amount1 === 'string')) + ); + }, + isAmino(o: any): o is MsgCreatePositionAmino { + return ( + o && + (o.$typeUrl === MsgCreatePosition.typeUrl || + (typeof o.pool_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.lower_tick === 'bigint' && + typeof o.upper_tick === 'bigint' && + Array.isArray(o.tokens_provided) && + (!o.tokens_provided.length || Coin.isAmino(o.tokens_provided[0])) && + typeof o.token_min_amount0 === 'string' && + typeof o.token_min_amount1 === 'string')) + ); + }, + encode( + message: MsgCreatePosition, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + if (message.lowerTick !== BigInt(0)) { + writer.uint32(24).int64(message.lowerTick); + } + if (message.upperTick !== BigInt(0)) { + writer.uint32(32).int64(message.upperTick); + } + for (const v of message.tokensProvided) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.tokenMinAmount0 !== '') { + writer.uint32(50).string(message.tokenMinAmount0); + } + if (message.tokenMinAmount1 !== '') { + writer.uint32(58).string(message.tokenMinAmount1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.lowerTick = reader.int64(); + break; + case 4: + message.upperTick = reader.int64(); + break; + case 5: + message.tokensProvided.push(Coin.decode(reader, reader.uint32())); + break; + case 6: + message.tokenMinAmount0 = reader.string(); + break; + case 7: + message.tokenMinAmount1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreatePosition { + const message = createBaseMsgCreatePosition(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.sender = object.sender ?? ''; + message.lowerTick = + object.lowerTick !== undefined && object.lowerTick !== null + ? BigInt(object.lowerTick.toString()) + : BigInt(0); + message.upperTick = + object.upperTick !== undefined && object.upperTick !== null + ? BigInt(object.upperTick.toString()) + : BigInt(0); + message.tokensProvided = + object.tokensProvided?.map((e) => Coin.fromPartial(e)) || []; + message.tokenMinAmount0 = object.tokenMinAmount0 ?? ''; + message.tokenMinAmount1 = object.tokenMinAmount1 ?? ''; + return message; + }, + fromAmino(object: MsgCreatePositionAmino): MsgCreatePosition { + const message = createBaseMsgCreatePosition(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + message.tokensProvided = + object.tokens_provided?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.token_min_amount0 !== undefined && + object.token_min_amount0 !== null + ) { + message.tokenMinAmount0 = object.token_min_amount0; + } + if ( + object.token_min_amount1 !== undefined && + object.token_min_amount1 !== null + ) { + message.tokenMinAmount1 = object.token_min_amount1; + } + return message; + }, + toAmino(message: MsgCreatePosition): MsgCreatePositionAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.lower_tick = + message.lowerTick !== BigInt(0) + ? message.lowerTick.toString() + : undefined; + obj.upper_tick = + message.upperTick !== BigInt(0) + ? message.upperTick.toString() + : undefined; + if (message.tokensProvided) { + obj.tokens_provided = message.tokensProvided.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.tokens_provided = message.tokensProvided; + } + obj.token_min_amount0 = + message.tokenMinAmount0 === '' ? undefined : message.tokenMinAmount0; + obj.token_min_amount1 = + message.tokenMinAmount1 === '' ? undefined : message.tokenMinAmount1; + return obj; + }, + fromAminoMsg(object: MsgCreatePositionAminoMsg): MsgCreatePosition { + return MsgCreatePosition.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePosition): MsgCreatePositionAminoMsg { + return { + type: 'osmosis/cl-create-position', + value: MsgCreatePosition.toAmino(message), + }; + }, + fromProtoMsg(message: MsgCreatePositionProtoMsg): MsgCreatePosition { + return MsgCreatePosition.decode(message.value); + }, + toProto(message: MsgCreatePosition): Uint8Array { + return MsgCreatePosition.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePosition): MsgCreatePositionProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value: MsgCreatePosition.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgCreatePosition.typeUrl, MsgCreatePosition); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreatePosition.aminoType, + MsgCreatePosition.typeUrl +); +function createBaseMsgCreatePositionResponse(): MsgCreatePositionResponse { + return { + positionId: BigInt(0), + amount0: '', + amount1: '', + liquidityCreated: '', + lowerTick: BigInt(0), + upperTick: BigInt(0), + }; +} +export const MsgCreatePositionResponse = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePositionResponse', + aminoType: 'osmosis/concentratedliquidity/create-position-response', + is(o: any): o is MsgCreatePositionResponse { + return ( + o && + (o.$typeUrl === MsgCreatePositionResponse.typeUrl || + (typeof o.positionId === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.liquidityCreated === 'string' && + typeof o.lowerTick === 'bigint' && + typeof o.upperTick === 'bigint')) + ); + }, + isSDK(o: any): o is MsgCreatePositionResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCreatePositionResponse.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.liquidity_created === 'string' && + typeof o.lower_tick === 'bigint' && + typeof o.upper_tick === 'bigint')) + ); + }, + isAmino(o: any): o is MsgCreatePositionResponseAmino { + return ( + o && + (o.$typeUrl === MsgCreatePositionResponse.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.liquidity_created === 'string' && + typeof o.lower_tick === 'bigint' && + typeof o.upper_tick === 'bigint')) + ); + }, + encode( + message: MsgCreatePositionResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + if (message.amount0 !== '') { + writer.uint32(18).string(message.amount0); + } + if (message.amount1 !== '') { + writer.uint32(26).string(message.amount1); + } + if (message.liquidityCreated !== '') { + writer + .uint32(42) + .string(Decimal.fromUserInput(message.liquidityCreated, 18).atomics); + } + if (message.lowerTick !== BigInt(0)) { + writer.uint32(48).int64(message.lowerTick); + } + if (message.upperTick !== BigInt(0)) { + writer.uint32(56).int64(message.upperTick); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreatePositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + case 2: + message.amount0 = reader.string(); + break; + case 3: + message.amount1 = reader.string(); + break; + case 5: + message.liquidityCreated = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 6: + message.lowerTick = reader.int64(); + break; + case 7: + message.upperTick = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreatePositionResponse { + const message = createBaseMsgCreatePositionResponse(); + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0); + message.amount0 = object.amount0 ?? ''; + message.amount1 = object.amount1 ?? ''; + message.liquidityCreated = object.liquidityCreated ?? ''; + message.lowerTick = + object.lowerTick !== undefined && object.lowerTick !== null + ? BigInt(object.lowerTick.toString()) + : BigInt(0); + message.upperTick = + object.upperTick !== undefined && object.upperTick !== null + ? BigInt(object.upperTick.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgCreatePositionResponseAmino): MsgCreatePositionResponse { + const message = createBaseMsgCreatePositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if ( + object.liquidity_created !== undefined && + object.liquidity_created !== null + ) { + message.liquidityCreated = object.liquidity_created; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + return message; + }, + toAmino(message: MsgCreatePositionResponse): MsgCreatePositionResponseAmino { + const obj: any = {}; + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined; + obj.amount0 = message.amount0 === '' ? undefined : message.amount0; + obj.amount1 = message.amount1 === '' ? undefined : message.amount1; + obj.liquidity_created = + message.liquidityCreated === '' ? undefined : message.liquidityCreated; + obj.lower_tick = + message.lowerTick !== BigInt(0) + ? message.lowerTick.toString() + : undefined; + obj.upper_tick = + message.upperTick !== BigInt(0) + ? message.upperTick.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgCreatePositionResponseAminoMsg + ): MsgCreatePositionResponse { + return MsgCreatePositionResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCreatePositionResponse + ): MsgCreatePositionResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/create-position-response', + value: MsgCreatePositionResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreatePositionResponseProtoMsg + ): MsgCreatePositionResponse { + return MsgCreatePositionResponse.decode(message.value); + }, + toProto(message: MsgCreatePositionResponse): Uint8Array { + return MsgCreatePositionResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreatePositionResponse + ): MsgCreatePositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCreatePositionResponse', + value: MsgCreatePositionResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreatePositionResponse.typeUrl, + MsgCreatePositionResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreatePositionResponse.aminoType, + MsgCreatePositionResponse.typeUrl +); +function createBaseMsgAddToPosition(): MsgAddToPosition { + return { + positionId: BigInt(0), + sender: '', + amount0: '', + amount1: '', + tokenMinAmount0: '', + tokenMinAmount1: '', + }; +} +export const MsgAddToPosition = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + aminoType: 'osmosis/cl-add-to-position', + is(o: any): o is MsgAddToPosition { + return ( + o && + (o.$typeUrl === MsgAddToPosition.typeUrl || + (typeof o.positionId === 'bigint' && + typeof o.sender === 'string' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.tokenMinAmount0 === 'string' && + typeof o.tokenMinAmount1 === 'string')) + ); + }, + isSDK(o: any): o is MsgAddToPositionSDKType { + return ( + o && + (o.$typeUrl === MsgAddToPosition.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.token_min_amount0 === 'string' && + typeof o.token_min_amount1 === 'string')) + ); + }, + isAmino(o: any): o is MsgAddToPositionAmino { + return ( + o && + (o.$typeUrl === MsgAddToPosition.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.token_min_amount0 === 'string' && + typeof o.token_min_amount1 === 'string')) + ); + }, + encode( + message: MsgAddToPosition, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + if (message.amount0 !== '') { + writer.uint32(26).string(message.amount0); + } + if (message.amount1 !== '') { + writer.uint32(34).string(message.amount1); + } + if (message.tokenMinAmount0 !== '') { + writer.uint32(42).string(message.tokenMinAmount0); + } + if (message.tokenMinAmount1 !== '') { + writer.uint32(50).string(message.tokenMinAmount1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddToPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddToPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.amount0 = reader.string(); + break; + case 4: + message.amount1 = reader.string(); + break; + case 5: + message.tokenMinAmount0 = reader.string(); + break; + case 6: + message.tokenMinAmount1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddToPosition { + const message = createBaseMsgAddToPosition(); + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0); + message.sender = object.sender ?? ''; + message.amount0 = object.amount0 ?? ''; + message.amount1 = object.amount1 ?? ''; + message.tokenMinAmount0 = object.tokenMinAmount0 ?? ''; + message.tokenMinAmount1 = object.tokenMinAmount1 ?? ''; + return message; + }, + fromAmino(object: MsgAddToPositionAmino): MsgAddToPosition { + const message = createBaseMsgAddToPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if ( + object.token_min_amount0 !== undefined && + object.token_min_amount0 !== null + ) { + message.tokenMinAmount0 = object.token_min_amount0; + } + if ( + object.token_min_amount1 !== undefined && + object.token_min_amount1 !== null + ) { + message.tokenMinAmount1 = object.token_min_amount1; + } + return message; + }, + toAmino(message: MsgAddToPosition): MsgAddToPositionAmino { + const obj: any = {}; + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.amount0 = message.amount0 === '' ? undefined : message.amount0; + obj.amount1 = message.amount1 === '' ? undefined : message.amount1; + obj.token_min_amount0 = + message.tokenMinAmount0 === '' ? undefined : message.tokenMinAmount0; + obj.token_min_amount1 = + message.tokenMinAmount1 === '' ? undefined : message.tokenMinAmount1; + return obj; + }, + fromAminoMsg(object: MsgAddToPositionAminoMsg): MsgAddToPosition { + return MsgAddToPosition.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddToPosition): MsgAddToPositionAminoMsg { + return { + type: 'osmosis/cl-add-to-position', + value: MsgAddToPosition.toAmino(message), + }; + }, + fromProtoMsg(message: MsgAddToPositionProtoMsg): MsgAddToPosition { + return MsgAddToPosition.decode(message.value); + }, + toProto(message: MsgAddToPosition): Uint8Array { + return MsgAddToPosition.encode(message).finish(); + }, + toProtoMsg(message: MsgAddToPosition): MsgAddToPositionProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value: MsgAddToPosition.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgAddToPosition.typeUrl, MsgAddToPosition); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToPosition.aminoType, + MsgAddToPosition.typeUrl +); +function createBaseMsgAddToPositionResponse(): MsgAddToPositionResponse { + return { + positionId: BigInt(0), + amount0: '', + amount1: '', + }; +} +export const MsgAddToPositionResponse = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPositionResponse', + aminoType: 'osmosis/concentratedliquidity/add-to-position-response', + is(o: any): o is MsgAddToPositionResponse { + return ( + o && + (o.$typeUrl === MsgAddToPositionResponse.typeUrl || + (typeof o.positionId === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string')) + ); + }, + isSDK(o: any): o is MsgAddToPositionResponseSDKType { + return ( + o && + (o.$typeUrl === MsgAddToPositionResponse.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string')) + ); + }, + isAmino(o: any): o is MsgAddToPositionResponseAmino { + return ( + o && + (o.$typeUrl === MsgAddToPositionResponse.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string')) + ); + }, + encode( + message: MsgAddToPositionResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + if (message.amount0 !== '') { + writer.uint32(18).string(message.amount0); + } + if (message.amount1 !== '') { + writer.uint32(26).string(message.amount1); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddToPositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + case 2: + message.amount0 = reader.string(); + break; + case 3: + message.amount1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgAddToPositionResponse { + const message = createBaseMsgAddToPositionResponse(); + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0); + message.amount0 = object.amount0 ?? ''; + message.amount1 = object.amount1 ?? ''; + return message; + }, + fromAmino(object: MsgAddToPositionResponseAmino): MsgAddToPositionResponse { + const message = createBaseMsgAddToPositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + return message; + }, + toAmino(message: MsgAddToPositionResponse): MsgAddToPositionResponseAmino { + const obj: any = {}; + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined; + obj.amount0 = message.amount0 === '' ? undefined : message.amount0; + obj.amount1 = message.amount1 === '' ? undefined : message.amount1; + return obj; + }, + fromAminoMsg( + object: MsgAddToPositionResponseAminoMsg + ): MsgAddToPositionResponse { + return MsgAddToPositionResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgAddToPositionResponse + ): MsgAddToPositionResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/add-to-position-response', + value: MsgAddToPositionResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgAddToPositionResponseProtoMsg + ): MsgAddToPositionResponse { + return MsgAddToPositionResponse.decode(message.value); + }, + toProto(message: MsgAddToPositionResponse): Uint8Array { + return MsgAddToPositionResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgAddToPositionResponse + ): MsgAddToPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgAddToPositionResponse', + value: MsgAddToPositionResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgAddToPositionResponse.typeUrl, + MsgAddToPositionResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToPositionResponse.aminoType, + MsgAddToPositionResponse.typeUrl +); +function createBaseMsgWithdrawPosition(): MsgWithdrawPosition { + return { + positionId: BigInt(0), + sender: '', + liquidityAmount: '', + }; +} +export const MsgWithdrawPosition = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + aminoType: 'osmosis/cl-withdraw-position', + is(o: any): o is MsgWithdrawPosition { + return ( + o && + (o.$typeUrl === MsgWithdrawPosition.typeUrl || + (typeof o.positionId === 'bigint' && + typeof o.sender === 'string' && + typeof o.liquidityAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgWithdrawPositionSDKType { + return ( + o && + (o.$typeUrl === MsgWithdrawPosition.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.liquidity_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgWithdrawPositionAmino { + return ( + o && + (o.$typeUrl === MsgWithdrawPosition.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.liquidity_amount === 'string')) + ); + }, + encode( + message: MsgWithdrawPosition, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + if (message.liquidityAmount !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.liquidityAmount, 18).atomics); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.liquidityAmount = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawPosition { + const message = createBaseMsgWithdrawPosition(); + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0); + message.sender = object.sender ?? ''; + message.liquidityAmount = object.liquidityAmount ?? ''; + return message; + }, + fromAmino(object: MsgWithdrawPositionAmino): MsgWithdrawPosition { + const message = createBaseMsgWithdrawPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if ( + object.liquidity_amount !== undefined && + object.liquidity_amount !== null + ) { + message.liquidityAmount = object.liquidity_amount; + } + return message; + }, + toAmino(message: MsgWithdrawPosition): MsgWithdrawPositionAmino { + const obj: any = {}; + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.liquidity_amount = + message.liquidityAmount === '' ? undefined : message.liquidityAmount; + return obj; + }, + fromAminoMsg(object: MsgWithdrawPositionAminoMsg): MsgWithdrawPosition { + return MsgWithdrawPosition.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawPosition): MsgWithdrawPositionAminoMsg { + return { + type: 'osmosis/cl-withdraw-position', + value: MsgWithdrawPosition.toAmino(message), + }; + }, + fromProtoMsg(message: MsgWithdrawPositionProtoMsg): MsgWithdrawPosition { + return MsgWithdrawPosition.decode(message.value); + }, + toProto(message: MsgWithdrawPosition): Uint8Array { + return MsgWithdrawPosition.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawPosition): MsgWithdrawPositionProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value: MsgWithdrawPosition.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgWithdrawPosition.typeUrl, + MsgWithdrawPosition +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawPosition.aminoType, + MsgWithdrawPosition.typeUrl +); +function createBaseMsgWithdrawPositionResponse(): MsgWithdrawPositionResponse { + return { + amount0: '', + amount1: '', + }; +} +export const MsgWithdrawPositionResponse = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPositionResponse', + aminoType: 'osmosis/concentratedliquidity/withdraw-position-response', + is(o: any): o is MsgWithdrawPositionResponse { + return ( + o && + (o.$typeUrl === MsgWithdrawPositionResponse.typeUrl || + (typeof o.amount0 === 'string' && typeof o.amount1 === 'string')) + ); + }, + isSDK(o: any): o is MsgWithdrawPositionResponseSDKType { + return ( + o && + (o.$typeUrl === MsgWithdrawPositionResponse.typeUrl || + (typeof o.amount0 === 'string' && typeof o.amount1 === 'string')) + ); + }, + isAmino(o: any): o is MsgWithdrawPositionResponseAmino { + return ( + o && + (o.$typeUrl === MsgWithdrawPositionResponse.typeUrl || + (typeof o.amount0 === 'string' && typeof o.amount1 === 'string')) + ); + }, + encode( + message: MsgWithdrawPositionResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.amount0 !== '') { + writer.uint32(10).string(message.amount0); + } + if (message.amount1 !== '') { + writer.uint32(18).string(message.amount1); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawPositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount0 = reader.string(); + break; + case 2: + message.amount1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgWithdrawPositionResponse { + const message = createBaseMsgWithdrawPositionResponse(); + message.amount0 = object.amount0 ?? ''; + message.amount1 = object.amount1 ?? ''; + return message; + }, + fromAmino( + object: MsgWithdrawPositionResponseAmino + ): MsgWithdrawPositionResponse { + const message = createBaseMsgWithdrawPositionResponse(); + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + return message; + }, + toAmino( + message: MsgWithdrawPositionResponse + ): MsgWithdrawPositionResponseAmino { + const obj: any = {}; + obj.amount0 = message.amount0 === '' ? undefined : message.amount0; + obj.amount1 = message.amount1 === '' ? undefined : message.amount1; + return obj; + }, + fromAminoMsg( + object: MsgWithdrawPositionResponseAminoMsg + ): MsgWithdrawPositionResponse { + return MsgWithdrawPositionResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgWithdrawPositionResponse + ): MsgWithdrawPositionResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/withdraw-position-response', + value: MsgWithdrawPositionResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgWithdrawPositionResponseProtoMsg + ): MsgWithdrawPositionResponse { + return MsgWithdrawPositionResponse.decode(message.value); + }, + toProto(message: MsgWithdrawPositionResponse): Uint8Array { + return MsgWithdrawPositionResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgWithdrawPositionResponse + ): MsgWithdrawPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPositionResponse', + value: MsgWithdrawPositionResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgWithdrawPositionResponse.typeUrl, + MsgWithdrawPositionResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawPositionResponse.aminoType, + MsgWithdrawPositionResponse.typeUrl +); +function createBaseMsgCollectSpreadRewards(): MsgCollectSpreadRewards { + return { + positionIds: [], + sender: '', + }; +} +export const MsgCollectSpreadRewards = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + aminoType: 'osmosis/cl-col-sp-rewards', + is(o: any): o is MsgCollectSpreadRewards { + return ( + o && + (o.$typeUrl === MsgCollectSpreadRewards.typeUrl || + (Array.isArray(o.positionIds) && + (!o.positionIds.length || typeof o.positionIds[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + isSDK(o: any): o is MsgCollectSpreadRewardsSDKType { + return ( + o && + (o.$typeUrl === MsgCollectSpreadRewards.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + isAmino(o: any): o is MsgCollectSpreadRewardsAmino { + return ( + o && + (o.$typeUrl === MsgCollectSpreadRewards.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + encode( + message: MsgCollectSpreadRewards, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.positionIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectSpreadRewards { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCollectSpreadRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.positionIds.push(reader.uint64()); + } + } else { + message.positionIds.push(reader.uint64()); + } + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCollectSpreadRewards { + const message = createBaseMsgCollectSpreadRewards(); + message.positionIds = + object.positionIds?.map((e) => BigInt(e.toString())) || []; + message.sender = object.sender ?? ''; + return message; + }, + fromAmino(object: MsgCollectSpreadRewardsAmino): MsgCollectSpreadRewards { + const message = createBaseMsgCollectSpreadRewards(); + message.positionIds = object.position_ids?.map((e) => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsAmino { + const obj: any = {}; + if (message.positionIds) { + obj.position_ids = message.positionIds.map((e) => e.toString()); + } else { + obj.position_ids = message.positionIds; + } + obj.sender = message.sender === '' ? undefined : message.sender; + return obj; + }, + fromAminoMsg( + object: MsgCollectSpreadRewardsAminoMsg + ): MsgCollectSpreadRewards { + return MsgCollectSpreadRewards.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCollectSpreadRewards + ): MsgCollectSpreadRewardsAminoMsg { + return { + type: 'osmosis/cl-col-sp-rewards', + value: MsgCollectSpreadRewards.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCollectSpreadRewardsProtoMsg + ): MsgCollectSpreadRewards { + return MsgCollectSpreadRewards.decode(message.value); + }, + toProto(message: MsgCollectSpreadRewards): Uint8Array { + return MsgCollectSpreadRewards.encode(message).finish(); + }, + toProtoMsg( + message: MsgCollectSpreadRewards + ): MsgCollectSpreadRewardsProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value: MsgCollectSpreadRewards.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCollectSpreadRewards.typeUrl, + MsgCollectSpreadRewards +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectSpreadRewards.aminoType, + MsgCollectSpreadRewards.typeUrl +); +function createBaseMsgCollectSpreadRewardsResponse(): MsgCollectSpreadRewardsResponse { + return { + collectedSpreadRewards: [], + }; +} +export const MsgCollectSpreadRewardsResponse = { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse', + aminoType: 'osmosis/concentratedliquidity/collect-spread-rewards-response', + is(o: any): o is MsgCollectSpreadRewardsResponse { + return ( + o && + (o.$typeUrl === MsgCollectSpreadRewardsResponse.typeUrl || + (Array.isArray(o.collectedSpreadRewards) && + (!o.collectedSpreadRewards.length || + Coin.is(o.collectedSpreadRewards[0])))) + ); + }, + isSDK(o: any): o is MsgCollectSpreadRewardsResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCollectSpreadRewardsResponse.typeUrl || + (Array.isArray(o.collected_spread_rewards) && + (!o.collected_spread_rewards.length || + Coin.isSDK(o.collected_spread_rewards[0])))) + ); + }, + isAmino(o: any): o is MsgCollectSpreadRewardsResponseAmino { + return ( + o && + (o.$typeUrl === MsgCollectSpreadRewardsResponse.typeUrl || + (Array.isArray(o.collected_spread_rewards) && + (!o.collected_spread_rewards.length || + Coin.isAmino(o.collected_spread_rewards[0])))) + ); + }, + encode( + message: MsgCollectSpreadRewardsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.collectedSpreadRewards) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectSpreadRewardsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCollectSpreadRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.collectedSpreadRewards.push( + Coin.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCollectSpreadRewardsResponse { + const message = createBaseMsgCollectSpreadRewardsResponse(); + message.collectedSpreadRewards = + object.collectedSpreadRewards?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: MsgCollectSpreadRewardsResponseAmino + ): MsgCollectSpreadRewardsResponse { + const message = createBaseMsgCollectSpreadRewardsResponse(); + message.collectedSpreadRewards = + object.collected_spread_rewards?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: MsgCollectSpreadRewardsResponse + ): MsgCollectSpreadRewardsResponseAmino { + const obj: any = {}; + if (message.collectedSpreadRewards) { + obj.collected_spread_rewards = message.collectedSpreadRewards.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.collected_spread_rewards = message.collectedSpreadRewards; + } + return obj; + }, + fromAminoMsg( + object: MsgCollectSpreadRewardsResponseAminoMsg + ): MsgCollectSpreadRewardsResponse { + return MsgCollectSpreadRewardsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCollectSpreadRewardsResponse + ): MsgCollectSpreadRewardsResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/collect-spread-rewards-response', + value: MsgCollectSpreadRewardsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCollectSpreadRewardsResponseProtoMsg + ): MsgCollectSpreadRewardsResponse { + return MsgCollectSpreadRewardsResponse.decode(message.value); + }, + toProto(message: MsgCollectSpreadRewardsResponse): Uint8Array { + return MsgCollectSpreadRewardsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCollectSpreadRewardsResponse + ): MsgCollectSpreadRewardsResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse', + value: MsgCollectSpreadRewardsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCollectSpreadRewardsResponse.typeUrl, + MsgCollectSpreadRewardsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectSpreadRewardsResponse.aminoType, + MsgCollectSpreadRewardsResponse.typeUrl +); +function createBaseMsgCollectIncentives(): MsgCollectIncentives { + return { + positionIds: [], + sender: '', + }; +} +export const MsgCollectIncentives = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + aminoType: 'osmosis/cl-collect-incentives', + is(o: any): o is MsgCollectIncentives { + return ( + o && + (o.$typeUrl === MsgCollectIncentives.typeUrl || + (Array.isArray(o.positionIds) && + (!o.positionIds.length || typeof o.positionIds[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + isSDK(o: any): o is MsgCollectIncentivesSDKType { + return ( + o && + (o.$typeUrl === MsgCollectIncentives.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + isAmino(o: any): o is MsgCollectIncentivesAmino { + return ( + o && + (o.$typeUrl === MsgCollectIncentives.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + encode( + message: MsgCollectIncentives, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.positionIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectIncentives { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCollectIncentives(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.positionIds.push(reader.uint64()); + } + } else { + message.positionIds.push(reader.uint64()); + } + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCollectIncentives { + const message = createBaseMsgCollectIncentives(); + message.positionIds = + object.positionIds?.map((e) => BigInt(e.toString())) || []; + message.sender = object.sender ?? ''; + return message; + }, + fromAmino(object: MsgCollectIncentivesAmino): MsgCollectIncentives { + const message = createBaseMsgCollectIncentives(); + message.positionIds = object.position_ids?.map((e) => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgCollectIncentives): MsgCollectIncentivesAmino { + const obj: any = {}; + if (message.positionIds) { + obj.position_ids = message.positionIds.map((e) => e.toString()); + } else { + obj.position_ids = message.positionIds; + } + obj.sender = message.sender === '' ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgCollectIncentivesAminoMsg): MsgCollectIncentives { + return MsgCollectIncentives.fromAmino(object.value); + }, + toAminoMsg(message: MsgCollectIncentives): MsgCollectIncentivesAminoMsg { + return { + type: 'osmosis/cl-collect-incentives', + value: MsgCollectIncentives.toAmino(message), + }; + }, + fromProtoMsg(message: MsgCollectIncentivesProtoMsg): MsgCollectIncentives { + return MsgCollectIncentives.decode(message.value); + }, + toProto(message: MsgCollectIncentives): Uint8Array { + return MsgCollectIncentives.encode(message).finish(); + }, + toProtoMsg(message: MsgCollectIncentives): MsgCollectIncentivesProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + value: MsgCollectIncentives.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCollectIncentives.typeUrl, + MsgCollectIncentives +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectIncentives.aminoType, + MsgCollectIncentives.typeUrl +); +function createBaseMsgCollectIncentivesResponse(): MsgCollectIncentivesResponse { + return { + collectedIncentives: [], + forfeitedIncentives: [], + }; +} +export const MsgCollectIncentivesResponse = { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse', + aminoType: 'osmosis/concentratedliquidity/collect-incentives-response', + is(o: any): o is MsgCollectIncentivesResponse { + return ( + o && + (o.$typeUrl === MsgCollectIncentivesResponse.typeUrl || + (Array.isArray(o.collectedIncentives) && + (!o.collectedIncentives.length || + Coin.is(o.collectedIncentives[0])) && + Array.isArray(o.forfeitedIncentives) && + (!o.forfeitedIncentives.length || Coin.is(o.forfeitedIncentives[0])))) + ); + }, + isSDK(o: any): o is MsgCollectIncentivesResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCollectIncentivesResponse.typeUrl || + (Array.isArray(o.collected_incentives) && + (!o.collected_incentives.length || + Coin.isSDK(o.collected_incentives[0])) && + Array.isArray(o.forfeited_incentives) && + (!o.forfeited_incentives.length || + Coin.isSDK(o.forfeited_incentives[0])))) + ); + }, + isAmino(o: any): o is MsgCollectIncentivesResponseAmino { + return ( + o && + (o.$typeUrl === MsgCollectIncentivesResponse.typeUrl || + (Array.isArray(o.collected_incentives) && + (!o.collected_incentives.length || + Coin.isAmino(o.collected_incentives[0])) && + Array.isArray(o.forfeited_incentives) && + (!o.forfeited_incentives.length || + Coin.isAmino(o.forfeited_incentives[0])))) + ); + }, + encode( + message: MsgCollectIncentivesResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.collectedIncentives) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.forfeitedIncentives) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectIncentivesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCollectIncentivesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.collectedIncentives.push( + Coin.decode(reader, reader.uint32()) + ); + break; + case 2: + message.forfeitedIncentives.push( + Coin.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCollectIncentivesResponse { + const message = createBaseMsgCollectIncentivesResponse(); + message.collectedIncentives = + object.collectedIncentives?.map((e) => Coin.fromPartial(e)) || []; + message.forfeitedIncentives = + object.forfeitedIncentives?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: MsgCollectIncentivesResponseAmino + ): MsgCollectIncentivesResponse { + const message = createBaseMsgCollectIncentivesResponse(); + message.collectedIncentives = + object.collected_incentives?.map((e) => Coin.fromAmino(e)) || []; + message.forfeitedIncentives = + object.forfeited_incentives?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: MsgCollectIncentivesResponse + ): MsgCollectIncentivesResponseAmino { + const obj: any = {}; + if (message.collectedIncentives) { + obj.collected_incentives = message.collectedIncentives.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.collected_incentives = message.collectedIncentives; + } + if (message.forfeitedIncentives) { + obj.forfeited_incentives = message.forfeitedIncentives.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.forfeited_incentives = message.forfeitedIncentives; + } + return obj; + }, + fromAminoMsg( + object: MsgCollectIncentivesResponseAminoMsg + ): MsgCollectIncentivesResponse { + return MsgCollectIncentivesResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCollectIncentivesResponse + ): MsgCollectIncentivesResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/collect-incentives-response', + value: MsgCollectIncentivesResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCollectIncentivesResponseProtoMsg + ): MsgCollectIncentivesResponse { + return MsgCollectIncentivesResponse.decode(message.value); + }, + toProto(message: MsgCollectIncentivesResponse): Uint8Array { + return MsgCollectIncentivesResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCollectIncentivesResponse + ): MsgCollectIncentivesResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse', + value: MsgCollectIncentivesResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCollectIncentivesResponse.typeUrl, + MsgCollectIncentivesResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectIncentivesResponse.aminoType, + MsgCollectIncentivesResponse.typeUrl +); +function createBaseMsgFungifyChargedPositions(): MsgFungifyChargedPositions { + return { + positionIds: [], + sender: '', + }; +} +export const MsgFungifyChargedPositions = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions', + aminoType: 'osmosis/cl-fungify-charged-positions', + is(o: any): o is MsgFungifyChargedPositions { + return ( + o && + (o.$typeUrl === MsgFungifyChargedPositions.typeUrl || + (Array.isArray(o.positionIds) && + (!o.positionIds.length || typeof o.positionIds[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + isSDK(o: any): o is MsgFungifyChargedPositionsSDKType { + return ( + o && + (o.$typeUrl === MsgFungifyChargedPositions.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + isAmino(o: any): o is MsgFungifyChargedPositionsAmino { + return ( + o && + (o.$typeUrl === MsgFungifyChargedPositions.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string')) + ); + }, + encode( + message: MsgFungifyChargedPositions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.positionIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgFungifyChargedPositions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFungifyChargedPositions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.positionIds.push(reader.uint64()); + } + } else { + message.positionIds.push(reader.uint64()); + } + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgFungifyChargedPositions { + const message = createBaseMsgFungifyChargedPositions(); + message.positionIds = + object.positionIds?.map((e) => BigInt(e.toString())) || []; + message.sender = object.sender ?? ''; + return message; + }, + fromAmino( + object: MsgFungifyChargedPositionsAmino + ): MsgFungifyChargedPositions { + const message = createBaseMsgFungifyChargedPositions(); + message.positionIds = object.position_ids?.map((e) => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino( + message: MsgFungifyChargedPositions + ): MsgFungifyChargedPositionsAmino { + const obj: any = {}; + if (message.positionIds) { + obj.position_ids = message.positionIds.map((e) => e.toString()); + } else { + obj.position_ids = message.positionIds; + } + obj.sender = message.sender === '' ? undefined : message.sender; + return obj; + }, + fromAminoMsg( + object: MsgFungifyChargedPositionsAminoMsg + ): MsgFungifyChargedPositions { + return MsgFungifyChargedPositions.fromAmino(object.value); + }, + toAminoMsg( + message: MsgFungifyChargedPositions + ): MsgFungifyChargedPositionsAminoMsg { + return { + type: 'osmosis/cl-fungify-charged-positions', + value: MsgFungifyChargedPositions.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgFungifyChargedPositionsProtoMsg + ): MsgFungifyChargedPositions { + return MsgFungifyChargedPositions.decode(message.value); + }, + toProto(message: MsgFungifyChargedPositions): Uint8Array { + return MsgFungifyChargedPositions.encode(message).finish(); + }, + toProtoMsg( + message: MsgFungifyChargedPositions + ): MsgFungifyChargedPositionsProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions', + value: MsgFungifyChargedPositions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgFungifyChargedPositions.typeUrl, + MsgFungifyChargedPositions +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgFungifyChargedPositions.aminoType, + MsgFungifyChargedPositions.typeUrl +); +function createBaseMsgFungifyChargedPositionsResponse(): MsgFungifyChargedPositionsResponse { + return { + newPositionId: BigInt(0), + }; +} +export const MsgFungifyChargedPositionsResponse = { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositionsResponse', + aminoType: 'osmosis/concentratedliquidity/fungify-charged-positions-response', + is(o: any): o is MsgFungifyChargedPositionsResponse { + return ( + o && + (o.$typeUrl === MsgFungifyChargedPositionsResponse.typeUrl || + typeof o.newPositionId === 'bigint') + ); + }, + isSDK(o: any): o is MsgFungifyChargedPositionsResponseSDKType { + return ( + o && + (o.$typeUrl === MsgFungifyChargedPositionsResponse.typeUrl || + typeof o.new_position_id === 'bigint') + ); + }, + isAmino(o: any): o is MsgFungifyChargedPositionsResponseAmino { + return ( + o && + (o.$typeUrl === MsgFungifyChargedPositionsResponse.typeUrl || + typeof o.new_position_id === 'bigint') + ); + }, + encode( + message: MsgFungifyChargedPositionsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.newPositionId !== BigInt(0)) { + writer.uint32(8).uint64(message.newPositionId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgFungifyChargedPositionsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFungifyChargedPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newPositionId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgFungifyChargedPositionsResponse { + const message = createBaseMsgFungifyChargedPositionsResponse(); + message.newPositionId = + object.newPositionId !== undefined && object.newPositionId !== null + ? BigInt(object.newPositionId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgFungifyChargedPositionsResponseAmino + ): MsgFungifyChargedPositionsResponse { + const message = createBaseMsgFungifyChargedPositionsResponse(); + if ( + object.new_position_id !== undefined && + object.new_position_id !== null + ) { + message.newPositionId = BigInt(object.new_position_id); + } + return message; + }, + toAmino( + message: MsgFungifyChargedPositionsResponse + ): MsgFungifyChargedPositionsResponseAmino { + const obj: any = {}; + obj.new_position_id = + message.newPositionId !== BigInt(0) + ? message.newPositionId.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgFungifyChargedPositionsResponseAminoMsg + ): MsgFungifyChargedPositionsResponse { + return MsgFungifyChargedPositionsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgFungifyChargedPositionsResponse + ): MsgFungifyChargedPositionsResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/fungify-charged-positions-response', + value: MsgFungifyChargedPositionsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgFungifyChargedPositionsResponseProtoMsg + ): MsgFungifyChargedPositionsResponse { + return MsgFungifyChargedPositionsResponse.decode(message.value); + }, + toProto(message: MsgFungifyChargedPositionsResponse): Uint8Array { + return MsgFungifyChargedPositionsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgFungifyChargedPositionsResponse + ): MsgFungifyChargedPositionsResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositionsResponse', + value: MsgFungifyChargedPositionsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgFungifyChargedPositionsResponse.typeUrl, + MsgFungifyChargedPositionsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgFungifyChargedPositionsResponse.aminoType, + MsgFungifyChargedPositionsResponse.typeUrl +); +function createBaseMsgTransferPositions(): MsgTransferPositions { + return { + positionIds: [], + sender: '', + newOwner: '', + }; +} +export const MsgTransferPositions = { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + aminoType: 'osmosis/cl-transfer-positions', + is(o: any): o is MsgTransferPositions { + return ( + o && + (o.$typeUrl === MsgTransferPositions.typeUrl || + (Array.isArray(o.positionIds) && + (!o.positionIds.length || typeof o.positionIds[0] === 'bigint') && + typeof o.sender === 'string' && + typeof o.newOwner === 'string')) + ); + }, + isSDK(o: any): o is MsgTransferPositionsSDKType { + return ( + o && + (o.$typeUrl === MsgTransferPositions.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string' && + typeof o.new_owner === 'string')) + ); + }, + isAmino(o: any): o is MsgTransferPositionsAmino { + return ( + o && + (o.$typeUrl === MsgTransferPositions.typeUrl || + (Array.isArray(o.position_ids) && + (!o.position_ids.length || typeof o.position_ids[0] === 'bigint') && + typeof o.sender === 'string' && + typeof o.new_owner === 'string')) + ); + }, + encode( + message: MsgTransferPositions, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.positionIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + if (message.newOwner !== '') { + writer.uint32(26).string(message.newOwner); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgTransferPositions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPositions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.positionIds.push(reader.uint64()); + } + } else { + message.positionIds.push(reader.uint64()); + } + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.newOwner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTransferPositions { + const message = createBaseMsgTransferPositions(); + message.positionIds = + object.positionIds?.map((e) => BigInt(e.toString())) || []; + message.sender = object.sender ?? ''; + message.newOwner = object.newOwner ?? ''; + return message; + }, + fromAmino(object: MsgTransferPositionsAmino): MsgTransferPositions { + const message = createBaseMsgTransferPositions(); + message.positionIds = object.position_ids?.map((e) => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_owner !== undefined && object.new_owner !== null) { + message.newOwner = object.new_owner; + } + return message; + }, + toAmino(message: MsgTransferPositions): MsgTransferPositionsAmino { + const obj: any = {}; + if (message.positionIds) { + obj.position_ids = message.positionIds.map((e) => e.toString()); + } else { + obj.position_ids = message.positionIds; + } + obj.sender = message.sender === '' ? undefined : message.sender; + obj.new_owner = message.newOwner === '' ? undefined : message.newOwner; + return obj; + }, + fromAminoMsg(object: MsgTransferPositionsAminoMsg): MsgTransferPositions { + return MsgTransferPositions.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferPositions): MsgTransferPositionsAminoMsg { + return { + type: 'osmosis/cl-transfer-positions', + value: MsgTransferPositions.toAmino(message), + }; + }, + fromProtoMsg(message: MsgTransferPositionsProtoMsg): MsgTransferPositions { + return MsgTransferPositions.decode(message.value); + }, + toProto(message: MsgTransferPositions): Uint8Array { + return MsgTransferPositions.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPositions): MsgTransferPositionsProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + value: MsgTransferPositions.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgTransferPositions.typeUrl, + MsgTransferPositions +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTransferPositions.aminoType, + MsgTransferPositions.typeUrl +); +function createBaseMsgTransferPositionsResponse(): MsgTransferPositionsResponse { + return {}; +} +export const MsgTransferPositionsResponse = { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse', + aminoType: 'osmosis/concentratedliquidity/transfer-positions-response', + is(o: any): o is MsgTransferPositionsResponse { + return o && o.$typeUrl === MsgTransferPositionsResponse.typeUrl; + }, + isSDK(o: any): o is MsgTransferPositionsResponseSDKType { + return o && o.$typeUrl === MsgTransferPositionsResponse.typeUrl; + }, + isAmino(o: any): o is MsgTransferPositionsResponseAmino { + return o && o.$typeUrl === MsgTransferPositionsResponse.typeUrl; + }, + encode( + _: MsgTransferPositionsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgTransferPositionsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgTransferPositionsResponse { + const message = createBaseMsgTransferPositionsResponse(); + return message; + }, + fromAmino( + _: MsgTransferPositionsResponseAmino + ): MsgTransferPositionsResponse { + const message = createBaseMsgTransferPositionsResponse(); + return message; + }, + toAmino(_: MsgTransferPositionsResponse): MsgTransferPositionsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgTransferPositionsResponseAminoMsg + ): MsgTransferPositionsResponse { + return MsgTransferPositionsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgTransferPositionsResponse + ): MsgTransferPositionsResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/transfer-positions-response', + value: MsgTransferPositionsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgTransferPositionsResponseProtoMsg + ): MsgTransferPositionsResponse { + return MsgTransferPositionsResponse.decode(message.value); + }, + toProto(message: MsgTransferPositionsResponse): Uint8Array { + return MsgTransferPositionsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgTransferPositionsResponse + ): MsgTransferPositionsResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse', + value: MsgTransferPositionsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgTransferPositionsResponse.typeUrl, + MsgTransferPositionsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTransferPositionsResponse.aminoType, + MsgTransferPositionsResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts new file mode 100644 index 00000000..00d65320 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgCreateBalancerPool } from './tx'; +export const AminoConverter = { + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool': { + aminoType: 'osmosis/gamm/create-balancer-pool', + toAmino: MsgCreateBalancerPool.toAmino, + fromAmino: MsgCreateBalancerPool.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts new file mode 100644 index 00000000..4d34d7b9 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { MsgCreateBalancerPool } from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + MsgCreateBalancerPool, + ], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value: MsgCreateBalancerPool.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value, + }; + }, + }, + fromPartial: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value: MsgCreateBalancerPool.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..8d27167e --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,33 @@ +//@ts-nocheck +import { Rpc } from '../../../../../helpers'; +import { BinaryReader } from '../../../../../binary'; + +import { MsgCreateBalancerPool, MsgCreateBalancerPoolResponse } from './tx'; +export interface Msg { + createBalancerPool( + request: MsgCreateBalancerPool + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createBalancerPool = this.createBalancerPool.bind(this); + } + createBalancerPool( + request: MsgCreateBalancerPool + ): Promise { + const data = MsgCreateBalancerPool.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.poolmodels.balancer.v1beta1.Msg', + 'CreateBalancerPool', + data + ); + return promise.then((data) => + MsgCreateBalancerPoolResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts new file mode 100644 index 00000000..72647031 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts @@ -0,0 +1,355 @@ +//@ts-nocheck +import { + PoolParams, + PoolParamsAmino, + PoolParamsSDKType, + PoolAsset, + PoolAssetAmino, + PoolAssetSDKType, +} from '../../../v1beta1/balancerPool'; +import { BinaryReader, BinaryWriter } from '../../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../../registry'; +/** ===================== MsgCreatePool */ +export interface MsgCreateBalancerPool { + sender: string; + poolParams?: PoolParams; + poolAssets: PoolAsset[]; + futurePoolGovernor: string; +} +export interface MsgCreateBalancerPoolProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool'; + value: Uint8Array; +} +/** ===================== MsgCreatePool */ +export interface MsgCreateBalancerPoolAmino { + sender?: string; + pool_params?: PoolParamsAmino; + pool_assets?: PoolAssetAmino[]; + future_pool_governor?: string; +} +export interface MsgCreateBalancerPoolAminoMsg { + type: 'osmosis/gamm/create-balancer-pool'; + value: MsgCreateBalancerPoolAmino; +} +/** ===================== MsgCreatePool */ +export interface MsgCreateBalancerPoolSDKType { + sender: string; + pool_params?: PoolParamsSDKType; + pool_assets: PoolAssetSDKType[]; + future_pool_governor: string; +} +/** Returns the poolID */ +export interface MsgCreateBalancerPoolResponse { + poolId: bigint; +} +export interface MsgCreateBalancerPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPoolResponse'; + value: Uint8Array; +} +/** Returns the poolID */ +export interface MsgCreateBalancerPoolResponseAmino { + pool_id?: string; +} +export interface MsgCreateBalancerPoolResponseAminoMsg { + type: 'osmosis/gamm/poolmodels/balancer/create-balancer-pool-response'; + value: MsgCreateBalancerPoolResponseAmino; +} +/** Returns the poolID */ +export interface MsgCreateBalancerPoolResponseSDKType { + pool_id: bigint; +} +function createBaseMsgCreateBalancerPool(): MsgCreateBalancerPool { + return { + sender: '', + poolParams: undefined, + poolAssets: [], + futurePoolGovernor: '', + }; +} +export const MsgCreateBalancerPool = { + typeUrl: '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + aminoType: 'osmosis/gamm/create-balancer-pool', + is(o: any): o is MsgCreateBalancerPool { + return ( + o && + (o.$typeUrl === MsgCreateBalancerPool.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.poolAssets) && + (!o.poolAssets.length || PoolAsset.is(o.poolAssets[0])) && + typeof o.futurePoolGovernor === 'string')) + ); + }, + isSDK(o: any): o is MsgCreateBalancerPoolSDKType { + return ( + o && + (o.$typeUrl === MsgCreateBalancerPool.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.pool_assets) && + (!o.pool_assets.length || PoolAsset.isSDK(o.pool_assets[0])) && + typeof o.future_pool_governor === 'string')) + ); + }, + isAmino(o: any): o is MsgCreateBalancerPoolAmino { + return ( + o && + (o.$typeUrl === MsgCreateBalancerPool.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.pool_assets) && + (!o.pool_assets.length || PoolAsset.isAmino(o.pool_assets[0])) && + typeof o.future_pool_governor === 'string')) + ); + }, + encode( + message: MsgCreateBalancerPool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.poolAssets) { + PoolAsset.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.futurePoolGovernor !== '') { + writer.uint32(34).string(message.futurePoolGovernor); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateBalancerPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBalancerPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolParams = PoolParams.decode(reader, reader.uint32()); + break; + case 3: + message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())); + break; + case 4: + message.futurePoolGovernor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateBalancerPool { + const message = createBaseMsgCreateBalancerPool(); + message.sender = object.sender ?? ''; + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined; + message.poolAssets = + object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || []; + message.futurePoolGovernor = object.futurePoolGovernor ?? ''; + return message; + }, + fromAmino(object: MsgCreateBalancerPoolAmino): MsgCreateBalancerPool { + const message = createBaseMsgCreateBalancerPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + message.poolAssets = + object.pool_assets?.map((e) => PoolAsset.fromAmino(e)) || []; + if ( + object.future_pool_governor !== undefined && + object.future_pool_governor !== null + ) { + message.futurePoolGovernor = object.future_pool_governor; + } + return message; + }, + toAmino(message: MsgCreateBalancerPool): MsgCreateBalancerPoolAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined; + if (message.poolAssets) { + obj.pool_assets = message.poolAssets.map((e) => + e ? PoolAsset.toAmino(e) : undefined + ); + } else { + obj.pool_assets = message.poolAssets; + } + obj.future_pool_governor = + message.futurePoolGovernor === '' + ? undefined + : message.futurePoolGovernor; + return obj; + }, + fromAminoMsg(object: MsgCreateBalancerPoolAminoMsg): MsgCreateBalancerPool { + return MsgCreateBalancerPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateBalancerPool): MsgCreateBalancerPoolAminoMsg { + return { + type: 'osmosis/gamm/create-balancer-pool', + value: MsgCreateBalancerPool.toAmino(message), + }; + }, + fromProtoMsg(message: MsgCreateBalancerPoolProtoMsg): MsgCreateBalancerPool { + return MsgCreateBalancerPool.decode(message.value); + }, + toProto(message: MsgCreateBalancerPool): Uint8Array { + return MsgCreateBalancerPool.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBalancerPool): MsgCreateBalancerPoolProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value: MsgCreateBalancerPool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateBalancerPool.typeUrl, + MsgCreateBalancerPool +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateBalancerPool.aminoType, + MsgCreateBalancerPool.typeUrl +); +function createBaseMsgCreateBalancerPoolResponse(): MsgCreateBalancerPoolResponse { + return { + poolId: BigInt(0), + }; +} +export const MsgCreateBalancerPoolResponse = { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPoolResponse', + aminoType: 'osmosis/gamm/poolmodels/balancer/create-balancer-pool-response', + is(o: any): o is MsgCreateBalancerPoolResponse { + return ( + o && + (o.$typeUrl === MsgCreateBalancerPoolResponse.typeUrl || + typeof o.poolId === 'bigint') + ); + }, + isSDK(o: any): o is MsgCreateBalancerPoolResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCreateBalancerPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + isAmino(o: any): o is MsgCreateBalancerPoolResponseAmino { + return ( + o && + (o.$typeUrl === MsgCreateBalancerPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + encode( + message: MsgCreateBalancerPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateBalancerPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBalancerPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreateBalancerPoolResponse { + const message = createBaseMsgCreateBalancerPoolResponse(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgCreateBalancerPoolResponseAmino + ): MsgCreateBalancerPoolResponse { + const message = createBaseMsgCreateBalancerPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino( + message: MsgCreateBalancerPoolResponse + ): MsgCreateBalancerPoolResponseAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgCreateBalancerPoolResponseAminoMsg + ): MsgCreateBalancerPoolResponse { + return MsgCreateBalancerPoolResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCreateBalancerPoolResponse + ): MsgCreateBalancerPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/poolmodels/balancer/create-balancer-pool-response', + value: MsgCreateBalancerPoolResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateBalancerPoolResponseProtoMsg + ): MsgCreateBalancerPoolResponse { + return MsgCreateBalancerPoolResponse.decode(message.value); + }, + toProto(message: MsgCreateBalancerPoolResponse): Uint8Array { + return MsgCreateBalancerPoolResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreateBalancerPoolResponse + ): MsgCreateBalancerPoolResponseProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPoolResponse', + value: MsgCreateBalancerPoolResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateBalancerPoolResponse.typeUrl, + MsgCreateBalancerPoolResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateBalancerPoolResponse.aminoType, + MsgCreateBalancerPoolResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts new file mode 100644 index 00000000..290fd9f7 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts @@ -0,0 +1,501 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../../registry'; +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParams { + swapFee: string; + /** + * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old + * pools can maintain a non-zero fee. No new pool can be created with non-zero + * fee anymore + */ + exitFee: string; +} +export interface PoolParamsProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams'; + value: Uint8Array; +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsAmino { + swap_fee?: string; + /** + * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old + * pools can maintain a non-zero fee. No new pool can be created with non-zero + * fee anymore + */ + exit_fee?: string; +} +export interface PoolParamsAminoMsg { + type: 'osmosis/gamm/StableswapPoolParams'; + value: PoolParamsAmino; +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsSDKType { + swap_fee: string; + exit_fee: string; +} +/** Pool is the stableswap Pool struct */ +export interface Pool { + $typeUrl?: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool'; + address: string; + id: bigint; + poolParams: PoolParams; + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * a time specified as 0w,1w,2w, etc. which specifies how long the token + * would need to be locked up to count in governance. 0w means no lockup. + */ + futurePoolGovernor: string; + /** sum of all LP shares */ + totalShares: Coin; + /** assets in the pool */ + poolLiquidity: Coin[]; + /** for calculation amognst assets with different precisions */ + scalingFactors: bigint[]; + /** scaling_factor_controller is the address can adjust pool scaling factors */ + scalingFactorController: string; +} +export interface PoolProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool'; + value: Uint8Array; +} +/** Pool is the stableswap Pool struct */ +export interface PoolAmino { + address?: string; + id?: string; + pool_params?: PoolParamsAmino; + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * a time specified as 0w,1w,2w, etc. which specifies how long the token + * would need to be locked up to count in governance. 0w means no lockup. + */ + future_pool_governor?: string; + /** sum of all LP shares */ + total_shares?: CoinAmino; + /** assets in the pool */ + pool_liquidity?: CoinAmino[]; + /** for calculation amognst assets with different precisions */ + scaling_factors?: string[]; + /** scaling_factor_controller is the address can adjust pool scaling factors */ + scaling_factor_controller?: string; +} +export interface PoolAminoMsg { + type: 'osmosis/gamm/StableswapPool'; + value: PoolAmino; +} +/** Pool is the stableswap Pool struct */ +export interface PoolSDKType { + $typeUrl?: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool'; + address: string; + id: bigint; + pool_params: PoolParamsSDKType; + future_pool_governor: string; + total_shares: CoinSDKType; + pool_liquidity: CoinSDKType[]; + scaling_factors: bigint[]; + scaling_factor_controller: string; +} +function createBasePoolParams(): PoolParams { + return { + swapFee: '', + exitFee: '', + }; +} +export const PoolParams = { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams', + aminoType: 'osmosis/gamm/StableswapPoolParams', + is(o: any): o is PoolParams { + return ( + o && + (o.$typeUrl === PoolParams.typeUrl || + (typeof o.swapFee === 'string' && typeof o.exitFee === 'string')) + ); + }, + isSDK(o: any): o is PoolParamsSDKType { + return ( + o && + (o.$typeUrl === PoolParams.typeUrl || + (typeof o.swap_fee === 'string' && typeof o.exit_fee === 'string')) + ); + }, + isAmino(o: any): o is PoolParamsAmino { + return ( + o && + (o.$typeUrl === PoolParams.typeUrl || + (typeof o.swap_fee === 'string' && typeof o.exit_fee === 'string')) + ); + }, + encode( + message: PoolParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.swapFee !== '') { + writer + .uint32(10) + .string(Decimal.fromUserInput(message.swapFee, 18).atomics); + } + if (message.exitFee !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.exitFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.exitFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PoolParams { + const message = createBasePoolParams(); + message.swapFee = object.swapFee ?? ''; + message.exitFee = object.exitFee ?? ''; + return message; + }, + fromAmino(object: PoolParamsAmino): PoolParams { + const message = createBasePoolParams(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + if (object.exit_fee !== undefined && object.exit_fee !== null) { + message.exitFee = object.exit_fee; + } + return message; + }, + toAmino(message: PoolParams): PoolParamsAmino { + const obj: any = {}; + obj.swap_fee = message.swapFee === '' ? undefined : message.swapFee; + obj.exit_fee = message.exitFee === '' ? undefined : message.exitFee; + return obj; + }, + fromAminoMsg(object: PoolParamsAminoMsg): PoolParams { + return PoolParams.fromAmino(object.value); + }, + toAminoMsg(message: PoolParams): PoolParamsAminoMsg { + return { + type: 'osmosis/gamm/StableswapPoolParams', + value: PoolParams.toAmino(message), + }; + }, + fromProtoMsg(message: PoolParamsProtoMsg): PoolParams { + return PoolParams.decode(message.value); + }, + toProto(message: PoolParams): Uint8Array { + return PoolParams.encode(message).finish(); + }, + toProtoMsg(message: PoolParams): PoolParamsProtoMsg { + return { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams', + value: PoolParams.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(PoolParams.typeUrl, PoolParams); +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolParams.aminoType, + PoolParams.typeUrl +); +function createBasePool(): Pool { + return { + $typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool', + address: '', + id: BigInt(0), + poolParams: PoolParams.fromPartial({}), + futurePoolGovernor: '', + totalShares: Coin.fromPartial({}), + poolLiquidity: [], + scalingFactors: [], + scalingFactorController: '', + }; +} +export const Pool = { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool', + aminoType: 'osmosis/gamm/StableswapPool', + is(o: any): o is Pool { + return ( + o && + (o.$typeUrl === Pool.typeUrl || + (typeof o.address === 'string' && + typeof o.id === 'bigint' && + PoolParams.is(o.poolParams) && + typeof o.futurePoolGovernor === 'string' && + Coin.is(o.totalShares) && + Array.isArray(o.poolLiquidity) && + (!o.poolLiquidity.length || Coin.is(o.poolLiquidity[0])) && + Array.isArray(o.scalingFactors) && + (!o.scalingFactors.length || + typeof o.scalingFactors[0] === 'bigint') && + typeof o.scalingFactorController === 'string')) + ); + }, + isSDK(o: any): o is PoolSDKType { + return ( + o && + (o.$typeUrl === Pool.typeUrl || + (typeof o.address === 'string' && + typeof o.id === 'bigint' && + PoolParams.isSDK(o.pool_params) && + typeof o.future_pool_governor === 'string' && + Coin.isSDK(o.total_shares) && + Array.isArray(o.pool_liquidity) && + (!o.pool_liquidity.length || Coin.isSDK(o.pool_liquidity[0])) && + Array.isArray(o.scaling_factors) && + (!o.scaling_factors.length || + typeof o.scaling_factors[0] === 'bigint') && + typeof o.scaling_factor_controller === 'string')) + ); + }, + isAmino(o: any): o is PoolAmino { + return ( + o && + (o.$typeUrl === Pool.typeUrl || + (typeof o.address === 'string' && + typeof o.id === 'bigint' && + PoolParams.isAmino(o.pool_params) && + typeof o.future_pool_governor === 'string' && + Coin.isAmino(o.total_shares) && + Array.isArray(o.pool_liquidity) && + (!o.pool_liquidity.length || Coin.isAmino(o.pool_liquidity[0])) && + Array.isArray(o.scaling_factors) && + (!o.scaling_factors.length || + typeof o.scaling_factors[0] === 'bigint') && + typeof o.scaling_factor_controller === 'string')) + ); + }, + encode( + message: Pool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + if (message.id !== BigInt(0)) { + writer.uint32(16).uint64(message.id); + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(26).fork()).ldelim(); + } + if (message.futurePoolGovernor !== '') { + writer.uint32(34).string(message.futurePoolGovernor); + } + if (message.totalShares !== undefined) { + Coin.encode(message.totalShares, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.poolLiquidity) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + writer.uint32(58).fork(); + for (const v of message.scalingFactors) { + writer.uint64(v); + } + writer.ldelim(); + if (message.scalingFactorController !== '') { + writer.uint32(66).string(message.scalingFactorController); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.id = reader.uint64(); + break; + case 3: + message.poolParams = PoolParams.decode(reader, reader.uint32()); + break; + case 4: + message.futurePoolGovernor = reader.string(); + break; + case 5: + message.totalShares = Coin.decode(reader, reader.uint32()); + break; + case 6: + message.poolLiquidity.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.scalingFactors.push(reader.uint64()); + } + } else { + message.scalingFactors.push(reader.uint64()); + } + break; + case 8: + message.scalingFactorController = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Pool { + const message = createBasePool(); + message.address = object.address ?? ''; + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0); + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined; + message.futurePoolGovernor = object.futurePoolGovernor ?? ''; + message.totalShares = + object.totalShares !== undefined && object.totalShares !== null + ? Coin.fromPartial(object.totalShares) + : undefined; + message.poolLiquidity = + object.poolLiquidity?.map((e) => Coin.fromPartial(e)) || []; + message.scalingFactors = + object.scalingFactors?.map((e) => BigInt(e.toString())) || []; + message.scalingFactorController = object.scalingFactorController ?? ''; + return message; + }, + fromAmino(object: PoolAmino): Pool { + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + if ( + object.future_pool_governor !== undefined && + object.future_pool_governor !== null + ) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + message.poolLiquidity = + object.pool_liquidity?.map((e) => Coin.fromAmino(e)) || []; + message.scalingFactors = + object.scaling_factors?.map((e) => BigInt(e)) || []; + if ( + object.scaling_factor_controller !== undefined && + object.scaling_factor_controller !== null + ) { + message.scalingFactorController = object.scaling_factor_controller; + } + return message; + }, + toAmino(message: Pool): PoolAmino { + const obj: any = {}; + obj.address = message.address === '' ? undefined : message.address; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined; + obj.future_pool_governor = + message.futurePoolGovernor === '' + ? undefined + : message.futurePoolGovernor; + obj.total_shares = message.totalShares + ? Coin.toAmino(message.totalShares) + : undefined; + if (message.poolLiquidity) { + obj.pool_liquidity = message.poolLiquidity.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.pool_liquidity = message.poolLiquidity; + } + if (message.scalingFactors) { + obj.scaling_factors = message.scalingFactors.map((e) => e.toString()); + } else { + obj.scaling_factors = message.scalingFactors; + } + obj.scaling_factor_controller = + message.scalingFactorController === '' + ? undefined + : message.scalingFactorController; + return obj; + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value); + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: 'osmosis/gamm/StableswapPool', + value: Pool.toAmino(message), + }; + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value); + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish(); + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool', + value: Pool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts new file mode 100644 index 00000000..04d81dea --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts @@ -0,0 +1,18 @@ +//@ts-nocheck +import { + MsgCreateStableswapPool, + MsgStableSwapAdjustScalingFactors, +} from './tx'; +export const AminoConverter = { + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool': { + aminoType: 'osmosis/gamm/create-stableswap-pool', + toAmino: MsgCreateStableswapPool.toAmino, + fromAmino: MsgCreateStableswapPool.fromAmino, + }, + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors': + { + aminoType: 'osmosis/gamm/stableswap-adjust-scaling-factors', + toAmino: MsgStableSwapAdjustScalingFactors.toAmino, + fromAmino: MsgStableSwapAdjustScalingFactors.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts new file mode 100644 index 00000000..1e4d8f24 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts @@ -0,0 +1,72 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgCreateStableswapPool, + MsgStableSwapAdjustScalingFactors, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + MsgCreateStableswapPool, + ], + [ + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + MsgStableSwapAdjustScalingFactors, + ], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value: MsgCreateStableswapPool.encode(value).finish(), + }; + }, + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value: MsgStableSwapAdjustScalingFactors.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value, + }; + }, + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value, + }; + }, + }, + fromPartial: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value: MsgCreateStableswapPool.fromPartial(value), + }; + }, + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value: MsgStableSwapAdjustScalingFactors.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..f3757c25 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,56 @@ +//@ts-nocheck +import { Rpc } from '../../../../../helpers'; +import { BinaryReader } from '../../../../../binary'; + +import { + MsgCreateStableswapPool, + MsgCreateStableswapPoolResponse, + MsgStableSwapAdjustScalingFactors, + MsgStableSwapAdjustScalingFactorsResponse, +} from './tx'; +export interface Msg { + createStableswapPool( + request: MsgCreateStableswapPool + ): Promise; + stableSwapAdjustScalingFactors( + request: MsgStableSwapAdjustScalingFactors + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createStableswapPool = this.createStableswapPool.bind(this); + this.stableSwapAdjustScalingFactors = + this.stableSwapAdjustScalingFactors.bind(this); + } + createStableswapPool( + request: MsgCreateStableswapPool + ): Promise { + const data = MsgCreateStableswapPool.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.poolmodels.stableswap.v1beta1.Msg', + 'CreateStableswapPool', + data + ); + return promise.then((data) => + MsgCreateStableswapPoolResponse.decode(new BinaryReader(data)) + ); + } + stableSwapAdjustScalingFactors( + request: MsgStableSwapAdjustScalingFactors + ): Promise { + const data = MsgStableSwapAdjustScalingFactors.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.poolmodels.stableswap.v1beta1.Msg', + 'StableSwapAdjustScalingFactors', + data + ); + return promise.then((data) => + MsgStableSwapAdjustScalingFactorsResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts new file mode 100644 index 00000000..68ccdd35 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts @@ -0,0 +1,759 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../../../binary'; +import { GlobalDecoderRegistry } from '../../../../../registry'; + +import { + PoolParams, + PoolParamsAmino, + PoolParamsSDKType, +} from './stableswap_pool'; +/** ===================== MsgCreatePool */ +export interface MsgCreateStableswapPool { + sender: string; + poolParams?: PoolParams; + initialPoolLiquidity: Coin[]; + scalingFactors: bigint[]; + futurePoolGovernor: string; + scalingFactorController: string; +} +export interface MsgCreateStableswapPoolProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool'; + value: Uint8Array; +} +/** ===================== MsgCreatePool */ +export interface MsgCreateStableswapPoolAmino { + sender?: string; + pool_params?: PoolParamsAmino; + initial_pool_liquidity?: CoinAmino[]; + scaling_factors?: string[]; + future_pool_governor?: string; + scaling_factor_controller?: string; +} +export interface MsgCreateStableswapPoolAminoMsg { + type: 'osmosis/gamm/create-stableswap-pool'; + value: MsgCreateStableswapPoolAmino; +} +/** ===================== MsgCreatePool */ +export interface MsgCreateStableswapPoolSDKType { + sender: string; + pool_params?: PoolParamsSDKType; + initial_pool_liquidity: CoinSDKType[]; + scaling_factors: bigint[]; + future_pool_governor: string; + scaling_factor_controller: string; +} +/** Returns a poolID with custom poolName. */ +export interface MsgCreateStableswapPoolResponse { + poolId: bigint; +} +export interface MsgCreateStableswapPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPoolResponse'; + value: Uint8Array; +} +/** Returns a poolID with custom poolName. */ +export interface MsgCreateStableswapPoolResponseAmino { + pool_id?: string; +} +export interface MsgCreateStableswapPoolResponseAminoMsg { + type: 'osmosis/gamm/create-stableswap-pool-response'; + value: MsgCreateStableswapPoolResponseAmino; +} +/** Returns a poolID with custom poolName. */ +export interface MsgCreateStableswapPoolResponseSDKType { + pool_id: bigint; +} +/** + * Sender must be the pool's scaling_factor_governor in order for the tx to + * succeed. Adjusts stableswap scaling factors. + */ +export interface MsgStableSwapAdjustScalingFactors { + sender: string; + poolId: bigint; + scalingFactors: bigint[]; +} +export interface MsgStableSwapAdjustScalingFactorsProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors'; + value: Uint8Array; +} +/** + * Sender must be the pool's scaling_factor_governor in order for the tx to + * succeed. Adjusts stableswap scaling factors. + */ +export interface MsgStableSwapAdjustScalingFactorsAmino { + sender?: string; + pool_id?: string; + scaling_factors?: string[]; +} +export interface MsgStableSwapAdjustScalingFactorsAminoMsg { + type: 'osmosis/gamm/stableswap-adjust-scaling-factors'; + value: MsgStableSwapAdjustScalingFactorsAmino; +} +/** + * Sender must be the pool's scaling_factor_governor in order for the tx to + * succeed. Adjusts stableswap scaling factors. + */ +export interface MsgStableSwapAdjustScalingFactorsSDKType { + sender: string; + pool_id: bigint; + scaling_factors: bigint[]; +} +export interface MsgStableSwapAdjustScalingFactorsResponse {} +export interface MsgStableSwapAdjustScalingFactorsResponseProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactorsResponse'; + value: Uint8Array; +} +export interface MsgStableSwapAdjustScalingFactorsResponseAmino {} +export interface MsgStableSwapAdjustScalingFactorsResponseAminoMsg { + type: 'osmosis/gamm/stable-swap-adjust-scaling-factors-response'; + value: MsgStableSwapAdjustScalingFactorsResponseAmino; +} +export interface MsgStableSwapAdjustScalingFactorsResponseSDKType {} +function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { + return { + sender: '', + poolParams: undefined, + initialPoolLiquidity: [], + scalingFactors: [], + futurePoolGovernor: '', + scalingFactorController: '', + }; +} +export const MsgCreateStableswapPool = { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + aminoType: 'osmosis/gamm/create-stableswap-pool', + is(o: any): o is MsgCreateStableswapPool { + return ( + o && + (o.$typeUrl === MsgCreateStableswapPool.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.initialPoolLiquidity) && + (!o.initialPoolLiquidity.length || + Coin.is(o.initialPoolLiquidity[0])) && + Array.isArray(o.scalingFactors) && + (!o.scalingFactors.length || + typeof o.scalingFactors[0] === 'bigint') && + typeof o.futurePoolGovernor === 'string' && + typeof o.scalingFactorController === 'string')) + ); + }, + isSDK(o: any): o is MsgCreateStableswapPoolSDKType { + return ( + o && + (o.$typeUrl === MsgCreateStableswapPool.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.initial_pool_liquidity) && + (!o.initial_pool_liquidity.length || + Coin.isSDK(o.initial_pool_liquidity[0])) && + Array.isArray(o.scaling_factors) && + (!o.scaling_factors.length || + typeof o.scaling_factors[0] === 'bigint') && + typeof o.future_pool_governor === 'string' && + typeof o.scaling_factor_controller === 'string')) + ); + }, + isAmino(o: any): o is MsgCreateStableswapPoolAmino { + return ( + o && + (o.$typeUrl === MsgCreateStableswapPool.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.initial_pool_liquidity) && + (!o.initial_pool_liquidity.length || + Coin.isAmino(o.initial_pool_liquidity[0])) && + Array.isArray(o.scaling_factors) && + (!o.scaling_factors.length || + typeof o.scaling_factors[0] === 'bigint') && + typeof o.future_pool_governor === 'string' && + typeof o.scaling_factor_controller === 'string')) + ); + }, + encode( + message: MsgCreateStableswapPool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.initialPoolLiquidity) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.scalingFactors) { + writer.uint64(v); + } + writer.ldelim(); + if (message.futurePoolGovernor !== '') { + writer.uint32(42).string(message.futurePoolGovernor); + } + if (message.scalingFactorController !== '') { + writer.uint32(50).string(message.scalingFactorController); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateStableswapPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateStableswapPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolParams = PoolParams.decode(reader, reader.uint32()); + break; + case 3: + message.initialPoolLiquidity.push( + Coin.decode(reader, reader.uint32()) + ); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.scalingFactors.push(reader.uint64()); + } + } else { + message.scalingFactors.push(reader.uint64()); + } + break; + case 5: + message.futurePoolGovernor = reader.string(); + break; + case 6: + message.scalingFactorController = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreateStableswapPool { + const message = createBaseMsgCreateStableswapPool(); + message.sender = object.sender ?? ''; + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined; + message.initialPoolLiquidity = + object.initialPoolLiquidity?.map((e) => Coin.fromPartial(e)) || []; + message.scalingFactors = + object.scalingFactors?.map((e) => BigInt(e.toString())) || []; + message.futurePoolGovernor = object.futurePoolGovernor ?? ''; + message.scalingFactorController = object.scalingFactorController ?? ''; + return message; + }, + fromAmino(object: MsgCreateStableswapPoolAmino): MsgCreateStableswapPool { + const message = createBaseMsgCreateStableswapPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + message.initialPoolLiquidity = + object.initial_pool_liquidity?.map((e) => Coin.fromAmino(e)) || []; + message.scalingFactors = + object.scaling_factors?.map((e) => BigInt(e)) || []; + if ( + object.future_pool_governor !== undefined && + object.future_pool_governor !== null + ) { + message.futurePoolGovernor = object.future_pool_governor; + } + if ( + object.scaling_factor_controller !== undefined && + object.scaling_factor_controller !== null + ) { + message.scalingFactorController = object.scaling_factor_controller; + } + return message; + }, + toAmino(message: MsgCreateStableswapPool): MsgCreateStableswapPoolAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined; + if (message.initialPoolLiquidity) { + obj.initial_pool_liquidity = message.initialPoolLiquidity.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.initial_pool_liquidity = message.initialPoolLiquidity; + } + if (message.scalingFactors) { + obj.scaling_factors = message.scalingFactors.map((e) => e.toString()); + } else { + obj.scaling_factors = message.scalingFactors; + } + obj.future_pool_governor = + message.futurePoolGovernor === '' + ? undefined + : message.futurePoolGovernor; + obj.scaling_factor_controller = + message.scalingFactorController === '' + ? undefined + : message.scalingFactorController; + return obj; + }, + fromAminoMsg( + object: MsgCreateStableswapPoolAminoMsg + ): MsgCreateStableswapPool { + return MsgCreateStableswapPool.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCreateStableswapPool + ): MsgCreateStableswapPoolAminoMsg { + return { + type: 'osmosis/gamm/create-stableswap-pool', + value: MsgCreateStableswapPool.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateStableswapPoolProtoMsg + ): MsgCreateStableswapPool { + return MsgCreateStableswapPool.decode(message.value); + }, + toProto(message: MsgCreateStableswapPool): Uint8Array { + return MsgCreateStableswapPool.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreateStableswapPool + ): MsgCreateStableswapPoolProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value: MsgCreateStableswapPool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateStableswapPool.typeUrl, + MsgCreateStableswapPool +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateStableswapPool.aminoType, + MsgCreateStableswapPool.typeUrl +); +function createBaseMsgCreateStableswapPoolResponse(): MsgCreateStableswapPoolResponse { + return { + poolId: BigInt(0), + }; +} +export const MsgCreateStableswapPoolResponse = { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPoolResponse', + aminoType: 'osmosis/gamm/create-stableswap-pool-response', + is(o: any): o is MsgCreateStableswapPoolResponse { + return ( + o && + (o.$typeUrl === MsgCreateStableswapPoolResponse.typeUrl || + typeof o.poolId === 'bigint') + ); + }, + isSDK(o: any): o is MsgCreateStableswapPoolResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCreateStableswapPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + isAmino(o: any): o is MsgCreateStableswapPoolResponseAmino { + return ( + o && + (o.$typeUrl === MsgCreateStableswapPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + encode( + message: MsgCreateStableswapPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateStableswapPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateStableswapPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreateStableswapPoolResponse { + const message = createBaseMsgCreateStableswapPoolResponse(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgCreateStableswapPoolResponseAmino + ): MsgCreateStableswapPoolResponse { + const message = createBaseMsgCreateStableswapPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino( + message: MsgCreateStableswapPoolResponse + ): MsgCreateStableswapPoolResponseAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgCreateStableswapPoolResponseAminoMsg + ): MsgCreateStableswapPoolResponse { + return MsgCreateStableswapPoolResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgCreateStableswapPoolResponse + ): MsgCreateStableswapPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/create-stableswap-pool-response', + value: MsgCreateStableswapPoolResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateStableswapPoolResponseProtoMsg + ): MsgCreateStableswapPoolResponse { + return MsgCreateStableswapPoolResponse.decode(message.value); + }, + toProto(message: MsgCreateStableswapPoolResponse): Uint8Array { + return MsgCreateStableswapPoolResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreateStableswapPoolResponse + ): MsgCreateStableswapPoolResponseProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPoolResponse', + value: MsgCreateStableswapPoolResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateStableswapPoolResponse.typeUrl, + MsgCreateStableswapPoolResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateStableswapPoolResponse.aminoType, + MsgCreateStableswapPoolResponse.typeUrl +); +function createBaseMsgStableSwapAdjustScalingFactors(): MsgStableSwapAdjustScalingFactors { + return { + sender: '', + poolId: BigInt(0), + scalingFactors: [], + }; +} +export const MsgStableSwapAdjustScalingFactors = { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + aminoType: 'osmosis/gamm/stableswap-adjust-scaling-factors', + is(o: any): o is MsgStableSwapAdjustScalingFactors { + return ( + o && + (o.$typeUrl === MsgStableSwapAdjustScalingFactors.typeUrl || + (typeof o.sender === 'string' && + typeof o.poolId === 'bigint' && + Array.isArray(o.scalingFactors) && + (!o.scalingFactors.length || + typeof o.scalingFactors[0] === 'bigint'))) + ); + }, + isSDK(o: any): o is MsgStableSwapAdjustScalingFactorsSDKType { + return ( + o && + (o.$typeUrl === MsgStableSwapAdjustScalingFactors.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + Array.isArray(o.scaling_factors) && + (!o.scaling_factors.length || + typeof o.scaling_factors[0] === 'bigint'))) + ); + }, + isAmino(o: any): o is MsgStableSwapAdjustScalingFactorsAmino { + return ( + o && + (o.$typeUrl === MsgStableSwapAdjustScalingFactors.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + Array.isArray(o.scaling_factors) && + (!o.scaling_factors.length || + typeof o.scaling_factors[0] === 'bigint'))) + ); + }, + encode( + message: MsgStableSwapAdjustScalingFactors, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + writer.uint32(26).fork(); + for (const v of message.scalingFactors) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgStableSwapAdjustScalingFactors { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStableSwapAdjustScalingFactors(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.scalingFactors.push(reader.uint64()); + } + } else { + message.scalingFactors.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgStableSwapAdjustScalingFactors { + const message = createBaseMsgStableSwapAdjustScalingFactors(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.scalingFactors = + object.scalingFactors?.map((e) => BigInt(e.toString())) || []; + return message; + }, + fromAmino( + object: MsgStableSwapAdjustScalingFactorsAmino + ): MsgStableSwapAdjustScalingFactors { + const message = createBaseMsgStableSwapAdjustScalingFactors(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.scalingFactors = + object.scaling_factors?.map((e) => BigInt(e)) || []; + return message; + }, + toAmino( + message: MsgStableSwapAdjustScalingFactors + ): MsgStableSwapAdjustScalingFactorsAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + if (message.scalingFactors) { + obj.scaling_factors = message.scalingFactors.map((e) => e.toString()); + } else { + obj.scaling_factors = message.scalingFactors; + } + return obj; + }, + fromAminoMsg( + object: MsgStableSwapAdjustScalingFactorsAminoMsg + ): MsgStableSwapAdjustScalingFactors { + return MsgStableSwapAdjustScalingFactors.fromAmino(object.value); + }, + toAminoMsg( + message: MsgStableSwapAdjustScalingFactors + ): MsgStableSwapAdjustScalingFactorsAminoMsg { + return { + type: 'osmosis/gamm/stableswap-adjust-scaling-factors', + value: MsgStableSwapAdjustScalingFactors.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgStableSwapAdjustScalingFactorsProtoMsg + ): MsgStableSwapAdjustScalingFactors { + return MsgStableSwapAdjustScalingFactors.decode(message.value); + }, + toProto(message: MsgStableSwapAdjustScalingFactors): Uint8Array { + return MsgStableSwapAdjustScalingFactors.encode(message).finish(); + }, + toProtoMsg( + message: MsgStableSwapAdjustScalingFactors + ): MsgStableSwapAdjustScalingFactorsProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value: MsgStableSwapAdjustScalingFactors.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgStableSwapAdjustScalingFactors.typeUrl, + MsgStableSwapAdjustScalingFactors +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgStableSwapAdjustScalingFactors.aminoType, + MsgStableSwapAdjustScalingFactors.typeUrl +); +function createBaseMsgStableSwapAdjustScalingFactorsResponse(): MsgStableSwapAdjustScalingFactorsResponse { + return {}; +} +export const MsgStableSwapAdjustScalingFactorsResponse = { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactorsResponse', + aminoType: 'osmosis/gamm/stable-swap-adjust-scaling-factors-response', + is(o: any): o is MsgStableSwapAdjustScalingFactorsResponse { + return ( + o && o.$typeUrl === MsgStableSwapAdjustScalingFactorsResponse.typeUrl + ); + }, + isSDK(o: any): o is MsgStableSwapAdjustScalingFactorsResponseSDKType { + return ( + o && o.$typeUrl === MsgStableSwapAdjustScalingFactorsResponse.typeUrl + ); + }, + isAmino(o: any): o is MsgStableSwapAdjustScalingFactorsResponseAmino { + return ( + o && o.$typeUrl === MsgStableSwapAdjustScalingFactorsResponse.typeUrl + ); + }, + encode( + _: MsgStableSwapAdjustScalingFactorsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgStableSwapAdjustScalingFactorsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgStableSwapAdjustScalingFactorsResponse { + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); + return message; + }, + fromAmino( + _: MsgStableSwapAdjustScalingFactorsResponseAmino + ): MsgStableSwapAdjustScalingFactorsResponse { + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); + return message; + }, + toAmino( + _: MsgStableSwapAdjustScalingFactorsResponse + ): MsgStableSwapAdjustScalingFactorsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgStableSwapAdjustScalingFactorsResponseAminoMsg + ): MsgStableSwapAdjustScalingFactorsResponse { + return MsgStableSwapAdjustScalingFactorsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgStableSwapAdjustScalingFactorsResponse + ): MsgStableSwapAdjustScalingFactorsResponseAminoMsg { + return { + type: 'osmosis/gamm/stable-swap-adjust-scaling-factors-response', + value: MsgStableSwapAdjustScalingFactorsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgStableSwapAdjustScalingFactorsResponseProtoMsg + ): MsgStableSwapAdjustScalingFactorsResponse { + return MsgStableSwapAdjustScalingFactorsResponse.decode(message.value); + }, + toProto(message: MsgStableSwapAdjustScalingFactorsResponse): Uint8Array { + return MsgStableSwapAdjustScalingFactorsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgStableSwapAdjustScalingFactorsResponse + ): MsgStableSwapAdjustScalingFactorsResponseProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactorsResponse', + value: MsgStableSwapAdjustScalingFactorsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgStableSwapAdjustScalingFactorsResponse.typeUrl, + MsgStableSwapAdjustScalingFactorsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgStableSwapAdjustScalingFactorsResponse.aminoType, + MsgStableSwapAdjustScalingFactorsResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/balancerPool.ts b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/balancerPool.ts new file mode 100644 index 00000000..ea4816e2 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/balancerPool.ts @@ -0,0 +1,968 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { Timestamp } from '../../../google/protobuf/timestamp'; +import { + Duration, + DurationAmino, + DurationSDKType, +} from '../../../google/protobuf/duration'; +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { toTimestamp, fromTimestamp } from '../../../helpers'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * Parameters for changing the weights in a balancer pool smoothly from + * a start weight and end weight over a period of time. + * Currently, the only smooth change supported is linear changing between + * the two weights, but more types may be added in the future. + * When these parameters are set, the weight w(t) for pool time `t` is the + * following: + * t <= start_time: w(t) = initial_pool_weights + * start_time < t <= start_time + duration: + * w(t) = initial_pool_weights + (t - start_time) * + * (target_pool_weights - initial_pool_weights) / (duration) + * t > start_time + duration: w(t) = target_pool_weights + */ +export interface SmoothWeightChangeParams { + /** + * The start time for beginning the weight change. + * If a parameter change / pool instantiation leaves this blank, + * it should be generated by the state_machine as the current time. + */ + startTime: Date; + /** Duration for the weights to change over */ + duration: Duration; + /** + * The initial pool weights. These are copied from the pool's settings + * at the time of weight change instantiation. + * The amount PoolAsset.token.amount field is ignored if present, + * future type refactorings should just have a type with the denom & weight + * here. + */ + initialPoolWeights: PoolAsset[]; + /** + * The target pool weights. The pool weights will change linearly with respect + * to time between start_time, and start_time + duration. The amount + * PoolAsset.token.amount field is ignored if present, future type + * refactorings should just have a type with the denom & weight here. + */ + targetPoolWeights: PoolAsset[]; +} +export interface SmoothWeightChangeParamsProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.SmoothWeightChangeParams'; + value: Uint8Array; +} +/** + * Parameters for changing the weights in a balancer pool smoothly from + * a start weight and end weight over a period of time. + * Currently, the only smooth change supported is linear changing between + * the two weights, but more types may be added in the future. + * When these parameters are set, the weight w(t) for pool time `t` is the + * following: + * t <= start_time: w(t) = initial_pool_weights + * start_time < t <= start_time + duration: + * w(t) = initial_pool_weights + (t - start_time) * + * (target_pool_weights - initial_pool_weights) / (duration) + * t > start_time + duration: w(t) = target_pool_weights + */ +export interface SmoothWeightChangeParamsAmino { + /** + * The start time for beginning the weight change. + * If a parameter change / pool instantiation leaves this blank, + * it should be generated by the state_machine as the current time. + */ + start_time?: string; + /** Duration for the weights to change over */ + duration?: DurationAmino; + /** + * The initial pool weights. These are copied from the pool's settings + * at the time of weight change instantiation. + * The amount PoolAsset.token.amount field is ignored if present, + * future type refactorings should just have a type with the denom & weight + * here. + */ + initial_pool_weights?: PoolAssetAmino[]; + /** + * The target pool weights. The pool weights will change linearly with respect + * to time between start_time, and start_time + duration. The amount + * PoolAsset.token.amount field is ignored if present, future type + * refactorings should just have a type with the denom & weight here. + */ + target_pool_weights?: PoolAssetAmino[]; +} +export interface SmoothWeightChangeParamsAminoMsg { + type: 'osmosis/gamm/smooth-weight-change-params'; + value: SmoothWeightChangeParamsAmino; +} +/** + * Parameters for changing the weights in a balancer pool smoothly from + * a start weight and end weight over a period of time. + * Currently, the only smooth change supported is linear changing between + * the two weights, but more types may be added in the future. + * When these parameters are set, the weight w(t) for pool time `t` is the + * following: + * t <= start_time: w(t) = initial_pool_weights + * start_time < t <= start_time + duration: + * w(t) = initial_pool_weights + (t - start_time) * + * (target_pool_weights - initial_pool_weights) / (duration) + * t > start_time + duration: w(t) = target_pool_weights + */ +export interface SmoothWeightChangeParamsSDKType { + start_time: Date; + duration: DurationSDKType; + initial_pool_weights: PoolAssetSDKType[]; + target_pool_weights: PoolAssetSDKType[]; +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParams { + swapFee: string; + /** + * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old + * pools can maintain a non-zero fee. No new pool can be created with non-zero + * fee anymore + */ + exitFee: string; + smoothWeightChangeParams?: SmoothWeightChangeParams; +} +export interface PoolParamsProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.PoolParams'; + value: Uint8Array; +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsAmino { + swap_fee?: string; + /** + * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old + * pools can maintain a non-zero fee. No new pool can be created with non-zero + * fee anymore + */ + exit_fee?: string; + smooth_weight_change_params?: SmoothWeightChangeParamsAmino; +} +export interface PoolParamsAminoMsg { + type: 'osmosis/gamm/BalancerPoolParams'; + value: PoolParamsAmino; +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsSDKType { + swap_fee: string; + exit_fee: string; + smooth_weight_change_params?: SmoothWeightChangeParamsSDKType; +} +/** + * Pool asset is an internal struct that combines the amount of the + * token in the pool, and its balancer weight. + * This is an awkward packaging of data, + * and should be revisited in a future state migration. + */ +export interface PoolAsset { + /** + * Coins we are talking about, + * the denomination must be unique amongst all PoolAssets for this pool. + */ + token: Coin; + /** Weight that is not normalized. This weight must be less than 2^50 */ + weight: string; +} +export interface PoolAssetProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.PoolAsset'; + value: Uint8Array; +} +/** + * Pool asset is an internal struct that combines the amount of the + * token in the pool, and its balancer weight. + * This is an awkward packaging of data, + * and should be revisited in a future state migration. + */ +export interface PoolAssetAmino { + /** + * Coins we are talking about, + * the denomination must be unique amongst all PoolAssets for this pool. + */ + token?: CoinAmino; + /** Weight that is not normalized. This weight must be less than 2^50 */ + weight?: string; +} +export interface PoolAssetAminoMsg { + type: 'osmosis/gamm/pool-asset'; + value: PoolAssetAmino; +} +/** + * Pool asset is an internal struct that combines the amount of the + * token in the pool, and its balancer weight. + * This is an awkward packaging of data, + * and should be revisited in a future state migration. + */ +export interface PoolAssetSDKType { + token: CoinSDKType; + weight: string; +} +export interface Pool { + $typeUrl?: '/osmosis.gamm.v1beta1.Pool'; + address: string; + id: bigint; + poolParams: PoolParams; + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * a time specified as 0w,1w,2w, etc. which specifies how long the token + * would need to be locked up to count in governance. 0w means no lockup. + * TODO: Further improve these docs + */ + futurePoolGovernor: string; + /** sum of all LP tokens sent out */ + totalShares: Coin; + /** + * These are assumed to be sorted by denomiation. + * They contain the pool asset and the information about the weight + */ + poolAssets: PoolAsset[]; + /** sum of all non-normalized pool weights */ + totalWeight: string; +} +export interface PoolProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.Pool'; + value: Uint8Array; +} +export interface PoolAmino { + address?: string; + id?: string; + pool_params?: PoolParamsAmino; + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * a time specified as 0w,1w,2w, etc. which specifies how long the token + * would need to be locked up to count in governance. 0w means no lockup. + * TODO: Further improve these docs + */ + future_pool_governor?: string; + /** sum of all LP tokens sent out */ + total_shares?: CoinAmino; + /** + * These are assumed to be sorted by denomiation. + * They contain the pool asset and the information about the weight + */ + pool_assets?: PoolAssetAmino[]; + /** sum of all non-normalized pool weights */ + total_weight?: string; +} +export interface PoolAminoMsg { + type: 'osmosis/gamm/BalancerPool'; + value: PoolAmino; +} +export interface PoolSDKType { + $typeUrl?: '/osmosis.gamm.v1beta1.Pool'; + address: string; + id: bigint; + pool_params: PoolParamsSDKType; + future_pool_governor: string; + total_shares: CoinSDKType; + pool_assets: PoolAssetSDKType[]; + total_weight: string; +} +function createBaseSmoothWeightChangeParams(): SmoothWeightChangeParams { + return { + startTime: new Date(), + duration: Duration.fromPartial({}), + initialPoolWeights: [], + targetPoolWeights: [], + }; +} +export const SmoothWeightChangeParams = { + typeUrl: '/osmosis.gamm.v1beta1.SmoothWeightChangeParams', + aminoType: 'osmosis/gamm/smooth-weight-change-params', + is(o: any): o is SmoothWeightChangeParams { + return ( + o && + (o.$typeUrl === SmoothWeightChangeParams.typeUrl || + (Timestamp.is(o.startTime) && + Duration.is(o.duration) && + Array.isArray(o.initialPoolWeights) && + (!o.initialPoolWeights.length || + PoolAsset.is(o.initialPoolWeights[0])) && + Array.isArray(o.targetPoolWeights) && + (!o.targetPoolWeights.length || + PoolAsset.is(o.targetPoolWeights[0])))) + ); + }, + isSDK(o: any): o is SmoothWeightChangeParamsSDKType { + return ( + o && + (o.$typeUrl === SmoothWeightChangeParams.typeUrl || + (Timestamp.isSDK(o.start_time) && + Duration.isSDK(o.duration) && + Array.isArray(o.initial_pool_weights) && + (!o.initial_pool_weights.length || + PoolAsset.isSDK(o.initial_pool_weights[0])) && + Array.isArray(o.target_pool_weights) && + (!o.target_pool_weights.length || + PoolAsset.isSDK(o.target_pool_weights[0])))) + ); + }, + isAmino(o: any): o is SmoothWeightChangeParamsAmino { + return ( + o && + (o.$typeUrl === SmoothWeightChangeParams.typeUrl || + (Timestamp.isAmino(o.start_time) && + Duration.isAmino(o.duration) && + Array.isArray(o.initial_pool_weights) && + (!o.initial_pool_weights.length || + PoolAsset.isAmino(o.initial_pool_weights[0])) && + Array.isArray(o.target_pool_weights) && + (!o.target_pool_weights.length || + PoolAsset.isAmino(o.target_pool_weights[0])))) + ); + }, + encode( + message: SmoothWeightChangeParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(10).fork() + ).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.initialPoolWeights) { + PoolAsset.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.targetPoolWeights) { + PoolAsset.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SmoothWeightChangeParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSmoothWeightChangeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.initialPoolWeights.push( + PoolAsset.decode(reader, reader.uint32()) + ); + break; + case 4: + message.targetPoolWeights.push( + PoolAsset.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SmoothWeightChangeParams { + const message = createBaseSmoothWeightChangeParams(); + message.startTime = object.startTime ?? undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.initialPoolWeights = + object.initialPoolWeights?.map((e) => PoolAsset.fromPartial(e)) || []; + message.targetPoolWeights = + object.targetPoolWeights?.map((e) => PoolAsset.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { + const message = createBaseSmoothWeightChangeParams(); + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + message.initialPoolWeights = + object.initial_pool_weights?.map((e) => PoolAsset.fromAmino(e)) || []; + message.targetPoolWeights = + object.target_pool_weights?.map((e) => PoolAsset.fromAmino(e)) || []; + return message; + }, + toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { + const obj: any = {}; + obj.start_time = message.startTime + ? Timestamp.toAmino(toTimestamp(message.startTime)) + : undefined; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + if (message.initialPoolWeights) { + obj.initial_pool_weights = message.initialPoolWeights.map((e) => + e ? PoolAsset.toAmino(e) : undefined + ); + } else { + obj.initial_pool_weights = message.initialPoolWeights; + } + if (message.targetPoolWeights) { + obj.target_pool_weights = message.targetPoolWeights.map((e) => + e ? PoolAsset.toAmino(e) : undefined + ); + } else { + obj.target_pool_weights = message.targetPoolWeights; + } + return obj; + }, + fromAminoMsg( + object: SmoothWeightChangeParamsAminoMsg + ): SmoothWeightChangeParams { + return SmoothWeightChangeParams.fromAmino(object.value); + }, + toAminoMsg( + message: SmoothWeightChangeParams + ): SmoothWeightChangeParamsAminoMsg { + return { + type: 'osmosis/gamm/smooth-weight-change-params', + value: SmoothWeightChangeParams.toAmino(message), + }; + }, + fromProtoMsg( + message: SmoothWeightChangeParamsProtoMsg + ): SmoothWeightChangeParams { + return SmoothWeightChangeParams.decode(message.value); + }, + toProto(message: SmoothWeightChangeParams): Uint8Array { + return SmoothWeightChangeParams.encode(message).finish(); + }, + toProtoMsg( + message: SmoothWeightChangeParams + ): SmoothWeightChangeParamsProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.SmoothWeightChangeParams', + value: SmoothWeightChangeParams.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SmoothWeightChangeParams.typeUrl, + SmoothWeightChangeParams +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SmoothWeightChangeParams.aminoType, + SmoothWeightChangeParams.typeUrl +); +function createBasePoolParams(): PoolParams { + return { + swapFee: '', + exitFee: '', + smoothWeightChangeParams: undefined, + }; +} +export const PoolParams = { + typeUrl: '/osmosis.gamm.v1beta1.PoolParams', + aminoType: 'osmosis/gamm/BalancerPoolParams', + is(o: any): o is PoolParams { + return ( + o && + (o.$typeUrl === PoolParams.typeUrl || + (typeof o.swapFee === 'string' && typeof o.exitFee === 'string')) + ); + }, + isSDK(o: any): o is PoolParamsSDKType { + return ( + o && + (o.$typeUrl === PoolParams.typeUrl || + (typeof o.swap_fee === 'string' && typeof o.exit_fee === 'string')) + ); + }, + isAmino(o: any): o is PoolParamsAmino { + return ( + o && + (o.$typeUrl === PoolParams.typeUrl || + (typeof o.swap_fee === 'string' && typeof o.exit_fee === 'string')) + ); + }, + encode( + message: PoolParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.swapFee !== '') { + writer + .uint32(10) + .string(Decimal.fromUserInput(message.swapFee, 18).atomics); + } + if (message.exitFee !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.exitFee, 18).atomics); + } + if (message.smoothWeightChangeParams !== undefined) { + SmoothWeightChangeParams.encode( + message.smoothWeightChangeParams, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.exitFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.smoothWeightChangeParams = SmoothWeightChangeParams.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PoolParams { + const message = createBasePoolParams(); + message.swapFee = object.swapFee ?? ''; + message.exitFee = object.exitFee ?? ''; + message.smoothWeightChangeParams = + object.smoothWeightChangeParams !== undefined && + object.smoothWeightChangeParams !== null + ? SmoothWeightChangeParams.fromPartial(object.smoothWeightChangeParams) + : undefined; + return message; + }, + fromAmino(object: PoolParamsAmino): PoolParams { + const message = createBasePoolParams(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + if (object.exit_fee !== undefined && object.exit_fee !== null) { + message.exitFee = object.exit_fee; + } + if ( + object.smooth_weight_change_params !== undefined && + object.smooth_weight_change_params !== null + ) { + message.smoothWeightChangeParams = SmoothWeightChangeParams.fromAmino( + object.smooth_weight_change_params + ); + } + return message; + }, + toAmino(message: PoolParams): PoolParamsAmino { + const obj: any = {}; + obj.swap_fee = message.swapFee === '' ? undefined : message.swapFee; + obj.exit_fee = message.exitFee === '' ? undefined : message.exitFee; + obj.smooth_weight_change_params = message.smoothWeightChangeParams + ? SmoothWeightChangeParams.toAmino(message.smoothWeightChangeParams) + : undefined; + return obj; + }, + fromAminoMsg(object: PoolParamsAminoMsg): PoolParams { + return PoolParams.fromAmino(object.value); + }, + toAminoMsg(message: PoolParams): PoolParamsAminoMsg { + return { + type: 'osmosis/gamm/BalancerPoolParams', + value: PoolParams.toAmino(message), + }; + }, + fromProtoMsg(message: PoolParamsProtoMsg): PoolParams { + return PoolParams.decode(message.value); + }, + toProto(message: PoolParams): Uint8Array { + return PoolParams.encode(message).finish(); + }, + toProtoMsg(message: PoolParams): PoolParamsProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.PoolParams', + value: PoolParams.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(PoolParams.typeUrl, PoolParams); +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolParams.aminoType, + PoolParams.typeUrl +); +function createBasePoolAsset(): PoolAsset { + return { + token: Coin.fromPartial({}), + weight: '', + }; +} +export const PoolAsset = { + typeUrl: '/osmosis.gamm.v1beta1.PoolAsset', + aminoType: 'osmosis/gamm/pool-asset', + is(o: any): o is PoolAsset { + return ( + o && + (o.$typeUrl === PoolAsset.typeUrl || + (Coin.is(o.token) && typeof o.weight === 'string')) + ); + }, + isSDK(o: any): o is PoolAssetSDKType { + return ( + o && + (o.$typeUrl === PoolAsset.typeUrl || + (Coin.isSDK(o.token) && typeof o.weight === 'string')) + ); + }, + isAmino(o: any): o is PoolAssetAmino { + return ( + o && + (o.$typeUrl === PoolAsset.typeUrl || + (Coin.isAmino(o.token) && typeof o.weight === 'string')) + ); + }, + encode( + message: PoolAsset, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(10).fork()).ldelim(); + } + if (message.weight !== '') { + writer.uint32(18).string(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolAsset { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.weight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PoolAsset { + const message = createBasePoolAsset(); + message.token = + object.token !== undefined && object.token !== null + ? Coin.fromPartial(object.token) + : undefined; + message.weight = object.weight ?? ''; + return message; + }, + fromAmino(object: PoolAssetAmino): PoolAsset { + const message = createBasePoolAsset(); + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; + }, + toAmino(message: PoolAsset): PoolAssetAmino { + const obj: any = {}; + obj.token = message.token ? Coin.toAmino(message.token) : undefined; + obj.weight = message.weight === '' ? undefined : message.weight; + return obj; + }, + fromAminoMsg(object: PoolAssetAminoMsg): PoolAsset { + return PoolAsset.fromAmino(object.value); + }, + toAminoMsg(message: PoolAsset): PoolAssetAminoMsg { + return { + type: 'osmosis/gamm/pool-asset', + value: PoolAsset.toAmino(message), + }; + }, + fromProtoMsg(message: PoolAssetProtoMsg): PoolAsset { + return PoolAsset.decode(message.value); + }, + toProto(message: PoolAsset): Uint8Array { + return PoolAsset.encode(message).finish(); + }, + toProtoMsg(message: PoolAsset): PoolAssetProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.PoolAsset', + value: PoolAsset.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(PoolAsset.typeUrl, PoolAsset); +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolAsset.aminoType, + PoolAsset.typeUrl +); +function createBasePool(): Pool { + return { + $typeUrl: '/osmosis.gamm.v1beta1.Pool', + address: '', + id: BigInt(0), + poolParams: PoolParams.fromPartial({}), + futurePoolGovernor: '', + totalShares: Coin.fromPartial({}), + poolAssets: [], + totalWeight: '', + }; +} +export const Pool = { + typeUrl: '/osmosis.gamm.v1beta1.Pool', + aminoType: 'osmosis/gamm/BalancerPool', + is(o: any): o is Pool { + return ( + o && + (o.$typeUrl === Pool.typeUrl || + (typeof o.address === 'string' && + typeof o.id === 'bigint' && + PoolParams.is(o.poolParams) && + typeof o.futurePoolGovernor === 'string' && + Coin.is(o.totalShares) && + Array.isArray(o.poolAssets) && + (!o.poolAssets.length || PoolAsset.is(o.poolAssets[0])) && + typeof o.totalWeight === 'string')) + ); + }, + isSDK(o: any): o is PoolSDKType { + return ( + o && + (o.$typeUrl === Pool.typeUrl || + (typeof o.address === 'string' && + typeof o.id === 'bigint' && + PoolParams.isSDK(o.pool_params) && + typeof o.future_pool_governor === 'string' && + Coin.isSDK(o.total_shares) && + Array.isArray(o.pool_assets) && + (!o.pool_assets.length || PoolAsset.isSDK(o.pool_assets[0])) && + typeof o.total_weight === 'string')) + ); + }, + isAmino(o: any): o is PoolAmino { + return ( + o && + (o.$typeUrl === Pool.typeUrl || + (typeof o.address === 'string' && + typeof o.id === 'bigint' && + PoolParams.isAmino(o.pool_params) && + typeof o.future_pool_governor === 'string' && + Coin.isAmino(o.total_shares) && + Array.isArray(o.pool_assets) && + (!o.pool_assets.length || PoolAsset.isAmino(o.pool_assets[0])) && + typeof o.total_weight === 'string')) + ); + }, + encode( + message: Pool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + if (message.id !== BigInt(0)) { + writer.uint32(16).uint64(message.id); + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(26).fork()).ldelim(); + } + if (message.futurePoolGovernor !== '') { + writer.uint32(34).string(message.futurePoolGovernor); + } + if (message.totalShares !== undefined) { + Coin.encode(message.totalShares, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.poolAssets) { + PoolAsset.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.totalWeight !== '') { + writer.uint32(58).string(message.totalWeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.id = reader.uint64(); + break; + case 3: + message.poolParams = PoolParams.decode(reader, reader.uint32()); + break; + case 4: + message.futurePoolGovernor = reader.string(); + break; + case 5: + message.totalShares = Coin.decode(reader, reader.uint32()); + break; + case 6: + message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())); + break; + case 7: + message.totalWeight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Pool { + const message = createBasePool(); + message.address = object.address ?? ''; + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0); + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined; + message.futurePoolGovernor = object.futurePoolGovernor ?? ''; + message.totalShares = + object.totalShares !== undefined && object.totalShares !== null + ? Coin.fromPartial(object.totalShares) + : undefined; + message.poolAssets = + object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || []; + message.totalWeight = object.totalWeight ?? ''; + return message; + }, + fromAmino(object: PoolAmino): Pool { + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + if ( + object.future_pool_governor !== undefined && + object.future_pool_governor !== null + ) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + message.poolAssets = + object.pool_assets?.map((e) => PoolAsset.fromAmino(e)) || []; + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + return message; + }, + toAmino(message: Pool): PoolAmino { + const obj: any = {}; + obj.address = message.address === '' ? undefined : message.address; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined; + obj.future_pool_governor = + message.futurePoolGovernor === '' + ? undefined + : message.futurePoolGovernor; + obj.total_shares = message.totalShares + ? Coin.toAmino(message.totalShares) + : undefined; + if (message.poolAssets) { + obj.pool_assets = message.poolAssets.map((e) => + e ? PoolAsset.toAmino(e) : undefined + ); + } else { + obj.pool_assets = message.poolAssets; + } + obj.total_weight = + message.totalWeight === '' ? undefined : message.totalWeight; + return obj; + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value); + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: 'osmosis/gamm/BalancerPool', + value: Pool.toAmino(message), + }; + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value); + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish(); + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.Pool', + value: Pool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.amino.ts new file mode 100644 index 00000000..c052b284 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.amino.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { + MsgJoinPool, + MsgExitPool, + MsgSwapExactAmountIn, + MsgSwapExactAmountOut, + MsgJoinSwapExternAmountIn, + MsgJoinSwapShareAmountOut, + MsgExitSwapExternAmountOut, + MsgExitSwapShareAmountIn, +} from './tx'; +export const AminoConverter = { + '/osmosis.gamm.v1beta1.MsgJoinPool': { + aminoType: 'osmosis/gamm/join-pool', + toAmino: MsgJoinPool.toAmino, + fromAmino: MsgJoinPool.fromAmino, + }, + '/osmosis.gamm.v1beta1.MsgExitPool': { + aminoType: 'osmosis/gamm/exit-pool', + toAmino: MsgExitPool.toAmino, + fromAmino: MsgExitPool.fromAmino, + }, + '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn': { + aminoType: 'osmosis/gamm/swap-exact-amount-in', + toAmino: MsgSwapExactAmountIn.toAmino, + fromAmino: MsgSwapExactAmountIn.fromAmino, + }, + '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut': { + aminoType: 'osmosis/gamm/swap-exact-amount-out', + toAmino: MsgSwapExactAmountOut.toAmino, + fromAmino: MsgSwapExactAmountOut.fromAmino, + }, + '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn': { + aminoType: 'osmosis/gamm/join-swap-extern-amount-in', + toAmino: MsgJoinSwapExternAmountIn.toAmino, + fromAmino: MsgJoinSwapExternAmountIn.fromAmino, + }, + '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut': { + aminoType: 'osmosis/gamm/join-swap-share-amount-out', + toAmino: MsgJoinSwapShareAmountOut.toAmino, + fromAmino: MsgJoinSwapShareAmountOut.fromAmino, + }, + '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut': { + aminoType: 'osmosis/gamm/exit-swap-extern-amount-out', + toAmino: MsgExitSwapExternAmountOut.toAmino, + fromAmino: MsgExitSwapExternAmountOut.fromAmino, + }, + '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn': { + aminoType: 'osmosis/gamm/exit-swap-share-amount-in', + toAmino: MsgExitSwapShareAmountIn.toAmino, + fromAmino: MsgExitSwapShareAmountIn.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.registry.ts new file mode 100644 index 00000000..43eb640b --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.registry.ts @@ -0,0 +1,189 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgJoinPool, + MsgExitPool, + MsgSwapExactAmountIn, + MsgSwapExactAmountOut, + MsgJoinSwapExternAmountIn, + MsgJoinSwapShareAmountOut, + MsgExitSwapExternAmountOut, + MsgExitSwapShareAmountIn, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.gamm.v1beta1.MsgJoinPool', MsgJoinPool], + ['/osmosis.gamm.v1beta1.MsgExitPool', MsgExitPool], + ['/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', MsgSwapExactAmountIn], + ['/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', MsgSwapExactAmountOut], + [ + '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + MsgJoinSwapExternAmountIn, + ], + [ + '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + MsgJoinSwapShareAmountOut, + ], + [ + '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + MsgExitSwapExternAmountOut, + ], + ['/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', MsgExitSwapShareAmountIn], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + joinPool(value: MsgJoinPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value: MsgJoinPool.encode(value).finish(), + }; + }, + exitPool(value: MsgExitPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value: MsgExitPool.encode(value).finish(), + }; + }, + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(value).finish(), + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(value).finish(), + }; + }, + joinSwapExternAmountIn(value: MsgJoinSwapExternAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value: MsgJoinSwapExternAmountIn.encode(value).finish(), + }; + }, + joinSwapShareAmountOut(value: MsgJoinSwapShareAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value: MsgJoinSwapShareAmountOut.encode(value).finish(), + }; + }, + exitSwapExternAmountOut(value: MsgExitSwapExternAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value: MsgExitSwapExternAmountOut.encode(value).finish(), + }; + }, + exitSwapShareAmountIn(value: MsgExitSwapShareAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value: MsgExitSwapShareAmountIn.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + joinPool(value: MsgJoinPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value, + }; + }, + exitPool(value: MsgExitPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value, + }; + }, + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value, + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value, + }; + }, + joinSwapExternAmountIn(value: MsgJoinSwapExternAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value, + }; + }, + joinSwapShareAmountOut(value: MsgJoinSwapShareAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value, + }; + }, + exitSwapExternAmountOut(value: MsgExitSwapExternAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value, + }; + }, + exitSwapShareAmountIn(value: MsgExitSwapShareAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value, + }; + }, + }, + fromPartial: { + joinPool(value: MsgJoinPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value: MsgJoinPool.fromPartial(value), + }; + }, + exitPool(value: MsgExitPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value: MsgExitPool.fromPartial(value), + }; + }, + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.fromPartial(value), + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.fromPartial(value), + }; + }, + joinSwapExternAmountIn(value: MsgJoinSwapExternAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value: MsgJoinSwapExternAmountIn.fromPartial(value), + }; + }, + joinSwapShareAmountOut(value: MsgJoinSwapShareAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value: MsgJoinSwapShareAmountOut.fromPartial(value), + }; + }, + exitSwapExternAmountOut(value: MsgExitSwapExternAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value: MsgExitSwapExternAmountOut.fromPartial(value), + }; + }, + exitSwapShareAmountIn(value: MsgExitSwapShareAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value: MsgExitSwapShareAmountIn.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..e5d1d65d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,161 @@ +//@ts-nocheck +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; + +import { + MsgJoinPool, + MsgJoinPoolResponse, + MsgExitPool, + MsgExitPoolResponse, + MsgSwapExactAmountIn, + MsgSwapExactAmountInResponse, + MsgSwapExactAmountOut, + MsgSwapExactAmountOutResponse, + MsgJoinSwapExternAmountIn, + MsgJoinSwapExternAmountInResponse, + MsgJoinSwapShareAmountOut, + MsgJoinSwapShareAmountOutResponse, + MsgExitSwapExternAmountOut, + MsgExitSwapExternAmountOutResponse, + MsgExitSwapShareAmountIn, + MsgExitSwapShareAmountInResponse, +} from './tx'; +export interface Msg { + joinPool(request: MsgJoinPool): Promise; + exitPool(request: MsgExitPool): Promise; + swapExactAmountIn( + request: MsgSwapExactAmountIn + ): Promise; + swapExactAmountOut( + request: MsgSwapExactAmountOut + ): Promise; + joinSwapExternAmountIn( + request: MsgJoinSwapExternAmountIn + ): Promise; + joinSwapShareAmountOut( + request: MsgJoinSwapShareAmountOut + ): Promise; + exitSwapExternAmountOut( + request: MsgExitSwapExternAmountOut + ): Promise; + exitSwapShareAmountIn( + request: MsgExitSwapShareAmountIn + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.joinPool = this.joinPool.bind(this); + this.exitPool = this.exitPool.bind(this); + this.swapExactAmountIn = this.swapExactAmountIn.bind(this); + this.swapExactAmountOut = this.swapExactAmountOut.bind(this); + this.joinSwapExternAmountIn = this.joinSwapExternAmountIn.bind(this); + this.joinSwapShareAmountOut = this.joinSwapShareAmountOut.bind(this); + this.exitSwapExternAmountOut = this.exitSwapExternAmountOut.bind(this); + this.exitSwapShareAmountIn = this.exitSwapShareAmountIn.bind(this); + } + joinPool(request: MsgJoinPool): Promise { + const data = MsgJoinPool.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'JoinPool', + data + ); + return promise.then((data) => + MsgJoinPoolResponse.decode(new BinaryReader(data)) + ); + } + exitPool(request: MsgExitPool): Promise { + const data = MsgExitPool.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'ExitPool', + data + ); + return promise.then((data) => + MsgExitPoolResponse.decode(new BinaryReader(data)) + ); + } + swapExactAmountIn( + request: MsgSwapExactAmountIn + ): Promise { + const data = MsgSwapExactAmountIn.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'SwapExactAmountIn', + data + ); + return promise.then((data) => + MsgSwapExactAmountInResponse.decode(new BinaryReader(data)) + ); + } + swapExactAmountOut( + request: MsgSwapExactAmountOut + ): Promise { + const data = MsgSwapExactAmountOut.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'SwapExactAmountOut', + data + ); + return promise.then((data) => + MsgSwapExactAmountOutResponse.decode(new BinaryReader(data)) + ); + } + joinSwapExternAmountIn( + request: MsgJoinSwapExternAmountIn + ): Promise { + const data = MsgJoinSwapExternAmountIn.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'JoinSwapExternAmountIn', + data + ); + return promise.then((data) => + MsgJoinSwapExternAmountInResponse.decode(new BinaryReader(data)) + ); + } + joinSwapShareAmountOut( + request: MsgJoinSwapShareAmountOut + ): Promise { + const data = MsgJoinSwapShareAmountOut.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'JoinSwapShareAmountOut', + data + ); + return promise.then((data) => + MsgJoinSwapShareAmountOutResponse.decode(new BinaryReader(data)) + ); + } + exitSwapExternAmountOut( + request: MsgExitSwapExternAmountOut + ): Promise { + const data = MsgExitSwapExternAmountOut.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'ExitSwapExternAmountOut', + data + ); + return promise.then((data) => + MsgExitSwapExternAmountOutResponse.decode(new BinaryReader(data)) + ); + } + exitSwapShareAmountIn( + request: MsgExitSwapShareAmountIn + ): Promise { + const data = MsgExitSwapShareAmountIn.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.gamm.v1beta1.Msg', + 'ExitSwapShareAmountIn', + data + ); + return promise.then((data) => + MsgExitSwapShareAmountInResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.ts new file mode 100644 index 00000000..60436d5a --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/gamm/v1beta1/tx.ts @@ -0,0 +1,2792 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { + SwapAmountInRoute, + SwapAmountInRouteAmino, + SwapAmountInRouteSDKType, + SwapAmountOutRoute, + SwapAmountOutRouteAmino, + SwapAmountOutRouteSDKType, +} from '../../poolmanager/v1beta1/swap_route'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * ===================== MsgJoinPool + * This is really MsgJoinPoolNoSwap + */ +export interface MsgJoinPool { + sender: string; + poolId: bigint; + shareOutAmount: string; + tokenInMaxs: Coin[]; +} +export interface MsgJoinPoolProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool'; + value: Uint8Array; +} +/** + * ===================== MsgJoinPool + * This is really MsgJoinPoolNoSwap + */ +export interface MsgJoinPoolAmino { + sender?: string; + pool_id?: string; + share_out_amount?: string; + token_in_maxs?: CoinAmino[]; +} +export interface MsgJoinPoolAminoMsg { + type: 'osmosis/gamm/join-pool'; + value: MsgJoinPoolAmino; +} +/** + * ===================== MsgJoinPool + * This is really MsgJoinPoolNoSwap + */ +export interface MsgJoinPoolSDKType { + sender: string; + pool_id: bigint; + share_out_amount: string; + token_in_maxs: CoinSDKType[]; +} +export interface MsgJoinPoolResponse { + shareOutAmount: string; + tokenIn: Coin[]; +} +export interface MsgJoinPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPoolResponse'; + value: Uint8Array; +} +export interface MsgJoinPoolResponseAmino { + share_out_amount?: string; + token_in?: CoinAmino[]; +} +export interface MsgJoinPoolResponseAminoMsg { + type: 'osmosis/gamm/join-pool-response'; + value: MsgJoinPoolResponseAmino; +} +export interface MsgJoinPoolResponseSDKType { + share_out_amount: string; + token_in: CoinSDKType[]; +} +/** ===================== MsgExitPool */ +export interface MsgExitPool { + sender: string; + poolId: bigint; + shareInAmount: string; + tokenOutMins: Coin[]; +} +export interface MsgExitPoolProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool'; + value: Uint8Array; +} +/** ===================== MsgExitPool */ +export interface MsgExitPoolAmino { + sender?: string; + pool_id?: string; + share_in_amount?: string; + token_out_mins?: CoinAmino[]; +} +export interface MsgExitPoolAminoMsg { + type: 'osmosis/gamm/exit-pool'; + value: MsgExitPoolAmino; +} +/** ===================== MsgExitPool */ +export interface MsgExitPoolSDKType { + sender: string; + pool_id: bigint; + share_in_amount: string; + token_out_mins: CoinSDKType[]; +} +export interface MsgExitPoolResponse { + tokenOut: Coin[]; +} +export interface MsgExitPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPoolResponse'; + value: Uint8Array; +} +export interface MsgExitPoolResponseAmino { + token_out?: CoinAmino[]; +} +export interface MsgExitPoolResponseAminoMsg { + type: 'osmosis/gamm/exit-pool-response'; + value: MsgExitPoolResponseAmino; +} +export interface MsgExitPoolResponseSDKType { + token_out: CoinSDKType[]; +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountIn { + sender: string; + routes: SwapAmountInRoute[]; + tokenIn: Coin; + tokenOutMinAmount: string; +} +export interface MsgSwapExactAmountInProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn'; + value: Uint8Array; +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInAmino { + sender?: string; + routes?: SwapAmountInRouteAmino[]; + token_in?: CoinAmino; + token_out_min_amount?: string; +} +export interface MsgSwapExactAmountInAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-in'; + value: MsgSwapExactAmountInAmino; +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInSDKType { + sender: string; + routes: SwapAmountInRouteSDKType[]; + token_in: CoinSDKType; + token_out_min_amount: string; +} +export interface MsgSwapExactAmountInResponse { + tokenOutAmount: string; +} +export interface MsgSwapExactAmountInResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountInResponse'; + value: Uint8Array; +} +export interface MsgSwapExactAmountInResponseAmino { + token_out_amount?: string; +} +export interface MsgSwapExactAmountInResponseAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-in-response'; + value: MsgSwapExactAmountInResponseAmino; +} +export interface MsgSwapExactAmountInResponseSDKType { + token_out_amount: string; +} +export interface MsgSwapExactAmountOut { + sender: string; + routes: SwapAmountOutRoute[]; + tokenInMaxAmount: string; + tokenOut: Coin; +} +export interface MsgSwapExactAmountOutProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut'; + value: Uint8Array; +} +export interface MsgSwapExactAmountOutAmino { + sender?: string; + routes?: SwapAmountOutRouteAmino[]; + token_in_max_amount?: string; + token_out?: CoinAmino; +} +export interface MsgSwapExactAmountOutAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-out'; + value: MsgSwapExactAmountOutAmino; +} +export interface MsgSwapExactAmountOutSDKType { + sender: string; + routes: SwapAmountOutRouteSDKType[]; + token_in_max_amount: string; + token_out: CoinSDKType; +} +export interface MsgSwapExactAmountOutResponse { + tokenInAmount: string; +} +export interface MsgSwapExactAmountOutResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOutResponse'; + value: Uint8Array; +} +export interface MsgSwapExactAmountOutResponseAmino { + token_in_amount?: string; +} +export interface MsgSwapExactAmountOutResponseAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-out-response'; + value: MsgSwapExactAmountOutResponseAmino; +} +export interface MsgSwapExactAmountOutResponseSDKType { + token_in_amount: string; +} +/** + * ===================== MsgJoinSwapExternAmountIn + * TODO: Rename to MsgJoinSwapExactAmountIn + */ +export interface MsgJoinSwapExternAmountIn { + sender: string; + poolId: bigint; + tokenIn: Coin; + shareOutMinAmount: string; +} +export interface MsgJoinSwapExternAmountInProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn'; + value: Uint8Array; +} +/** + * ===================== MsgJoinSwapExternAmountIn + * TODO: Rename to MsgJoinSwapExactAmountIn + */ +export interface MsgJoinSwapExternAmountInAmino { + sender?: string; + pool_id?: string; + token_in?: CoinAmino; + share_out_min_amount?: string; +} +export interface MsgJoinSwapExternAmountInAminoMsg { + type: 'osmosis/gamm/join-swap-extern-amount-in'; + value: MsgJoinSwapExternAmountInAmino; +} +/** + * ===================== MsgJoinSwapExternAmountIn + * TODO: Rename to MsgJoinSwapExactAmountIn + */ +export interface MsgJoinSwapExternAmountInSDKType { + sender: string; + pool_id: bigint; + token_in: CoinSDKType; + share_out_min_amount: string; +} +export interface MsgJoinSwapExternAmountInResponse { + shareOutAmount: string; +} +export interface MsgJoinSwapExternAmountInResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountInResponse'; + value: Uint8Array; +} +export interface MsgJoinSwapExternAmountInResponseAmino { + share_out_amount?: string; +} +export interface MsgJoinSwapExternAmountInResponseAminoMsg { + type: 'osmosis/gamm/join-swap-extern-amount-in-response'; + value: MsgJoinSwapExternAmountInResponseAmino; +} +export interface MsgJoinSwapExternAmountInResponseSDKType { + share_out_amount: string; +} +/** ===================== MsgJoinSwapShareAmountOut */ +export interface MsgJoinSwapShareAmountOut { + sender: string; + poolId: bigint; + tokenInDenom: string; + shareOutAmount: string; + tokenInMaxAmount: string; +} +export interface MsgJoinSwapShareAmountOutProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut'; + value: Uint8Array; +} +/** ===================== MsgJoinSwapShareAmountOut */ +export interface MsgJoinSwapShareAmountOutAmino { + sender?: string; + pool_id?: string; + token_in_denom?: string; + share_out_amount?: string; + token_in_max_amount?: string; +} +export interface MsgJoinSwapShareAmountOutAminoMsg { + type: 'osmosis/gamm/join-swap-share-amount-out'; + value: MsgJoinSwapShareAmountOutAmino; +} +/** ===================== MsgJoinSwapShareAmountOut */ +export interface MsgJoinSwapShareAmountOutSDKType { + sender: string; + pool_id: bigint; + token_in_denom: string; + share_out_amount: string; + token_in_max_amount: string; +} +export interface MsgJoinSwapShareAmountOutResponse { + tokenInAmount: string; +} +export interface MsgJoinSwapShareAmountOutResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOutResponse'; + value: Uint8Array; +} +export interface MsgJoinSwapShareAmountOutResponseAmino { + token_in_amount?: string; +} +export interface MsgJoinSwapShareAmountOutResponseAminoMsg { + type: 'osmosis/gamm/join-swap-share-amount-out-response'; + value: MsgJoinSwapShareAmountOutResponseAmino; +} +export interface MsgJoinSwapShareAmountOutResponseSDKType { + token_in_amount: string; +} +/** ===================== MsgExitSwapShareAmountIn */ +export interface MsgExitSwapShareAmountIn { + sender: string; + poolId: bigint; + tokenOutDenom: string; + shareInAmount: string; + tokenOutMinAmount: string; +} +export interface MsgExitSwapShareAmountInProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn'; + value: Uint8Array; +} +/** ===================== MsgExitSwapShareAmountIn */ +export interface MsgExitSwapShareAmountInAmino { + sender?: string; + pool_id?: string; + token_out_denom?: string; + share_in_amount?: string; + token_out_min_amount?: string; +} +export interface MsgExitSwapShareAmountInAminoMsg { + type: 'osmosis/gamm/exit-swap-share-amount-in'; + value: MsgExitSwapShareAmountInAmino; +} +/** ===================== MsgExitSwapShareAmountIn */ +export interface MsgExitSwapShareAmountInSDKType { + sender: string; + pool_id: bigint; + token_out_denom: string; + share_in_amount: string; + token_out_min_amount: string; +} +export interface MsgExitSwapShareAmountInResponse { + tokenOutAmount: string; +} +export interface MsgExitSwapShareAmountInResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountInResponse'; + value: Uint8Array; +} +export interface MsgExitSwapShareAmountInResponseAmino { + token_out_amount?: string; +} +export interface MsgExitSwapShareAmountInResponseAminoMsg { + type: 'osmosis/gamm/exit-swap-share-amount-in-response'; + value: MsgExitSwapShareAmountInResponseAmino; +} +export interface MsgExitSwapShareAmountInResponseSDKType { + token_out_amount: string; +} +/** ===================== MsgExitSwapExternAmountOut */ +export interface MsgExitSwapExternAmountOut { + sender: string; + poolId: bigint; + tokenOut: Coin; + shareInMaxAmount: string; +} +export interface MsgExitSwapExternAmountOutProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut'; + value: Uint8Array; +} +/** ===================== MsgExitSwapExternAmountOut */ +export interface MsgExitSwapExternAmountOutAmino { + sender?: string; + pool_id?: string; + token_out?: CoinAmino; + share_in_max_amount?: string; +} +export interface MsgExitSwapExternAmountOutAminoMsg { + type: 'osmosis/gamm/exit-swap-extern-amount-out'; + value: MsgExitSwapExternAmountOutAmino; +} +/** ===================== MsgExitSwapExternAmountOut */ +export interface MsgExitSwapExternAmountOutSDKType { + sender: string; + pool_id: bigint; + token_out: CoinSDKType; + share_in_max_amount: string; +} +export interface MsgExitSwapExternAmountOutResponse { + shareInAmount: string; +} +export interface MsgExitSwapExternAmountOutResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOutResponse'; + value: Uint8Array; +} +export interface MsgExitSwapExternAmountOutResponseAmino { + share_in_amount?: string; +} +export interface MsgExitSwapExternAmountOutResponseAminoMsg { + type: 'osmosis/gamm/exit-swap-extern-amount-out-response'; + value: MsgExitSwapExternAmountOutResponseAmino; +} +export interface MsgExitSwapExternAmountOutResponseSDKType { + share_in_amount: string; +} +function createBaseMsgJoinPool(): MsgJoinPool { + return { + sender: '', + poolId: BigInt(0), + shareOutAmount: '', + tokenInMaxs: [], + }; +} +export const MsgJoinPool = { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + aminoType: 'osmosis/gamm/join-pool', + is(o: any): o is MsgJoinPool { + return ( + o && + (o.$typeUrl === MsgJoinPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.poolId === 'bigint' && + typeof o.shareOutAmount === 'string' && + Array.isArray(o.tokenInMaxs) && + (!o.tokenInMaxs.length || Coin.is(o.tokenInMaxs[0])))) + ); + }, + isSDK(o: any): o is MsgJoinPoolSDKType { + return ( + o && + (o.$typeUrl === MsgJoinPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.share_out_amount === 'string' && + Array.isArray(o.token_in_maxs) && + (!o.token_in_maxs.length || Coin.isSDK(o.token_in_maxs[0])))) + ); + }, + isAmino(o: any): o is MsgJoinPoolAmino { + return ( + o && + (o.$typeUrl === MsgJoinPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.share_out_amount === 'string' && + Array.isArray(o.token_in_maxs) && + (!o.token_in_maxs.length || Coin.isAmino(o.token_in_maxs[0])))) + ); + }, + encode( + message: MsgJoinPool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + if (message.shareOutAmount !== '') { + writer.uint32(26).string(message.shareOutAmount); + } + for (const v of message.tokenInMaxs) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgJoinPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJoinPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + case 3: + message.shareOutAmount = reader.string(); + break; + case 4: + message.tokenInMaxs.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgJoinPool { + const message = createBaseMsgJoinPool(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.shareOutAmount = object.shareOutAmount ?? ''; + message.tokenInMaxs = + object.tokenInMaxs?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgJoinPoolAmino): MsgJoinPool { + const message = createBaseMsgJoinPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if ( + object.share_out_amount !== undefined && + object.share_out_amount !== null + ) { + message.shareOutAmount = object.share_out_amount; + } + message.tokenInMaxs = + object.token_in_maxs?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgJoinPool): MsgJoinPoolAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount; + if (message.tokenInMaxs) { + obj.token_in_maxs = message.tokenInMaxs.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.token_in_maxs = message.tokenInMaxs; + } + return obj; + }, + fromAminoMsg(object: MsgJoinPoolAminoMsg): MsgJoinPool { + return MsgJoinPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgJoinPool): MsgJoinPoolAminoMsg { + return { + type: 'osmosis/gamm/join-pool', + value: MsgJoinPool.toAmino(message), + }; + }, + fromProtoMsg(message: MsgJoinPoolProtoMsg): MsgJoinPool { + return MsgJoinPool.decode(message.value); + }, + toProto(message: MsgJoinPool): Uint8Array { + return MsgJoinPool.encode(message).finish(); + }, + toProtoMsg(message: MsgJoinPool): MsgJoinPoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value: MsgJoinPool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgJoinPool.typeUrl, MsgJoinPool); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinPool.aminoType, + MsgJoinPool.typeUrl +); +function createBaseMsgJoinPoolResponse(): MsgJoinPoolResponse { + return { + shareOutAmount: '', + tokenIn: [], + }; +} +export const MsgJoinPoolResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPoolResponse', + aminoType: 'osmosis/gamm/join-pool-response', + is(o: any): o is MsgJoinPoolResponse { + return ( + o && + (o.$typeUrl === MsgJoinPoolResponse.typeUrl || + (typeof o.shareOutAmount === 'string' && + Array.isArray(o.tokenIn) && + (!o.tokenIn.length || Coin.is(o.tokenIn[0])))) + ); + }, + isSDK(o: any): o is MsgJoinPoolResponseSDKType { + return ( + o && + (o.$typeUrl === MsgJoinPoolResponse.typeUrl || + (typeof o.share_out_amount === 'string' && + Array.isArray(o.token_in) && + (!o.token_in.length || Coin.isSDK(o.token_in[0])))) + ); + }, + isAmino(o: any): o is MsgJoinPoolResponseAmino { + return ( + o && + (o.$typeUrl === MsgJoinPoolResponse.typeUrl || + (typeof o.share_out_amount === 'string' && + Array.isArray(o.token_in) && + (!o.token_in.length || Coin.isAmino(o.token_in[0])))) + ); + }, + encode( + message: MsgJoinPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.shareOutAmount !== '') { + writer.uint32(10).string(message.shareOutAmount); + } + for (const v of message.tokenIn) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJoinPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shareOutAmount = reader.string(); + break; + case 2: + message.tokenIn.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgJoinPoolResponse { + const message = createBaseMsgJoinPoolResponse(); + message.shareOutAmount = object.shareOutAmount ?? ''; + message.tokenIn = object.tokenIn?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgJoinPoolResponseAmino): MsgJoinPoolResponse { + const message = createBaseMsgJoinPoolResponse(); + if ( + object.share_out_amount !== undefined && + object.share_out_amount !== null + ) { + message.shareOutAmount = object.share_out_amount; + } + message.tokenIn = object.token_in?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgJoinPoolResponse): MsgJoinPoolResponseAmino { + const obj: any = {}; + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount; + if (message.tokenIn) { + obj.token_in = message.tokenIn.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.token_in = message.tokenIn; + } + return obj; + }, + fromAminoMsg(object: MsgJoinPoolResponseAminoMsg): MsgJoinPoolResponse { + return MsgJoinPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgJoinPoolResponse): MsgJoinPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/join-pool-response', + value: MsgJoinPoolResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgJoinPoolResponseProtoMsg): MsgJoinPoolResponse { + return MsgJoinPoolResponse.decode(message.value); + }, + toProto(message: MsgJoinPoolResponse): Uint8Array { + return MsgJoinPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgJoinPoolResponse): MsgJoinPoolResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPoolResponse', + value: MsgJoinPoolResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgJoinPoolResponse.typeUrl, + MsgJoinPoolResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinPoolResponse.aminoType, + MsgJoinPoolResponse.typeUrl +); +function createBaseMsgExitPool(): MsgExitPool { + return { + sender: '', + poolId: BigInt(0), + shareInAmount: '', + tokenOutMins: [], + }; +} +export const MsgExitPool = { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + aminoType: 'osmosis/gamm/exit-pool', + is(o: any): o is MsgExitPool { + return ( + o && + (o.$typeUrl === MsgExitPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.poolId === 'bigint' && + typeof o.shareInAmount === 'string' && + Array.isArray(o.tokenOutMins) && + (!o.tokenOutMins.length || Coin.is(o.tokenOutMins[0])))) + ); + }, + isSDK(o: any): o is MsgExitPoolSDKType { + return ( + o && + (o.$typeUrl === MsgExitPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.share_in_amount === 'string' && + Array.isArray(o.token_out_mins) && + (!o.token_out_mins.length || Coin.isSDK(o.token_out_mins[0])))) + ); + }, + isAmino(o: any): o is MsgExitPoolAmino { + return ( + o && + (o.$typeUrl === MsgExitPool.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.share_in_amount === 'string' && + Array.isArray(o.token_out_mins) && + (!o.token_out_mins.length || Coin.isAmino(o.token_out_mins[0])))) + ); + }, + encode( + message: MsgExitPool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + if (message.shareInAmount !== '') { + writer.uint32(26).string(message.shareInAmount); + } + for (const v of message.tokenOutMins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExitPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExitPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + case 3: + message.shareInAmount = reader.string(); + break; + case 4: + message.tokenOutMins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExitPool { + const message = createBaseMsgExitPool(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.shareInAmount = object.shareInAmount ?? ''; + message.tokenOutMins = + object.tokenOutMins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgExitPoolAmino): MsgExitPool { + const message = createBaseMsgExitPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if ( + object.share_in_amount !== undefined && + object.share_in_amount !== null + ) { + message.shareInAmount = object.share_in_amount; + } + message.tokenOutMins = + object.token_out_mins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgExitPool): MsgExitPoolAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.share_in_amount = + message.shareInAmount === '' ? undefined : message.shareInAmount; + if (message.tokenOutMins) { + obj.token_out_mins = message.tokenOutMins.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.token_out_mins = message.tokenOutMins; + } + return obj; + }, + fromAminoMsg(object: MsgExitPoolAminoMsg): MsgExitPool { + return MsgExitPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgExitPool): MsgExitPoolAminoMsg { + return { + type: 'osmosis/gamm/exit-pool', + value: MsgExitPool.toAmino(message), + }; + }, + fromProtoMsg(message: MsgExitPoolProtoMsg): MsgExitPool { + return MsgExitPool.decode(message.value); + }, + toProto(message: MsgExitPool): Uint8Array { + return MsgExitPool.encode(message).finish(); + }, + toProtoMsg(message: MsgExitPool): MsgExitPoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value: MsgExitPool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgExitPool.typeUrl, MsgExitPool); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitPool.aminoType, + MsgExitPool.typeUrl +); +function createBaseMsgExitPoolResponse(): MsgExitPoolResponse { + return { + tokenOut: [], + }; +} +export const MsgExitPoolResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPoolResponse', + aminoType: 'osmosis/gamm/exit-pool-response', + is(o: any): o is MsgExitPoolResponse { + return ( + o && + (o.$typeUrl === MsgExitPoolResponse.typeUrl || + (Array.isArray(o.tokenOut) && + (!o.tokenOut.length || Coin.is(o.tokenOut[0])))) + ); + }, + isSDK(o: any): o is MsgExitPoolResponseSDKType { + return ( + o && + (o.$typeUrl === MsgExitPoolResponse.typeUrl || + (Array.isArray(o.token_out) && + (!o.token_out.length || Coin.isSDK(o.token_out[0])))) + ); + }, + isAmino(o: any): o is MsgExitPoolResponseAmino { + return ( + o && + (o.$typeUrl === MsgExitPoolResponse.typeUrl || + (Array.isArray(o.token_out) && + (!o.token_out.length || Coin.isAmino(o.token_out[0])))) + ); + }, + encode( + message: MsgExitPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.tokenOut) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExitPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenOut.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExitPoolResponse { + const message = createBaseMsgExitPoolResponse(); + message.tokenOut = object.tokenOut?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgExitPoolResponseAmino): MsgExitPoolResponse { + const message = createBaseMsgExitPoolResponse(); + message.tokenOut = object.token_out?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgExitPoolResponse): MsgExitPoolResponseAmino { + const obj: any = {}; + if (message.tokenOut) { + obj.token_out = message.tokenOut.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.token_out = message.tokenOut; + } + return obj; + }, + fromAminoMsg(object: MsgExitPoolResponseAminoMsg): MsgExitPoolResponse { + return MsgExitPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExitPoolResponse): MsgExitPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/exit-pool-response', + value: MsgExitPoolResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgExitPoolResponseProtoMsg): MsgExitPoolResponse { + return MsgExitPoolResponse.decode(message.value); + }, + toProto(message: MsgExitPoolResponse): Uint8Array { + return MsgExitPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExitPoolResponse): MsgExitPoolResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPoolResponse', + value: MsgExitPoolResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgExitPoolResponse.typeUrl, + MsgExitPoolResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitPoolResponse.aminoType, + MsgExitPoolResponse.typeUrl +); +function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { + return { + sender: '', + routes: [], + tokenIn: Coin.fromPartial({}), + tokenOutMinAmount: '', + }; +} +export const MsgSwapExactAmountIn = { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + aminoType: 'osmosis/gamm/swap-exact-amount-in', + is(o: any): o is MsgSwapExactAmountIn { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInRoute.is(o.routes[0])) && + Coin.is(o.tokenIn) && + typeof o.tokenOutMinAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgSwapExactAmountInSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInRoute.isSDK(o.routes[0])) && + Coin.isSDK(o.token_in) && + typeof o.token_out_min_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgSwapExactAmountInAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInRoute.isAmino(o.routes[0])) && + Coin.isAmino(o.token_in) && + typeof o.token_out_min_amount === 'string')) + ); + }, + encode( + message: MsgSwapExactAmountIn, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.routes) { + SwapAmountInRoute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.tokenIn !== undefined) { + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim(); + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(34).string(message.tokenOutMinAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountIn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.routes.push( + SwapAmountInRoute.decode(reader, reader.uint32()) + ); + break; + case 3: + message.tokenIn = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.tokenOutMinAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSwapExactAmountIn { + const message = createBaseMsgSwapExactAmountIn(); + message.sender = object.sender ?? ''; + message.routes = + object.routes?.map((e) => SwapAmountInRoute.fromPartial(e)) || []; + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined; + message.tokenOutMinAmount = object.tokenOutMinAmount ?? ''; + return message; + }, + fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { + const message = createBaseMsgSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = + object.routes?.map((e) => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if ( + object.token_out_min_amount !== undefined && + object.token_out_min_amount !== null + ) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; + }, + toAmino(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountInRoute.toAmino(e) : undefined + ); + } else { + obj.routes = message.routes; + } + obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined; + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount; + return obj; + }, + fromAminoMsg(object: MsgSwapExactAmountInAminoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.fromAmino(object.value); + }, + toAminoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-in', + value: MsgSwapExactAmountIn.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSwapExactAmountInProtoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.decode(message.value); + }, + toProto(message: MsgSwapExactAmountIn): Uint8Array { + return MsgSwapExactAmountIn.encode(message).finish(); + }, + toProtoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountIn.typeUrl, + MsgSwapExactAmountIn +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountIn.aminoType, + MsgSwapExactAmountIn.typeUrl +); +function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse { + return { + tokenOutAmount: '', + }; +} +export const MsgSwapExactAmountInResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountInResponse', + aminoType: 'osmosis/gamm/swap-exact-amount-in-response', + is(o: any): o is MsgSwapExactAmountInResponse { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || + typeof o.tokenOutAmount === 'string') + ); + }, + isSDK(o: any): o is MsgSwapExactAmountInResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + isAmino(o: any): o is MsgSwapExactAmountInResponseAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + encode( + message: MsgSwapExactAmountInResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenOutAmount !== '') { + writer.uint32(10).string(message.tokenOutAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountInResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountInResponse { + const message = createBaseMsgSwapExactAmountInResponse(); + message.tokenOutAmount = object.tokenOutAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSwapExactAmountInResponseAmino + ): MsgSwapExactAmountInResponse { + const message = createBaseMsgSwapExactAmountInResponse(); + if ( + object.token_out_amount !== undefined && + object.token_out_amount !== null + ) { + message.tokenOutAmount = object.token_out_amount; + } + return message; + }, + toAmino( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseAmino { + const obj: any = {}; + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount; + return obj; + }, + fromAminoMsg( + object: MsgSwapExactAmountInResponseAminoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-in-response', + value: MsgSwapExactAmountInResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSwapExactAmountInResponseProtoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.decode(message.value); + }, + toProto(message: MsgSwapExactAmountInResponse): Uint8Array { + return MsgSwapExactAmountInResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountInResponse', + value: MsgSwapExactAmountInResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountInResponse.typeUrl, + MsgSwapExactAmountInResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountInResponse.aminoType, + MsgSwapExactAmountInResponse.typeUrl +); +function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { + return { + sender: '', + routes: [], + tokenInMaxAmount: '', + tokenOut: Coin.fromPartial({}), + }; +} +export const MsgSwapExactAmountOut = { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + aminoType: 'osmosis/gamm/swap-exact-amount-out', + is(o: any): o is MsgSwapExactAmountOut { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutRoute.is(o.routes[0])) && + typeof o.tokenInMaxAmount === 'string' && + Coin.is(o.tokenOut))) + ); + }, + isSDK(o: any): o is MsgSwapExactAmountOutSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutRoute.isSDK(o.routes[0])) && + typeof o.token_in_max_amount === 'string' && + Coin.isSDK(o.token_out))) + ); + }, + isAmino(o: any): o is MsgSwapExactAmountOutAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutRoute.isAmino(o.routes[0])) && + typeof o.token_in_max_amount === 'string' && + Coin.isAmino(o.token_out))) + ); + }, + encode( + message: MsgSwapExactAmountOut, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.routes) { + SwapAmountOutRoute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(26).string(message.tokenInMaxAmount); + } + if (message.tokenOut !== undefined) { + Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountOut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.routes.push( + SwapAmountOutRoute.decode(reader, reader.uint32()) + ); + break; + case 3: + message.tokenInMaxAmount = reader.string(); + break; + case 4: + message.tokenOut = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSwapExactAmountOut { + const message = createBaseMsgSwapExactAmountOut(); + message.sender = object.sender ?? ''; + message.routes = + object.routes?.map((e) => SwapAmountOutRoute.fromPartial(e)) || []; + message.tokenInMaxAmount = object.tokenInMaxAmount ?? ''; + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined; + return message; + }, + fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { + const message = createBaseMsgSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = + object.routes?.map((e) => SwapAmountOutRoute.fromAmino(e)) || []; + if ( + object.token_in_max_amount !== undefined && + object.token_in_max_amount !== null + ) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; + }, + toAmino(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountOutRoute.toAmino(e) : undefined + ); + } else { + obj.routes = message.routes; + } + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount; + obj.token_out = message.tokenOut + ? Coin.toAmino(message.tokenOut) + : undefined; + return obj; + }, + fromAminoMsg(object: MsgSwapExactAmountOutAminoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.fromAmino(object.value); + }, + toAminoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-out', + value: MsgSwapExactAmountOut.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSwapExactAmountOutProtoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.decode(message.value); + }, + toProto(message: MsgSwapExactAmountOut): Uint8Array { + return MsgSwapExactAmountOut.encode(message).finish(); + }, + toProtoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountOut.typeUrl, + MsgSwapExactAmountOut +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOut.aminoType, + MsgSwapExactAmountOut.typeUrl +); +function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutResponse { + return { + tokenInAmount: '', + }; +} +export const MsgSwapExactAmountOutResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOutResponse', + aminoType: 'osmosis/gamm/swap-exact-amount-out-response', + is(o: any): o is MsgSwapExactAmountOutResponse { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || + typeof o.tokenInAmount === 'string') + ); + }, + isSDK(o: any): o is MsgSwapExactAmountOutResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + isAmino(o: any): o is MsgSwapExactAmountOutResponseAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + encode( + message: MsgSwapExactAmountOutResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenInAmount !== '') { + writer.uint32(10).string(message.tokenInAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountOutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountOutResponse { + const message = createBaseMsgSwapExactAmountOutResponse(); + message.tokenInAmount = object.tokenInAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSwapExactAmountOutResponseAmino + ): MsgSwapExactAmountOutResponse { + const message = createBaseMsgSwapExactAmountOutResponse(); + if ( + object.token_in_amount !== undefined && + object.token_in_amount !== null + ) { + message.tokenInAmount = object.token_in_amount; + } + return message; + }, + toAmino( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseAmino { + const obj: any = {}; + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount; + return obj; + }, + fromAminoMsg( + object: MsgSwapExactAmountOutResponseAminoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-out-response', + value: MsgSwapExactAmountOutResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSwapExactAmountOutResponseProtoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.decode(message.value); + }, + toProto(message: MsgSwapExactAmountOutResponse): Uint8Array { + return MsgSwapExactAmountOutResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOutResponse', + value: MsgSwapExactAmountOutResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountOutResponse.typeUrl, + MsgSwapExactAmountOutResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOutResponse.aminoType, + MsgSwapExactAmountOutResponse.typeUrl +); +function createBaseMsgJoinSwapExternAmountIn(): MsgJoinSwapExternAmountIn { + return { + sender: '', + poolId: BigInt(0), + tokenIn: Coin.fromPartial({}), + shareOutMinAmount: '', + }; +} +export const MsgJoinSwapExternAmountIn = { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + aminoType: 'osmosis/gamm/join-swap-extern-amount-in', + is(o: any): o is MsgJoinSwapExternAmountIn { + return ( + o && + (o.$typeUrl === MsgJoinSwapExternAmountIn.typeUrl || + (typeof o.sender === 'string' && + typeof o.poolId === 'bigint' && + Coin.is(o.tokenIn) && + typeof o.shareOutMinAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgJoinSwapExternAmountInSDKType { + return ( + o && + (o.$typeUrl === MsgJoinSwapExternAmountIn.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + Coin.isSDK(o.token_in) && + typeof o.share_out_min_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgJoinSwapExternAmountInAmino { + return ( + o && + (o.$typeUrl === MsgJoinSwapExternAmountIn.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + Coin.isAmino(o.token_in) && + typeof o.share_out_min_amount === 'string')) + ); + }, + encode( + message: MsgJoinSwapExternAmountIn, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + if (message.tokenIn !== undefined) { + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim(); + } + if (message.shareOutMinAmount !== '') { + writer.uint32(34).string(message.shareOutMinAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapExternAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJoinSwapExternAmountIn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + case 3: + message.tokenIn = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.shareOutMinAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgJoinSwapExternAmountIn { + const message = createBaseMsgJoinSwapExternAmountIn(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined; + message.shareOutMinAmount = object.shareOutMinAmount ?? ''; + return message; + }, + fromAmino(object: MsgJoinSwapExternAmountInAmino): MsgJoinSwapExternAmountIn { + const message = createBaseMsgJoinSwapExternAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if ( + object.share_out_min_amount !== undefined && + object.share_out_min_amount !== null + ) { + message.shareOutMinAmount = object.share_out_min_amount; + } + return message; + }, + toAmino(message: MsgJoinSwapExternAmountIn): MsgJoinSwapExternAmountInAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined; + obj.share_out_min_amount = + message.shareOutMinAmount === '' ? undefined : message.shareOutMinAmount; + return obj; + }, + fromAminoMsg( + object: MsgJoinSwapExternAmountInAminoMsg + ): MsgJoinSwapExternAmountIn { + return MsgJoinSwapExternAmountIn.fromAmino(object.value); + }, + toAminoMsg( + message: MsgJoinSwapExternAmountIn + ): MsgJoinSwapExternAmountInAminoMsg { + return { + type: 'osmosis/gamm/join-swap-extern-amount-in', + value: MsgJoinSwapExternAmountIn.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgJoinSwapExternAmountInProtoMsg + ): MsgJoinSwapExternAmountIn { + return MsgJoinSwapExternAmountIn.decode(message.value); + }, + toProto(message: MsgJoinSwapExternAmountIn): Uint8Array { + return MsgJoinSwapExternAmountIn.encode(message).finish(); + }, + toProtoMsg( + message: MsgJoinSwapExternAmountIn + ): MsgJoinSwapExternAmountInProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value: MsgJoinSwapExternAmountIn.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgJoinSwapExternAmountIn.typeUrl, + MsgJoinSwapExternAmountIn +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapExternAmountIn.aminoType, + MsgJoinSwapExternAmountIn.typeUrl +); +function createBaseMsgJoinSwapExternAmountInResponse(): MsgJoinSwapExternAmountInResponse { + return { + shareOutAmount: '', + }; +} +export const MsgJoinSwapExternAmountInResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountInResponse', + aminoType: 'osmosis/gamm/join-swap-extern-amount-in-response', + is(o: any): o is MsgJoinSwapExternAmountInResponse { + return ( + o && + (o.$typeUrl === MsgJoinSwapExternAmountInResponse.typeUrl || + typeof o.shareOutAmount === 'string') + ); + }, + isSDK(o: any): o is MsgJoinSwapExternAmountInResponseSDKType { + return ( + o && + (o.$typeUrl === MsgJoinSwapExternAmountInResponse.typeUrl || + typeof o.share_out_amount === 'string') + ); + }, + isAmino(o: any): o is MsgJoinSwapExternAmountInResponseAmino { + return ( + o && + (o.$typeUrl === MsgJoinSwapExternAmountInResponse.typeUrl || + typeof o.share_out_amount === 'string') + ); + }, + encode( + message: MsgJoinSwapExternAmountInResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.shareOutAmount !== '') { + writer.uint32(10).string(message.shareOutAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapExternAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJoinSwapExternAmountInResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shareOutAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgJoinSwapExternAmountInResponse { + const message = createBaseMsgJoinSwapExternAmountInResponse(); + message.shareOutAmount = object.shareOutAmount ?? ''; + return message; + }, + fromAmino( + object: MsgJoinSwapExternAmountInResponseAmino + ): MsgJoinSwapExternAmountInResponse { + const message = createBaseMsgJoinSwapExternAmountInResponse(); + if ( + object.share_out_amount !== undefined && + object.share_out_amount !== null + ) { + message.shareOutAmount = object.share_out_amount; + } + return message; + }, + toAmino( + message: MsgJoinSwapExternAmountInResponse + ): MsgJoinSwapExternAmountInResponseAmino { + const obj: any = {}; + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount; + return obj; + }, + fromAminoMsg( + object: MsgJoinSwapExternAmountInResponseAminoMsg + ): MsgJoinSwapExternAmountInResponse { + return MsgJoinSwapExternAmountInResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgJoinSwapExternAmountInResponse + ): MsgJoinSwapExternAmountInResponseAminoMsg { + return { + type: 'osmosis/gamm/join-swap-extern-amount-in-response', + value: MsgJoinSwapExternAmountInResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgJoinSwapExternAmountInResponseProtoMsg + ): MsgJoinSwapExternAmountInResponse { + return MsgJoinSwapExternAmountInResponse.decode(message.value); + }, + toProto(message: MsgJoinSwapExternAmountInResponse): Uint8Array { + return MsgJoinSwapExternAmountInResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgJoinSwapExternAmountInResponse + ): MsgJoinSwapExternAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountInResponse', + value: MsgJoinSwapExternAmountInResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgJoinSwapExternAmountInResponse.typeUrl, + MsgJoinSwapExternAmountInResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapExternAmountInResponse.aminoType, + MsgJoinSwapExternAmountInResponse.typeUrl +); +function createBaseMsgJoinSwapShareAmountOut(): MsgJoinSwapShareAmountOut { + return { + sender: '', + poolId: BigInt(0), + tokenInDenom: '', + shareOutAmount: '', + tokenInMaxAmount: '', + }; +} +export const MsgJoinSwapShareAmountOut = { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + aminoType: 'osmosis/gamm/join-swap-share-amount-out', + is(o: any): o is MsgJoinSwapShareAmountOut { + return ( + o && + (o.$typeUrl === MsgJoinSwapShareAmountOut.typeUrl || + (typeof o.sender === 'string' && + typeof o.poolId === 'bigint' && + typeof o.tokenInDenom === 'string' && + typeof o.shareOutAmount === 'string' && + typeof o.tokenInMaxAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgJoinSwapShareAmountOutSDKType { + return ( + o && + (o.$typeUrl === MsgJoinSwapShareAmountOut.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.token_in_denom === 'string' && + typeof o.share_out_amount === 'string' && + typeof o.token_in_max_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgJoinSwapShareAmountOutAmino { + return ( + o && + (o.$typeUrl === MsgJoinSwapShareAmountOut.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.token_in_denom === 'string' && + typeof o.share_out_amount === 'string' && + typeof o.token_in_max_amount === 'string')) + ); + }, + encode( + message: MsgJoinSwapShareAmountOut, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + if (message.tokenInDenom !== '') { + writer.uint32(26).string(message.tokenInDenom); + } + if (message.shareOutAmount !== '') { + writer.uint32(34).string(message.shareOutAmount); + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(42).string(message.tokenInMaxAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapShareAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJoinSwapShareAmountOut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + case 3: + message.tokenInDenom = reader.string(); + break; + case 4: + message.shareOutAmount = reader.string(); + break; + case 5: + message.tokenInMaxAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgJoinSwapShareAmountOut { + const message = createBaseMsgJoinSwapShareAmountOut(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.tokenInDenom = object.tokenInDenom ?? ''; + message.shareOutAmount = object.shareOutAmount ?? ''; + message.tokenInMaxAmount = object.tokenInMaxAmount ?? ''; + return message; + }, + fromAmino(object: MsgJoinSwapShareAmountOutAmino): MsgJoinSwapShareAmountOut { + const message = createBaseMsgJoinSwapShareAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if ( + object.share_out_amount !== undefined && + object.share_out_amount !== null + ) { + message.shareOutAmount = object.share_out_amount; + } + if ( + object.token_in_max_amount !== undefined && + object.token_in_max_amount !== null + ) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + return message; + }, + toAmino(message: MsgJoinSwapShareAmountOut): MsgJoinSwapShareAmountOutAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.token_in_denom = + message.tokenInDenom === '' ? undefined : message.tokenInDenom; + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount; + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount; + return obj; + }, + fromAminoMsg( + object: MsgJoinSwapShareAmountOutAminoMsg + ): MsgJoinSwapShareAmountOut { + return MsgJoinSwapShareAmountOut.fromAmino(object.value); + }, + toAminoMsg( + message: MsgJoinSwapShareAmountOut + ): MsgJoinSwapShareAmountOutAminoMsg { + return { + type: 'osmosis/gamm/join-swap-share-amount-out', + value: MsgJoinSwapShareAmountOut.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgJoinSwapShareAmountOutProtoMsg + ): MsgJoinSwapShareAmountOut { + return MsgJoinSwapShareAmountOut.decode(message.value); + }, + toProto(message: MsgJoinSwapShareAmountOut): Uint8Array { + return MsgJoinSwapShareAmountOut.encode(message).finish(); + }, + toProtoMsg( + message: MsgJoinSwapShareAmountOut + ): MsgJoinSwapShareAmountOutProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value: MsgJoinSwapShareAmountOut.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgJoinSwapShareAmountOut.typeUrl, + MsgJoinSwapShareAmountOut +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapShareAmountOut.aminoType, + MsgJoinSwapShareAmountOut.typeUrl +); +function createBaseMsgJoinSwapShareAmountOutResponse(): MsgJoinSwapShareAmountOutResponse { + return { + tokenInAmount: '', + }; +} +export const MsgJoinSwapShareAmountOutResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOutResponse', + aminoType: 'osmosis/gamm/join-swap-share-amount-out-response', + is(o: any): o is MsgJoinSwapShareAmountOutResponse { + return ( + o && + (o.$typeUrl === MsgJoinSwapShareAmountOutResponse.typeUrl || + typeof o.tokenInAmount === 'string') + ); + }, + isSDK(o: any): o is MsgJoinSwapShareAmountOutResponseSDKType { + return ( + o && + (o.$typeUrl === MsgJoinSwapShareAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + isAmino(o: any): o is MsgJoinSwapShareAmountOutResponseAmino { + return ( + o && + (o.$typeUrl === MsgJoinSwapShareAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + encode( + message: MsgJoinSwapShareAmountOutResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenInAmount !== '') { + writer.uint32(10).string(message.tokenInAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapShareAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJoinSwapShareAmountOutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgJoinSwapShareAmountOutResponse { + const message = createBaseMsgJoinSwapShareAmountOutResponse(); + message.tokenInAmount = object.tokenInAmount ?? ''; + return message; + }, + fromAmino( + object: MsgJoinSwapShareAmountOutResponseAmino + ): MsgJoinSwapShareAmountOutResponse { + const message = createBaseMsgJoinSwapShareAmountOutResponse(); + if ( + object.token_in_amount !== undefined && + object.token_in_amount !== null + ) { + message.tokenInAmount = object.token_in_amount; + } + return message; + }, + toAmino( + message: MsgJoinSwapShareAmountOutResponse + ): MsgJoinSwapShareAmountOutResponseAmino { + const obj: any = {}; + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount; + return obj; + }, + fromAminoMsg( + object: MsgJoinSwapShareAmountOutResponseAminoMsg + ): MsgJoinSwapShareAmountOutResponse { + return MsgJoinSwapShareAmountOutResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgJoinSwapShareAmountOutResponse + ): MsgJoinSwapShareAmountOutResponseAminoMsg { + return { + type: 'osmosis/gamm/join-swap-share-amount-out-response', + value: MsgJoinSwapShareAmountOutResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgJoinSwapShareAmountOutResponseProtoMsg + ): MsgJoinSwapShareAmountOutResponse { + return MsgJoinSwapShareAmountOutResponse.decode(message.value); + }, + toProto(message: MsgJoinSwapShareAmountOutResponse): Uint8Array { + return MsgJoinSwapShareAmountOutResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgJoinSwapShareAmountOutResponse + ): MsgJoinSwapShareAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOutResponse', + value: MsgJoinSwapShareAmountOutResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgJoinSwapShareAmountOutResponse.typeUrl, + MsgJoinSwapShareAmountOutResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapShareAmountOutResponse.aminoType, + MsgJoinSwapShareAmountOutResponse.typeUrl +); +function createBaseMsgExitSwapShareAmountIn(): MsgExitSwapShareAmountIn { + return { + sender: '', + poolId: BigInt(0), + tokenOutDenom: '', + shareInAmount: '', + tokenOutMinAmount: '', + }; +} +export const MsgExitSwapShareAmountIn = { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + aminoType: 'osmosis/gamm/exit-swap-share-amount-in', + is(o: any): o is MsgExitSwapShareAmountIn { + return ( + o && + (o.$typeUrl === MsgExitSwapShareAmountIn.typeUrl || + (typeof o.sender === 'string' && + typeof o.poolId === 'bigint' && + typeof o.tokenOutDenom === 'string' && + typeof o.shareInAmount === 'string' && + typeof o.tokenOutMinAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgExitSwapShareAmountInSDKType { + return ( + o && + (o.$typeUrl === MsgExitSwapShareAmountIn.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.token_out_denom === 'string' && + typeof o.share_in_amount === 'string' && + typeof o.token_out_min_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgExitSwapShareAmountInAmino { + return ( + o && + (o.$typeUrl === MsgExitSwapShareAmountIn.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + typeof o.token_out_denom === 'string' && + typeof o.share_in_amount === 'string' && + typeof o.token_out_min_amount === 'string')) + ); + }, + encode( + message: MsgExitSwapShareAmountIn, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + if (message.tokenOutDenom !== '') { + writer.uint32(26).string(message.tokenOutDenom); + } + if (message.shareInAmount !== '') { + writer.uint32(34).string(message.shareInAmount); + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(42).string(message.tokenOutMinAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapShareAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExitSwapShareAmountIn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + case 3: + message.tokenOutDenom = reader.string(); + break; + case 4: + message.shareInAmount = reader.string(); + break; + case 5: + message.tokenOutMinAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgExitSwapShareAmountIn { + const message = createBaseMsgExitSwapShareAmountIn(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.tokenOutDenom = object.tokenOutDenom ?? ''; + message.shareInAmount = object.shareInAmount ?? ''; + message.tokenOutMinAmount = object.tokenOutMinAmount ?? ''; + return message; + }, + fromAmino(object: MsgExitSwapShareAmountInAmino): MsgExitSwapShareAmountIn { + const message = createBaseMsgExitSwapShareAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if ( + object.token_out_denom !== undefined && + object.token_out_denom !== null + ) { + message.tokenOutDenom = object.token_out_denom; + } + if ( + object.share_in_amount !== undefined && + object.share_in_amount !== null + ) { + message.shareInAmount = object.share_in_amount; + } + if ( + object.token_out_min_amount !== undefined && + object.token_out_min_amount !== null + ) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; + }, + toAmino(message: MsgExitSwapShareAmountIn): MsgExitSwapShareAmountInAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.token_out_denom = + message.tokenOutDenom === '' ? undefined : message.tokenOutDenom; + obj.share_in_amount = + message.shareInAmount === '' ? undefined : message.shareInAmount; + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount; + return obj; + }, + fromAminoMsg( + object: MsgExitSwapShareAmountInAminoMsg + ): MsgExitSwapShareAmountIn { + return MsgExitSwapShareAmountIn.fromAmino(object.value); + }, + toAminoMsg( + message: MsgExitSwapShareAmountIn + ): MsgExitSwapShareAmountInAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-share-amount-in', + value: MsgExitSwapShareAmountIn.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgExitSwapShareAmountInProtoMsg + ): MsgExitSwapShareAmountIn { + return MsgExitSwapShareAmountIn.decode(message.value); + }, + toProto(message: MsgExitSwapShareAmountIn): Uint8Array { + return MsgExitSwapShareAmountIn.encode(message).finish(); + }, + toProtoMsg( + message: MsgExitSwapShareAmountIn + ): MsgExitSwapShareAmountInProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value: MsgExitSwapShareAmountIn.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgExitSwapShareAmountIn.typeUrl, + MsgExitSwapShareAmountIn +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapShareAmountIn.aminoType, + MsgExitSwapShareAmountIn.typeUrl +); +function createBaseMsgExitSwapShareAmountInResponse(): MsgExitSwapShareAmountInResponse { + return { + tokenOutAmount: '', + }; +} +export const MsgExitSwapShareAmountInResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountInResponse', + aminoType: 'osmosis/gamm/exit-swap-share-amount-in-response', + is(o: any): o is MsgExitSwapShareAmountInResponse { + return ( + o && + (o.$typeUrl === MsgExitSwapShareAmountInResponse.typeUrl || + typeof o.tokenOutAmount === 'string') + ); + }, + isSDK(o: any): o is MsgExitSwapShareAmountInResponseSDKType { + return ( + o && + (o.$typeUrl === MsgExitSwapShareAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + isAmino(o: any): o is MsgExitSwapShareAmountInResponseAmino { + return ( + o && + (o.$typeUrl === MsgExitSwapShareAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + encode( + message: MsgExitSwapShareAmountInResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenOutAmount !== '') { + writer.uint32(10).string(message.tokenOutAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapShareAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExitSwapShareAmountInResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgExitSwapShareAmountInResponse { + const message = createBaseMsgExitSwapShareAmountInResponse(); + message.tokenOutAmount = object.tokenOutAmount ?? ''; + return message; + }, + fromAmino( + object: MsgExitSwapShareAmountInResponseAmino + ): MsgExitSwapShareAmountInResponse { + const message = createBaseMsgExitSwapShareAmountInResponse(); + if ( + object.token_out_amount !== undefined && + object.token_out_amount !== null + ) { + message.tokenOutAmount = object.token_out_amount; + } + return message; + }, + toAmino( + message: MsgExitSwapShareAmountInResponse + ): MsgExitSwapShareAmountInResponseAmino { + const obj: any = {}; + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount; + return obj; + }, + fromAminoMsg( + object: MsgExitSwapShareAmountInResponseAminoMsg + ): MsgExitSwapShareAmountInResponse { + return MsgExitSwapShareAmountInResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgExitSwapShareAmountInResponse + ): MsgExitSwapShareAmountInResponseAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-share-amount-in-response', + value: MsgExitSwapShareAmountInResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgExitSwapShareAmountInResponseProtoMsg + ): MsgExitSwapShareAmountInResponse { + return MsgExitSwapShareAmountInResponse.decode(message.value); + }, + toProto(message: MsgExitSwapShareAmountInResponse): Uint8Array { + return MsgExitSwapShareAmountInResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgExitSwapShareAmountInResponse + ): MsgExitSwapShareAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountInResponse', + value: MsgExitSwapShareAmountInResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgExitSwapShareAmountInResponse.typeUrl, + MsgExitSwapShareAmountInResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapShareAmountInResponse.aminoType, + MsgExitSwapShareAmountInResponse.typeUrl +); +function createBaseMsgExitSwapExternAmountOut(): MsgExitSwapExternAmountOut { + return { + sender: '', + poolId: BigInt(0), + tokenOut: Coin.fromPartial({}), + shareInMaxAmount: '', + }; +} +export const MsgExitSwapExternAmountOut = { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + aminoType: 'osmosis/gamm/exit-swap-extern-amount-out', + is(o: any): o is MsgExitSwapExternAmountOut { + return ( + o && + (o.$typeUrl === MsgExitSwapExternAmountOut.typeUrl || + (typeof o.sender === 'string' && + typeof o.poolId === 'bigint' && + Coin.is(o.tokenOut) && + typeof o.shareInMaxAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgExitSwapExternAmountOutSDKType { + return ( + o && + (o.$typeUrl === MsgExitSwapExternAmountOut.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + Coin.isSDK(o.token_out) && + typeof o.share_in_max_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgExitSwapExternAmountOutAmino { + return ( + o && + (o.$typeUrl === MsgExitSwapExternAmountOut.typeUrl || + (typeof o.sender === 'string' && + typeof o.pool_id === 'bigint' && + Coin.isAmino(o.token_out) && + typeof o.share_in_max_amount === 'string')) + ); + }, + encode( + message: MsgExitSwapExternAmountOut, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + if (message.tokenOut !== undefined) { + Coin.encode(message.tokenOut, writer.uint32(26).fork()).ldelim(); + } + if (message.shareInMaxAmount !== '') { + writer.uint32(34).string(message.shareInMaxAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapExternAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExitSwapExternAmountOut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + case 3: + message.tokenOut = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.shareInMaxAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgExitSwapExternAmountOut { + const message = createBaseMsgExitSwapExternAmountOut(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined; + message.shareInMaxAmount = object.shareInMaxAmount ?? ''; + return message; + }, + fromAmino( + object: MsgExitSwapExternAmountOutAmino + ): MsgExitSwapExternAmountOut { + const message = createBaseMsgExitSwapExternAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + if ( + object.share_in_max_amount !== undefined && + object.share_in_max_amount !== null + ) { + message.shareInMaxAmount = object.share_in_max_amount; + } + return message; + }, + toAmino( + message: MsgExitSwapExternAmountOut + ): MsgExitSwapExternAmountOutAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.token_out = message.tokenOut + ? Coin.toAmino(message.tokenOut) + : undefined; + obj.share_in_max_amount = + message.shareInMaxAmount === '' ? undefined : message.shareInMaxAmount; + return obj; + }, + fromAminoMsg( + object: MsgExitSwapExternAmountOutAminoMsg + ): MsgExitSwapExternAmountOut { + return MsgExitSwapExternAmountOut.fromAmino(object.value); + }, + toAminoMsg( + message: MsgExitSwapExternAmountOut + ): MsgExitSwapExternAmountOutAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-extern-amount-out', + value: MsgExitSwapExternAmountOut.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgExitSwapExternAmountOutProtoMsg + ): MsgExitSwapExternAmountOut { + return MsgExitSwapExternAmountOut.decode(message.value); + }, + toProto(message: MsgExitSwapExternAmountOut): Uint8Array { + return MsgExitSwapExternAmountOut.encode(message).finish(); + }, + toProtoMsg( + message: MsgExitSwapExternAmountOut + ): MsgExitSwapExternAmountOutProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value: MsgExitSwapExternAmountOut.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgExitSwapExternAmountOut.typeUrl, + MsgExitSwapExternAmountOut +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapExternAmountOut.aminoType, + MsgExitSwapExternAmountOut.typeUrl +); +function createBaseMsgExitSwapExternAmountOutResponse(): MsgExitSwapExternAmountOutResponse { + return { + shareInAmount: '', + }; +} +export const MsgExitSwapExternAmountOutResponse = { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOutResponse', + aminoType: 'osmosis/gamm/exit-swap-extern-amount-out-response', + is(o: any): o is MsgExitSwapExternAmountOutResponse { + return ( + o && + (o.$typeUrl === MsgExitSwapExternAmountOutResponse.typeUrl || + typeof o.shareInAmount === 'string') + ); + }, + isSDK(o: any): o is MsgExitSwapExternAmountOutResponseSDKType { + return ( + o && + (o.$typeUrl === MsgExitSwapExternAmountOutResponse.typeUrl || + typeof o.share_in_amount === 'string') + ); + }, + isAmino(o: any): o is MsgExitSwapExternAmountOutResponseAmino { + return ( + o && + (o.$typeUrl === MsgExitSwapExternAmountOutResponse.typeUrl || + typeof o.share_in_amount === 'string') + ); + }, + encode( + message: MsgExitSwapExternAmountOutResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.shareInAmount !== '') { + writer.uint32(10).string(message.shareInAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapExternAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExitSwapExternAmountOutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shareInAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgExitSwapExternAmountOutResponse { + const message = createBaseMsgExitSwapExternAmountOutResponse(); + message.shareInAmount = object.shareInAmount ?? ''; + return message; + }, + fromAmino( + object: MsgExitSwapExternAmountOutResponseAmino + ): MsgExitSwapExternAmountOutResponse { + const message = createBaseMsgExitSwapExternAmountOutResponse(); + if ( + object.share_in_amount !== undefined && + object.share_in_amount !== null + ) { + message.shareInAmount = object.share_in_amount; + } + return message; + }, + toAmino( + message: MsgExitSwapExternAmountOutResponse + ): MsgExitSwapExternAmountOutResponseAmino { + const obj: any = {}; + obj.share_in_amount = + message.shareInAmount === '' ? undefined : message.shareInAmount; + return obj; + }, + fromAminoMsg( + object: MsgExitSwapExternAmountOutResponseAminoMsg + ): MsgExitSwapExternAmountOutResponse { + return MsgExitSwapExternAmountOutResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgExitSwapExternAmountOutResponse + ): MsgExitSwapExternAmountOutResponseAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-extern-amount-out-response', + value: MsgExitSwapExternAmountOutResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgExitSwapExternAmountOutResponseProtoMsg + ): MsgExitSwapExternAmountOutResponse { + return MsgExitSwapExternAmountOutResponse.decode(message.value); + }, + toProto(message: MsgExitSwapExternAmountOutResponse): Uint8Array { + return MsgExitSwapExternAmountOutResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgExitSwapExternAmountOutResponse + ): MsgExitSwapExternAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOutResponse', + value: MsgExitSwapExternAmountOutResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgExitSwapExternAmountOutResponse.typeUrl, + MsgExitSwapExternAmountOutResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapExternAmountOutResponse.aminoType, + MsgExitSwapExternAmountOutResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/ibchooks/genesis.ts b/packages/cosmos/src/proto_export/osmosis/ibchooks/genesis.ts new file mode 100644 index 00000000..628a1939 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/ibchooks/genesis.ts @@ -0,0 +1,115 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; + +import { Params, ParamsAmino, ParamsSDKType } from './params'; +export interface GenesisState { + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: '/osmosis.ibchooks.GenesisState'; + value: Uint8Array; +} +export interface GenesisStateAmino { + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: 'osmosis/ibchooks/genesis-state'; + value: GenesisStateAmino; +} +export interface GenesisStateSDKType { + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + }; +} +export const GenesisState = { + typeUrl: '/osmosis.ibchooks.GenesisState', + aminoType: 'osmosis/ibchooks/genesis-state', + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return ( + o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params)) + ); + }, + encode( + message: GenesisState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/ibchooks/genesis-state', + value: GenesisState.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: '/osmosis.ibchooks.GenesisState', + value: GenesisState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisState.aminoType, + GenesisState.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/ibchooks/params.ts b/packages/cosmos/src/proto_export/osmosis/ibchooks/params.ts new file mode 100644 index 00000000..dcb19698 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/ibchooks/params.ts @@ -0,0 +1,132 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +export interface Params { + allowedAsyncAckContracts: string[]; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.ibchooks.Params'; + value: Uint8Array; +} +export interface ParamsAmino { + allowed_async_ack_contracts?: string[]; +} +export interface ParamsAminoMsg { + type: 'osmosis/ibchooks/params'; + value: ParamsAmino; +} +export interface ParamsSDKType { + allowed_async_ack_contracts: string[]; +} +function createBaseParams(): Params { + return { + allowedAsyncAckContracts: [], + }; +} +export const Params = { + typeUrl: '/osmosis.ibchooks.Params', + aminoType: 'osmosis/ibchooks/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.allowedAsyncAckContracts) && + (!o.allowedAsyncAckContracts.length || + typeof o.allowedAsyncAckContracts[0] === 'string'))) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.allowed_async_ack_contracts) && + (!o.allowed_async_ack_contracts.length || + typeof o.allowed_async_ack_contracts[0] === 'string'))) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.allowed_async_ack_contracts) && + (!o.allowed_async_ack_contracts.length || + typeof o.allowed_async_ack_contracts[0] === 'string'))) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.allowedAsyncAckContracts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedAsyncAckContracts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedAsyncAckContracts = + object.allowedAsyncAckContracts?.map((e) => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedAsyncAckContracts = + object.allowed_async_ack_contracts?.map((e) => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedAsyncAckContracts) { + obj.allowed_async_ack_contracts = message.allowedAsyncAckContracts.map( + (e) => e + ); + } else { + obj.allowed_async_ack_contracts = message.allowedAsyncAckContracts; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/ibchooks/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.ibchooks.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.amino.ts new file mode 100644 index 00000000..bf09609d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgEmitIBCAck } from './tx'; +export const AminoConverter = { + '/osmosis.ibchooks.MsgEmitIBCAck': { + aminoType: 'osmosis/ibchooks/emit-ibc-ack', + toAmino: MsgEmitIBCAck.toAmino, + fromAmino: MsgEmitIBCAck.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.registry.ts new file mode 100644 index 00000000..8b963839 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.registry.ts @@ -0,0 +1,38 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { MsgEmitIBCAck } from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.ibchooks.MsgEmitIBCAck', MsgEmitIBCAck], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAck', + value: MsgEmitIBCAck.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAck', + value, + }; + }, + }, + fromPartial: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAck', + value: MsgEmitIBCAck.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.rpc.msg.ts new file mode 100644 index 00000000..d0edc989 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.rpc.msg.ts @@ -0,0 +1,34 @@ +//@ts-nocheck +import { Rpc } from '../../helpers'; +import { BinaryReader } from '../../binary'; + +import { MsgEmitIBCAck, MsgEmitIBCAckResponse } from './tx'; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * EmitIBCAck checks the sender can emit the ack and writes the IBC + * acknowledgement + */ + emitIBCAck(request: MsgEmitIBCAck): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.emitIBCAck = this.emitIBCAck.bind(this); + } + emitIBCAck(request: MsgEmitIBCAck): Promise { + const data = MsgEmitIBCAck.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.ibchooks.Msg', + 'EmitIBCAck', + data + ); + return promise.then((data) => + MsgEmitIBCAckResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.ts b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.ts new file mode 100644 index 00000000..9dff0df5 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/ibchooks/tx.ts @@ -0,0 +1,309 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +export interface MsgEmitIBCAck { + sender: string; + packetSequence: bigint; + channel: string; +} +export interface MsgEmitIBCAckProtoMsg { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAck'; + value: Uint8Array; +} +export interface MsgEmitIBCAckAmino { + sender?: string; + packet_sequence?: string; + channel?: string; +} +export interface MsgEmitIBCAckAminoMsg { + type: 'osmosis/ibchooks/emit-ibc-ack'; + value: MsgEmitIBCAckAmino; +} +export interface MsgEmitIBCAckSDKType { + sender: string; + packet_sequence: bigint; + channel: string; +} +export interface MsgEmitIBCAckResponse { + contractResult: string; + ibcAck: string; +} +export interface MsgEmitIBCAckResponseProtoMsg { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAckResponse'; + value: Uint8Array; +} +export interface MsgEmitIBCAckResponseAmino { + contract_result?: string; + ibc_ack?: string; +} +export interface MsgEmitIBCAckResponseAminoMsg { + type: 'osmosis/ibchooks/emit-ibc-ack-response'; + value: MsgEmitIBCAckResponseAmino; +} +export interface MsgEmitIBCAckResponseSDKType { + contract_result: string; + ibc_ack: string; +} +function createBaseMsgEmitIBCAck(): MsgEmitIBCAck { + return { + sender: '', + packetSequence: BigInt(0), + channel: '', + }; +} +export const MsgEmitIBCAck = { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAck', + aminoType: 'osmosis/ibchooks/emit-ibc-ack', + is(o: any): o is MsgEmitIBCAck { + return ( + o && + (o.$typeUrl === MsgEmitIBCAck.typeUrl || + (typeof o.sender === 'string' && + typeof o.packetSequence === 'bigint' && + typeof o.channel === 'string')) + ); + }, + isSDK(o: any): o is MsgEmitIBCAckSDKType { + return ( + o && + (o.$typeUrl === MsgEmitIBCAck.typeUrl || + (typeof o.sender === 'string' && + typeof o.packet_sequence === 'bigint' && + typeof o.channel === 'string')) + ); + }, + isAmino(o: any): o is MsgEmitIBCAckAmino { + return ( + o && + (o.$typeUrl === MsgEmitIBCAck.typeUrl || + (typeof o.sender === 'string' && + typeof o.packet_sequence === 'bigint' && + typeof o.channel === 'string')) + ); + }, + encode( + message: MsgEmitIBCAck, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.packetSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.packetSequence); + } + if (message.channel !== '') { + writer.uint32(26).string(message.channel); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmitIBCAck { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmitIBCAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.packetSequence = reader.uint64(); + break; + case 3: + message.channel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgEmitIBCAck { + const message = createBaseMsgEmitIBCAck(); + message.sender = object.sender ?? ''; + message.packetSequence = + object.packetSequence !== undefined && object.packetSequence !== null + ? BigInt(object.packetSequence.toString()) + : BigInt(0); + message.channel = object.channel ?? ''; + return message; + }, + fromAmino(object: MsgEmitIBCAckAmino): MsgEmitIBCAck { + const message = createBaseMsgEmitIBCAck(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if ( + object.packet_sequence !== undefined && + object.packet_sequence !== null + ) { + message.packetSequence = BigInt(object.packet_sequence); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + return message; + }, + toAmino(message: MsgEmitIBCAck): MsgEmitIBCAckAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.packet_sequence = + message.packetSequence !== BigInt(0) + ? message.packetSequence.toString() + : undefined; + obj.channel = message.channel === '' ? undefined : message.channel; + return obj; + }, + fromAminoMsg(object: MsgEmitIBCAckAminoMsg): MsgEmitIBCAck { + return MsgEmitIBCAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmitIBCAck): MsgEmitIBCAckAminoMsg { + return { + type: 'osmosis/ibchooks/emit-ibc-ack', + value: MsgEmitIBCAck.toAmino(message), + }; + }, + fromProtoMsg(message: MsgEmitIBCAckProtoMsg): MsgEmitIBCAck { + return MsgEmitIBCAck.decode(message.value); + }, + toProto(message: MsgEmitIBCAck): Uint8Array { + return MsgEmitIBCAck.encode(message).finish(); + }, + toProtoMsg(message: MsgEmitIBCAck): MsgEmitIBCAckProtoMsg { + return { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAck', + value: MsgEmitIBCAck.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgEmitIBCAck.typeUrl, MsgEmitIBCAck); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgEmitIBCAck.aminoType, + MsgEmitIBCAck.typeUrl +); +function createBaseMsgEmitIBCAckResponse(): MsgEmitIBCAckResponse { + return { + contractResult: '', + ibcAck: '', + }; +} +export const MsgEmitIBCAckResponse = { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAckResponse', + aminoType: 'osmosis/ibchooks/emit-ibc-ack-response', + is(o: any): o is MsgEmitIBCAckResponse { + return ( + o && + (o.$typeUrl === MsgEmitIBCAckResponse.typeUrl || + (typeof o.contractResult === 'string' && typeof o.ibcAck === 'string')) + ); + }, + isSDK(o: any): o is MsgEmitIBCAckResponseSDKType { + return ( + o && + (o.$typeUrl === MsgEmitIBCAckResponse.typeUrl || + (typeof o.contract_result === 'string' && + typeof o.ibc_ack === 'string')) + ); + }, + isAmino(o: any): o is MsgEmitIBCAckResponseAmino { + return ( + o && + (o.$typeUrl === MsgEmitIBCAckResponse.typeUrl || + (typeof o.contract_result === 'string' && + typeof o.ibc_ack === 'string')) + ); + }, + encode( + message: MsgEmitIBCAckResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.contractResult !== '') { + writer.uint32(10).string(message.contractResult); + } + if (message.ibcAck !== '') { + writer.uint32(18).string(message.ibcAck); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgEmitIBCAckResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmitIBCAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractResult = reader.string(); + break; + case 2: + message.ibcAck = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgEmitIBCAckResponse { + const message = createBaseMsgEmitIBCAckResponse(); + message.contractResult = object.contractResult ?? ''; + message.ibcAck = object.ibcAck ?? ''; + return message; + }, + fromAmino(object: MsgEmitIBCAckResponseAmino): MsgEmitIBCAckResponse { + const message = createBaseMsgEmitIBCAckResponse(); + if ( + object.contract_result !== undefined && + object.contract_result !== null + ) { + message.contractResult = object.contract_result; + } + if (object.ibc_ack !== undefined && object.ibc_ack !== null) { + message.ibcAck = object.ibc_ack; + } + return message; + }, + toAmino(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseAmino { + const obj: any = {}; + obj.contract_result = + message.contractResult === '' ? undefined : message.contractResult; + obj.ibc_ack = message.ibcAck === '' ? undefined : message.ibcAck; + return obj; + }, + fromAminoMsg(object: MsgEmitIBCAckResponseAminoMsg): MsgEmitIBCAckResponse { + return MsgEmitIBCAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseAminoMsg { + return { + type: 'osmosis/ibchooks/emit-ibc-ack-response', + value: MsgEmitIBCAckResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgEmitIBCAckResponseProtoMsg): MsgEmitIBCAckResponse { + return MsgEmitIBCAckResponse.decode(message.value); + }, + toProto(message: MsgEmitIBCAckResponse): Uint8Array { + return MsgEmitIBCAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseProtoMsg { + return { + typeUrl: '/osmosis.ibchooks.MsgEmitIBCAckResponse', + value: MsgEmitIBCAckResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgEmitIBCAckResponse.typeUrl, + MsgEmitIBCAckResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgEmitIBCAckResponse.aminoType, + MsgEmitIBCAckResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/incentives/gauge.ts b/packages/cosmos/src/proto_export/osmosis/incentives/gauge.ts new file mode 100644 index 00000000..a3d782ee --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/incentives/gauge.ts @@ -0,0 +1,511 @@ +//@ts-nocheck +import { + QueryCondition, + QueryConditionAmino, + QueryConditionSDKType, +} from '../lockup/lock'; +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin'; +import { Timestamp } from '../../google/protobuf/timestamp'; +import { + Duration, + DurationAmino, + DurationSDKType, +} from '../../google/protobuf/duration'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { toTimestamp, fromTimestamp } from '../../helpers'; +import { GlobalDecoderRegistry } from '../../registry'; +/** + * Gauge is an object that stores and distributes yields to recipients who + * satisfy certain conditions. Currently gauges support conditions around the + * duration for which a given denom is locked. + */ +export interface Gauge { + /** id is the unique ID of a Gauge */ + id: bigint; + /** + * is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge + * Non-perpetual gauges distribute their tokens equally per epoch while the + * gauge is in the active period. Perpetual gauges distribute all their tokens + * at a single time and only distribute their tokens again once the gauge is + * refilled, Intended for use with incentives that get refilled daily. + */ + isPerpetual: boolean; + /** + * distribute_to is where the gauge rewards are distributed to. + * This is queried via lock duration or by timestamp + */ + distributeTo: QueryCondition; + /** + * coins is the total amount of coins that have been in the gauge + * Can distribute multiple coin denoms + */ + coins: Coin[]; + /** start_time is the distribution start time */ + startTime: Date; + /** + * num_epochs_paid_over is the number of total epochs distribution will be + * completed over + */ + numEpochsPaidOver: bigint; + /** + * filled_epochs is the number of epochs distribution has been completed on + * already + */ + filledEpochs: bigint; + /** distributed_coins are coins that have been distributed already */ + distributedCoins: Coin[]; +} +export interface GaugeProtoMsg { + typeUrl: '/osmosis.incentives.Gauge'; + value: Uint8Array; +} +/** + * Gauge is an object that stores and distributes yields to recipients who + * satisfy certain conditions. Currently gauges support conditions around the + * duration for which a given denom is locked. + */ +export interface GaugeAmino { + /** id is the unique ID of a Gauge */ + id?: string; + /** + * is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge + * Non-perpetual gauges distribute their tokens equally per epoch while the + * gauge is in the active period. Perpetual gauges distribute all their tokens + * at a single time and only distribute their tokens again once the gauge is + * refilled, Intended for use with incentives that get refilled daily. + */ + is_perpetual?: boolean; + /** + * distribute_to is where the gauge rewards are distributed to. + * This is queried via lock duration or by timestamp + */ + distribute_to?: QueryConditionAmino; + /** + * coins is the total amount of coins that have been in the gauge + * Can distribute multiple coin denoms + */ + coins?: CoinAmino[]; + /** start_time is the distribution start time */ + start_time?: string; + /** + * num_epochs_paid_over is the number of total epochs distribution will be + * completed over + */ + num_epochs_paid_over?: string; + /** + * filled_epochs is the number of epochs distribution has been completed on + * already + */ + filled_epochs?: string; + /** distributed_coins are coins that have been distributed already */ + distributed_coins?: CoinAmino[]; +} +export interface GaugeAminoMsg { + type: 'osmosis/incentives/gauge'; + value: GaugeAmino; +} +/** + * Gauge is an object that stores and distributes yields to recipients who + * satisfy certain conditions. Currently gauges support conditions around the + * duration for which a given denom is locked. + */ +export interface GaugeSDKType { + id: bigint; + is_perpetual: boolean; + distribute_to: QueryConditionSDKType; + coins: CoinSDKType[]; + start_time: Date; + num_epochs_paid_over: bigint; + filled_epochs: bigint; + distributed_coins: CoinSDKType[]; +} +export interface LockableDurationsInfo { + /** List of incentivised durations that gauges will pay out to */ + lockableDurations: Duration[]; +} +export interface LockableDurationsInfoProtoMsg { + typeUrl: '/osmosis.incentives.LockableDurationsInfo'; + value: Uint8Array; +} +export interface LockableDurationsInfoAmino { + /** List of incentivised durations that gauges will pay out to */ + lockable_durations?: DurationAmino[]; +} +export interface LockableDurationsInfoAminoMsg { + type: 'osmosis/incentives/lockable-durations-info'; + value: LockableDurationsInfoAmino; +} +export interface LockableDurationsInfoSDKType { + lockable_durations: DurationSDKType[]; +} +function createBaseGauge(): Gauge { + return { + id: BigInt(0), + isPerpetual: false, + distributeTo: QueryCondition.fromPartial({}), + coins: [], + startTime: new Date(), + numEpochsPaidOver: BigInt(0), + filledEpochs: BigInt(0), + distributedCoins: [], + }; +} +export const Gauge = { + typeUrl: '/osmosis.incentives.Gauge', + aminoType: 'osmosis/incentives/gauge', + is(o: any): o is Gauge { + return ( + o && + (o.$typeUrl === Gauge.typeUrl || + (typeof o.id === 'bigint' && + typeof o.isPerpetual === 'boolean' && + QueryCondition.is(o.distributeTo) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])) && + Timestamp.is(o.startTime) && + typeof o.numEpochsPaidOver === 'bigint' && + typeof o.filledEpochs === 'bigint' && + Array.isArray(o.distributedCoins) && + (!o.distributedCoins.length || Coin.is(o.distributedCoins[0])))) + ); + }, + isSDK(o: any): o is GaugeSDKType { + return ( + o && + (o.$typeUrl === Gauge.typeUrl || + (typeof o.id === 'bigint' && + typeof o.is_perpetual === 'boolean' && + QueryCondition.isSDK(o.distribute_to) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])) && + Timestamp.isSDK(o.start_time) && + typeof o.num_epochs_paid_over === 'bigint' && + typeof o.filled_epochs === 'bigint' && + Array.isArray(o.distributed_coins) && + (!o.distributed_coins.length || Coin.isSDK(o.distributed_coins[0])))) + ); + }, + isAmino(o: any): o is GaugeAmino { + return ( + o && + (o.$typeUrl === Gauge.typeUrl || + (typeof o.id === 'bigint' && + typeof o.is_perpetual === 'boolean' && + QueryCondition.isAmino(o.distribute_to) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])) && + Timestamp.isAmino(o.start_time) && + typeof o.num_epochs_paid_over === 'bigint' && + typeof o.filled_epochs === 'bigint' && + Array.isArray(o.distributed_coins) && + (!o.distributed_coins.length || + Coin.isAmino(o.distributed_coins[0])))) + ); + }, + encode( + message: Gauge, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.isPerpetual === true) { + writer.uint32(16).bool(message.isPerpetual); + } + if (message.distributeTo !== undefined) { + QueryCondition.encode( + message.distributeTo, + writer.uint32(26).fork() + ).ldelim(); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.numEpochsPaidOver !== BigInt(0)) { + writer.uint32(48).uint64(message.numEpochsPaidOver); + } + if (message.filledEpochs !== BigInt(0)) { + writer.uint32(56).uint64(message.filledEpochs); + } + for (const v of message.distributedCoins) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Gauge { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGauge(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.isPerpetual = reader.bool(); + break; + case 3: + message.distributeTo = QueryCondition.decode(reader, reader.uint32()); + break; + case 4: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 5: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.numEpochsPaidOver = reader.uint64(); + break; + case 7: + message.filledEpochs = reader.uint64(); + break; + case 8: + message.distributedCoins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Gauge { + const message = createBaseGauge(); + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0); + message.isPerpetual = object.isPerpetual ?? false; + message.distributeTo = + object.distributeTo !== undefined && object.distributeTo !== null + ? QueryCondition.fromPartial(object.distributeTo) + : undefined; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + message.startTime = object.startTime ?? undefined; + message.numEpochsPaidOver = + object.numEpochsPaidOver !== undefined && + object.numEpochsPaidOver !== null + ? BigInt(object.numEpochsPaidOver.toString()) + : BigInt(0); + message.filledEpochs = + object.filledEpochs !== undefined && object.filledEpochs !== null + ? BigInt(object.filledEpochs.toString()) + : BigInt(0); + message.distributedCoins = + object.distributedCoins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GaugeAmino): Gauge { + const message = createBaseGauge(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.is_perpetual !== undefined && object.is_perpetual !== null) { + message.isPerpetual = object.is_perpetual; + } + if (object.distribute_to !== undefined && object.distribute_to !== null) { + message.distributeTo = QueryCondition.fromAmino(object.distribute_to); + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if ( + object.num_epochs_paid_over !== undefined && + object.num_epochs_paid_over !== null + ) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.filled_epochs !== undefined && object.filled_epochs !== null) { + message.filledEpochs = BigInt(object.filled_epochs); + } + message.distributedCoins = + object.distributed_coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Gauge): GaugeAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.is_perpetual = + message.isPerpetual === false ? undefined : message.isPerpetual; + obj.distribute_to = message.distributeTo + ? QueryCondition.toAmino(message.distributeTo) + : undefined; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + obj.start_time = message.startTime + ? Timestamp.toAmino(toTimestamp(message.startTime)) + : undefined; + obj.num_epochs_paid_over = + message.numEpochsPaidOver !== BigInt(0) + ? message.numEpochsPaidOver.toString() + : undefined; + obj.filled_epochs = + message.filledEpochs !== BigInt(0) + ? message.filledEpochs.toString() + : undefined; + if (message.distributedCoins) { + obj.distributed_coins = message.distributedCoins.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.distributed_coins = message.distributedCoins; + } + return obj; + }, + fromAminoMsg(object: GaugeAminoMsg): Gauge { + return Gauge.fromAmino(object.value); + }, + toAminoMsg(message: Gauge): GaugeAminoMsg { + return { + type: 'osmosis/incentives/gauge', + value: Gauge.toAmino(message), + }; + }, + fromProtoMsg(message: GaugeProtoMsg): Gauge { + return Gauge.decode(message.value); + }, + toProto(message: Gauge): Uint8Array { + return Gauge.encode(message).finish(); + }, + toProtoMsg(message: Gauge): GaugeProtoMsg { + return { + typeUrl: '/osmosis.incentives.Gauge', + value: Gauge.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Gauge.typeUrl, Gauge); +GlobalDecoderRegistry.registerAminoProtoMapping(Gauge.aminoType, Gauge.typeUrl); +function createBaseLockableDurationsInfo(): LockableDurationsInfo { + return { + lockableDurations: [], + }; +} +export const LockableDurationsInfo = { + typeUrl: '/osmosis.incentives.LockableDurationsInfo', + aminoType: 'osmosis/incentives/lockable-durations-info', + is(o: any): o is LockableDurationsInfo { + return ( + o && + (o.$typeUrl === LockableDurationsInfo.typeUrl || + (Array.isArray(o.lockableDurations) && + (!o.lockableDurations.length || Duration.is(o.lockableDurations[0])))) + ); + }, + isSDK(o: any): o is LockableDurationsInfoSDKType { + return ( + o && + (o.$typeUrl === LockableDurationsInfo.typeUrl || + (Array.isArray(o.lockable_durations) && + (!o.lockable_durations.length || + Duration.isSDK(o.lockable_durations[0])))) + ); + }, + isAmino(o: any): o is LockableDurationsInfoAmino { + return ( + o && + (o.$typeUrl === LockableDurationsInfo.typeUrl || + (Array.isArray(o.lockable_durations) && + (!o.lockable_durations.length || + Duration.isAmino(o.lockable_durations[0])))) + ); + }, + encode( + message: LockableDurationsInfo, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.lockableDurations) { + Duration.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): LockableDurationsInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockableDurationsInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockableDurations.push( + Duration.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LockableDurationsInfo { + const message = createBaseLockableDurationsInfo(); + message.lockableDurations = + object.lockableDurations?.map((e) => Duration.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LockableDurationsInfoAmino): LockableDurationsInfo { + const message = createBaseLockableDurationsInfo(); + message.lockableDurations = + object.lockable_durations?.map((e) => Duration.fromAmino(e)) || []; + return message; + }, + toAmino(message: LockableDurationsInfo): LockableDurationsInfoAmino { + const obj: any = {}; + if (message.lockableDurations) { + obj.lockable_durations = message.lockableDurations.map((e) => + e ? Duration.toAmino(e) : undefined + ); + } else { + obj.lockable_durations = message.lockableDurations; + } + return obj; + }, + fromAminoMsg(object: LockableDurationsInfoAminoMsg): LockableDurationsInfo { + return LockableDurationsInfo.fromAmino(object.value); + }, + toAminoMsg(message: LockableDurationsInfo): LockableDurationsInfoAminoMsg { + return { + type: 'osmosis/incentives/lockable-durations-info', + value: LockableDurationsInfo.toAmino(message), + }; + }, + fromProtoMsg(message: LockableDurationsInfoProtoMsg): LockableDurationsInfo { + return LockableDurationsInfo.decode(message.value); + }, + toProto(message: LockableDurationsInfo): Uint8Array { + return LockableDurationsInfo.encode(message).finish(); + }, + toProtoMsg(message: LockableDurationsInfo): LockableDurationsInfoProtoMsg { + return { + typeUrl: '/osmosis.incentives.LockableDurationsInfo', + value: LockableDurationsInfo.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + LockableDurationsInfo.typeUrl, + LockableDurationsInfo +); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockableDurationsInfo.aminoType, + LockableDurationsInfo.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/incentives/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/incentives/tx.amino.ts new file mode 100644 index 00000000..2634507b --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/incentives/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgCreateGauge, MsgAddToGauge, MsgCreateGroup } from './tx'; +export const AminoConverter = { + '/osmosis.incentives.MsgCreateGauge': { + aminoType: 'osmosis/incentives/create-gauge', + toAmino: MsgCreateGauge.toAmino, + fromAmino: MsgCreateGauge.fromAmino, + }, + '/osmosis.incentives.MsgAddToGauge': { + aminoType: 'osmosis/incentives/add-to-gauge', + toAmino: MsgAddToGauge.toAmino, + fromAmino: MsgAddToGauge.fromAmino, + }, + '/osmosis.incentives.MsgCreateGroup': { + aminoType: 'osmosis/incentives/create-group', + toAmino: MsgCreateGroup.toAmino, + fromAmino: MsgCreateGroup.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/incentives/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/incentives/tx.registry.ts new file mode 100644 index 00000000..c54e9f02 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/incentives/tx.registry.ts @@ -0,0 +1,76 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { MsgCreateGauge, MsgAddToGauge, MsgCreateGroup } from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.incentives.MsgCreateGauge', MsgCreateGauge], + ['/osmosis.incentives.MsgAddToGauge', MsgAddToGauge], + ['/osmosis.incentives.MsgCreateGroup', MsgCreateGroup], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createGauge(value: MsgCreateGauge) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value: MsgCreateGauge.encode(value).finish(), + }; + }, + addToGauge(value: MsgAddToGauge) { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value: MsgAddToGauge.encode(value).finish(), + }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + value: MsgCreateGroup.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createGauge(value: MsgCreateGauge) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value, + }; + }, + addToGauge(value: MsgAddToGauge) { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value, + }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + value, + }; + }, + }, + fromPartial: { + createGauge(value: MsgCreateGauge) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value: MsgCreateGauge.fromPartial(value), + }; + }, + addToGauge(value: MsgAddToGauge) { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value: MsgAddToGauge.fromPartial(value), + }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + value: MsgCreateGroup.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/incentives/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/incentives/tx.rpc.msg.ts new file mode 100644 index 00000000..1184180d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/incentives/tx.rpc.msg.ts @@ -0,0 +1,62 @@ +//@ts-nocheck +import { Rpc } from '../../helpers'; +import { BinaryReader } from '../../binary'; + +import { + MsgCreateGauge, + MsgCreateGaugeResponse, + MsgAddToGauge, + MsgAddToGaugeResponse, + MsgCreateGroup, + MsgCreateGroupResponse, +} from './tx'; +export interface Msg { + createGauge(request: MsgCreateGauge): Promise; + addToGauge(request: MsgAddToGauge): Promise; + createGroup(request: MsgCreateGroup): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createGauge = this.createGauge.bind(this); + this.addToGauge = this.addToGauge.bind(this); + this.createGroup = this.createGroup.bind(this); + } + createGauge(request: MsgCreateGauge): Promise { + const data = MsgCreateGauge.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.incentives.Msg', + 'CreateGauge', + data + ); + return promise.then((data) => + MsgCreateGaugeResponse.decode(new BinaryReader(data)) + ); + } + addToGauge(request: MsgAddToGauge): Promise { + const data = MsgAddToGauge.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.incentives.Msg', + 'AddToGauge', + data + ); + return promise.then((data) => + MsgAddToGaugeResponse.decode(new BinaryReader(data)) + ); + } + createGroup(request: MsgCreateGroup): Promise { + const data = MsgCreateGroup.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.incentives.Msg', + 'CreateGroup', + data + ); + return promise.then((data) => + MsgCreateGroupResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/incentives/tx.ts b/packages/cosmos/src/proto_export/osmosis/incentives/tx.ts new file mode 100644 index 00000000..d9073da9 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/incentives/tx.ts @@ -0,0 +1,1035 @@ +//@ts-nocheck +import { + QueryCondition, + QueryConditionAmino, + QueryConditionSDKType, +} from '../lockup/lock'; +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin'; +import { Timestamp } from '../../google/protobuf/timestamp'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { toTimestamp, fromTimestamp } from '../../helpers'; +import { GlobalDecoderRegistry } from '../../registry'; +/** MsgCreateGauge creates a gague to distribute rewards to users */ +export interface MsgCreateGauge { + /** + * is_perpetual shows if it's a perpetual or non-perpetual gauge + * Non-perpetual gauges distribute their tokens equally per epoch while the + * gauge is in the active period. Perpetual gauges distribute all their tokens + * at a single time and only distribute their tokens again once the gauge is + * refilled + */ + isPerpetual: boolean; + /** owner is the address of gauge creator */ + owner: string; + /** + * distribute_to show which lock the gauge should distribute to by time + * duration or by timestamp + */ + distributeTo: QueryCondition; + /** coins are coin(s) to be distributed by the gauge */ + coins: Coin[]; + /** start_time is the distribution start time */ + startTime: Date; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * over + */ + numEpochsPaidOver: bigint; + /** + * pool_id is the ID of the pool that the gauge is meant to be associated + * with. if pool_id is set, then the "QueryCondition.LockQueryType" must be + * "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct + * unset, including "QueryCondition.Denom". However, note that, internally, + * the empty string in "QueryCondition.Denom" ends up being overwritten with + * incentivestypes.NoLockExternalGaugeDenom() so that the gauges + * associated with a pool can be queried by this prefix if needed. + */ + poolId: bigint; +} +export interface MsgCreateGaugeProtoMsg { + typeUrl: '/osmosis.incentives.MsgCreateGauge'; + value: Uint8Array; +} +/** MsgCreateGauge creates a gague to distribute rewards to users */ +export interface MsgCreateGaugeAmino { + /** + * is_perpetual shows if it's a perpetual or non-perpetual gauge + * Non-perpetual gauges distribute their tokens equally per epoch while the + * gauge is in the active period. Perpetual gauges distribute all their tokens + * at a single time and only distribute their tokens again once the gauge is + * refilled + */ + is_perpetual?: boolean; + /** owner is the address of gauge creator */ + owner?: string; + /** + * distribute_to show which lock the gauge should distribute to by time + * duration or by timestamp + */ + distribute_to?: QueryConditionAmino; + /** coins are coin(s) to be distributed by the gauge */ + coins?: CoinAmino[]; + /** start_time is the distribution start time */ + start_time?: string; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * over + */ + num_epochs_paid_over?: string; + /** + * pool_id is the ID of the pool that the gauge is meant to be associated + * with. if pool_id is set, then the "QueryCondition.LockQueryType" must be + * "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct + * unset, including "QueryCondition.Denom". However, note that, internally, + * the empty string in "QueryCondition.Denom" ends up being overwritten with + * incentivestypes.NoLockExternalGaugeDenom() so that the gauges + * associated with a pool can be queried by this prefix if needed. + */ + pool_id?: string; +} +export interface MsgCreateGaugeAminoMsg { + type: 'osmosis/incentives/create-gauge'; + value: MsgCreateGaugeAmino; +} +/** MsgCreateGauge creates a gague to distribute rewards to users */ +export interface MsgCreateGaugeSDKType { + is_perpetual: boolean; + owner: string; + distribute_to: QueryConditionSDKType; + coins: CoinSDKType[]; + start_time: Date; + num_epochs_paid_over: bigint; + pool_id: bigint; +} +export interface MsgCreateGaugeResponse {} +export interface MsgCreateGaugeResponseProtoMsg { + typeUrl: '/osmosis.incentives.MsgCreateGaugeResponse'; + value: Uint8Array; +} +export interface MsgCreateGaugeResponseAmino {} +export interface MsgCreateGaugeResponseAminoMsg { + type: 'osmosis/incentives/create-gauge-response'; + value: MsgCreateGaugeResponseAmino; +} +export interface MsgCreateGaugeResponseSDKType {} +/** MsgAddToGauge adds coins to a previously created gauge */ +export interface MsgAddToGauge { + /** owner is the gauge owner's address */ + owner: string; + /** gauge_id is the ID of gauge that rewards are getting added to */ + gaugeId: bigint; + /** rewards are the coin(s) to add to gauge */ + rewards: Coin[]; +} +export interface MsgAddToGaugeProtoMsg { + typeUrl: '/osmosis.incentives.MsgAddToGauge'; + value: Uint8Array; +} +/** MsgAddToGauge adds coins to a previously created gauge */ +export interface MsgAddToGaugeAmino { + /** owner is the gauge owner's address */ + owner?: string; + /** gauge_id is the ID of gauge that rewards are getting added to */ + gauge_id?: string; + /** rewards are the coin(s) to add to gauge */ + rewards?: CoinAmino[]; +} +export interface MsgAddToGaugeAminoMsg { + type: 'osmosis/incentives/add-to-gauge'; + value: MsgAddToGaugeAmino; +} +/** MsgAddToGauge adds coins to a previously created gauge */ +export interface MsgAddToGaugeSDKType { + owner: string; + gauge_id: bigint; + rewards: CoinSDKType[]; +} +export interface MsgAddToGaugeResponse {} +export interface MsgAddToGaugeResponseProtoMsg { + typeUrl: '/osmosis.incentives.MsgAddToGaugeResponse'; + value: Uint8Array; +} +export interface MsgAddToGaugeResponseAmino {} +export interface MsgAddToGaugeResponseAminoMsg { + type: 'osmosis/incentives/add-to-gauge-response'; + value: MsgAddToGaugeResponseAmino; +} +export interface MsgAddToGaugeResponseSDKType {} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroup { + /** coins are the provided coins that the group will distribute */ + coins: Coin[]; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * in. 0 means it's perpetual + */ + numEpochsPaidOver: bigint; + /** owner is the group owner's address */ + owner: string; + /** pool_ids are the IDs of pools that the group is comprised of */ + poolIds: bigint[]; +} +export interface MsgCreateGroupProtoMsg { + typeUrl: '/osmosis.incentives.MsgCreateGroup'; + value: Uint8Array; +} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroupAmino { + /** coins are the provided coins that the group will distribute */ + coins?: CoinAmino[]; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * in. 0 means it's perpetual + */ + num_epochs_paid_over?: string; + /** owner is the group owner's address */ + owner?: string; + /** pool_ids are the IDs of pools that the group is comprised of */ + pool_ids?: string[]; +} +export interface MsgCreateGroupAminoMsg { + type: 'osmosis/incentives/create-group'; + value: MsgCreateGroupAmino; +} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroupSDKType { + coins: CoinSDKType[]; + num_epochs_paid_over: bigint; + owner: string; + pool_ids: bigint[]; +} +export interface MsgCreateGroupResponse { + /** group_id is the ID of the group that is created from this msg */ + groupId: bigint; +} +export interface MsgCreateGroupResponseProtoMsg { + typeUrl: '/osmosis.incentives.MsgCreateGroupResponse'; + value: Uint8Array; +} +export interface MsgCreateGroupResponseAmino { + /** group_id is the ID of the group that is created from this msg */ + group_id?: string; +} +export interface MsgCreateGroupResponseAminoMsg { + type: 'osmosis/incentives/create-group-response'; + value: MsgCreateGroupResponseAmino; +} +export interface MsgCreateGroupResponseSDKType { + group_id: bigint; +} +function createBaseMsgCreateGauge(): MsgCreateGauge { + return { + isPerpetual: false, + owner: '', + distributeTo: QueryCondition.fromPartial({}), + coins: [], + startTime: new Date(), + numEpochsPaidOver: BigInt(0), + poolId: BigInt(0), + }; +} +export const MsgCreateGauge = { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + aminoType: 'osmosis/incentives/create-gauge', + is(o: any): o is MsgCreateGauge { + return ( + o && + (o.$typeUrl === MsgCreateGauge.typeUrl || + (typeof o.isPerpetual === 'boolean' && + typeof o.owner === 'string' && + QueryCondition.is(o.distributeTo) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])) && + Timestamp.is(o.startTime) && + typeof o.numEpochsPaidOver === 'bigint' && + typeof o.poolId === 'bigint')) + ); + }, + isSDK(o: any): o is MsgCreateGaugeSDKType { + return ( + o && + (o.$typeUrl === MsgCreateGauge.typeUrl || + (typeof o.is_perpetual === 'boolean' && + typeof o.owner === 'string' && + QueryCondition.isSDK(o.distribute_to) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])) && + Timestamp.isSDK(o.start_time) && + typeof o.num_epochs_paid_over === 'bigint' && + typeof o.pool_id === 'bigint')) + ); + }, + isAmino(o: any): o is MsgCreateGaugeAmino { + return ( + o && + (o.$typeUrl === MsgCreateGauge.typeUrl || + (typeof o.is_perpetual === 'boolean' && + typeof o.owner === 'string' && + QueryCondition.isAmino(o.distribute_to) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])) && + Timestamp.isAmino(o.start_time) && + typeof o.num_epochs_paid_over === 'bigint' && + typeof o.pool_id === 'bigint')) + ); + }, + encode( + message: MsgCreateGauge, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.isPerpetual === true) { + writer.uint32(8).bool(message.isPerpetual); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + if (message.distributeTo !== undefined) { + QueryCondition.encode( + message.distributeTo, + writer.uint32(26).fork() + ).ldelim(); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.numEpochsPaidOver !== BigInt(0)) { + writer.uint32(48).uint64(message.numEpochsPaidOver); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(56).uint64(message.poolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGauge { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGauge(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isPerpetual = reader.bool(); + break; + case 2: + message.owner = reader.string(); + break; + case 3: + message.distributeTo = QueryCondition.decode(reader, reader.uint32()); + break; + case 4: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 5: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.numEpochsPaidOver = reader.uint64(); + break; + case 7: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGauge { + const message = createBaseMsgCreateGauge(); + message.isPerpetual = object.isPerpetual ?? false; + message.owner = object.owner ?? ''; + message.distributeTo = + object.distributeTo !== undefined && object.distributeTo !== null + ? QueryCondition.fromPartial(object.distributeTo) + : undefined; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + message.startTime = object.startTime ?? undefined; + message.numEpochsPaidOver = + object.numEpochsPaidOver !== undefined && + object.numEpochsPaidOver !== null + ? BigInt(object.numEpochsPaidOver.toString()) + : BigInt(0); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgCreateGaugeAmino): MsgCreateGauge { + const message = createBaseMsgCreateGauge(); + if (object.is_perpetual !== undefined && object.is_perpetual !== null) { + message.isPerpetual = object.is_perpetual; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.distribute_to !== undefined && object.distribute_to !== null) { + message.distributeTo = QueryCondition.fromAmino(object.distribute_to); + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if ( + object.num_epochs_paid_over !== undefined && + object.num_epochs_paid_over !== null + ) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino(message: MsgCreateGauge): MsgCreateGaugeAmino { + const obj: any = {}; + obj.is_perpetual = + message.isPerpetual === false ? undefined : message.isPerpetual; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.distribute_to = message.distributeTo + ? QueryCondition.toAmino(message.distributeTo) + : undefined; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + obj.start_time = message.startTime + ? Timestamp.toAmino(toTimestamp(message.startTime)) + : undefined; + obj.num_epochs_paid_over = + message.numEpochsPaidOver !== BigInt(0) + ? message.numEpochsPaidOver.toString() + : undefined; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGaugeAminoMsg): MsgCreateGauge { + return MsgCreateGauge.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGauge): MsgCreateGaugeAminoMsg { + return { + type: 'osmosis/incentives/create-gauge', + value: MsgCreateGauge.toAmino(message), + }; + }, + fromProtoMsg(message: MsgCreateGaugeProtoMsg): MsgCreateGauge { + return MsgCreateGauge.decode(message.value); + }, + toProto(message: MsgCreateGauge): Uint8Array { + return MsgCreateGauge.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGauge): MsgCreateGaugeProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value: MsgCreateGauge.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgCreateGauge.typeUrl, MsgCreateGauge); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateGauge.aminoType, + MsgCreateGauge.typeUrl +); +function createBaseMsgCreateGaugeResponse(): MsgCreateGaugeResponse { + return {}; +} +export const MsgCreateGaugeResponse = { + typeUrl: '/osmosis.incentives.MsgCreateGaugeResponse', + aminoType: 'osmosis/incentives/create-gauge-response', + is(o: any): o is MsgCreateGaugeResponse { + return o && o.$typeUrl === MsgCreateGaugeResponse.typeUrl; + }, + isSDK(o: any): o is MsgCreateGaugeResponseSDKType { + return o && o.$typeUrl === MsgCreateGaugeResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateGaugeResponseAmino { + return o && o.$typeUrl === MsgCreateGaugeResponse.typeUrl; + }, + encode( + _: MsgCreateGaugeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateGaugeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGaugeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateGaugeResponse { + const message = createBaseMsgCreateGaugeResponse(); + return message; + }, + fromAmino(_: MsgCreateGaugeResponseAmino): MsgCreateGaugeResponse { + const message = createBaseMsgCreateGaugeResponse(); + return message; + }, + toAmino(_: MsgCreateGaugeResponse): MsgCreateGaugeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateGaugeResponseAminoMsg): MsgCreateGaugeResponse { + return MsgCreateGaugeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGaugeResponse): MsgCreateGaugeResponseAminoMsg { + return { + type: 'osmosis/incentives/create-gauge-response', + value: MsgCreateGaugeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateGaugeResponseProtoMsg + ): MsgCreateGaugeResponse { + return MsgCreateGaugeResponse.decode(message.value); + }, + toProto(message: MsgCreateGaugeResponse): Uint8Array { + return MsgCreateGaugeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGaugeResponse): MsgCreateGaugeResponseProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgCreateGaugeResponse', + value: MsgCreateGaugeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateGaugeResponse.typeUrl, + MsgCreateGaugeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateGaugeResponse.aminoType, + MsgCreateGaugeResponse.typeUrl +); +function createBaseMsgAddToGauge(): MsgAddToGauge { + return { + owner: '', + gaugeId: BigInt(0), + rewards: [], + }; +} +export const MsgAddToGauge = { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + aminoType: 'osmosis/incentives/add-to-gauge', + is(o: any): o is MsgAddToGauge { + return ( + o && + (o.$typeUrl === MsgAddToGauge.typeUrl || + (typeof o.owner === 'string' && + typeof o.gaugeId === 'bigint' && + Array.isArray(o.rewards) && + (!o.rewards.length || Coin.is(o.rewards[0])))) + ); + }, + isSDK(o: any): o is MsgAddToGaugeSDKType { + return ( + o && + (o.$typeUrl === MsgAddToGauge.typeUrl || + (typeof o.owner === 'string' && + typeof o.gauge_id === 'bigint' && + Array.isArray(o.rewards) && + (!o.rewards.length || Coin.isSDK(o.rewards[0])))) + ); + }, + isAmino(o: any): o is MsgAddToGaugeAmino { + return ( + o && + (o.$typeUrl === MsgAddToGauge.typeUrl || + (typeof o.owner === 'string' && + typeof o.gauge_id === 'bigint' && + Array.isArray(o.rewards) && + (!o.rewards.length || Coin.isAmino(o.rewards[0])))) + ); + }, + encode( + message: MsgAddToGauge, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.gaugeId !== BigInt(0)) { + writer.uint32(16).uint64(message.gaugeId); + } + for (const v of message.rewards) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddToGauge { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddToGauge(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.gaugeId = reader.uint64(); + break; + case 3: + message.rewards.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddToGauge { + const message = createBaseMsgAddToGauge(); + message.owner = object.owner ?? ''; + message.gaugeId = + object.gaugeId !== undefined && object.gaugeId !== null + ? BigInt(object.gaugeId.toString()) + : BigInt(0); + message.rewards = object.rewards?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgAddToGaugeAmino): MsgAddToGauge { + const message = createBaseMsgAddToGauge(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + message.rewards = object.rewards?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgAddToGauge): MsgAddToGaugeAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.gauge_id = + message.gaugeId !== BigInt(0) ? message.gaugeId.toString() : undefined; + if (message.rewards) { + obj.rewards = message.rewards.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.rewards = message.rewards; + } + return obj; + }, + fromAminoMsg(object: MsgAddToGaugeAminoMsg): MsgAddToGauge { + return MsgAddToGauge.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddToGauge): MsgAddToGaugeAminoMsg { + return { + type: 'osmosis/incentives/add-to-gauge', + value: MsgAddToGauge.toAmino(message), + }; + }, + fromProtoMsg(message: MsgAddToGaugeProtoMsg): MsgAddToGauge { + return MsgAddToGauge.decode(message.value); + }, + toProto(message: MsgAddToGauge): Uint8Array { + return MsgAddToGauge.encode(message).finish(); + }, + toProtoMsg(message: MsgAddToGauge): MsgAddToGaugeProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value: MsgAddToGauge.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgAddToGauge.typeUrl, MsgAddToGauge); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToGauge.aminoType, + MsgAddToGauge.typeUrl +); +function createBaseMsgAddToGaugeResponse(): MsgAddToGaugeResponse { + return {}; +} +export const MsgAddToGaugeResponse = { + typeUrl: '/osmosis.incentives.MsgAddToGaugeResponse', + aminoType: 'osmosis/incentives/add-to-gauge-response', + is(o: any): o is MsgAddToGaugeResponse { + return o && o.$typeUrl === MsgAddToGaugeResponse.typeUrl; + }, + isSDK(o: any): o is MsgAddToGaugeResponseSDKType { + return o && o.$typeUrl === MsgAddToGaugeResponse.typeUrl; + }, + isAmino(o: any): o is MsgAddToGaugeResponseAmino { + return o && o.$typeUrl === MsgAddToGaugeResponse.typeUrl; + }, + encode( + _: MsgAddToGaugeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToGaugeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddToGaugeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAddToGaugeResponse { + const message = createBaseMsgAddToGaugeResponse(); + return message; + }, + fromAmino(_: MsgAddToGaugeResponseAmino): MsgAddToGaugeResponse { + const message = createBaseMsgAddToGaugeResponse(); + return message; + }, + toAmino(_: MsgAddToGaugeResponse): MsgAddToGaugeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddToGaugeResponseAminoMsg): MsgAddToGaugeResponse { + return MsgAddToGaugeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddToGaugeResponse): MsgAddToGaugeResponseAminoMsg { + return { + type: 'osmosis/incentives/add-to-gauge-response', + value: MsgAddToGaugeResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgAddToGaugeResponseProtoMsg): MsgAddToGaugeResponse { + return MsgAddToGaugeResponse.decode(message.value); + }, + toProto(message: MsgAddToGaugeResponse): Uint8Array { + return MsgAddToGaugeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddToGaugeResponse): MsgAddToGaugeResponseProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgAddToGaugeResponse', + value: MsgAddToGaugeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgAddToGaugeResponse.typeUrl, + MsgAddToGaugeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToGaugeResponse.aminoType, + MsgAddToGaugeResponse.typeUrl +); +function createBaseMsgCreateGroup(): MsgCreateGroup { + return { + coins: [], + numEpochsPaidOver: BigInt(0), + owner: '', + poolIds: [], + }; +} +export const MsgCreateGroup = { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + aminoType: 'osmosis/incentives/create-group', + is(o: any): o is MsgCreateGroup { + return ( + o && + (o.$typeUrl === MsgCreateGroup.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])) && + typeof o.numEpochsPaidOver === 'bigint' && + typeof o.owner === 'string' && + Array.isArray(o.poolIds) && + (!o.poolIds.length || typeof o.poolIds[0] === 'bigint'))) + ); + }, + isSDK(o: any): o is MsgCreateGroupSDKType { + return ( + o && + (o.$typeUrl === MsgCreateGroup.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])) && + typeof o.num_epochs_paid_over === 'bigint' && + typeof o.owner === 'string' && + Array.isArray(o.pool_ids) && + (!o.pool_ids.length || typeof o.pool_ids[0] === 'bigint'))) + ); + }, + isAmino(o: any): o is MsgCreateGroupAmino { + return ( + o && + (o.$typeUrl === MsgCreateGroup.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])) && + typeof o.num_epochs_paid_over === 'bigint' && + typeof o.owner === 'string' && + Array.isArray(o.pool_ids) && + (!o.pool_ids.length || typeof o.pool_ids[0] === 'bigint'))) + ); + }, + encode( + message: MsgCreateGroup, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.numEpochsPaidOver !== BigInt(0)) { + writer.uint32(16).uint64(message.numEpochsPaidOver); + } + if (message.owner !== '') { + writer.uint32(26).string(message.owner); + } + writer.uint32(34).fork(); + for (const v of message.poolIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroup { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.numEpochsPaidOver = reader.uint64(); + break; + case 3: + message.owner = reader.string(); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.poolIds.push(reader.uint64()); + } + } else { + message.poolIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + message.numEpochsPaidOver = + object.numEpochsPaidOver !== undefined && + object.numEpochsPaidOver !== null + ? BigInt(object.numEpochsPaidOver.toString()) + : BigInt(0); + message.owner = object.owner ?? ''; + message.poolIds = object.poolIds?.map((e) => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgCreateGroupAmino): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.num_epochs_paid_over !== undefined && + object.num_epochs_paid_over !== null + ) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.poolIds = object.pool_ids?.map((e) => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgCreateGroup): MsgCreateGroupAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + obj.num_epochs_paid_over = + message.numEpochsPaidOver !== BigInt(0) + ? message.numEpochsPaidOver.toString() + : undefined; + obj.owner = message.owner === '' ? undefined : message.owner; + if (message.poolIds) { + obj.pool_ids = message.poolIds.map((e) => e.toString()); + } else { + obj.pool_ids = message.poolIds; + } + return obj; + }, + fromAminoMsg(object: MsgCreateGroupAminoMsg): MsgCreateGroup { + return MsgCreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroup): MsgCreateGroupAminoMsg { + return { + type: 'osmosis/incentives/create-group', + value: MsgCreateGroup.toAmino(message), + }; + }, + fromProtoMsg(message: MsgCreateGroupProtoMsg): MsgCreateGroup { + return MsgCreateGroup.decode(message.value); + }, + toProto(message: MsgCreateGroup): Uint8Array { + return MsgCreateGroup.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroup): MsgCreateGroupProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + value: MsgCreateGroup.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgCreateGroup.typeUrl, MsgCreateGroup); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateGroup.aminoType, + MsgCreateGroup.typeUrl +); +function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { + return { + groupId: BigInt(0), + }; +} +export const MsgCreateGroupResponse = { + typeUrl: '/osmosis.incentives.MsgCreateGroupResponse', + aminoType: 'osmosis/incentives/create-group-response', + is(o: any): o is MsgCreateGroupResponse { + return ( + o && + (o.$typeUrl === MsgCreateGroupResponse.typeUrl || + typeof o.groupId === 'bigint') + ); + }, + isSDK(o: any): o is MsgCreateGroupResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCreateGroupResponse.typeUrl || + typeof o.group_id === 'bigint') + ); + }, + isAmino(o: any): o is MsgCreateGroupResponseAmino { + return ( + o && + (o.$typeUrl === MsgCreateGroupResponse.typeUrl || + typeof o.group_id === 'bigint') + ); + }, + encode( + message: MsgCreateGroupResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateGroupResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + message.groupId = + object.groupId !== undefined && object.groupId !== null + ? BigInt(object.groupId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgCreateGroupResponseAmino): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: MsgCreateGroupResponse): MsgCreateGroupResponseAmino { + const obj: any = {}; + obj.group_id = + message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupResponseAminoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseAminoMsg { + return { + type: 'osmosis/incentives/create-group-response', + value: MsgCreateGroupResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateGroupResponseProtoMsg + ): MsgCreateGroupResponse { + return MsgCreateGroupResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupResponse): Uint8Array { + return MsgCreateGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroupResponse', + value: MsgCreateGroupResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateGroupResponse.typeUrl, + MsgCreateGroupResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateGroupResponse.aminoType, + MsgCreateGroupResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/lcd.ts b/packages/cosmos/src/proto_export/osmosis/lcd.ts new file mode 100644 index 00000000..8514b51b --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lcd.ts @@ -0,0 +1,58 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; +export const createLCDClient = async ({ + restEndpoint, +}: { + restEndpoint: string; +}) => { + const requestClient = new LCDClient({ + restEndpoint, + }); + return { + osmosis: { + lockup: new (await import('./lockup/query.lcd')).LCDQueryClient({ + requestClient, + }), + poolmanager: { + v2: new (await import('./poolmanager/v2/query.lcd')).LCDQueryClient({ + requestClient, + }), + }, + protorev: { + v1beta1: new ( + await import('./protorev/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + smartaccount: { + v1beta1: new ( + await import('./smartaccount/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + tokenfactory: { + v1beta1: new ( + await import('./tokenfactory/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + txfees: { + v1beta1: new ( + await import('./txfees/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + valsetpref: { + v1beta1: new ( + await import('./valsetpref/v1beta1/query.lcd') + ).LCDQueryClient({ + requestClient, + }), + }, + }, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/genesis.ts b/packages/cosmos/src/proto_export/osmosis/lockup/genesis.ts new file mode 100644 index 00000000..38591767 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/genesis.ts @@ -0,0 +1,213 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; + +import { + PeriodLock, + PeriodLockAmino, + PeriodLockSDKType, + SyntheticLock, + SyntheticLockAmino, + SyntheticLockSDKType, +} from './lock'; +import { Params, ParamsAmino, ParamsSDKType } from './params'; +/** GenesisState defines the lockup module's genesis state. */ +export interface GenesisState { + lastLockId: bigint; + locks: PeriodLock[]; + syntheticLocks: SyntheticLock[]; + params?: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: '/osmosis.lockup.GenesisState'; + value: Uint8Array; +} +/** GenesisState defines the lockup module's genesis state. */ +export interface GenesisStateAmino { + last_lock_id?: string; + locks?: PeriodLockAmino[]; + synthetic_locks?: SyntheticLockAmino[]; + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: 'osmosis/lockup/genesis-state'; + value: GenesisStateAmino; +} +/** GenesisState defines the lockup module's genesis state. */ +export interface GenesisStateSDKType { + last_lock_id: bigint; + locks: PeriodLockSDKType[]; + synthetic_locks: SyntheticLockSDKType[]; + params?: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + lastLockId: BigInt(0), + locks: [], + syntheticLocks: [], + params: undefined, + }; +} +export const GenesisState = { + typeUrl: '/osmosis.lockup.GenesisState', + aminoType: 'osmosis/lockup/genesis-state', + is(o: any): o is GenesisState { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.lastLockId === 'bigint' && + Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])) && + Array.isArray(o.syntheticLocks) && + (!o.syntheticLocks.length || SyntheticLock.is(o.syntheticLocks[0])))) + ); + }, + isSDK(o: any): o is GenesisStateSDKType { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.last_lock_id === 'bigint' && + Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])) && + Array.isArray(o.synthetic_locks) && + (!o.synthetic_locks.length || + SyntheticLock.isSDK(o.synthetic_locks[0])))) + ); + }, + isAmino(o: any): o is GenesisStateAmino { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.last_lock_id === 'bigint' && + Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])) && + Array.isArray(o.synthetic_locks) && + (!o.synthetic_locks.length || + SyntheticLock.isAmino(o.synthetic_locks[0])))) + ); + }, + encode( + message: GenesisState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lastLockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lastLockId); + } + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.syntheticLocks) { + SyntheticLock.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastLockId = reader.uint64(); + break; + case 2: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + case 3: + message.syntheticLocks.push( + SyntheticLock.decode(reader, reader.uint32()) + ); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.lastLockId = + object.lastLockId !== undefined && object.lastLockId !== null + ? BigInt(object.lastLockId.toString()) + : BigInt(0); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + message.syntheticLocks = + object.syntheticLocks?.map((e) => SyntheticLock.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.last_lock_id !== undefined && object.last_lock_id !== null) { + message.lastLockId = BigInt(object.last_lock_id); + } + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + message.syntheticLocks = + object.synthetic_locks?.map((e) => SyntheticLock.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.last_lock_id = + message.lastLockId !== BigInt(0) + ? message.lastLockId.toString() + : undefined; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + if (message.syntheticLocks) { + obj.synthetic_locks = message.syntheticLocks.map((e) => + e ? SyntheticLock.toAmino(e) : undefined + ); + } else { + obj.synthetic_locks = message.syntheticLocks; + } + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/lockup/genesis-state', + value: GenesisState.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: '/osmosis.lockup.GenesisState', + value: GenesisState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisState.aminoType, + GenesisState.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/lock.ts b/packages/cosmos/src/proto_export/osmosis/lockup/lock.ts new file mode 100644 index 00000000..332ede68 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/lock.ts @@ -0,0 +1,830 @@ +//@ts-nocheck +import { + Duration, + DurationAmino, + DurationSDKType, +} from '../../google/protobuf/duration'; +import { Timestamp } from '../../google/protobuf/timestamp'; +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { toTimestamp, fromTimestamp, isSet } from '../../helpers'; +import { GlobalDecoderRegistry } from '../../registry'; +/** + * LockQueryType defines the type of the lock query that can + * either be by duration or start time of the lock. + */ +export enum LockQueryType { + ByDuration = 0, + ByTime = 1, + NoLock = 2, + ByGroup = 3, + UNRECOGNIZED = -1, +} +export const LockQueryTypeSDKType = LockQueryType; +export const LockQueryTypeAmino = LockQueryType; +export function lockQueryTypeFromJSON(object: any): LockQueryType { + switch (object) { + case 0: + case 'ByDuration': + return LockQueryType.ByDuration; + case 1: + case 'ByTime': + return LockQueryType.ByTime; + case 2: + case 'NoLock': + return LockQueryType.NoLock; + case 3: + case 'ByGroup': + return LockQueryType.ByGroup; + case -1: + case 'UNRECOGNIZED': + default: + return LockQueryType.UNRECOGNIZED; + } +} +export function lockQueryTypeToJSON(object: LockQueryType): string { + switch (object) { + case LockQueryType.ByDuration: + return 'ByDuration'; + case LockQueryType.ByTime: + return 'ByTime'; + case LockQueryType.NoLock: + return 'NoLock'; + case LockQueryType.ByGroup: + return 'ByGroup'; + case LockQueryType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +/** + * PeriodLock is a single lock unit by period defined by the x/lockup module. + * It's a record of a locked coin at a specific time. It stores owner, duration, + * unlock time and the number of coins locked. A state of a period lock is + * created upon lock creation, and deleted once the lock has been matured after + * the `duration` has passed since unbonding started. + */ +export interface PeriodLock { + /** + * ID is the unique id of the lock. + * The ID of the lock is decided upon lock creation, incrementing by 1 for + * every lock. + */ + ID: bigint; + /** + * Owner is the account address of the lock owner. + * Only the owner can modify the state of the lock. + */ + owner: string; + /** + * Duration is the time needed for a lock to mature after unlocking has + * started. + */ + duration: Duration; + /** + * EndTime refers to the time at which the lock would mature and get deleted. + * This value is first initialized when an unlock has started for the lock, + * end time being block time + duration. + */ + endTime: Date; + /** Coins are the tokens locked within the lock, kept in the module account. */ + coins: Coin[]; + /** + * Reward Receiver Address is the address that would be receiving rewards for + * the incentives for the lock. This is set to owner by default and can be + * changed via separate msg. + */ + rewardReceiverAddress: string; +} +export interface PeriodLockProtoMsg { + typeUrl: '/osmosis.lockup.PeriodLock'; + value: Uint8Array; +} +/** + * PeriodLock is a single lock unit by period defined by the x/lockup module. + * It's a record of a locked coin at a specific time. It stores owner, duration, + * unlock time and the number of coins locked. A state of a period lock is + * created upon lock creation, and deleted once the lock has been matured after + * the `duration` has passed since unbonding started. + */ +export interface PeriodLockAmino { + /** + * ID is the unique id of the lock. + * The ID of the lock is decided upon lock creation, incrementing by 1 for + * every lock. + */ + ID?: string; + /** + * Owner is the account address of the lock owner. + * Only the owner can modify the state of the lock. + */ + owner?: string; + /** + * Duration is the time needed for a lock to mature after unlocking has + * started. + */ + duration?: DurationAmino; + /** + * EndTime refers to the time at which the lock would mature and get deleted. + * This value is first initialized when an unlock has started for the lock, + * end time being block time + duration. + */ + end_time?: string; + /** Coins are the tokens locked within the lock, kept in the module account. */ + coins?: CoinAmino[]; + /** + * Reward Receiver Address is the address that would be receiving rewards for + * the incentives for the lock. This is set to owner by default and can be + * changed via separate msg. + */ + reward_receiver_address?: string; +} +export interface PeriodLockAminoMsg { + type: 'osmosis/lockup/period-lock'; + value: PeriodLockAmino; +} +/** + * PeriodLock is a single lock unit by period defined by the x/lockup module. + * It's a record of a locked coin at a specific time. It stores owner, duration, + * unlock time and the number of coins locked. A state of a period lock is + * created upon lock creation, and deleted once the lock has been matured after + * the `duration` has passed since unbonding started. + */ +export interface PeriodLockSDKType { + ID: bigint; + owner: string; + duration: DurationSDKType; + end_time: Date; + coins: CoinSDKType[]; + reward_receiver_address: string; +} +/** + * QueryCondition is a struct used for querying locks upon different conditions. + * Duration field and timestamp fields could be optional, depending on the + * LockQueryType. + */ +export interface QueryCondition { + /** LockQueryType is a type of lock query, ByLockDuration | ByLockTime */ + lockQueryType: LockQueryType; + /** Denom represents the token denomination we are looking to lock up */ + denom: string; + /** + * Duration is used to query locks with longer duration than the specified + * duration. Duration field must not be nil when the lock query type is + * `ByLockDuration`. + */ + duration: Duration; + /** + * Timestamp is used by locks started before the specified duration. + * Timestamp field must not be nil when the lock query type is `ByLockTime`. + * Querying locks with timestamp is currently not implemented. + */ + timestamp: Date; +} +export interface QueryConditionProtoMsg { + typeUrl: '/osmosis.lockup.QueryCondition'; + value: Uint8Array; +} +/** + * QueryCondition is a struct used for querying locks upon different conditions. + * Duration field and timestamp fields could be optional, depending on the + * LockQueryType. + */ +export interface QueryConditionAmino { + /** LockQueryType is a type of lock query, ByLockDuration | ByLockTime */ + lock_query_type?: LockQueryType; + /** Denom represents the token denomination we are looking to lock up */ + denom?: string; + /** + * Duration is used to query locks with longer duration than the specified + * duration. Duration field must not be nil when the lock query type is + * `ByLockDuration`. + */ + duration?: DurationAmino; + /** + * Timestamp is used by locks started before the specified duration. + * Timestamp field must not be nil when the lock query type is `ByLockTime`. + * Querying locks with timestamp is currently not implemented. + */ + timestamp?: string; +} +export interface QueryConditionAminoMsg { + type: 'osmosis/lockup/query-condition'; + value: QueryConditionAmino; +} +/** + * QueryCondition is a struct used for querying locks upon different conditions. + * Duration field and timestamp fields could be optional, depending on the + * LockQueryType. + */ +export interface QueryConditionSDKType { + lock_query_type: LockQueryType; + denom: string; + duration: DurationSDKType; + timestamp: Date; +} +/** + * SyntheticLock is creating virtual lockup where new denom is combination of + * original denom and synthetic suffix. At the time of synthetic lockup creation + * and deletion, accumulation store is also being updated and on querier side, + * they can query as freely as native lockup. + */ +export interface SyntheticLock { + /** + * Underlying Lock ID is the underlying native lock's id for this synthetic + * lockup. A synthetic lock MUST have an underlying lock. + */ + underlyingLockId: bigint; + /** + * SynthDenom is the synthetic denom that is a combination of + * gamm share + bonding status + validator address. + */ + synthDenom: string; + /** + * used for unbonding synthetic lockups, for active synthetic lockups, this + * value is set to uninitialized value + */ + endTime: Date; + /** + * Duration is the duration for a synthetic lock to mature + * at the point of unbonding has started. + */ + duration: Duration; +} +export interface SyntheticLockProtoMsg { + typeUrl: '/osmosis.lockup.SyntheticLock'; + value: Uint8Array; +} +/** + * SyntheticLock is creating virtual lockup where new denom is combination of + * original denom and synthetic suffix. At the time of synthetic lockup creation + * and deletion, accumulation store is also being updated and on querier side, + * they can query as freely as native lockup. + */ +export interface SyntheticLockAmino { + /** + * Underlying Lock ID is the underlying native lock's id for this synthetic + * lockup. A synthetic lock MUST have an underlying lock. + */ + underlying_lock_id?: string; + /** + * SynthDenom is the synthetic denom that is a combination of + * gamm share + bonding status + validator address. + */ + synth_denom?: string; + /** + * used for unbonding synthetic lockups, for active synthetic lockups, this + * value is set to uninitialized value + */ + end_time?: string; + /** + * Duration is the duration for a synthetic lock to mature + * at the point of unbonding has started. + */ + duration?: DurationAmino; +} +export interface SyntheticLockAminoMsg { + type: 'osmosis/lockup/synthetic-lock'; + value: SyntheticLockAmino; +} +/** + * SyntheticLock is creating virtual lockup where new denom is combination of + * original denom and synthetic suffix. At the time of synthetic lockup creation + * and deletion, accumulation store is also being updated and on querier side, + * they can query as freely as native lockup. + */ +export interface SyntheticLockSDKType { + underlying_lock_id: bigint; + synth_denom: string; + end_time: Date; + duration: DurationSDKType; +} +function createBasePeriodLock(): PeriodLock { + return { + ID: BigInt(0), + owner: '', + duration: Duration.fromPartial({}), + endTime: new Date(), + coins: [], + rewardReceiverAddress: '', + }; +} +export const PeriodLock = { + typeUrl: '/osmosis.lockup.PeriodLock', + aminoType: 'osmosis/lockup/period-lock', + is(o: any): o is PeriodLock { + return ( + o && + (o.$typeUrl === PeriodLock.typeUrl || + (typeof o.ID === 'bigint' && + typeof o.owner === 'string' && + Duration.is(o.duration) && + Timestamp.is(o.endTime) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])) && + typeof o.rewardReceiverAddress === 'string')) + ); + }, + isSDK(o: any): o is PeriodLockSDKType { + return ( + o && + (o.$typeUrl === PeriodLock.typeUrl || + (typeof o.ID === 'bigint' && + typeof o.owner === 'string' && + Duration.isSDK(o.duration) && + Timestamp.isSDK(o.end_time) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])) && + typeof o.reward_receiver_address === 'string')) + ); + }, + isAmino(o: any): o is PeriodLockAmino { + return ( + o && + (o.$typeUrl === PeriodLock.typeUrl || + (typeof o.ID === 'bigint' && + typeof o.owner === 'string' && + Duration.isAmino(o.duration) && + Timestamp.isAmino(o.end_time) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])) && + typeof o.reward_receiver_address === 'string')) + ); + }, + encode( + message: PeriodLock, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.ID !== BigInt(0)) { + writer.uint32(8).uint64(message.ID); + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); + } + if (message.endTime !== undefined) { + Timestamp.encode( + toTimestamp(message.endTime), + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.rewardReceiverAddress !== '') { + writer.uint32(50).string(message.rewardReceiverAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeriodLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriodLock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ID = reader.uint64(); + break; + case 2: + message.owner = reader.string(); + break; + case 3: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.endTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 6: + message.rewardReceiverAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PeriodLock { + const message = createBasePeriodLock(); + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0); + message.owner = object.owner ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.endTime = object.endTime ?? undefined; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + message.rewardReceiverAddress = object.rewardReceiverAddress ?? ''; + return message; + }, + fromAmino(object: PeriodLockAmino): PeriodLock { + const message = createBasePeriodLock(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.reward_receiver_address !== undefined && + object.reward_receiver_address !== null + ) { + message.rewardReceiverAddress = object.reward_receiver_address; + } + return message; + }, + toAmino(message: PeriodLock): PeriodLockAmino { + const obj: any = {}; + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + obj.end_time = message.endTime + ? Timestamp.toAmino(toTimestamp(message.endTime)) + : undefined; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + obj.reward_receiver_address = + message.rewardReceiverAddress === '' + ? undefined + : message.rewardReceiverAddress; + return obj; + }, + fromAminoMsg(object: PeriodLockAminoMsg): PeriodLock { + return PeriodLock.fromAmino(object.value); + }, + toAminoMsg(message: PeriodLock): PeriodLockAminoMsg { + return { + type: 'osmosis/lockup/period-lock', + value: PeriodLock.toAmino(message), + }; + }, + fromProtoMsg(message: PeriodLockProtoMsg): PeriodLock { + return PeriodLock.decode(message.value); + }, + toProto(message: PeriodLock): Uint8Array { + return PeriodLock.encode(message).finish(); + }, + toProtoMsg(message: PeriodLock): PeriodLockProtoMsg { + return { + typeUrl: '/osmosis.lockup.PeriodLock', + value: PeriodLock.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(PeriodLock.typeUrl, PeriodLock); +GlobalDecoderRegistry.registerAminoProtoMapping( + PeriodLock.aminoType, + PeriodLock.typeUrl +); +function createBaseQueryCondition(): QueryCondition { + return { + lockQueryType: 0, + denom: '', + duration: Duration.fromPartial({}), + timestamp: new Date(), + }; +} +export const QueryCondition = { + typeUrl: '/osmosis.lockup.QueryCondition', + aminoType: 'osmosis/lockup/query-condition', + is(o: any): o is QueryCondition { + return ( + o && + (o.$typeUrl === QueryCondition.typeUrl || + (isSet(o.lockQueryType) && + typeof o.denom === 'string' && + Duration.is(o.duration) && + Timestamp.is(o.timestamp))) + ); + }, + isSDK(o: any): o is QueryConditionSDKType { + return ( + o && + (o.$typeUrl === QueryCondition.typeUrl || + (isSet(o.lock_query_type) && + typeof o.denom === 'string' && + Duration.isSDK(o.duration) && + Timestamp.isSDK(o.timestamp))) + ); + }, + isAmino(o: any): o is QueryConditionAmino { + return ( + o && + (o.$typeUrl === QueryCondition.typeUrl || + (isSet(o.lock_query_type) && + typeof o.denom === 'string' && + Duration.isAmino(o.duration) && + Timestamp.isAmino(o.timestamp))) + ); + }, + encode( + message: QueryCondition, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockQueryType !== 0) { + writer.uint32(8).int32(message.lockQueryType); + } + if (message.denom !== '') { + writer.uint32(18).string(message.denom); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCondition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCondition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockQueryType = reader.int32() as any; + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCondition { + const message = createBaseQueryCondition(); + message.lockQueryType = object.lockQueryType ?? 0; + message.denom = object.denom ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: QueryConditionAmino): QueryCondition { + const message = createBaseQueryCondition(); + if ( + object.lock_query_type !== undefined && + object.lock_query_type !== null + ) { + message.lockQueryType = object.lock_query_type; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: QueryCondition): QueryConditionAmino { + const obj: any = {}; + obj.lock_query_type = + message.lockQueryType === 0 ? undefined : message.lockQueryType; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined; + return obj; + }, + fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { + return QueryCondition.fromAmino(object.value); + }, + toAminoMsg(message: QueryCondition): QueryConditionAminoMsg { + return { + type: 'osmosis/lockup/query-condition', + value: QueryCondition.toAmino(message), + }; + }, + fromProtoMsg(message: QueryConditionProtoMsg): QueryCondition { + return QueryCondition.decode(message.value); + }, + toProto(message: QueryCondition): Uint8Array { + return QueryCondition.encode(message).finish(); + }, + toProtoMsg(message: QueryCondition): QueryConditionProtoMsg { + return { + typeUrl: '/osmosis.lockup.QueryCondition', + value: QueryCondition.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(QueryCondition.typeUrl, QueryCondition); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryCondition.aminoType, + QueryCondition.typeUrl +); +function createBaseSyntheticLock(): SyntheticLock { + return { + underlyingLockId: BigInt(0), + synthDenom: '', + endTime: new Date(), + duration: Duration.fromPartial({}), + }; +} +export const SyntheticLock = { + typeUrl: '/osmosis.lockup.SyntheticLock', + aminoType: 'osmosis/lockup/synthetic-lock', + is(o: any): o is SyntheticLock { + return ( + o && + (o.$typeUrl === SyntheticLock.typeUrl || + (typeof o.underlyingLockId === 'bigint' && + typeof o.synthDenom === 'string' && + Timestamp.is(o.endTime) && + Duration.is(o.duration))) + ); + }, + isSDK(o: any): o is SyntheticLockSDKType { + return ( + o && + (o.$typeUrl === SyntheticLock.typeUrl || + (typeof o.underlying_lock_id === 'bigint' && + typeof o.synth_denom === 'string' && + Timestamp.isSDK(o.end_time) && + Duration.isSDK(o.duration))) + ); + }, + isAmino(o: any): o is SyntheticLockAmino { + return ( + o && + (o.$typeUrl === SyntheticLock.typeUrl || + (typeof o.underlying_lock_id === 'bigint' && + typeof o.synth_denom === 'string' && + Timestamp.isAmino(o.end_time) && + Duration.isAmino(o.duration))) + ); + }, + encode( + message: SyntheticLock, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.underlyingLockId !== BigInt(0)) { + writer.uint32(8).uint64(message.underlyingLockId); + } + if (message.synthDenom !== '') { + writer.uint32(18).string(message.synthDenom); + } + if (message.endTime !== undefined) { + Timestamp.encode( + toTimestamp(message.endTime), + writer.uint32(26).fork() + ).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SyntheticLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSyntheticLock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.underlyingLockId = reader.uint64(); + break; + case 2: + message.synthDenom = reader.string(); + break; + case 3: + message.endTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SyntheticLock { + const message = createBaseSyntheticLock(); + message.underlyingLockId = + object.underlyingLockId !== undefined && object.underlyingLockId !== null + ? BigInt(object.underlyingLockId.toString()) + : BigInt(0); + message.synthDenom = object.synthDenom ?? ''; + message.endTime = object.endTime ?? undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, + fromAmino(object: SyntheticLockAmino): SyntheticLock { + const message = createBaseSyntheticLock(); + if ( + object.underlying_lock_id !== undefined && + object.underlying_lock_id !== null + ) { + message.underlyingLockId = BigInt(object.underlying_lock_id); + } + if (object.synth_denom !== undefined && object.synth_denom !== null) { + message.synthDenom = object.synth_denom; + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino(message: SyntheticLock): SyntheticLockAmino { + const obj: any = {}; + obj.underlying_lock_id = + message.underlyingLockId !== BigInt(0) + ? message.underlyingLockId.toString() + : undefined; + obj.synth_denom = + message.synthDenom === '' ? undefined : message.synthDenom; + obj.end_time = message.endTime + ? Timestamp.toAmino(toTimestamp(message.endTime)) + : undefined; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + return obj; + }, + fromAminoMsg(object: SyntheticLockAminoMsg): SyntheticLock { + return SyntheticLock.fromAmino(object.value); + }, + toAminoMsg(message: SyntheticLock): SyntheticLockAminoMsg { + return { + type: 'osmosis/lockup/synthetic-lock', + value: SyntheticLock.toAmino(message), + }; + }, + fromProtoMsg(message: SyntheticLockProtoMsg): SyntheticLock { + return SyntheticLock.decode(message.value); + }, + toProto(message: SyntheticLock): Uint8Array { + return SyntheticLock.encode(message).finish(); + }, + toProtoMsg(message: SyntheticLock): SyntheticLockProtoMsg { + return { + typeUrl: '/osmosis.lockup.SyntheticLock', + value: SyntheticLock.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SyntheticLock.typeUrl, SyntheticLock); +GlobalDecoderRegistry.registerAminoProtoMapping( + SyntheticLock.aminoType, + SyntheticLock.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/params.ts b/packages/cosmos/src/proto_export/osmosis/lockup/params.ts new file mode 100644 index 00000000..14f6eee0 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/params.ts @@ -0,0 +1,131 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +export interface Params { + forceUnlockAllowedAddresses: string[]; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.lockup.Params'; + value: Uint8Array; +} +export interface ParamsAmino { + force_unlock_allowed_addresses?: string[]; +} +export interface ParamsAminoMsg { + type: 'osmosis/lockup/params'; + value: ParamsAmino; +} +export interface ParamsSDKType { + force_unlock_allowed_addresses: string[]; +} +function createBaseParams(): Params { + return { + forceUnlockAllowedAddresses: [], + }; +} +export const Params = { + typeUrl: '/osmosis.lockup.Params', + aminoType: 'osmosis/lockup/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.forceUnlockAllowedAddresses) && + (!o.forceUnlockAllowedAddresses.length || + typeof o.forceUnlockAllowedAddresses[0] === 'string'))) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.force_unlock_allowed_addresses) && + (!o.force_unlock_allowed_addresses.length || + typeof o.force_unlock_allowed_addresses[0] === 'string'))) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.force_unlock_allowed_addresses) && + (!o.force_unlock_allowed_addresses.length || + typeof o.force_unlock_allowed_addresses[0] === 'string'))) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.forceUnlockAllowedAddresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.forceUnlockAllowedAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.forceUnlockAllowedAddresses = + object.forceUnlockAllowedAddresses?.map((e) => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.forceUnlockAllowedAddresses = + object.force_unlock_allowed_addresses?.map((e) => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.forceUnlockAllowedAddresses) { + obj.force_unlock_allowed_addresses = + message.forceUnlockAllowedAddresses.map((e) => e); + } else { + obj.force_unlock_allowed_addresses = message.forceUnlockAllowedAddresses; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/lockup/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.lockup.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/query.lcd.ts b/packages/cosmos/src/proto_export/osmosis/lockup/query.lcd.ts new file mode 100644 index 00000000..65910246 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/query.lcd.ts @@ -0,0 +1,309 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; + +import { + ModuleBalanceRequest, + ModuleBalanceResponseSDKType, + ModuleLockedAmountRequest, + ModuleLockedAmountResponseSDKType, + AccountUnlockableCoinsRequest, + AccountUnlockableCoinsResponseSDKType, + AccountUnlockingCoinsRequest, + AccountUnlockingCoinsResponseSDKType, + AccountLockedCoinsRequest, + AccountLockedCoinsResponseSDKType, + AccountLockedPastTimeRequest, + AccountLockedPastTimeResponseSDKType, + AccountLockedPastTimeNotUnlockingOnlyRequest, + AccountLockedPastTimeNotUnlockingOnlyResponseSDKType, + AccountUnlockedBeforeTimeRequest, + AccountUnlockedBeforeTimeResponseSDKType, + AccountLockedPastTimeDenomRequest, + AccountLockedPastTimeDenomResponseSDKType, + LockedDenomRequest, + LockedDenomResponseSDKType, + LockedRequest, + LockedResponseSDKType, + LockRewardReceiverRequest, + LockRewardReceiverResponseSDKType, + NextLockIDRequest, + NextLockIDResponseSDKType, + SyntheticLockupsByLockupIDRequest, + SyntheticLockupsByLockupIDResponseSDKType, + SyntheticLockupByLockupIDRequest, + SyntheticLockupByLockupIDResponseSDKType, + AccountLockedLongerDurationRequest, + AccountLockedLongerDurationResponseSDKType, + AccountLockedDurationRequest, + AccountLockedDurationResponseSDKType, + AccountLockedLongerDurationNotUnlockingOnlyRequest, + AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType, + AccountLockedLongerDurationDenomRequest, + AccountLockedLongerDurationDenomResponseSDKType, + QueryParamsRequest, + QueryParamsResponseSDKType, +} from './query'; +export class LCDQueryClient { + req: LCDClient; + constructor({ requestClient }: { requestClient: LCDClient }) { + this.req = requestClient; + this.moduleBalance = this.moduleBalance.bind(this); + this.moduleLockedAmount = this.moduleLockedAmount.bind(this); + this.accountUnlockableCoins = this.accountUnlockableCoins.bind(this); + this.accountUnlockingCoins = this.accountUnlockingCoins.bind(this); + this.accountLockedCoins = this.accountLockedCoins.bind(this); + this.accountLockedPastTime = this.accountLockedPastTime.bind(this); + this.accountLockedPastTimeNotUnlockingOnly = + this.accountLockedPastTimeNotUnlockingOnly.bind(this); + this.accountUnlockedBeforeTime = this.accountUnlockedBeforeTime.bind(this); + this.accountLockedPastTimeDenom = + this.accountLockedPastTimeDenom.bind(this); + this.lockedDenom = this.lockedDenom.bind(this); + this.lockedByID = this.lockedByID.bind(this); + this.lockRewardReceiver = this.lockRewardReceiver.bind(this); + this.nextLockID = this.nextLockID.bind(this); + this.syntheticLockupsByLockupID = + this.syntheticLockupsByLockupID.bind(this); + this.syntheticLockupByLockupID = this.syntheticLockupByLockupID.bind(this); + this.accountLockedLongerDuration = + this.accountLockedLongerDuration.bind(this); + this.accountLockedDuration = this.accountLockedDuration.bind(this); + this.accountLockedLongerDurationNotUnlockingOnly = + this.accountLockedLongerDurationNotUnlockingOnly.bind(this); + this.accountLockedLongerDurationDenom = + this.accountLockedLongerDurationDenom.bind(this); + this.params = this.params.bind(this); + } + /* Return full balance of the module */ + async moduleBalance( + _params: ModuleBalanceRequest = {} + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/module_balance`; + return await this.req.get(endpoint); + } + /* Return locked balance of the module */ + async moduleLockedAmount( + _params: ModuleLockedAmountRequest = {} + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/module_locked_amount`; + return await this.req.get(endpoint); + } + /* Returns unlockable coins which are not withdrawn yet */ + async accountUnlockableCoins( + params: AccountUnlockableCoinsRequest + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/account_unlockable_coins/${params.owner}`; + return await this.req.get(endpoint); + } + /* Returns unlocking coins */ + async accountUnlockingCoins( + params: AccountUnlockingCoinsRequest + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/account_unlocking_coins/${params.owner}`; + return await this.req.get(endpoint); + } + /* Return a locked coins that can't be withdrawn */ + async accountLockedCoins( + params: AccountLockedCoinsRequest + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/account_locked_coins/${params.owner}`; + return await this.req.get(endpoint); + } + /* Returns locked records of an account with unlock time beyond timestamp */ + async accountLockedPastTime( + params: AccountLockedPastTimeRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.timestamp !== 'undefined') { + options.params.timestamp = params.timestamp; + } + const endpoint = `osmosis/lockup/v1beta1/account_locked_pasttime/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns locked records of an account with unlock time beyond timestamp + excluding tokens started unlocking */ + async accountLockedPastTimeNotUnlockingOnly( + params: AccountLockedPastTimeNotUnlockingOnlyRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.timestamp !== 'undefined') { + options.params.timestamp = params.timestamp; + } + const endpoint = `osmosis/lockup/v1beta1/account_locked_pasttime_not_unlocking_only/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns unlocked records with unlock time before timestamp */ + async accountUnlockedBeforeTime( + params: AccountUnlockedBeforeTimeRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.timestamp !== 'undefined') { + options.params.timestamp = params.timestamp; + } + const endpoint = `osmosis/lockup/v1beta1/account_unlocked_before_time/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns lock records by address, timestamp, denom */ + async accountLockedPastTimeDenom( + params: AccountLockedPastTimeDenomRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.timestamp !== 'undefined') { + options.params.timestamp = params.timestamp; + } + if (typeof params?.denom !== 'undefined') { + options.params.denom = params.denom; + } + const endpoint = `osmosis/lockup/v1beta1/account_locked_pasttime_denom/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns total locked per denom with longer past given time */ + async lockedDenom( + params: LockedDenomRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.denom !== 'undefined') { + options.params.denom = params.denom; + } + if (typeof params?.duration !== 'undefined') { + options.params.duration = params.duration; + } + const endpoint = `osmosis/lockup/v1beta1/locked_denom`; + return await this.req.get(endpoint, options); + } + /* Returns lock record by id */ + async lockedByID(params: LockedRequest): Promise { + const endpoint = `osmosis/lockup/v1beta1/locked_by_id/${params.lockId}`; + return await this.req.get(endpoint); + } + /* Returns lock record by id */ + async lockRewardReceiver( + params: LockRewardReceiverRequest + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/lock_reward_receiver/${params.lockId}`; + return await this.req.get(endpoint); + } + /* Returns next lock ID */ + async nextLockID( + _params: NextLockIDRequest = {} + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/next_lock_id`; + return await this.req.get(endpoint); + } + /* Returns synthetic lockup by native lockup id + Deprecated: use SyntheticLockupByLockupID instead */ + async syntheticLockupsByLockupID( + params: SyntheticLockupsByLockupIDRequest + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/synthetic_lockups_by_lock_id/${params.lockId}`; + return await this.req.get( + endpoint + ); + } + /* Returns synthetic lockup by native lockup id */ + async syntheticLockupByLockupID( + params: SyntheticLockupByLockupIDRequest + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/synthetic_lockup_by_lock_id/${params.lockId}`; + return await this.req.get( + endpoint + ); + } + /* Returns account locked records with longer duration */ + async accountLockedLongerDuration( + params: AccountLockedLongerDurationRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.duration !== 'undefined') { + options.params.duration = params.duration; + } + const endpoint = `osmosis/lockup/v1beta1/account_locked_longer_duration/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns account locked records with a specific duration */ + async accountLockedDuration( + params: AccountLockedDurationRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.duration !== 'undefined') { + options.params.duration = params.duration; + } + const endpoint = `osmosis/lockup/v1beta1/account_locked_duration/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns account locked records with longer duration excluding tokens + started unlocking */ + async accountLockedLongerDurationNotUnlockingOnly( + params: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.duration !== 'undefined') { + options.params.duration = params.duration; + } + const endpoint = `osmosis/lockup/v1beta1/account_locked_longer_duration_not_unlocking_only/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns account's locked records for a denom with longer duration */ + async accountLockedLongerDurationDenom( + params: AccountLockedLongerDurationDenomRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.duration !== 'undefined') { + options.params.duration = params.duration; + } + if (typeof params?.denom !== 'undefined') { + options.params.denom = params.denom; + } + const endpoint = `osmosis/lockup/v1beta1/account_locked_longer_duration_denom/${params.owner}`; + return await this.req.get( + endpoint, + options + ); + } + /* Params returns lockup params. */ + async params( + _params: QueryParamsRequest = {} + ): Promise { + const endpoint = `osmosis/lockup/v1beta1/params`; + return await this.req.get(endpoint); + } +} diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/query.rpc.Query.ts b/packages/cosmos/src/proto_export/osmosis/lockup/query.rpc.Query.ts new file mode 100644 index 00000000..1e715b90 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/query.rpc.Query.ts @@ -0,0 +1,945 @@ +//@ts-nocheck +import { + QueryClient, + createProtobufRpcClient, + ProtobufRpcClient, +} from '@cosmjs/stargate'; +import { useQuery } from '@tanstack/react-query'; + +import { Rpc } from '../../helpers'; +import { BinaryReader } from '../../binary'; +import { ReactQueryParams } from '../../react-query'; + +import { + ModuleBalanceRequest, + ModuleBalanceResponse, + ModuleLockedAmountRequest, + ModuleLockedAmountResponse, + AccountUnlockableCoinsRequest, + AccountUnlockableCoinsResponse, + AccountUnlockingCoinsRequest, + AccountUnlockingCoinsResponse, + AccountLockedCoinsRequest, + AccountLockedCoinsResponse, + AccountLockedPastTimeRequest, + AccountLockedPastTimeResponse, + AccountLockedPastTimeNotUnlockingOnlyRequest, + AccountLockedPastTimeNotUnlockingOnlyResponse, + AccountUnlockedBeforeTimeRequest, + AccountUnlockedBeforeTimeResponse, + AccountLockedPastTimeDenomRequest, + AccountLockedPastTimeDenomResponse, + LockedDenomRequest, + LockedDenomResponse, + LockedRequest, + LockedResponse, + LockRewardReceiverRequest, + LockRewardReceiverResponse, + NextLockIDRequest, + NextLockIDResponse, + SyntheticLockupsByLockupIDRequest, + SyntheticLockupsByLockupIDResponse, + SyntheticLockupByLockupIDRequest, + SyntheticLockupByLockupIDResponse, + AccountLockedLongerDurationRequest, + AccountLockedLongerDurationResponse, + AccountLockedDurationRequest, + AccountLockedDurationResponse, + AccountLockedLongerDurationNotUnlockingOnlyRequest, + AccountLockedLongerDurationNotUnlockingOnlyResponse, + AccountLockedLongerDurationDenomRequest, + AccountLockedLongerDurationDenomResponse, + QueryParamsRequest, + QueryParamsResponse, +} from './query'; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Return full balance of the module */ + moduleBalance(request?: ModuleBalanceRequest): Promise; + /** Return locked balance of the module */ + moduleLockedAmount( + request?: ModuleLockedAmountRequest + ): Promise; + /** Returns unlockable coins which are not withdrawn yet */ + accountUnlockableCoins( + request: AccountUnlockableCoinsRequest + ): Promise; + /** Returns unlocking coins */ + accountUnlockingCoins( + request: AccountUnlockingCoinsRequest + ): Promise; + /** Return a locked coins that can't be withdrawn */ + accountLockedCoins( + request: AccountLockedCoinsRequest + ): Promise; + /** Returns locked records of an account with unlock time beyond timestamp */ + accountLockedPastTime( + request: AccountLockedPastTimeRequest + ): Promise; + /** + * Returns locked records of an account with unlock time beyond timestamp + * excluding tokens started unlocking + */ + accountLockedPastTimeNotUnlockingOnly( + request: AccountLockedPastTimeNotUnlockingOnlyRequest + ): Promise; + /** Returns unlocked records with unlock time before timestamp */ + accountUnlockedBeforeTime( + request: AccountUnlockedBeforeTimeRequest + ): Promise; + /** Returns lock records by address, timestamp, denom */ + accountLockedPastTimeDenom( + request: AccountLockedPastTimeDenomRequest + ): Promise; + /** Returns total locked per denom with longer past given time */ + lockedDenom(request: LockedDenomRequest): Promise; + /** Returns lock record by id */ + lockedByID(request: LockedRequest): Promise; + /** Returns lock record by id */ + lockRewardReceiver( + request: LockRewardReceiverRequest + ): Promise; + /** Returns next lock ID */ + nextLockID(request?: NextLockIDRequest): Promise; + /** + * Returns synthetic lockup by native lockup id + * Deprecated: use SyntheticLockupByLockupID instead + */ + syntheticLockupsByLockupID( + request: SyntheticLockupsByLockupIDRequest + ): Promise; + /** Returns synthetic lockup by native lockup id */ + syntheticLockupByLockupID( + request: SyntheticLockupByLockupIDRequest + ): Promise; + /** Returns account locked records with longer duration */ + accountLockedLongerDuration( + request: AccountLockedLongerDurationRequest + ): Promise; + /** Returns account locked records with a specific duration */ + accountLockedDuration( + request: AccountLockedDurationRequest + ): Promise; + /** + * Returns account locked records with longer duration excluding tokens + * started unlocking + */ + accountLockedLongerDurationNotUnlockingOnly( + request: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): Promise; + /** Returns account's locked records for a denom with longer duration */ + accountLockedLongerDurationDenom( + request: AccountLockedLongerDurationDenomRequest + ): Promise; + /** Params returns lockup params. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.moduleBalance = this.moduleBalance.bind(this); + this.moduleLockedAmount = this.moduleLockedAmount.bind(this); + this.accountUnlockableCoins = this.accountUnlockableCoins.bind(this); + this.accountUnlockingCoins = this.accountUnlockingCoins.bind(this); + this.accountLockedCoins = this.accountLockedCoins.bind(this); + this.accountLockedPastTime = this.accountLockedPastTime.bind(this); + this.accountLockedPastTimeNotUnlockingOnly = + this.accountLockedPastTimeNotUnlockingOnly.bind(this); + this.accountUnlockedBeforeTime = this.accountUnlockedBeforeTime.bind(this); + this.accountLockedPastTimeDenom = + this.accountLockedPastTimeDenom.bind(this); + this.lockedDenom = this.lockedDenom.bind(this); + this.lockedByID = this.lockedByID.bind(this); + this.lockRewardReceiver = this.lockRewardReceiver.bind(this); + this.nextLockID = this.nextLockID.bind(this); + this.syntheticLockupsByLockupID = + this.syntheticLockupsByLockupID.bind(this); + this.syntheticLockupByLockupID = this.syntheticLockupByLockupID.bind(this); + this.accountLockedLongerDuration = + this.accountLockedLongerDuration.bind(this); + this.accountLockedDuration = this.accountLockedDuration.bind(this); + this.accountLockedLongerDurationNotUnlockingOnly = + this.accountLockedLongerDurationNotUnlockingOnly.bind(this); + this.accountLockedLongerDurationDenom = + this.accountLockedLongerDurationDenom.bind(this); + this.params = this.params.bind(this); + } + moduleBalance( + request: ModuleBalanceRequest = {} + ): Promise { + const data = ModuleBalanceRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'ModuleBalance', + data + ); + return promise.then((data) => + ModuleBalanceResponse.decode(new BinaryReader(data)) + ); + } + moduleLockedAmount( + request: ModuleLockedAmountRequest = {} + ): Promise { + const data = ModuleLockedAmountRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'ModuleLockedAmount', + data + ); + return promise.then((data) => + ModuleLockedAmountResponse.decode(new BinaryReader(data)) + ); + } + accountUnlockableCoins( + request: AccountUnlockableCoinsRequest + ): Promise { + const data = AccountUnlockableCoinsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountUnlockableCoins', + data + ); + return promise.then((data) => + AccountUnlockableCoinsResponse.decode(new BinaryReader(data)) + ); + } + accountUnlockingCoins( + request: AccountUnlockingCoinsRequest + ): Promise { + const data = AccountUnlockingCoinsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountUnlockingCoins', + data + ); + return promise.then((data) => + AccountUnlockingCoinsResponse.decode(new BinaryReader(data)) + ); + } + accountLockedCoins( + request: AccountLockedCoinsRequest + ): Promise { + const data = AccountLockedCoinsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedCoins', + data + ); + return promise.then((data) => + AccountLockedCoinsResponse.decode(new BinaryReader(data)) + ); + } + accountLockedPastTime( + request: AccountLockedPastTimeRequest + ): Promise { + const data = AccountLockedPastTimeRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedPastTime', + data + ); + return promise.then((data) => + AccountLockedPastTimeResponse.decode(new BinaryReader(data)) + ); + } + accountLockedPastTimeNotUnlockingOnly( + request: AccountLockedPastTimeNotUnlockingOnlyRequest + ): Promise { + const data = + AccountLockedPastTimeNotUnlockingOnlyRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedPastTimeNotUnlockingOnly', + data + ); + return promise.then((data) => + AccountLockedPastTimeNotUnlockingOnlyResponse.decode( + new BinaryReader(data) + ) + ); + } + accountUnlockedBeforeTime( + request: AccountUnlockedBeforeTimeRequest + ): Promise { + const data = AccountUnlockedBeforeTimeRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountUnlockedBeforeTime', + data + ); + return promise.then((data) => + AccountUnlockedBeforeTimeResponse.decode(new BinaryReader(data)) + ); + } + accountLockedPastTimeDenom( + request: AccountLockedPastTimeDenomRequest + ): Promise { + const data = AccountLockedPastTimeDenomRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedPastTimeDenom', + data + ); + return promise.then((data) => + AccountLockedPastTimeDenomResponse.decode(new BinaryReader(data)) + ); + } + lockedDenom(request: LockedDenomRequest): Promise { + const data = LockedDenomRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'LockedDenom', + data + ); + return promise.then((data) => + LockedDenomResponse.decode(new BinaryReader(data)) + ); + } + lockedByID(request: LockedRequest): Promise { + const data = LockedRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'LockedByID', + data + ); + return promise.then((data) => + LockedResponse.decode(new BinaryReader(data)) + ); + } + lockRewardReceiver( + request: LockRewardReceiverRequest + ): Promise { + const data = LockRewardReceiverRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'LockRewardReceiver', + data + ); + return promise.then((data) => + LockRewardReceiverResponse.decode(new BinaryReader(data)) + ); + } + nextLockID(request: NextLockIDRequest = {}): Promise { + const data = NextLockIDRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'NextLockID', + data + ); + return promise.then((data) => + NextLockIDResponse.decode(new BinaryReader(data)) + ); + } + syntheticLockupsByLockupID( + request: SyntheticLockupsByLockupIDRequest + ): Promise { + const data = SyntheticLockupsByLockupIDRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'SyntheticLockupsByLockupID', + data + ); + return promise.then((data) => + SyntheticLockupsByLockupIDResponse.decode(new BinaryReader(data)) + ); + } + syntheticLockupByLockupID( + request: SyntheticLockupByLockupIDRequest + ): Promise { + const data = SyntheticLockupByLockupIDRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'SyntheticLockupByLockupID', + data + ); + return promise.then((data) => + SyntheticLockupByLockupIDResponse.decode(new BinaryReader(data)) + ); + } + accountLockedLongerDuration( + request: AccountLockedLongerDurationRequest + ): Promise { + const data = AccountLockedLongerDurationRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedLongerDuration', + data + ); + return promise.then((data) => + AccountLockedLongerDurationResponse.decode(new BinaryReader(data)) + ); + } + accountLockedDuration( + request: AccountLockedDurationRequest + ): Promise { + const data = AccountLockedDurationRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedDuration', + data + ); + return promise.then((data) => + AccountLockedDurationResponse.decode(new BinaryReader(data)) + ); + } + accountLockedLongerDurationNotUnlockingOnly( + request: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): Promise { + const data = + AccountLockedLongerDurationNotUnlockingOnlyRequest.encode( + request + ).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedLongerDurationNotUnlockingOnly', + data + ); + return promise.then((data) => + AccountLockedLongerDurationNotUnlockingOnlyResponse.decode( + new BinaryReader(data) + ) + ); + } + accountLockedLongerDurationDenom( + request: AccountLockedLongerDurationDenomRequest + ): Promise { + const data = + AccountLockedLongerDurationDenomRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Query', + 'AccountLockedLongerDurationDenom', + data + ); + return promise.then((data) => + AccountLockedLongerDurationDenomResponse.decode(new BinaryReader(data)) + ); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request('osmosis.lockup.Query', 'Params', data); + return promise.then((data) => + QueryParamsResponse.decode(new BinaryReader(data)) + ); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + moduleBalance( + request?: ModuleBalanceRequest + ): Promise { + return queryService.moduleBalance(request); + }, + moduleLockedAmount( + request?: ModuleLockedAmountRequest + ): Promise { + return queryService.moduleLockedAmount(request); + }, + accountUnlockableCoins( + request: AccountUnlockableCoinsRequest + ): Promise { + return queryService.accountUnlockableCoins(request); + }, + accountUnlockingCoins( + request: AccountUnlockingCoinsRequest + ): Promise { + return queryService.accountUnlockingCoins(request); + }, + accountLockedCoins( + request: AccountLockedCoinsRequest + ): Promise { + return queryService.accountLockedCoins(request); + }, + accountLockedPastTime( + request: AccountLockedPastTimeRequest + ): Promise { + return queryService.accountLockedPastTime(request); + }, + accountLockedPastTimeNotUnlockingOnly( + request: AccountLockedPastTimeNotUnlockingOnlyRequest + ): Promise { + return queryService.accountLockedPastTimeNotUnlockingOnly(request); + }, + accountUnlockedBeforeTime( + request: AccountUnlockedBeforeTimeRequest + ): Promise { + return queryService.accountUnlockedBeforeTime(request); + }, + accountLockedPastTimeDenom( + request: AccountLockedPastTimeDenomRequest + ): Promise { + return queryService.accountLockedPastTimeDenom(request); + }, + lockedDenom(request: LockedDenomRequest): Promise { + return queryService.lockedDenom(request); + }, + lockedByID(request: LockedRequest): Promise { + return queryService.lockedByID(request); + }, + lockRewardReceiver( + request: LockRewardReceiverRequest + ): Promise { + return queryService.lockRewardReceiver(request); + }, + nextLockID(request?: NextLockIDRequest): Promise { + return queryService.nextLockID(request); + }, + syntheticLockupsByLockupID( + request: SyntheticLockupsByLockupIDRequest + ): Promise { + return queryService.syntheticLockupsByLockupID(request); + }, + syntheticLockupByLockupID( + request: SyntheticLockupByLockupIDRequest + ): Promise { + return queryService.syntheticLockupByLockupID(request); + }, + accountLockedLongerDuration( + request: AccountLockedLongerDurationRequest + ): Promise { + return queryService.accountLockedLongerDuration(request); + }, + accountLockedDuration( + request: AccountLockedDurationRequest + ): Promise { + return queryService.accountLockedDuration(request); + }, + accountLockedLongerDurationNotUnlockingOnly( + request: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): Promise { + return queryService.accountLockedLongerDurationNotUnlockingOnly(request); + }, + accountLockedLongerDurationDenom( + request: AccountLockedLongerDurationDenomRequest + ): Promise { + return queryService.accountLockedLongerDurationDenom(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + }; +}; +export interface UseModuleBalanceQuery + extends ReactQueryParams { + request?: ModuleBalanceRequest; +} +export interface UseModuleLockedAmountQuery + extends ReactQueryParams { + request?: ModuleLockedAmountRequest; +} +export interface UseAccountUnlockableCoinsQuery + extends ReactQueryParams { + request: AccountUnlockableCoinsRequest; +} +export interface UseAccountUnlockingCoinsQuery + extends ReactQueryParams { + request: AccountUnlockingCoinsRequest; +} +export interface UseAccountLockedCoinsQuery + extends ReactQueryParams { + request: AccountLockedCoinsRequest; +} +export interface UseAccountLockedPastTimeQuery + extends ReactQueryParams { + request: AccountLockedPastTimeRequest; +} +export interface UseAccountLockedPastTimeNotUnlockingOnlyQuery + extends ReactQueryParams< + AccountLockedPastTimeNotUnlockingOnlyResponse, + TData + > { + request: AccountLockedPastTimeNotUnlockingOnlyRequest; +} +export interface UseAccountUnlockedBeforeTimeQuery + extends ReactQueryParams { + request: AccountUnlockedBeforeTimeRequest; +} +export interface UseAccountLockedPastTimeDenomQuery + extends ReactQueryParams { + request: AccountLockedPastTimeDenomRequest; +} +export interface UseLockedDenomQuery + extends ReactQueryParams { + request: LockedDenomRequest; +} +export interface UseLockedByIDQuery + extends ReactQueryParams { + request: LockedRequest; +} +export interface UseLockRewardReceiverQuery + extends ReactQueryParams { + request: LockRewardReceiverRequest; +} +export interface UseNextLockIDQuery + extends ReactQueryParams { + request?: NextLockIDRequest; +} +export interface UseSyntheticLockupsByLockupIDQuery + extends ReactQueryParams { + request: SyntheticLockupsByLockupIDRequest; +} +export interface UseSyntheticLockupByLockupIDQuery + extends ReactQueryParams { + request: SyntheticLockupByLockupIDRequest; +} +export interface UseAccountLockedLongerDurationQuery + extends ReactQueryParams { + request: AccountLockedLongerDurationRequest; +} +export interface UseAccountLockedDurationQuery + extends ReactQueryParams { + request: AccountLockedDurationRequest; +} +export interface UseAccountLockedLongerDurationNotUnlockingOnlyQuery + extends ReactQueryParams< + AccountLockedLongerDurationNotUnlockingOnlyResponse, + TData + > { + request: AccountLockedLongerDurationNotUnlockingOnlyRequest; +} +export interface UseAccountLockedLongerDurationDenomQuery + extends ReactQueryParams { + request: AccountLockedLongerDurationDenomRequest; +} +export interface UseParamsQuery + extends ReactQueryParams { + request?: QueryParamsRequest; +} +const _queryClients: WeakMap = + new WeakMap(); +const getQueryService = ( + rpc: ProtobufRpcClient | undefined +): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useModuleBalance = ({ + request, + options, + }: UseModuleBalanceQuery) => { + return useQuery( + ['moduleBalanceQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.moduleBalance(request); + }, + options + ); + }; + const useModuleLockedAmount = ({ + request, + options, + }: UseModuleLockedAmountQuery) => { + return useQuery( + ['moduleLockedAmountQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.moduleLockedAmount(request); + }, + options + ); + }; + const useAccountUnlockableCoins = ({ + request, + options, + }: UseAccountUnlockableCoinsQuery) => { + return useQuery( + ['accountUnlockableCoinsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountUnlockableCoins(request); + }, + options + ); + }; + const useAccountUnlockingCoins = ({ + request, + options, + }: UseAccountUnlockingCoinsQuery) => { + return useQuery( + ['accountUnlockingCoinsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountUnlockingCoins(request); + }, + options + ); + }; + const useAccountLockedCoins = ({ + request, + options, + }: UseAccountLockedCoinsQuery) => { + return useQuery( + ['accountLockedCoinsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedCoins(request); + }, + options + ); + }; + const useAccountLockedPastTime = ({ + request, + options, + }: UseAccountLockedPastTimeQuery) => { + return useQuery( + ['accountLockedPastTimeQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedPastTime(request); + }, + options + ); + }; + const useAccountLockedPastTimeNotUnlockingOnly = < + TData = AccountLockedPastTimeNotUnlockingOnlyResponse + >({ + request, + options, + }: UseAccountLockedPastTimeNotUnlockingOnlyQuery) => { + return useQuery< + AccountLockedPastTimeNotUnlockingOnlyResponse, + Error, + TData + >( + ['accountLockedPastTimeNotUnlockingOnlyQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedPastTimeNotUnlockingOnly(request); + }, + options + ); + }; + const useAccountUnlockedBeforeTime = < + TData = AccountUnlockedBeforeTimeResponse + >({ + request, + options, + }: UseAccountUnlockedBeforeTimeQuery) => { + return useQuery( + ['accountUnlockedBeforeTimeQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountUnlockedBeforeTime(request); + }, + options + ); + }; + const useAccountLockedPastTimeDenom = < + TData = AccountLockedPastTimeDenomResponse + >({ + request, + options, + }: UseAccountLockedPastTimeDenomQuery) => { + return useQuery( + ['accountLockedPastTimeDenomQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedPastTimeDenom(request); + }, + options + ); + }; + const useLockedDenom = ({ + request, + options, + }: UseLockedDenomQuery) => { + return useQuery( + ['lockedDenomQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.lockedDenom(request); + }, + options + ); + }; + const useLockedByID = ({ + request, + options, + }: UseLockedByIDQuery) => { + return useQuery( + ['lockedByIDQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.lockedByID(request); + }, + options + ); + }; + const useLockRewardReceiver = ({ + request, + options, + }: UseLockRewardReceiverQuery) => { + return useQuery( + ['lockRewardReceiverQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.lockRewardReceiver(request); + }, + options + ); + }; + const useNextLockID = ({ + request, + options, + }: UseNextLockIDQuery) => { + return useQuery( + ['nextLockIDQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.nextLockID(request); + }, + options + ); + }; + const useSyntheticLockupsByLockupID = < + TData = SyntheticLockupsByLockupIDResponse + >({ + request, + options, + }: UseSyntheticLockupsByLockupIDQuery) => { + return useQuery( + ['syntheticLockupsByLockupIDQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.syntheticLockupsByLockupID(request); + }, + options + ); + }; + const useSyntheticLockupByLockupID = < + TData = SyntheticLockupByLockupIDResponse + >({ + request, + options, + }: UseSyntheticLockupByLockupIDQuery) => { + return useQuery( + ['syntheticLockupByLockupIDQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.syntheticLockupByLockupID(request); + }, + options + ); + }; + const useAccountLockedLongerDuration = < + TData = AccountLockedLongerDurationResponse + >({ + request, + options, + }: UseAccountLockedLongerDurationQuery) => { + return useQuery( + ['accountLockedLongerDurationQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedLongerDuration(request); + }, + options + ); + }; + const useAccountLockedDuration = ({ + request, + options, + }: UseAccountLockedDurationQuery) => { + return useQuery( + ['accountLockedDurationQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedDuration(request); + }, + options + ); + }; + const useAccountLockedLongerDurationNotUnlockingOnly = < + TData = AccountLockedLongerDurationNotUnlockingOnlyResponse + >({ + request, + options, + }: UseAccountLockedLongerDurationNotUnlockingOnlyQuery) => { + return useQuery< + AccountLockedLongerDurationNotUnlockingOnlyResponse, + Error, + TData + >( + ['accountLockedLongerDurationNotUnlockingOnlyQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedLongerDurationNotUnlockingOnly( + request + ); + }, + options + ); + }; + const useAccountLockedLongerDurationDenom = < + TData = AccountLockedLongerDurationDenomResponse + >({ + request, + options, + }: UseAccountLockedLongerDurationDenomQuery) => { + return useQuery( + ['accountLockedLongerDurationDenomQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.accountLockedLongerDurationDenom(request); + }, + options + ); + }; + const useParams = ({ + request, + options, + }: UseParamsQuery) => { + return useQuery( + ['paramsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.params(request); + }, + options + ); + }; + return { + /** Return full balance of the module */ useModuleBalance, + /** Return locked balance of the module */ useModuleLockedAmount, + /** Returns unlockable coins which are not withdrawn yet */ useAccountUnlockableCoins, + /** Returns unlocking coins */ useAccountUnlockingCoins, + /** Return a locked coins that can't be withdrawn */ useAccountLockedCoins, + /** Returns locked records of an account with unlock time beyond timestamp */ useAccountLockedPastTime, + /** + * Returns locked records of an account with unlock time beyond timestamp + * excluding tokens started unlocking + */ + useAccountLockedPastTimeNotUnlockingOnly, + /** Returns unlocked records with unlock time before timestamp */ useAccountUnlockedBeforeTime, + /** Returns lock records by address, timestamp, denom */ useAccountLockedPastTimeDenom, + /** Returns total locked per denom with longer past given time */ useLockedDenom, + /** Returns lock record by id */ useLockedByID, + /** Returns lock record by id */ useLockRewardReceiver, + /** Returns next lock ID */ useNextLockID, + /** + * Returns synthetic lockup by native lockup id + * Deprecated: use SyntheticLockupByLockupID instead + */ + useSyntheticLockupsByLockupID, + /** Returns synthetic lockup by native lockup id */ useSyntheticLockupByLockupID, + /** Returns account locked records with longer duration */ useAccountLockedLongerDuration, + /** Returns account locked records with a specific duration */ useAccountLockedDuration, + /** + * Returns account locked records with longer duration excluding tokens + * started unlocking + */ + useAccountLockedLongerDurationNotUnlockingOnly, + /** Returns account's locked records for a denom with longer duration */ useAccountLockedLongerDurationDenom, + /** Params returns lockup params. */ useParams, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/query.ts b/packages/cosmos/src/proto_export/osmosis/lockup/query.ts new file mode 100644 index 00000000..be1d6e9d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/query.ts @@ -0,0 +1,5596 @@ +//@ts-nocheck +import { Timestamp } from '../../google/protobuf/timestamp'; +import { + Duration, + DurationAmino, + DurationSDKType, +} from '../../google/protobuf/duration'; +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +import { toTimestamp, fromTimestamp } from '../../helpers'; + +import { Params, ParamsAmino, ParamsSDKType } from './params'; +import { + PeriodLock, + PeriodLockAmino, + PeriodLockSDKType, + SyntheticLock, + SyntheticLockAmino, + SyntheticLockSDKType, +} from './lock'; +export interface ModuleBalanceRequest {} +export interface ModuleBalanceRequestProtoMsg { + typeUrl: '/osmosis.lockup.ModuleBalanceRequest'; + value: Uint8Array; +} +export interface ModuleBalanceRequestAmino {} +export interface ModuleBalanceRequestAminoMsg { + type: 'osmosis/lockup/module-balance-request'; + value: ModuleBalanceRequestAmino; +} +export interface ModuleBalanceRequestSDKType {} +export interface ModuleBalanceResponse { + coins: Coin[]; +} +export interface ModuleBalanceResponseProtoMsg { + typeUrl: '/osmosis.lockup.ModuleBalanceResponse'; + value: Uint8Array; +} +export interface ModuleBalanceResponseAmino { + coins?: CoinAmino[]; +} +export interface ModuleBalanceResponseAminoMsg { + type: 'osmosis/lockup/module-balance-response'; + value: ModuleBalanceResponseAmino; +} +export interface ModuleBalanceResponseSDKType { + coins: CoinSDKType[]; +} +export interface ModuleLockedAmountRequest {} +export interface ModuleLockedAmountRequestProtoMsg { + typeUrl: '/osmosis.lockup.ModuleLockedAmountRequest'; + value: Uint8Array; +} +export interface ModuleLockedAmountRequestAmino {} +export interface ModuleLockedAmountRequestAminoMsg { + type: 'osmosis/lockup/module-locked-amount-request'; + value: ModuleLockedAmountRequestAmino; +} +export interface ModuleLockedAmountRequestSDKType {} +export interface ModuleLockedAmountResponse { + coins: Coin[]; +} +export interface ModuleLockedAmountResponseProtoMsg { + typeUrl: '/osmosis.lockup.ModuleLockedAmountResponse'; + value: Uint8Array; +} +export interface ModuleLockedAmountResponseAmino { + coins?: CoinAmino[]; +} +export interface ModuleLockedAmountResponseAminoMsg { + type: 'osmosis/lockup/module-locked-amount-response'; + value: ModuleLockedAmountResponseAmino; +} +export interface ModuleLockedAmountResponseSDKType { + coins: CoinSDKType[]; +} +export interface AccountUnlockableCoinsRequest { + owner: string; +} +export interface AccountUnlockableCoinsRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountUnlockableCoinsRequest'; + value: Uint8Array; +} +export interface AccountUnlockableCoinsRequestAmino { + owner?: string; +} +export interface AccountUnlockableCoinsRequestAminoMsg { + type: 'osmosis/lockup/account-unlockable-coins-request'; + value: AccountUnlockableCoinsRequestAmino; +} +export interface AccountUnlockableCoinsRequestSDKType { + owner: string; +} +export interface AccountUnlockableCoinsResponse { + coins: Coin[]; +} +export interface AccountUnlockableCoinsResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountUnlockableCoinsResponse'; + value: Uint8Array; +} +export interface AccountUnlockableCoinsResponseAmino { + coins?: CoinAmino[]; +} +export interface AccountUnlockableCoinsResponseAminoMsg { + type: 'osmosis/lockup/account-unlockable-coins-response'; + value: AccountUnlockableCoinsResponseAmino; +} +export interface AccountUnlockableCoinsResponseSDKType { + coins: CoinSDKType[]; +} +export interface AccountUnlockingCoinsRequest { + owner: string; +} +export interface AccountUnlockingCoinsRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountUnlockingCoinsRequest'; + value: Uint8Array; +} +export interface AccountUnlockingCoinsRequestAmino { + owner?: string; +} +export interface AccountUnlockingCoinsRequestAminoMsg { + type: 'osmosis/lockup/account-unlocking-coins-request'; + value: AccountUnlockingCoinsRequestAmino; +} +export interface AccountUnlockingCoinsRequestSDKType { + owner: string; +} +export interface AccountUnlockingCoinsResponse { + coins: Coin[]; +} +export interface AccountUnlockingCoinsResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountUnlockingCoinsResponse'; + value: Uint8Array; +} +export interface AccountUnlockingCoinsResponseAmino { + coins?: CoinAmino[]; +} +export interface AccountUnlockingCoinsResponseAminoMsg { + type: 'osmosis/lockup/account-unlocking-coins-response'; + value: AccountUnlockingCoinsResponseAmino; +} +export interface AccountUnlockingCoinsResponseSDKType { + coins: CoinSDKType[]; +} +export interface AccountLockedCoinsRequest { + owner: string; +} +export interface AccountLockedCoinsRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedCoinsRequest'; + value: Uint8Array; +} +export interface AccountLockedCoinsRequestAmino { + owner?: string; +} +export interface AccountLockedCoinsRequestAminoMsg { + type: 'osmosis/lockup/account-locked-coins-request'; + value: AccountLockedCoinsRequestAmino; +} +export interface AccountLockedCoinsRequestSDKType { + owner: string; +} +export interface AccountLockedCoinsResponse { + coins: Coin[]; +} +export interface AccountLockedCoinsResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedCoinsResponse'; + value: Uint8Array; +} +export interface AccountLockedCoinsResponseAmino { + coins?: CoinAmino[]; +} +export interface AccountLockedCoinsResponseAminoMsg { + type: 'osmosis/lockup/account-locked-coins-response'; + value: AccountLockedCoinsResponseAmino; +} +export interface AccountLockedCoinsResponseSDKType { + coins: CoinSDKType[]; +} +export interface AccountLockedPastTimeRequest { + owner: string; + timestamp: Date; +} +export interface AccountLockedPastTimeRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeRequest'; + value: Uint8Array; +} +export interface AccountLockedPastTimeRequestAmino { + owner?: string; + timestamp?: string; +} +export interface AccountLockedPastTimeRequestAminoMsg { + type: 'osmosis/lockup/account-locked-past-time-request'; + value: AccountLockedPastTimeRequestAmino; +} +export interface AccountLockedPastTimeRequestSDKType { + owner: string; + timestamp: Date; +} +export interface AccountLockedPastTimeResponse { + locks: PeriodLock[]; +} +export interface AccountLockedPastTimeResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeResponse'; + value: Uint8Array; +} +export interface AccountLockedPastTimeResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountLockedPastTimeResponseAminoMsg { + type: 'osmosis/lockup/account-locked-past-time-response'; + value: AccountLockedPastTimeResponseAmino; +} +export interface AccountLockedPastTimeResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface AccountLockedPastTimeNotUnlockingOnlyRequest { + owner: string; + timestamp: Date; +} +export interface AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyRequest'; + value: Uint8Array; +} +export interface AccountLockedPastTimeNotUnlockingOnlyRequestAmino { + owner?: string; + timestamp?: string; +} +export interface AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg { + type: 'osmosis/lockup/account-locked-past-time-not-unlocking-only-request'; + value: AccountLockedPastTimeNotUnlockingOnlyRequestAmino; +} +export interface AccountLockedPastTimeNotUnlockingOnlyRequestSDKType { + owner: string; + timestamp: Date; +} +export interface AccountLockedPastTimeNotUnlockingOnlyResponse { + locks: PeriodLock[]; +} +export interface AccountLockedPastTimeNotUnlockingOnlyResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyResponse'; + value: Uint8Array; +} +export interface AccountLockedPastTimeNotUnlockingOnlyResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountLockedPastTimeNotUnlockingOnlyResponseAminoMsg { + type: 'osmosis/lockup/account-locked-past-time-not-unlocking-only-response'; + value: AccountLockedPastTimeNotUnlockingOnlyResponseAmino; +} +export interface AccountLockedPastTimeNotUnlockingOnlyResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface AccountUnlockedBeforeTimeRequest { + owner: string; + timestamp: Date; +} +export interface AccountUnlockedBeforeTimeRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountUnlockedBeforeTimeRequest'; + value: Uint8Array; +} +export interface AccountUnlockedBeforeTimeRequestAmino { + owner?: string; + timestamp?: string; +} +export interface AccountUnlockedBeforeTimeRequestAminoMsg { + type: 'osmosis/lockup/account-unlocked-before-time-request'; + value: AccountUnlockedBeforeTimeRequestAmino; +} +export interface AccountUnlockedBeforeTimeRequestSDKType { + owner: string; + timestamp: Date; +} +export interface AccountUnlockedBeforeTimeResponse { + locks: PeriodLock[]; +} +export interface AccountUnlockedBeforeTimeResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountUnlockedBeforeTimeResponse'; + value: Uint8Array; +} +export interface AccountUnlockedBeforeTimeResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountUnlockedBeforeTimeResponseAminoMsg { + type: 'osmosis/lockup/account-unlocked-before-time-response'; + value: AccountUnlockedBeforeTimeResponseAmino; +} +export interface AccountUnlockedBeforeTimeResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface AccountLockedPastTimeDenomRequest { + owner: string; + timestamp: Date; + denom: string; +} +export interface AccountLockedPastTimeDenomRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeDenomRequest'; + value: Uint8Array; +} +export interface AccountLockedPastTimeDenomRequestAmino { + owner?: string; + timestamp?: string; + denom?: string; +} +export interface AccountLockedPastTimeDenomRequestAminoMsg { + type: 'osmosis/lockup/account-locked-past-time-denom-request'; + value: AccountLockedPastTimeDenomRequestAmino; +} +export interface AccountLockedPastTimeDenomRequestSDKType { + owner: string; + timestamp: Date; + denom: string; +} +export interface AccountLockedPastTimeDenomResponse { + locks: PeriodLock[]; +} +export interface AccountLockedPastTimeDenomResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeDenomResponse'; + value: Uint8Array; +} +export interface AccountLockedPastTimeDenomResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountLockedPastTimeDenomResponseAminoMsg { + type: 'osmosis/lockup/account-locked-past-time-denom-response'; + value: AccountLockedPastTimeDenomResponseAmino; +} +export interface AccountLockedPastTimeDenomResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface LockedDenomRequest { + denom: string; + duration: Duration; +} +export interface LockedDenomRequestProtoMsg { + typeUrl: '/osmosis.lockup.LockedDenomRequest'; + value: Uint8Array; +} +export interface LockedDenomRequestAmino { + denom?: string; + duration?: DurationAmino; +} +export interface LockedDenomRequestAminoMsg { + type: 'osmosis/lockup/locked-denom-request'; + value: LockedDenomRequestAmino; +} +export interface LockedDenomRequestSDKType { + denom: string; + duration: DurationSDKType; +} +export interface LockedDenomResponse { + amount: string; +} +export interface LockedDenomResponseProtoMsg { + typeUrl: '/osmosis.lockup.LockedDenomResponse'; + value: Uint8Array; +} +export interface LockedDenomResponseAmino { + amount?: string; +} +export interface LockedDenomResponseAminoMsg { + type: 'osmosis/lockup/locked-denom-response'; + value: LockedDenomResponseAmino; +} +export interface LockedDenomResponseSDKType { + amount: string; +} +export interface LockedRequest { + lockId: bigint; +} +export interface LockedRequestProtoMsg { + typeUrl: '/osmosis.lockup.LockedRequest'; + value: Uint8Array; +} +export interface LockedRequestAmino { + lock_id?: string; +} +export interface LockedRequestAminoMsg { + type: 'osmosis/lockup/locked-request'; + value: LockedRequestAmino; +} +export interface LockedRequestSDKType { + lock_id: bigint; +} +export interface LockedResponse { + lock?: PeriodLock; +} +export interface LockedResponseProtoMsg { + typeUrl: '/osmosis.lockup.LockedResponse'; + value: Uint8Array; +} +export interface LockedResponseAmino { + lock?: PeriodLockAmino; +} +export interface LockedResponseAminoMsg { + type: 'osmosis/lockup/locked-response'; + value: LockedResponseAmino; +} +export interface LockedResponseSDKType { + lock?: PeriodLockSDKType; +} +export interface LockRewardReceiverRequest { + lockId: bigint; +} +export interface LockRewardReceiverRequestProtoMsg { + typeUrl: '/osmosis.lockup.LockRewardReceiverRequest'; + value: Uint8Array; +} +export interface LockRewardReceiverRequestAmino { + lock_id?: string; +} +export interface LockRewardReceiverRequestAminoMsg { + type: 'osmosis/lockup/lock-reward-receiver-request'; + value: LockRewardReceiverRequestAmino; +} +export interface LockRewardReceiverRequestSDKType { + lock_id: bigint; +} +export interface LockRewardReceiverResponse { + rewardReceiver: string; +} +export interface LockRewardReceiverResponseProtoMsg { + typeUrl: '/osmosis.lockup.LockRewardReceiverResponse'; + value: Uint8Array; +} +export interface LockRewardReceiverResponseAmino { + reward_receiver?: string; +} +export interface LockRewardReceiverResponseAminoMsg { + type: 'osmosis/lockup/lock-reward-receiver-response'; + value: LockRewardReceiverResponseAmino; +} +export interface LockRewardReceiverResponseSDKType { + reward_receiver: string; +} +export interface NextLockIDRequest {} +export interface NextLockIDRequestProtoMsg { + typeUrl: '/osmosis.lockup.NextLockIDRequest'; + value: Uint8Array; +} +export interface NextLockIDRequestAmino {} +export interface NextLockIDRequestAminoMsg { + type: 'osmosis/lockup/next-lock-id-request'; + value: NextLockIDRequestAmino; +} +export interface NextLockIDRequestSDKType {} +export interface NextLockIDResponse { + lockId: bigint; +} +export interface NextLockIDResponseProtoMsg { + typeUrl: '/osmosis.lockup.NextLockIDResponse'; + value: Uint8Array; +} +export interface NextLockIDResponseAmino { + lock_id?: string; +} +export interface NextLockIDResponseAminoMsg { + type: 'osmosis/lockup/next-lock-id-response'; + value: NextLockIDResponseAmino; +} +export interface NextLockIDResponseSDKType { + lock_id: bigint; +} +/** @deprecated */ +export interface SyntheticLockupsByLockupIDRequest { + lockId: bigint; +} +export interface SyntheticLockupsByLockupIDRequestProtoMsg { + typeUrl: '/osmosis.lockup.SyntheticLockupsByLockupIDRequest'; + value: Uint8Array; +} +/** @deprecated */ +export interface SyntheticLockupsByLockupIDRequestAmino { + lock_id?: string; +} +export interface SyntheticLockupsByLockupIDRequestAminoMsg { + type: 'osmosis/lockup/synthetic-lockups-by-lockup-id-request'; + value: SyntheticLockupsByLockupIDRequestAmino; +} +/** @deprecated */ +export interface SyntheticLockupsByLockupIDRequestSDKType { + lock_id: bigint; +} +/** @deprecated */ +export interface SyntheticLockupsByLockupIDResponse { + syntheticLocks: SyntheticLock[]; +} +export interface SyntheticLockupsByLockupIDResponseProtoMsg { + typeUrl: '/osmosis.lockup.SyntheticLockupsByLockupIDResponse'; + value: Uint8Array; +} +/** @deprecated */ +export interface SyntheticLockupsByLockupIDResponseAmino { + synthetic_locks?: SyntheticLockAmino[]; +} +export interface SyntheticLockupsByLockupIDResponseAminoMsg { + type: 'osmosis/lockup/synthetic-lockups-by-lockup-id-response'; + value: SyntheticLockupsByLockupIDResponseAmino; +} +/** @deprecated */ +export interface SyntheticLockupsByLockupIDResponseSDKType { + synthetic_locks: SyntheticLockSDKType[]; +} +export interface SyntheticLockupByLockupIDRequest { + lockId: bigint; +} +export interface SyntheticLockupByLockupIDRequestProtoMsg { + typeUrl: '/osmosis.lockup.SyntheticLockupByLockupIDRequest'; + value: Uint8Array; +} +export interface SyntheticLockupByLockupIDRequestAmino { + lock_id?: string; +} +export interface SyntheticLockupByLockupIDRequestAminoMsg { + type: 'osmosis/lockup/synthetic-lockup-by-lockup-id-request'; + value: SyntheticLockupByLockupIDRequestAmino; +} +export interface SyntheticLockupByLockupIDRequestSDKType { + lock_id: bigint; +} +export interface SyntheticLockupByLockupIDResponse { + syntheticLock: SyntheticLock; +} +export interface SyntheticLockupByLockupIDResponseProtoMsg { + typeUrl: '/osmosis.lockup.SyntheticLockupByLockupIDResponse'; + value: Uint8Array; +} +export interface SyntheticLockupByLockupIDResponseAmino { + synthetic_lock?: SyntheticLockAmino; +} +export interface SyntheticLockupByLockupIDResponseAminoMsg { + type: 'osmosis/lockup/synthetic-lockup-by-lockup-id-response'; + value: SyntheticLockupByLockupIDResponseAmino; +} +export interface SyntheticLockupByLockupIDResponseSDKType { + synthetic_lock: SyntheticLockSDKType; +} +export interface AccountLockedLongerDurationRequest { + owner: string; + duration: Duration; +} +export interface AccountLockedLongerDurationRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationRequest'; + value: Uint8Array; +} +export interface AccountLockedLongerDurationRequestAmino { + owner?: string; + duration?: DurationAmino; +} +export interface AccountLockedLongerDurationRequestAminoMsg { + type: 'osmosis/lockup/account-locked-longer-duration-request'; + value: AccountLockedLongerDurationRequestAmino; +} +export interface AccountLockedLongerDurationRequestSDKType { + owner: string; + duration: DurationSDKType; +} +export interface AccountLockedLongerDurationResponse { + locks: PeriodLock[]; +} +export interface AccountLockedLongerDurationResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationResponse'; + value: Uint8Array; +} +export interface AccountLockedLongerDurationResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountLockedLongerDurationResponseAminoMsg { + type: 'osmosis/lockup/account-locked-longer-duration-response'; + value: AccountLockedLongerDurationResponseAmino; +} +export interface AccountLockedLongerDurationResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface AccountLockedDurationRequest { + owner: string; + duration: Duration; +} +export interface AccountLockedDurationRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedDurationRequest'; + value: Uint8Array; +} +export interface AccountLockedDurationRequestAmino { + owner?: string; + duration?: DurationAmino; +} +export interface AccountLockedDurationRequestAminoMsg { + type: 'osmosis/lockup/account-locked-duration-request'; + value: AccountLockedDurationRequestAmino; +} +export interface AccountLockedDurationRequestSDKType { + owner: string; + duration: DurationSDKType; +} +export interface AccountLockedDurationResponse { + locks: PeriodLock[]; +} +export interface AccountLockedDurationResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedDurationResponse'; + value: Uint8Array; +} +export interface AccountLockedDurationResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountLockedDurationResponseAminoMsg { + type: 'osmosis/lockup/account-locked-duration-response'; + value: AccountLockedDurationResponseAmino; +} +export interface AccountLockedDurationResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyRequest { + owner: string; + duration: Duration; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyRequest'; + value: Uint8Array; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { + owner?: string; + duration?: DurationAmino; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyRequestAminoMsg { + type: 'osmosis/lockup/account-locked-longer-duration-not-unlocking-only-request'; + value: AccountLockedLongerDurationNotUnlockingOnlyRequestAmino; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyRequestSDKType { + owner: string; + duration: DurationSDKType; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyResponse { + locks: PeriodLock[]; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyResponse'; + value: Uint8Array; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyResponseAminoMsg { + type: 'osmosis/lockup/account-locked-longer-duration-not-unlocking-only-response'; + value: AccountLockedLongerDurationNotUnlockingOnlyResponseAmino; +} +export interface AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface AccountLockedLongerDurationDenomRequest { + owner: string; + duration: Duration; + denom: string; +} +export interface AccountLockedLongerDurationDenomRequestProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationDenomRequest'; + value: Uint8Array; +} +export interface AccountLockedLongerDurationDenomRequestAmino { + owner?: string; + duration?: DurationAmino; + denom?: string; +} +export interface AccountLockedLongerDurationDenomRequestAminoMsg { + type: 'osmosis/lockup/account-locked-longer-duration-denom-request'; + value: AccountLockedLongerDurationDenomRequestAmino; +} +export interface AccountLockedLongerDurationDenomRequestSDKType { + owner: string; + duration: DurationSDKType; + denom: string; +} +export interface AccountLockedLongerDurationDenomResponse { + locks: PeriodLock[]; +} +export interface AccountLockedLongerDurationDenomResponseProtoMsg { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationDenomResponse'; + value: Uint8Array; +} +export interface AccountLockedLongerDurationDenomResponseAmino { + locks?: PeriodLockAmino[]; +} +export interface AccountLockedLongerDurationDenomResponseAminoMsg { + type: 'osmosis/lockup/account-locked-longer-duration-denom-response'; + value: AccountLockedLongerDurationDenomResponseAmino; +} +export interface AccountLockedLongerDurationDenomResponseSDKType { + locks: PeriodLockSDKType[]; +} +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: '/osmosis.lockup.QueryParamsRequest'; + value: Uint8Array; +} +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: 'osmosis/lockup/query-params-request'; + value: QueryParamsRequestAmino; +} +export interface QueryParamsRequestSDKType {} +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: '/osmosis.lockup.QueryParamsResponse'; + value: Uint8Array; +} +export interface QueryParamsResponseAmino { + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: 'osmosis/lockup/query-params-response'; + value: QueryParamsResponseAmino; +} +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +function createBaseModuleBalanceRequest(): ModuleBalanceRequest { + return {}; +} +export const ModuleBalanceRequest = { + typeUrl: '/osmosis.lockup.ModuleBalanceRequest', + aminoType: 'osmosis/lockup/module-balance-request', + is(o: any): o is ModuleBalanceRequest { + return o && o.$typeUrl === ModuleBalanceRequest.typeUrl; + }, + isSDK(o: any): o is ModuleBalanceRequestSDKType { + return o && o.$typeUrl === ModuleBalanceRequest.typeUrl; + }, + isAmino(o: any): o is ModuleBalanceRequestAmino { + return o && o.$typeUrl === ModuleBalanceRequest.typeUrl; + }, + encode( + _: ModuleBalanceRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ModuleBalanceRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleBalanceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ModuleBalanceRequest { + const message = createBaseModuleBalanceRequest(); + return message; + }, + fromAmino(_: ModuleBalanceRequestAmino): ModuleBalanceRequest { + const message = createBaseModuleBalanceRequest(); + return message; + }, + toAmino(_: ModuleBalanceRequest): ModuleBalanceRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ModuleBalanceRequestAminoMsg): ModuleBalanceRequest { + return ModuleBalanceRequest.fromAmino(object.value); + }, + toAminoMsg(message: ModuleBalanceRequest): ModuleBalanceRequestAminoMsg { + return { + type: 'osmosis/lockup/module-balance-request', + value: ModuleBalanceRequest.toAmino(message), + }; + }, + fromProtoMsg(message: ModuleBalanceRequestProtoMsg): ModuleBalanceRequest { + return ModuleBalanceRequest.decode(message.value); + }, + toProto(message: ModuleBalanceRequest): Uint8Array { + return ModuleBalanceRequest.encode(message).finish(); + }, + toProtoMsg(message: ModuleBalanceRequest): ModuleBalanceRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.ModuleBalanceRequest', + value: ModuleBalanceRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ModuleBalanceRequest.typeUrl, + ModuleBalanceRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleBalanceRequest.aminoType, + ModuleBalanceRequest.typeUrl +); +function createBaseModuleBalanceResponse(): ModuleBalanceResponse { + return { + coins: [], + }; +} +export const ModuleBalanceResponse = { + typeUrl: '/osmosis.lockup.ModuleBalanceResponse', + aminoType: 'osmosis/lockup/module-balance-response', + is(o: any): o is ModuleBalanceResponse { + return ( + o && + (o.$typeUrl === ModuleBalanceResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is ModuleBalanceResponseSDKType { + return ( + o && + (o.$typeUrl === ModuleBalanceResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is ModuleBalanceResponseAmino { + return ( + o && + (o.$typeUrl === ModuleBalanceResponse.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: ModuleBalanceResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ModuleBalanceResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleBalanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleBalanceResponse { + const message = createBaseModuleBalanceResponse(); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleBalanceResponseAmino): ModuleBalanceResponse { + const message = createBaseModuleBalanceResponse(); + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModuleBalanceResponse): ModuleBalanceResponseAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: ModuleBalanceResponseAminoMsg): ModuleBalanceResponse { + return ModuleBalanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: ModuleBalanceResponse): ModuleBalanceResponseAminoMsg { + return { + type: 'osmosis/lockup/module-balance-response', + value: ModuleBalanceResponse.toAmino(message), + }; + }, + fromProtoMsg(message: ModuleBalanceResponseProtoMsg): ModuleBalanceResponse { + return ModuleBalanceResponse.decode(message.value); + }, + toProto(message: ModuleBalanceResponse): Uint8Array { + return ModuleBalanceResponse.encode(message).finish(); + }, + toProtoMsg(message: ModuleBalanceResponse): ModuleBalanceResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.ModuleBalanceResponse', + value: ModuleBalanceResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ModuleBalanceResponse.typeUrl, + ModuleBalanceResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleBalanceResponse.aminoType, + ModuleBalanceResponse.typeUrl +); +function createBaseModuleLockedAmountRequest(): ModuleLockedAmountRequest { + return {}; +} +export const ModuleLockedAmountRequest = { + typeUrl: '/osmosis.lockup.ModuleLockedAmountRequest', + aminoType: 'osmosis/lockup/module-locked-amount-request', + is(o: any): o is ModuleLockedAmountRequest { + return o && o.$typeUrl === ModuleLockedAmountRequest.typeUrl; + }, + isSDK(o: any): o is ModuleLockedAmountRequestSDKType { + return o && o.$typeUrl === ModuleLockedAmountRequest.typeUrl; + }, + isAmino(o: any): o is ModuleLockedAmountRequestAmino { + return o && o.$typeUrl === ModuleLockedAmountRequest.typeUrl; + }, + encode( + _: ModuleLockedAmountRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ModuleLockedAmountRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleLockedAmountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): ModuleLockedAmountRequest { + const message = createBaseModuleLockedAmountRequest(); + return message; + }, + fromAmino(_: ModuleLockedAmountRequestAmino): ModuleLockedAmountRequest { + const message = createBaseModuleLockedAmountRequest(); + return message; + }, + toAmino(_: ModuleLockedAmountRequest): ModuleLockedAmountRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: ModuleLockedAmountRequestAminoMsg + ): ModuleLockedAmountRequest { + return ModuleLockedAmountRequest.fromAmino(object.value); + }, + toAminoMsg( + message: ModuleLockedAmountRequest + ): ModuleLockedAmountRequestAminoMsg { + return { + type: 'osmosis/lockup/module-locked-amount-request', + value: ModuleLockedAmountRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: ModuleLockedAmountRequestProtoMsg + ): ModuleLockedAmountRequest { + return ModuleLockedAmountRequest.decode(message.value); + }, + toProto(message: ModuleLockedAmountRequest): Uint8Array { + return ModuleLockedAmountRequest.encode(message).finish(); + }, + toProtoMsg( + message: ModuleLockedAmountRequest + ): ModuleLockedAmountRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.ModuleLockedAmountRequest', + value: ModuleLockedAmountRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ModuleLockedAmountRequest.typeUrl, + ModuleLockedAmountRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleLockedAmountRequest.aminoType, + ModuleLockedAmountRequest.typeUrl +); +function createBaseModuleLockedAmountResponse(): ModuleLockedAmountResponse { + return { + coins: [], + }; +} +export const ModuleLockedAmountResponse = { + typeUrl: '/osmosis.lockup.ModuleLockedAmountResponse', + aminoType: 'osmosis/lockup/module-locked-amount-response', + is(o: any): o is ModuleLockedAmountResponse { + return ( + o && + (o.$typeUrl === ModuleLockedAmountResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is ModuleLockedAmountResponseSDKType { + return ( + o && + (o.$typeUrl === ModuleLockedAmountResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is ModuleLockedAmountResponseAmino { + return ( + o && + (o.$typeUrl === ModuleLockedAmountResponse.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: ModuleLockedAmountResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ModuleLockedAmountResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleLockedAmountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): ModuleLockedAmountResponse { + const message = createBaseModuleLockedAmountResponse(); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: ModuleLockedAmountResponseAmino + ): ModuleLockedAmountResponse { + const message = createBaseModuleLockedAmountResponse(); + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: ModuleLockedAmountResponse + ): ModuleLockedAmountResponseAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg( + object: ModuleLockedAmountResponseAminoMsg + ): ModuleLockedAmountResponse { + return ModuleLockedAmountResponse.fromAmino(object.value); + }, + toAminoMsg( + message: ModuleLockedAmountResponse + ): ModuleLockedAmountResponseAminoMsg { + return { + type: 'osmosis/lockup/module-locked-amount-response', + value: ModuleLockedAmountResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: ModuleLockedAmountResponseProtoMsg + ): ModuleLockedAmountResponse { + return ModuleLockedAmountResponse.decode(message.value); + }, + toProto(message: ModuleLockedAmountResponse): Uint8Array { + return ModuleLockedAmountResponse.encode(message).finish(); + }, + toProtoMsg( + message: ModuleLockedAmountResponse + ): ModuleLockedAmountResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.ModuleLockedAmountResponse', + value: ModuleLockedAmountResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ModuleLockedAmountResponse.typeUrl, + ModuleLockedAmountResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleLockedAmountResponse.aminoType, + ModuleLockedAmountResponse.typeUrl +); +function createBaseAccountUnlockableCoinsRequest(): AccountUnlockableCoinsRequest { + return { + owner: '', + }; +} +export const AccountUnlockableCoinsRequest = { + typeUrl: '/osmosis.lockup.AccountUnlockableCoinsRequest', + aminoType: 'osmosis/lockup/account-unlockable-coins-request', + is(o: any): o is AccountUnlockableCoinsRequest { + return ( + o && + (o.$typeUrl === AccountUnlockableCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + isSDK(o: any): o is AccountUnlockableCoinsRequestSDKType { + return ( + o && + (o.$typeUrl === AccountUnlockableCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + isAmino(o: any): o is AccountUnlockableCoinsRequestAmino { + return ( + o && + (o.$typeUrl === AccountUnlockableCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + encode( + message: AccountUnlockableCoinsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountUnlockableCoinsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUnlockableCoinsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountUnlockableCoinsRequest { + const message = createBaseAccountUnlockableCoinsRequest(); + message.owner = object.owner ?? ''; + return message; + }, + fromAmino( + object: AccountUnlockableCoinsRequestAmino + ): AccountUnlockableCoinsRequest { + const message = createBaseAccountUnlockableCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino( + message: AccountUnlockableCoinsRequest + ): AccountUnlockableCoinsRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + return obj; + }, + fromAminoMsg( + object: AccountUnlockableCoinsRequestAminoMsg + ): AccountUnlockableCoinsRequest { + return AccountUnlockableCoinsRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountUnlockableCoinsRequest + ): AccountUnlockableCoinsRequestAminoMsg { + return { + type: 'osmosis/lockup/account-unlockable-coins-request', + value: AccountUnlockableCoinsRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountUnlockableCoinsRequestProtoMsg + ): AccountUnlockableCoinsRequest { + return AccountUnlockableCoinsRequest.decode(message.value); + }, + toProto(message: AccountUnlockableCoinsRequest): Uint8Array { + return AccountUnlockableCoinsRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountUnlockableCoinsRequest + ): AccountUnlockableCoinsRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountUnlockableCoinsRequest', + value: AccountUnlockableCoinsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountUnlockableCoinsRequest.typeUrl, + AccountUnlockableCoinsRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountUnlockableCoinsRequest.aminoType, + AccountUnlockableCoinsRequest.typeUrl +); +function createBaseAccountUnlockableCoinsResponse(): AccountUnlockableCoinsResponse { + return { + coins: [], + }; +} +export const AccountUnlockableCoinsResponse = { + typeUrl: '/osmosis.lockup.AccountUnlockableCoinsResponse', + aminoType: 'osmosis/lockup/account-unlockable-coins-response', + is(o: any): o is AccountUnlockableCoinsResponse { + return ( + o && + (o.$typeUrl === AccountUnlockableCoinsResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is AccountUnlockableCoinsResponseSDKType { + return ( + o && + (o.$typeUrl === AccountUnlockableCoinsResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is AccountUnlockableCoinsResponseAmino { + return ( + o && + (o.$typeUrl === AccountUnlockableCoinsResponse.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: AccountUnlockableCoinsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountUnlockableCoinsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUnlockableCoinsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountUnlockableCoinsResponse { + const message = createBaseAccountUnlockableCoinsResponse(); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountUnlockableCoinsResponseAmino + ): AccountUnlockableCoinsResponse { + const message = createBaseAccountUnlockableCoinsResponse(); + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountUnlockableCoinsResponse + ): AccountUnlockableCoinsResponseAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg( + object: AccountUnlockableCoinsResponseAminoMsg + ): AccountUnlockableCoinsResponse { + return AccountUnlockableCoinsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountUnlockableCoinsResponse + ): AccountUnlockableCoinsResponseAminoMsg { + return { + type: 'osmosis/lockup/account-unlockable-coins-response', + value: AccountUnlockableCoinsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountUnlockableCoinsResponseProtoMsg + ): AccountUnlockableCoinsResponse { + return AccountUnlockableCoinsResponse.decode(message.value); + }, + toProto(message: AccountUnlockableCoinsResponse): Uint8Array { + return AccountUnlockableCoinsResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountUnlockableCoinsResponse + ): AccountUnlockableCoinsResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountUnlockableCoinsResponse', + value: AccountUnlockableCoinsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountUnlockableCoinsResponse.typeUrl, + AccountUnlockableCoinsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountUnlockableCoinsResponse.aminoType, + AccountUnlockableCoinsResponse.typeUrl +); +function createBaseAccountUnlockingCoinsRequest(): AccountUnlockingCoinsRequest { + return { + owner: '', + }; +} +export const AccountUnlockingCoinsRequest = { + typeUrl: '/osmosis.lockup.AccountUnlockingCoinsRequest', + aminoType: 'osmosis/lockup/account-unlocking-coins-request', + is(o: any): o is AccountUnlockingCoinsRequest { + return ( + o && + (o.$typeUrl === AccountUnlockingCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + isSDK(o: any): o is AccountUnlockingCoinsRequestSDKType { + return ( + o && + (o.$typeUrl === AccountUnlockingCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + isAmino(o: any): o is AccountUnlockingCoinsRequestAmino { + return ( + o && + (o.$typeUrl === AccountUnlockingCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + encode( + message: AccountUnlockingCoinsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountUnlockingCoinsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUnlockingCoinsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountUnlockingCoinsRequest { + const message = createBaseAccountUnlockingCoinsRequest(); + message.owner = object.owner ?? ''; + return message; + }, + fromAmino( + object: AccountUnlockingCoinsRequestAmino + ): AccountUnlockingCoinsRequest { + const message = createBaseAccountUnlockingCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino( + message: AccountUnlockingCoinsRequest + ): AccountUnlockingCoinsRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + return obj; + }, + fromAminoMsg( + object: AccountUnlockingCoinsRequestAminoMsg + ): AccountUnlockingCoinsRequest { + return AccountUnlockingCoinsRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountUnlockingCoinsRequest + ): AccountUnlockingCoinsRequestAminoMsg { + return { + type: 'osmosis/lockup/account-unlocking-coins-request', + value: AccountUnlockingCoinsRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountUnlockingCoinsRequestProtoMsg + ): AccountUnlockingCoinsRequest { + return AccountUnlockingCoinsRequest.decode(message.value); + }, + toProto(message: AccountUnlockingCoinsRequest): Uint8Array { + return AccountUnlockingCoinsRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountUnlockingCoinsRequest + ): AccountUnlockingCoinsRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountUnlockingCoinsRequest', + value: AccountUnlockingCoinsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountUnlockingCoinsRequest.typeUrl, + AccountUnlockingCoinsRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountUnlockingCoinsRequest.aminoType, + AccountUnlockingCoinsRequest.typeUrl +); +function createBaseAccountUnlockingCoinsResponse(): AccountUnlockingCoinsResponse { + return { + coins: [], + }; +} +export const AccountUnlockingCoinsResponse = { + typeUrl: '/osmosis.lockup.AccountUnlockingCoinsResponse', + aminoType: 'osmosis/lockup/account-unlocking-coins-response', + is(o: any): o is AccountUnlockingCoinsResponse { + return ( + o && + (o.$typeUrl === AccountUnlockingCoinsResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is AccountUnlockingCoinsResponseSDKType { + return ( + o && + (o.$typeUrl === AccountUnlockingCoinsResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is AccountUnlockingCoinsResponseAmino { + return ( + o && + (o.$typeUrl === AccountUnlockingCoinsResponse.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: AccountUnlockingCoinsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountUnlockingCoinsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUnlockingCoinsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountUnlockingCoinsResponse { + const message = createBaseAccountUnlockingCoinsResponse(); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountUnlockingCoinsResponseAmino + ): AccountUnlockingCoinsResponse { + const message = createBaseAccountUnlockingCoinsResponse(); + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountUnlockingCoinsResponse + ): AccountUnlockingCoinsResponseAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg( + object: AccountUnlockingCoinsResponseAminoMsg + ): AccountUnlockingCoinsResponse { + return AccountUnlockingCoinsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountUnlockingCoinsResponse + ): AccountUnlockingCoinsResponseAminoMsg { + return { + type: 'osmosis/lockup/account-unlocking-coins-response', + value: AccountUnlockingCoinsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountUnlockingCoinsResponseProtoMsg + ): AccountUnlockingCoinsResponse { + return AccountUnlockingCoinsResponse.decode(message.value); + }, + toProto(message: AccountUnlockingCoinsResponse): Uint8Array { + return AccountUnlockingCoinsResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountUnlockingCoinsResponse + ): AccountUnlockingCoinsResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountUnlockingCoinsResponse', + value: AccountUnlockingCoinsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountUnlockingCoinsResponse.typeUrl, + AccountUnlockingCoinsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountUnlockingCoinsResponse.aminoType, + AccountUnlockingCoinsResponse.typeUrl +); +function createBaseAccountLockedCoinsRequest(): AccountLockedCoinsRequest { + return { + owner: '', + }; +} +export const AccountLockedCoinsRequest = { + typeUrl: '/osmosis.lockup.AccountLockedCoinsRequest', + aminoType: 'osmosis/lockup/account-locked-coins-request', + is(o: any): o is AccountLockedCoinsRequest { + return ( + o && + (o.$typeUrl === AccountLockedCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + isSDK(o: any): o is AccountLockedCoinsRequestSDKType { + return ( + o && + (o.$typeUrl === AccountLockedCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + isAmino(o: any): o is AccountLockedCoinsRequestAmino { + return ( + o && + (o.$typeUrl === AccountLockedCoinsRequest.typeUrl || + typeof o.owner === 'string') + ); + }, + encode( + message: AccountLockedCoinsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedCoinsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedCoinsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedCoinsRequest { + const message = createBaseAccountLockedCoinsRequest(); + message.owner = object.owner ?? ''; + return message; + }, + fromAmino(object: AccountLockedCoinsRequestAmino): AccountLockedCoinsRequest { + const message = createBaseAccountLockedCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: AccountLockedCoinsRequest): AccountLockedCoinsRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + return obj; + }, + fromAminoMsg( + object: AccountLockedCoinsRequestAminoMsg + ): AccountLockedCoinsRequest { + return AccountLockedCoinsRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedCoinsRequest + ): AccountLockedCoinsRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-coins-request', + value: AccountLockedCoinsRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedCoinsRequestProtoMsg + ): AccountLockedCoinsRequest { + return AccountLockedCoinsRequest.decode(message.value); + }, + toProto(message: AccountLockedCoinsRequest): Uint8Array { + return AccountLockedCoinsRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedCoinsRequest + ): AccountLockedCoinsRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedCoinsRequest', + value: AccountLockedCoinsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedCoinsRequest.typeUrl, + AccountLockedCoinsRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedCoinsRequest.aminoType, + AccountLockedCoinsRequest.typeUrl +); +function createBaseAccountLockedCoinsResponse(): AccountLockedCoinsResponse { + return { + coins: [], + }; +} +export const AccountLockedCoinsResponse = { + typeUrl: '/osmosis.lockup.AccountLockedCoinsResponse', + aminoType: 'osmosis/lockup/account-locked-coins-response', + is(o: any): o is AccountLockedCoinsResponse { + return ( + o && + (o.$typeUrl === AccountLockedCoinsResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is AccountLockedCoinsResponseSDKType { + return ( + o && + (o.$typeUrl === AccountLockedCoinsResponse.typeUrl || + (Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is AccountLockedCoinsResponseAmino { + return ( + o && + (o.$typeUrl === AccountLockedCoinsResponse.typeUrl || + (Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: AccountLockedCoinsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedCoinsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedCoinsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedCoinsResponse { + const message = createBaseAccountLockedCoinsResponse(); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedCoinsResponseAmino + ): AccountLockedCoinsResponse { + const message = createBaseAccountLockedCoinsResponse(); + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedCoinsResponse + ): AccountLockedCoinsResponseAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedCoinsResponseAminoMsg + ): AccountLockedCoinsResponse { + return AccountLockedCoinsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedCoinsResponse + ): AccountLockedCoinsResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-coins-response', + value: AccountLockedCoinsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedCoinsResponseProtoMsg + ): AccountLockedCoinsResponse { + return AccountLockedCoinsResponse.decode(message.value); + }, + toProto(message: AccountLockedCoinsResponse): Uint8Array { + return AccountLockedCoinsResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedCoinsResponse + ): AccountLockedCoinsResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedCoinsResponse', + value: AccountLockedCoinsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedCoinsResponse.typeUrl, + AccountLockedCoinsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedCoinsResponse.aminoType, + AccountLockedCoinsResponse.typeUrl +); +function createBaseAccountLockedPastTimeRequest(): AccountLockedPastTimeRequest { + return { + owner: '', + timestamp: new Date(), + }; +} +export const AccountLockedPastTimeRequest = { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeRequest', + aminoType: 'osmosis/lockup/account-locked-past-time-request', + is(o: any): o is AccountLockedPastTimeRequest { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.is(o.timestamp))) + ); + }, + isSDK(o: any): o is AccountLockedPastTimeRequestSDKType { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.isSDK(o.timestamp))) + ); + }, + isAmino(o: any): o is AccountLockedPastTimeRequestAmino { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.isAmino(o.timestamp))) + ); + }, + encode( + message: AccountLockedPastTimeRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedPastTimeRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedPastTimeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedPastTimeRequest { + const message = createBaseAccountLockedPastTimeRequest(); + message.owner = object.owner ?? ''; + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino( + object: AccountLockedPastTimeRequestAmino + ): AccountLockedPastTimeRequest { + const message = createBaseAccountLockedPastTimeRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino( + message: AccountLockedPastTimeRequest + ): AccountLockedPastTimeRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined; + return obj; + }, + fromAminoMsg( + object: AccountLockedPastTimeRequestAminoMsg + ): AccountLockedPastTimeRequest { + return AccountLockedPastTimeRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedPastTimeRequest + ): AccountLockedPastTimeRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-past-time-request', + value: AccountLockedPastTimeRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedPastTimeRequestProtoMsg + ): AccountLockedPastTimeRequest { + return AccountLockedPastTimeRequest.decode(message.value); + }, + toProto(message: AccountLockedPastTimeRequest): Uint8Array { + return AccountLockedPastTimeRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedPastTimeRequest + ): AccountLockedPastTimeRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeRequest', + value: AccountLockedPastTimeRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedPastTimeRequest.typeUrl, + AccountLockedPastTimeRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedPastTimeRequest.aminoType, + AccountLockedPastTimeRequest.typeUrl +); +function createBaseAccountLockedPastTimeResponse(): AccountLockedPastTimeResponse { + return { + locks: [], + }; +} +export const AccountLockedPastTimeResponse = { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeResponse', + aminoType: 'osmosis/lockup/account-locked-past-time-response', + is(o: any): o is AccountLockedPastTimeResponse { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK(o: any): o is AccountLockedPastTimeResponseSDKType { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino(o: any): o is AccountLockedPastTimeResponseAmino { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountLockedPastTimeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedPastTimeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedPastTimeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedPastTimeResponse { + const message = createBaseAccountLockedPastTimeResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedPastTimeResponseAmino + ): AccountLockedPastTimeResponse { + const message = createBaseAccountLockedPastTimeResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedPastTimeResponse + ): AccountLockedPastTimeResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedPastTimeResponseAminoMsg + ): AccountLockedPastTimeResponse { + return AccountLockedPastTimeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedPastTimeResponse + ): AccountLockedPastTimeResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-past-time-response', + value: AccountLockedPastTimeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedPastTimeResponseProtoMsg + ): AccountLockedPastTimeResponse { + return AccountLockedPastTimeResponse.decode(message.value); + }, + toProto(message: AccountLockedPastTimeResponse): Uint8Array { + return AccountLockedPastTimeResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedPastTimeResponse + ): AccountLockedPastTimeResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeResponse', + value: AccountLockedPastTimeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedPastTimeResponse.typeUrl, + AccountLockedPastTimeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedPastTimeResponse.aminoType, + AccountLockedPastTimeResponse.typeUrl +); +function createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(): AccountLockedPastTimeNotUnlockingOnlyRequest { + return { + owner: '', + timestamp: new Date(), + }; +} +export const AccountLockedPastTimeNotUnlockingOnlyRequest = { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyRequest', + aminoType: + 'osmosis/lockup/account-locked-past-time-not-unlocking-only-request', + is(o: any): o is AccountLockedPastTimeNotUnlockingOnlyRequest { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.is(o.timestamp))) + ); + }, + isSDK(o: any): o is AccountLockedPastTimeNotUnlockingOnlyRequestSDKType { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.isSDK(o.timestamp))) + ); + }, + isAmino(o: any): o is AccountLockedPastTimeNotUnlockingOnlyRequestAmino { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.isAmino(o.timestamp))) + ); + }, + encode( + message: AccountLockedPastTimeNotUnlockingOnlyRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedPastTimeNotUnlockingOnlyRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedPastTimeNotUnlockingOnlyRequest { + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(); + message.owner = object.owner ?? ''; + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino( + object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino + ): AccountLockedPastTimeNotUnlockingOnlyRequest { + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino( + message: AccountLockedPastTimeNotUnlockingOnlyRequest + ): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined; + return obj; + }, + fromAminoMsg( + object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg + ): AccountLockedPastTimeNotUnlockingOnlyRequest { + return AccountLockedPastTimeNotUnlockingOnlyRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedPastTimeNotUnlockingOnlyRequest + ): AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-past-time-not-unlocking-only-request', + value: AccountLockedPastTimeNotUnlockingOnlyRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg + ): AccountLockedPastTimeNotUnlockingOnlyRequest { + return AccountLockedPastTimeNotUnlockingOnlyRequest.decode(message.value); + }, + toProto(message: AccountLockedPastTimeNotUnlockingOnlyRequest): Uint8Array { + return AccountLockedPastTimeNotUnlockingOnlyRequest.encode( + message + ).finish(); + }, + toProtoMsg( + message: AccountLockedPastTimeNotUnlockingOnlyRequest + ): AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyRequest', + value: + AccountLockedPastTimeNotUnlockingOnlyRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl, + AccountLockedPastTimeNotUnlockingOnlyRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedPastTimeNotUnlockingOnlyRequest.aminoType, + AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl +); +function createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(): AccountLockedPastTimeNotUnlockingOnlyResponse { + return { + locks: [], + }; +} +export const AccountLockedPastTimeNotUnlockingOnlyResponse = { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyResponse', + aminoType: + 'osmosis/lockup/account-locked-past-time-not-unlocking-only-response', + is(o: any): o is AccountLockedPastTimeNotUnlockingOnlyResponse { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK(o: any): o is AccountLockedPastTimeNotUnlockingOnlyResponseSDKType { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino(o: any): o is AccountLockedPastTimeNotUnlockingOnlyResponseAmino { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountLockedPastTimeNotUnlockingOnlyResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedPastTimeNotUnlockingOnlyResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedPastTimeNotUnlockingOnlyResponse { + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedPastTimeNotUnlockingOnlyResponseAmino + ): AccountLockedPastTimeNotUnlockingOnlyResponse { + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedPastTimeNotUnlockingOnlyResponse + ): AccountLockedPastTimeNotUnlockingOnlyResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedPastTimeNotUnlockingOnlyResponseAminoMsg + ): AccountLockedPastTimeNotUnlockingOnlyResponse { + return AccountLockedPastTimeNotUnlockingOnlyResponse.fromAmino( + object.value + ); + }, + toAminoMsg( + message: AccountLockedPastTimeNotUnlockingOnlyResponse + ): AccountLockedPastTimeNotUnlockingOnlyResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-past-time-not-unlocking-only-response', + value: AccountLockedPastTimeNotUnlockingOnlyResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedPastTimeNotUnlockingOnlyResponseProtoMsg + ): AccountLockedPastTimeNotUnlockingOnlyResponse { + return AccountLockedPastTimeNotUnlockingOnlyResponse.decode(message.value); + }, + toProto(message: AccountLockedPastTimeNotUnlockingOnlyResponse): Uint8Array { + return AccountLockedPastTimeNotUnlockingOnlyResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: AccountLockedPastTimeNotUnlockingOnlyResponse + ): AccountLockedPastTimeNotUnlockingOnlyResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyResponse', + value: + AccountLockedPastTimeNotUnlockingOnlyResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl, + AccountLockedPastTimeNotUnlockingOnlyResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedPastTimeNotUnlockingOnlyResponse.aminoType, + AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl +); +function createBaseAccountUnlockedBeforeTimeRequest(): AccountUnlockedBeforeTimeRequest { + return { + owner: '', + timestamp: new Date(), + }; +} +export const AccountUnlockedBeforeTimeRequest = { + typeUrl: '/osmosis.lockup.AccountUnlockedBeforeTimeRequest', + aminoType: 'osmosis/lockup/account-unlocked-before-time-request', + is(o: any): o is AccountUnlockedBeforeTimeRequest { + return ( + o && + (o.$typeUrl === AccountUnlockedBeforeTimeRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.is(o.timestamp))) + ); + }, + isSDK(o: any): o is AccountUnlockedBeforeTimeRequestSDKType { + return ( + o && + (o.$typeUrl === AccountUnlockedBeforeTimeRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.isSDK(o.timestamp))) + ); + }, + isAmino(o: any): o is AccountUnlockedBeforeTimeRequestAmino { + return ( + o && + (o.$typeUrl === AccountUnlockedBeforeTimeRequest.typeUrl || + (typeof o.owner === 'string' && Timestamp.isAmino(o.timestamp))) + ); + }, + encode( + message: AccountUnlockedBeforeTimeRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountUnlockedBeforeTimeRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUnlockedBeforeTimeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountUnlockedBeforeTimeRequest { + const message = createBaseAccountUnlockedBeforeTimeRequest(); + message.owner = object.owner ?? ''; + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino( + object: AccountUnlockedBeforeTimeRequestAmino + ): AccountUnlockedBeforeTimeRequest { + const message = createBaseAccountUnlockedBeforeTimeRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino( + message: AccountUnlockedBeforeTimeRequest + ): AccountUnlockedBeforeTimeRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined; + return obj; + }, + fromAminoMsg( + object: AccountUnlockedBeforeTimeRequestAminoMsg + ): AccountUnlockedBeforeTimeRequest { + return AccountUnlockedBeforeTimeRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountUnlockedBeforeTimeRequest + ): AccountUnlockedBeforeTimeRequestAminoMsg { + return { + type: 'osmosis/lockup/account-unlocked-before-time-request', + value: AccountUnlockedBeforeTimeRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountUnlockedBeforeTimeRequestProtoMsg + ): AccountUnlockedBeforeTimeRequest { + return AccountUnlockedBeforeTimeRequest.decode(message.value); + }, + toProto(message: AccountUnlockedBeforeTimeRequest): Uint8Array { + return AccountUnlockedBeforeTimeRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountUnlockedBeforeTimeRequest + ): AccountUnlockedBeforeTimeRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountUnlockedBeforeTimeRequest', + value: AccountUnlockedBeforeTimeRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountUnlockedBeforeTimeRequest.typeUrl, + AccountUnlockedBeforeTimeRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountUnlockedBeforeTimeRequest.aminoType, + AccountUnlockedBeforeTimeRequest.typeUrl +); +function createBaseAccountUnlockedBeforeTimeResponse(): AccountUnlockedBeforeTimeResponse { + return { + locks: [], + }; +} +export const AccountUnlockedBeforeTimeResponse = { + typeUrl: '/osmosis.lockup.AccountUnlockedBeforeTimeResponse', + aminoType: 'osmosis/lockup/account-unlocked-before-time-response', + is(o: any): o is AccountUnlockedBeforeTimeResponse { + return ( + o && + (o.$typeUrl === AccountUnlockedBeforeTimeResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK(o: any): o is AccountUnlockedBeforeTimeResponseSDKType { + return ( + o && + (o.$typeUrl === AccountUnlockedBeforeTimeResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino(o: any): o is AccountUnlockedBeforeTimeResponseAmino { + return ( + o && + (o.$typeUrl === AccountUnlockedBeforeTimeResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountUnlockedBeforeTimeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountUnlockedBeforeTimeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUnlockedBeforeTimeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountUnlockedBeforeTimeResponse { + const message = createBaseAccountUnlockedBeforeTimeResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountUnlockedBeforeTimeResponseAmino + ): AccountUnlockedBeforeTimeResponse { + const message = createBaseAccountUnlockedBeforeTimeResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountUnlockedBeforeTimeResponse + ): AccountUnlockedBeforeTimeResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountUnlockedBeforeTimeResponseAminoMsg + ): AccountUnlockedBeforeTimeResponse { + return AccountUnlockedBeforeTimeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountUnlockedBeforeTimeResponse + ): AccountUnlockedBeforeTimeResponseAminoMsg { + return { + type: 'osmosis/lockup/account-unlocked-before-time-response', + value: AccountUnlockedBeforeTimeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountUnlockedBeforeTimeResponseProtoMsg + ): AccountUnlockedBeforeTimeResponse { + return AccountUnlockedBeforeTimeResponse.decode(message.value); + }, + toProto(message: AccountUnlockedBeforeTimeResponse): Uint8Array { + return AccountUnlockedBeforeTimeResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountUnlockedBeforeTimeResponse + ): AccountUnlockedBeforeTimeResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountUnlockedBeforeTimeResponse', + value: AccountUnlockedBeforeTimeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountUnlockedBeforeTimeResponse.typeUrl, + AccountUnlockedBeforeTimeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountUnlockedBeforeTimeResponse.aminoType, + AccountUnlockedBeforeTimeResponse.typeUrl +); +function createBaseAccountLockedPastTimeDenomRequest(): AccountLockedPastTimeDenomRequest { + return { + owner: '', + timestamp: new Date(), + denom: '', + }; +} +export const AccountLockedPastTimeDenomRequest = { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeDenomRequest', + aminoType: 'osmosis/lockup/account-locked-past-time-denom-request', + is(o: any): o is AccountLockedPastTimeDenomRequest { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeDenomRequest.typeUrl || + (typeof o.owner === 'string' && + Timestamp.is(o.timestamp) && + typeof o.denom === 'string')) + ); + }, + isSDK(o: any): o is AccountLockedPastTimeDenomRequestSDKType { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeDenomRequest.typeUrl || + (typeof o.owner === 'string' && + Timestamp.isSDK(o.timestamp) && + typeof o.denom === 'string')) + ); + }, + isAmino(o: any): o is AccountLockedPastTimeDenomRequestAmino { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeDenomRequest.typeUrl || + (typeof o.owner === 'string' && + Timestamp.isAmino(o.timestamp) && + typeof o.denom === 'string')) + ); + }, + encode( + message: AccountLockedPastTimeDenomRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(18).fork() + ).ldelim(); + } + if (message.denom !== '') { + writer.uint32(26).string(message.denom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedPastTimeDenomRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedPastTimeDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 3: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedPastTimeDenomRequest { + const message = createBaseAccountLockedPastTimeDenomRequest(); + message.owner = object.owner ?? ''; + message.timestamp = object.timestamp ?? undefined; + message.denom = object.denom ?? ''; + return message; + }, + fromAmino( + object: AccountLockedPastTimeDenomRequestAmino + ): AccountLockedPastTimeDenomRequest { + const message = createBaseAccountLockedPastTimeDenomRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino( + message: AccountLockedPastTimeDenomRequest + ): AccountLockedPastTimeDenomRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined; + obj.denom = message.denom === '' ? undefined : message.denom; + return obj; + }, + fromAminoMsg( + object: AccountLockedPastTimeDenomRequestAminoMsg + ): AccountLockedPastTimeDenomRequest { + return AccountLockedPastTimeDenomRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedPastTimeDenomRequest + ): AccountLockedPastTimeDenomRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-past-time-denom-request', + value: AccountLockedPastTimeDenomRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedPastTimeDenomRequestProtoMsg + ): AccountLockedPastTimeDenomRequest { + return AccountLockedPastTimeDenomRequest.decode(message.value); + }, + toProto(message: AccountLockedPastTimeDenomRequest): Uint8Array { + return AccountLockedPastTimeDenomRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedPastTimeDenomRequest + ): AccountLockedPastTimeDenomRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeDenomRequest', + value: AccountLockedPastTimeDenomRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedPastTimeDenomRequest.typeUrl, + AccountLockedPastTimeDenomRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedPastTimeDenomRequest.aminoType, + AccountLockedPastTimeDenomRequest.typeUrl +); +function createBaseAccountLockedPastTimeDenomResponse(): AccountLockedPastTimeDenomResponse { + return { + locks: [], + }; +} +export const AccountLockedPastTimeDenomResponse = { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeDenomResponse', + aminoType: 'osmosis/lockup/account-locked-past-time-denom-response', + is(o: any): o is AccountLockedPastTimeDenomResponse { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeDenomResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK(o: any): o is AccountLockedPastTimeDenomResponseSDKType { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeDenomResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino(o: any): o is AccountLockedPastTimeDenomResponseAmino { + return ( + o && + (o.$typeUrl === AccountLockedPastTimeDenomResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountLockedPastTimeDenomResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedPastTimeDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedPastTimeDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedPastTimeDenomResponse { + const message = createBaseAccountLockedPastTimeDenomResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedPastTimeDenomResponseAmino + ): AccountLockedPastTimeDenomResponse { + const message = createBaseAccountLockedPastTimeDenomResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedPastTimeDenomResponse + ): AccountLockedPastTimeDenomResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedPastTimeDenomResponseAminoMsg + ): AccountLockedPastTimeDenomResponse { + return AccountLockedPastTimeDenomResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedPastTimeDenomResponse + ): AccountLockedPastTimeDenomResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-past-time-denom-response', + value: AccountLockedPastTimeDenomResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedPastTimeDenomResponseProtoMsg + ): AccountLockedPastTimeDenomResponse { + return AccountLockedPastTimeDenomResponse.decode(message.value); + }, + toProto(message: AccountLockedPastTimeDenomResponse): Uint8Array { + return AccountLockedPastTimeDenomResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedPastTimeDenomResponse + ): AccountLockedPastTimeDenomResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedPastTimeDenomResponse', + value: AccountLockedPastTimeDenomResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedPastTimeDenomResponse.typeUrl, + AccountLockedPastTimeDenomResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedPastTimeDenomResponse.aminoType, + AccountLockedPastTimeDenomResponse.typeUrl +); +function createBaseLockedDenomRequest(): LockedDenomRequest { + return { + denom: '', + duration: Duration.fromPartial({}), + }; +} +export const LockedDenomRequest = { + typeUrl: '/osmosis.lockup.LockedDenomRequest', + aminoType: 'osmosis/lockup/locked-denom-request', + is(o: any): o is LockedDenomRequest { + return ( + o && + (o.$typeUrl === LockedDenomRequest.typeUrl || + (typeof o.denom === 'string' && Duration.is(o.duration))) + ); + }, + isSDK(o: any): o is LockedDenomRequestSDKType { + return ( + o && + (o.$typeUrl === LockedDenomRequest.typeUrl || + (typeof o.denom === 'string' && Duration.isSDK(o.duration))) + ); + }, + isAmino(o: any): o is LockedDenomRequestAmino { + return ( + o && + (o.$typeUrl === LockedDenomRequest.typeUrl || + (typeof o.denom === 'string' && Duration.isAmino(o.duration))) + ); + }, + encode( + message: LockedDenomRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): LockedDenomRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockedDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LockedDenomRequest { + const message = createBaseLockedDenomRequest(); + message.denom = object.denom ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, + fromAmino(object: LockedDenomRequestAmino): LockedDenomRequest { + const message = createBaseLockedDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino(message: LockedDenomRequest): LockedDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + return obj; + }, + fromAminoMsg(object: LockedDenomRequestAminoMsg): LockedDenomRequest { + return LockedDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: LockedDenomRequest): LockedDenomRequestAminoMsg { + return { + type: 'osmosis/lockup/locked-denom-request', + value: LockedDenomRequest.toAmino(message), + }; + }, + fromProtoMsg(message: LockedDenomRequestProtoMsg): LockedDenomRequest { + return LockedDenomRequest.decode(message.value); + }, + toProto(message: LockedDenomRequest): Uint8Array { + return LockedDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: LockedDenomRequest): LockedDenomRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.LockedDenomRequest', + value: LockedDenomRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(LockedDenomRequest.typeUrl, LockedDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockedDenomRequest.aminoType, + LockedDenomRequest.typeUrl +); +function createBaseLockedDenomResponse(): LockedDenomResponse { + return { + amount: '', + }; +} +export const LockedDenomResponse = { + typeUrl: '/osmosis.lockup.LockedDenomResponse', + aminoType: 'osmosis/lockup/locked-denom-response', + is(o: any): o is LockedDenomResponse { + return ( + o && + (o.$typeUrl === LockedDenomResponse.typeUrl || + typeof o.amount === 'string') + ); + }, + isSDK(o: any): o is LockedDenomResponseSDKType { + return ( + o && + (o.$typeUrl === LockedDenomResponse.typeUrl || + typeof o.amount === 'string') + ); + }, + isAmino(o: any): o is LockedDenomResponseAmino { + return ( + o && + (o.$typeUrl === LockedDenomResponse.typeUrl || + typeof o.amount === 'string') + ); + }, + encode( + message: LockedDenomResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.amount !== '') { + writer.uint32(10).string(message.amount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): LockedDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockedDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LockedDenomResponse { + const message = createBaseLockedDenomResponse(); + message.amount = object.amount ?? ''; + return message; + }, + fromAmino(object: LockedDenomResponseAmino): LockedDenomResponse { + const message = createBaseLockedDenomResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: LockedDenomResponse): LockedDenomResponseAmino { + const obj: any = {}; + obj.amount = message.amount === '' ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: LockedDenomResponseAminoMsg): LockedDenomResponse { + return LockedDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: LockedDenomResponse): LockedDenomResponseAminoMsg { + return { + type: 'osmosis/lockup/locked-denom-response', + value: LockedDenomResponse.toAmino(message), + }; + }, + fromProtoMsg(message: LockedDenomResponseProtoMsg): LockedDenomResponse { + return LockedDenomResponse.decode(message.value); + }, + toProto(message: LockedDenomResponse): Uint8Array { + return LockedDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: LockedDenomResponse): LockedDenomResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.LockedDenomResponse', + value: LockedDenomResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + LockedDenomResponse.typeUrl, + LockedDenomResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockedDenomResponse.aminoType, + LockedDenomResponse.typeUrl +); +function createBaseLockedRequest(): LockedRequest { + return { + lockId: BigInt(0), + }; +} +export const LockedRequest = { + typeUrl: '/osmosis.lockup.LockedRequest', + aminoType: 'osmosis/lockup/locked-request', + is(o: any): o is LockedRequest { + return ( + o && + (o.$typeUrl === LockedRequest.typeUrl || typeof o.lockId === 'bigint') + ); + }, + isSDK(o: any): o is LockedRequestSDKType { + return ( + o && + (o.$typeUrl === LockedRequest.typeUrl || typeof o.lock_id === 'bigint') + ); + }, + isAmino(o: any): o is LockedRequestAmino { + return ( + o && + (o.$typeUrl === LockedRequest.typeUrl || typeof o.lock_id === 'bigint') + ); + }, + encode( + message: LockedRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LockedRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockedRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LockedRequest { + const message = createBaseLockedRequest(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: LockedRequestAmino): LockedRequest { + const message = createBaseLockedRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino(message: LockedRequest): LockedRequestAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LockedRequestAminoMsg): LockedRequest { + return LockedRequest.fromAmino(object.value); + }, + toAminoMsg(message: LockedRequest): LockedRequestAminoMsg { + return { + type: 'osmosis/lockup/locked-request', + value: LockedRequest.toAmino(message), + }; + }, + fromProtoMsg(message: LockedRequestProtoMsg): LockedRequest { + return LockedRequest.decode(message.value); + }, + toProto(message: LockedRequest): Uint8Array { + return LockedRequest.encode(message).finish(); + }, + toProtoMsg(message: LockedRequest): LockedRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.LockedRequest', + value: LockedRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(LockedRequest.typeUrl, LockedRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockedRequest.aminoType, + LockedRequest.typeUrl +); +function createBaseLockedResponse(): LockedResponse { + return { + lock: undefined, + }; +} +export const LockedResponse = { + typeUrl: '/osmosis.lockup.LockedResponse', + aminoType: 'osmosis/lockup/locked-response', + is(o: any): o is LockedResponse { + return o && o.$typeUrl === LockedResponse.typeUrl; + }, + isSDK(o: any): o is LockedResponseSDKType { + return o && o.$typeUrl === LockedResponse.typeUrl; + }, + isAmino(o: any): o is LockedResponseAmino { + return o && o.$typeUrl === LockedResponse.typeUrl; + }, + encode( + message: LockedResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lock !== undefined) { + PeriodLock.encode(message.lock, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LockedResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lock = PeriodLock.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LockedResponse { + const message = createBaseLockedResponse(); + message.lock = + object.lock !== undefined && object.lock !== null + ? PeriodLock.fromPartial(object.lock) + : undefined; + return message; + }, + fromAmino(object: LockedResponseAmino): LockedResponse { + const message = createBaseLockedResponse(); + if (object.lock !== undefined && object.lock !== null) { + message.lock = PeriodLock.fromAmino(object.lock); + } + return message; + }, + toAmino(message: LockedResponse): LockedResponseAmino { + const obj: any = {}; + obj.lock = message.lock ? PeriodLock.toAmino(message.lock) : undefined; + return obj; + }, + fromAminoMsg(object: LockedResponseAminoMsg): LockedResponse { + return LockedResponse.fromAmino(object.value); + }, + toAminoMsg(message: LockedResponse): LockedResponseAminoMsg { + return { + type: 'osmosis/lockup/locked-response', + value: LockedResponse.toAmino(message), + }; + }, + fromProtoMsg(message: LockedResponseProtoMsg): LockedResponse { + return LockedResponse.decode(message.value); + }, + toProto(message: LockedResponse): Uint8Array { + return LockedResponse.encode(message).finish(); + }, + toProtoMsg(message: LockedResponse): LockedResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.LockedResponse', + value: LockedResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(LockedResponse.typeUrl, LockedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockedResponse.aminoType, + LockedResponse.typeUrl +); +function createBaseLockRewardReceiverRequest(): LockRewardReceiverRequest { + return { + lockId: BigInt(0), + }; +} +export const LockRewardReceiverRequest = { + typeUrl: '/osmosis.lockup.LockRewardReceiverRequest', + aminoType: 'osmosis/lockup/lock-reward-receiver-request', + is(o: any): o is LockRewardReceiverRequest { + return ( + o && + (o.$typeUrl === LockRewardReceiverRequest.typeUrl || + typeof o.lockId === 'bigint') + ); + }, + isSDK(o: any): o is LockRewardReceiverRequestSDKType { + return ( + o && + (o.$typeUrl === LockRewardReceiverRequest.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + isAmino(o: any): o is LockRewardReceiverRequestAmino { + return ( + o && + (o.$typeUrl === LockRewardReceiverRequest.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + encode( + message: LockRewardReceiverRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): LockRewardReceiverRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockRewardReceiverRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): LockRewardReceiverRequest { + const message = createBaseLockRewardReceiverRequest(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: LockRewardReceiverRequestAmino): LockRewardReceiverRequest { + const message = createBaseLockRewardReceiverRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino(message: LockRewardReceiverRequest): LockRewardReceiverRequestAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: LockRewardReceiverRequestAminoMsg + ): LockRewardReceiverRequest { + return LockRewardReceiverRequest.fromAmino(object.value); + }, + toAminoMsg( + message: LockRewardReceiverRequest + ): LockRewardReceiverRequestAminoMsg { + return { + type: 'osmosis/lockup/lock-reward-receiver-request', + value: LockRewardReceiverRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: LockRewardReceiverRequestProtoMsg + ): LockRewardReceiverRequest { + return LockRewardReceiverRequest.decode(message.value); + }, + toProto(message: LockRewardReceiverRequest): Uint8Array { + return LockRewardReceiverRequest.encode(message).finish(); + }, + toProtoMsg( + message: LockRewardReceiverRequest + ): LockRewardReceiverRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.LockRewardReceiverRequest', + value: LockRewardReceiverRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + LockRewardReceiverRequest.typeUrl, + LockRewardReceiverRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockRewardReceiverRequest.aminoType, + LockRewardReceiverRequest.typeUrl +); +function createBaseLockRewardReceiverResponse(): LockRewardReceiverResponse { + return { + rewardReceiver: '', + }; +} +export const LockRewardReceiverResponse = { + typeUrl: '/osmosis.lockup.LockRewardReceiverResponse', + aminoType: 'osmosis/lockup/lock-reward-receiver-response', + is(o: any): o is LockRewardReceiverResponse { + return ( + o && + (o.$typeUrl === LockRewardReceiverResponse.typeUrl || + typeof o.rewardReceiver === 'string') + ); + }, + isSDK(o: any): o is LockRewardReceiverResponseSDKType { + return ( + o && + (o.$typeUrl === LockRewardReceiverResponse.typeUrl || + typeof o.reward_receiver === 'string') + ); + }, + isAmino(o: any): o is LockRewardReceiverResponseAmino { + return ( + o && + (o.$typeUrl === LockRewardReceiverResponse.typeUrl || + typeof o.reward_receiver === 'string') + ); + }, + encode( + message: LockRewardReceiverResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.rewardReceiver !== '') { + writer.uint32(10).string(message.rewardReceiver); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): LockRewardReceiverResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockRewardReceiverResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardReceiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): LockRewardReceiverResponse { + const message = createBaseLockRewardReceiverResponse(); + message.rewardReceiver = object.rewardReceiver ?? ''; + return message; + }, + fromAmino( + object: LockRewardReceiverResponseAmino + ): LockRewardReceiverResponse { + const message = createBaseLockRewardReceiverResponse(); + if ( + object.reward_receiver !== undefined && + object.reward_receiver !== null + ) { + message.rewardReceiver = object.reward_receiver; + } + return message; + }, + toAmino( + message: LockRewardReceiverResponse + ): LockRewardReceiverResponseAmino { + const obj: any = {}; + obj.reward_receiver = + message.rewardReceiver === '' ? undefined : message.rewardReceiver; + return obj; + }, + fromAminoMsg( + object: LockRewardReceiverResponseAminoMsg + ): LockRewardReceiverResponse { + return LockRewardReceiverResponse.fromAmino(object.value); + }, + toAminoMsg( + message: LockRewardReceiverResponse + ): LockRewardReceiverResponseAminoMsg { + return { + type: 'osmosis/lockup/lock-reward-receiver-response', + value: LockRewardReceiverResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: LockRewardReceiverResponseProtoMsg + ): LockRewardReceiverResponse { + return LockRewardReceiverResponse.decode(message.value); + }, + toProto(message: LockRewardReceiverResponse): Uint8Array { + return LockRewardReceiverResponse.encode(message).finish(); + }, + toProtoMsg( + message: LockRewardReceiverResponse + ): LockRewardReceiverResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.LockRewardReceiverResponse', + value: LockRewardReceiverResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + LockRewardReceiverResponse.typeUrl, + LockRewardReceiverResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockRewardReceiverResponse.aminoType, + LockRewardReceiverResponse.typeUrl +); +function createBaseNextLockIDRequest(): NextLockIDRequest { + return {}; +} +export const NextLockIDRequest = { + typeUrl: '/osmosis.lockup.NextLockIDRequest', + aminoType: 'osmosis/lockup/next-lock-id-request', + is(o: any): o is NextLockIDRequest { + return o && o.$typeUrl === NextLockIDRequest.typeUrl; + }, + isSDK(o: any): o is NextLockIDRequestSDKType { + return o && o.$typeUrl === NextLockIDRequest.typeUrl; + }, + isAmino(o: any): o is NextLockIDRequestAmino { + return o && o.$typeUrl === NextLockIDRequest.typeUrl; + }, + encode( + _: NextLockIDRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NextLockIDRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextLockIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): NextLockIDRequest { + const message = createBaseNextLockIDRequest(); + return message; + }, + fromAmino(_: NextLockIDRequestAmino): NextLockIDRequest { + const message = createBaseNextLockIDRequest(); + return message; + }, + toAmino(_: NextLockIDRequest): NextLockIDRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: NextLockIDRequestAminoMsg): NextLockIDRequest { + return NextLockIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: NextLockIDRequest): NextLockIDRequestAminoMsg { + return { + type: 'osmosis/lockup/next-lock-id-request', + value: NextLockIDRequest.toAmino(message), + }; + }, + fromProtoMsg(message: NextLockIDRequestProtoMsg): NextLockIDRequest { + return NextLockIDRequest.decode(message.value); + }, + toProto(message: NextLockIDRequest): Uint8Array { + return NextLockIDRequest.encode(message).finish(); + }, + toProtoMsg(message: NextLockIDRequest): NextLockIDRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.NextLockIDRequest', + value: NextLockIDRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(NextLockIDRequest.typeUrl, NextLockIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + NextLockIDRequest.aminoType, + NextLockIDRequest.typeUrl +); +function createBaseNextLockIDResponse(): NextLockIDResponse { + return { + lockId: BigInt(0), + }; +} +export const NextLockIDResponse = { + typeUrl: '/osmosis.lockup.NextLockIDResponse', + aminoType: 'osmosis/lockup/next-lock-id-response', + is(o: any): o is NextLockIDResponse { + return ( + o && + (o.$typeUrl === NextLockIDResponse.typeUrl || + typeof o.lockId === 'bigint') + ); + }, + isSDK(o: any): o is NextLockIDResponseSDKType { + return ( + o && + (o.$typeUrl === NextLockIDResponse.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + isAmino(o: any): o is NextLockIDResponseAmino { + return ( + o && + (o.$typeUrl === NextLockIDResponse.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + encode( + message: NextLockIDResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): NextLockIDResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextLockIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NextLockIDResponse { + const message = createBaseNextLockIDResponse(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: NextLockIDResponseAmino): NextLockIDResponse { + const message = createBaseNextLockIDResponse(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino(message: NextLockIDResponse): NextLockIDResponseAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: NextLockIDResponseAminoMsg): NextLockIDResponse { + return NextLockIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: NextLockIDResponse): NextLockIDResponseAminoMsg { + return { + type: 'osmosis/lockup/next-lock-id-response', + value: NextLockIDResponse.toAmino(message), + }; + }, + fromProtoMsg(message: NextLockIDResponseProtoMsg): NextLockIDResponse { + return NextLockIDResponse.decode(message.value); + }, + toProto(message: NextLockIDResponse): Uint8Array { + return NextLockIDResponse.encode(message).finish(); + }, + toProtoMsg(message: NextLockIDResponse): NextLockIDResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.NextLockIDResponse', + value: NextLockIDResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(NextLockIDResponse.typeUrl, NextLockIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping( + NextLockIDResponse.aminoType, + NextLockIDResponse.typeUrl +); +function createBaseSyntheticLockupsByLockupIDRequest(): SyntheticLockupsByLockupIDRequest { + return { + lockId: BigInt(0), + }; +} +export const SyntheticLockupsByLockupIDRequest = { + typeUrl: '/osmosis.lockup.SyntheticLockupsByLockupIDRequest', + aminoType: 'osmosis/lockup/synthetic-lockups-by-lockup-id-request', + is(o: any): o is SyntheticLockupsByLockupIDRequest { + return ( + o && + (o.$typeUrl === SyntheticLockupsByLockupIDRequest.typeUrl || + typeof o.lockId === 'bigint') + ); + }, + isSDK(o: any): o is SyntheticLockupsByLockupIDRequestSDKType { + return ( + o && + (o.$typeUrl === SyntheticLockupsByLockupIDRequest.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + isAmino(o: any): o is SyntheticLockupsByLockupIDRequestAmino { + return ( + o && + (o.$typeUrl === SyntheticLockupsByLockupIDRequest.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + encode( + message: SyntheticLockupsByLockupIDRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SyntheticLockupsByLockupIDRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSyntheticLockupsByLockupIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SyntheticLockupsByLockupIDRequest { + const message = createBaseSyntheticLockupsByLockupIDRequest(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: SyntheticLockupsByLockupIDRequestAmino + ): SyntheticLockupsByLockupIDRequest { + const message = createBaseSyntheticLockupsByLockupIDRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino( + message: SyntheticLockupsByLockupIDRequest + ): SyntheticLockupsByLockupIDRequestAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: SyntheticLockupsByLockupIDRequestAminoMsg + ): SyntheticLockupsByLockupIDRequest { + return SyntheticLockupsByLockupIDRequest.fromAmino(object.value); + }, + toAminoMsg( + message: SyntheticLockupsByLockupIDRequest + ): SyntheticLockupsByLockupIDRequestAminoMsg { + return { + type: 'osmosis/lockup/synthetic-lockups-by-lockup-id-request', + value: SyntheticLockupsByLockupIDRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: SyntheticLockupsByLockupIDRequestProtoMsg + ): SyntheticLockupsByLockupIDRequest { + return SyntheticLockupsByLockupIDRequest.decode(message.value); + }, + toProto(message: SyntheticLockupsByLockupIDRequest): Uint8Array { + return SyntheticLockupsByLockupIDRequest.encode(message).finish(); + }, + toProtoMsg( + message: SyntheticLockupsByLockupIDRequest + ): SyntheticLockupsByLockupIDRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.SyntheticLockupsByLockupIDRequest', + value: SyntheticLockupsByLockupIDRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SyntheticLockupsByLockupIDRequest.typeUrl, + SyntheticLockupsByLockupIDRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SyntheticLockupsByLockupIDRequest.aminoType, + SyntheticLockupsByLockupIDRequest.typeUrl +); +function createBaseSyntheticLockupsByLockupIDResponse(): SyntheticLockupsByLockupIDResponse { + return { + syntheticLocks: [], + }; +} +export const SyntheticLockupsByLockupIDResponse = { + typeUrl: '/osmosis.lockup.SyntheticLockupsByLockupIDResponse', + aminoType: 'osmosis/lockup/synthetic-lockups-by-lockup-id-response', + is(o: any): o is SyntheticLockupsByLockupIDResponse { + return ( + o && + (o.$typeUrl === SyntheticLockupsByLockupIDResponse.typeUrl || + (Array.isArray(o.syntheticLocks) && + (!o.syntheticLocks.length || SyntheticLock.is(o.syntheticLocks[0])))) + ); + }, + isSDK(o: any): o is SyntheticLockupsByLockupIDResponseSDKType { + return ( + o && + (o.$typeUrl === SyntheticLockupsByLockupIDResponse.typeUrl || + (Array.isArray(o.synthetic_locks) && + (!o.synthetic_locks.length || + SyntheticLock.isSDK(o.synthetic_locks[0])))) + ); + }, + isAmino(o: any): o is SyntheticLockupsByLockupIDResponseAmino { + return ( + o && + (o.$typeUrl === SyntheticLockupsByLockupIDResponse.typeUrl || + (Array.isArray(o.synthetic_locks) && + (!o.synthetic_locks.length || + SyntheticLock.isAmino(o.synthetic_locks[0])))) + ); + }, + encode( + message: SyntheticLockupsByLockupIDResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.syntheticLocks) { + SyntheticLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SyntheticLockupsByLockupIDResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSyntheticLockupsByLockupIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.syntheticLocks.push( + SyntheticLock.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SyntheticLockupsByLockupIDResponse { + const message = createBaseSyntheticLockupsByLockupIDResponse(); + message.syntheticLocks = + object.syntheticLocks?.map((e) => SyntheticLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: SyntheticLockupsByLockupIDResponseAmino + ): SyntheticLockupsByLockupIDResponse { + const message = createBaseSyntheticLockupsByLockupIDResponse(); + message.syntheticLocks = + object.synthetic_locks?.map((e) => SyntheticLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: SyntheticLockupsByLockupIDResponse + ): SyntheticLockupsByLockupIDResponseAmino { + const obj: any = {}; + if (message.syntheticLocks) { + obj.synthetic_locks = message.syntheticLocks.map((e) => + e ? SyntheticLock.toAmino(e) : undefined + ); + } else { + obj.synthetic_locks = message.syntheticLocks; + } + return obj; + }, + fromAminoMsg( + object: SyntheticLockupsByLockupIDResponseAminoMsg + ): SyntheticLockupsByLockupIDResponse { + return SyntheticLockupsByLockupIDResponse.fromAmino(object.value); + }, + toAminoMsg( + message: SyntheticLockupsByLockupIDResponse + ): SyntheticLockupsByLockupIDResponseAminoMsg { + return { + type: 'osmosis/lockup/synthetic-lockups-by-lockup-id-response', + value: SyntheticLockupsByLockupIDResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: SyntheticLockupsByLockupIDResponseProtoMsg + ): SyntheticLockupsByLockupIDResponse { + return SyntheticLockupsByLockupIDResponse.decode(message.value); + }, + toProto(message: SyntheticLockupsByLockupIDResponse): Uint8Array { + return SyntheticLockupsByLockupIDResponse.encode(message).finish(); + }, + toProtoMsg( + message: SyntheticLockupsByLockupIDResponse + ): SyntheticLockupsByLockupIDResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.SyntheticLockupsByLockupIDResponse', + value: SyntheticLockupsByLockupIDResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SyntheticLockupsByLockupIDResponse.typeUrl, + SyntheticLockupsByLockupIDResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SyntheticLockupsByLockupIDResponse.aminoType, + SyntheticLockupsByLockupIDResponse.typeUrl +); +function createBaseSyntheticLockupByLockupIDRequest(): SyntheticLockupByLockupIDRequest { + return { + lockId: BigInt(0), + }; +} +export const SyntheticLockupByLockupIDRequest = { + typeUrl: '/osmosis.lockup.SyntheticLockupByLockupIDRequest', + aminoType: 'osmosis/lockup/synthetic-lockup-by-lockup-id-request', + is(o: any): o is SyntheticLockupByLockupIDRequest { + return ( + o && + (o.$typeUrl === SyntheticLockupByLockupIDRequest.typeUrl || + typeof o.lockId === 'bigint') + ); + }, + isSDK(o: any): o is SyntheticLockupByLockupIDRequestSDKType { + return ( + o && + (o.$typeUrl === SyntheticLockupByLockupIDRequest.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + isAmino(o: any): o is SyntheticLockupByLockupIDRequestAmino { + return ( + o && + (o.$typeUrl === SyntheticLockupByLockupIDRequest.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + encode( + message: SyntheticLockupByLockupIDRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SyntheticLockupByLockupIDRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSyntheticLockupByLockupIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SyntheticLockupByLockupIDRequest { + const message = createBaseSyntheticLockupByLockupIDRequest(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: SyntheticLockupByLockupIDRequestAmino + ): SyntheticLockupByLockupIDRequest { + const message = createBaseSyntheticLockupByLockupIDRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino( + message: SyntheticLockupByLockupIDRequest + ): SyntheticLockupByLockupIDRequestAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: SyntheticLockupByLockupIDRequestAminoMsg + ): SyntheticLockupByLockupIDRequest { + return SyntheticLockupByLockupIDRequest.fromAmino(object.value); + }, + toAminoMsg( + message: SyntheticLockupByLockupIDRequest + ): SyntheticLockupByLockupIDRequestAminoMsg { + return { + type: 'osmosis/lockup/synthetic-lockup-by-lockup-id-request', + value: SyntheticLockupByLockupIDRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: SyntheticLockupByLockupIDRequestProtoMsg + ): SyntheticLockupByLockupIDRequest { + return SyntheticLockupByLockupIDRequest.decode(message.value); + }, + toProto(message: SyntheticLockupByLockupIDRequest): Uint8Array { + return SyntheticLockupByLockupIDRequest.encode(message).finish(); + }, + toProtoMsg( + message: SyntheticLockupByLockupIDRequest + ): SyntheticLockupByLockupIDRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.SyntheticLockupByLockupIDRequest', + value: SyntheticLockupByLockupIDRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SyntheticLockupByLockupIDRequest.typeUrl, + SyntheticLockupByLockupIDRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SyntheticLockupByLockupIDRequest.aminoType, + SyntheticLockupByLockupIDRequest.typeUrl +); +function createBaseSyntheticLockupByLockupIDResponse(): SyntheticLockupByLockupIDResponse { + return { + syntheticLock: SyntheticLock.fromPartial({}), + }; +} +export const SyntheticLockupByLockupIDResponse = { + typeUrl: '/osmosis.lockup.SyntheticLockupByLockupIDResponse', + aminoType: 'osmosis/lockup/synthetic-lockup-by-lockup-id-response', + is(o: any): o is SyntheticLockupByLockupIDResponse { + return ( + o && + (o.$typeUrl === SyntheticLockupByLockupIDResponse.typeUrl || + SyntheticLock.is(o.syntheticLock)) + ); + }, + isSDK(o: any): o is SyntheticLockupByLockupIDResponseSDKType { + return ( + o && + (o.$typeUrl === SyntheticLockupByLockupIDResponse.typeUrl || + SyntheticLock.isSDK(o.synthetic_lock)) + ); + }, + isAmino(o: any): o is SyntheticLockupByLockupIDResponseAmino { + return ( + o && + (o.$typeUrl === SyntheticLockupByLockupIDResponse.typeUrl || + SyntheticLock.isAmino(o.synthetic_lock)) + ); + }, + encode( + message: SyntheticLockupByLockupIDResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.syntheticLock !== undefined) { + SyntheticLock.encode( + message.syntheticLock, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SyntheticLockupByLockupIDResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSyntheticLockupByLockupIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.syntheticLock = SyntheticLock.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SyntheticLockupByLockupIDResponse { + const message = createBaseSyntheticLockupByLockupIDResponse(); + message.syntheticLock = + object.syntheticLock !== undefined && object.syntheticLock !== null + ? SyntheticLock.fromPartial(object.syntheticLock) + : undefined; + return message; + }, + fromAmino( + object: SyntheticLockupByLockupIDResponseAmino + ): SyntheticLockupByLockupIDResponse { + const message = createBaseSyntheticLockupByLockupIDResponse(); + if (object.synthetic_lock !== undefined && object.synthetic_lock !== null) { + message.syntheticLock = SyntheticLock.fromAmino(object.synthetic_lock); + } + return message; + }, + toAmino( + message: SyntheticLockupByLockupIDResponse + ): SyntheticLockupByLockupIDResponseAmino { + const obj: any = {}; + obj.synthetic_lock = message.syntheticLock + ? SyntheticLock.toAmino(message.syntheticLock) + : undefined; + return obj; + }, + fromAminoMsg( + object: SyntheticLockupByLockupIDResponseAminoMsg + ): SyntheticLockupByLockupIDResponse { + return SyntheticLockupByLockupIDResponse.fromAmino(object.value); + }, + toAminoMsg( + message: SyntheticLockupByLockupIDResponse + ): SyntheticLockupByLockupIDResponseAminoMsg { + return { + type: 'osmosis/lockup/synthetic-lockup-by-lockup-id-response', + value: SyntheticLockupByLockupIDResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: SyntheticLockupByLockupIDResponseProtoMsg + ): SyntheticLockupByLockupIDResponse { + return SyntheticLockupByLockupIDResponse.decode(message.value); + }, + toProto(message: SyntheticLockupByLockupIDResponse): Uint8Array { + return SyntheticLockupByLockupIDResponse.encode(message).finish(); + }, + toProtoMsg( + message: SyntheticLockupByLockupIDResponse + ): SyntheticLockupByLockupIDResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.SyntheticLockupByLockupIDResponse', + value: SyntheticLockupByLockupIDResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SyntheticLockupByLockupIDResponse.typeUrl, + SyntheticLockupByLockupIDResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SyntheticLockupByLockupIDResponse.aminoType, + SyntheticLockupByLockupIDResponse.typeUrl +); +function createBaseAccountLockedLongerDurationRequest(): AccountLockedLongerDurationRequest { + return { + owner: '', + duration: Duration.fromPartial({}), + }; +} +export const AccountLockedLongerDurationRequest = { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationRequest', + aminoType: 'osmosis/lockup/account-locked-longer-duration-request', + is(o: any): o is AccountLockedLongerDurationRequest { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationRequest.typeUrl || + (typeof o.owner === 'string' && Duration.is(o.duration))) + ); + }, + isSDK(o: any): o is AccountLockedLongerDurationRequestSDKType { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationRequest.typeUrl || + (typeof o.owner === 'string' && Duration.isSDK(o.duration))) + ); + }, + isAmino(o: any): o is AccountLockedLongerDurationRequestAmino { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationRequest.typeUrl || + (typeof o.owner === 'string' && Duration.isAmino(o.duration))) + ); + }, + encode( + message: AccountLockedLongerDurationRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedLongerDurationRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedLongerDurationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedLongerDurationRequest { + const message = createBaseAccountLockedLongerDurationRequest(); + message.owner = object.owner ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, + fromAmino( + object: AccountLockedLongerDurationRequestAmino + ): AccountLockedLongerDurationRequest { + const message = createBaseAccountLockedLongerDurationRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino( + message: AccountLockedLongerDurationRequest + ): AccountLockedLongerDurationRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + return obj; + }, + fromAminoMsg( + object: AccountLockedLongerDurationRequestAminoMsg + ): AccountLockedLongerDurationRequest { + return AccountLockedLongerDurationRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedLongerDurationRequest + ): AccountLockedLongerDurationRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-longer-duration-request', + value: AccountLockedLongerDurationRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedLongerDurationRequestProtoMsg + ): AccountLockedLongerDurationRequest { + return AccountLockedLongerDurationRequest.decode(message.value); + }, + toProto(message: AccountLockedLongerDurationRequest): Uint8Array { + return AccountLockedLongerDurationRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedLongerDurationRequest + ): AccountLockedLongerDurationRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationRequest', + value: AccountLockedLongerDurationRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedLongerDurationRequest.typeUrl, + AccountLockedLongerDurationRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedLongerDurationRequest.aminoType, + AccountLockedLongerDurationRequest.typeUrl +); +function createBaseAccountLockedLongerDurationResponse(): AccountLockedLongerDurationResponse { + return { + locks: [], + }; +} +export const AccountLockedLongerDurationResponse = { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationResponse', + aminoType: 'osmosis/lockup/account-locked-longer-duration-response', + is(o: any): o is AccountLockedLongerDurationResponse { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK(o: any): o is AccountLockedLongerDurationResponseSDKType { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino(o: any): o is AccountLockedLongerDurationResponseAmino { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountLockedLongerDurationResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedLongerDurationResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedLongerDurationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedLongerDurationResponse { + const message = createBaseAccountLockedLongerDurationResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedLongerDurationResponseAmino + ): AccountLockedLongerDurationResponse { + const message = createBaseAccountLockedLongerDurationResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedLongerDurationResponse + ): AccountLockedLongerDurationResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedLongerDurationResponseAminoMsg + ): AccountLockedLongerDurationResponse { + return AccountLockedLongerDurationResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedLongerDurationResponse + ): AccountLockedLongerDurationResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-longer-duration-response', + value: AccountLockedLongerDurationResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedLongerDurationResponseProtoMsg + ): AccountLockedLongerDurationResponse { + return AccountLockedLongerDurationResponse.decode(message.value); + }, + toProto(message: AccountLockedLongerDurationResponse): Uint8Array { + return AccountLockedLongerDurationResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedLongerDurationResponse + ): AccountLockedLongerDurationResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationResponse', + value: AccountLockedLongerDurationResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedLongerDurationResponse.typeUrl, + AccountLockedLongerDurationResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedLongerDurationResponse.aminoType, + AccountLockedLongerDurationResponse.typeUrl +); +function createBaseAccountLockedDurationRequest(): AccountLockedDurationRequest { + return { + owner: '', + duration: Duration.fromPartial({}), + }; +} +export const AccountLockedDurationRequest = { + typeUrl: '/osmosis.lockup.AccountLockedDurationRequest', + aminoType: 'osmosis/lockup/account-locked-duration-request', + is(o: any): o is AccountLockedDurationRequest { + return ( + o && + (o.$typeUrl === AccountLockedDurationRequest.typeUrl || + (typeof o.owner === 'string' && Duration.is(o.duration))) + ); + }, + isSDK(o: any): o is AccountLockedDurationRequestSDKType { + return ( + o && + (o.$typeUrl === AccountLockedDurationRequest.typeUrl || + (typeof o.owner === 'string' && Duration.isSDK(o.duration))) + ); + }, + isAmino(o: any): o is AccountLockedDurationRequestAmino { + return ( + o && + (o.$typeUrl === AccountLockedDurationRequest.typeUrl || + (typeof o.owner === 'string' && Duration.isAmino(o.duration))) + ); + }, + encode( + message: AccountLockedDurationRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedDurationRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedDurationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedDurationRequest { + const message = createBaseAccountLockedDurationRequest(); + message.owner = object.owner ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, + fromAmino( + object: AccountLockedDurationRequestAmino + ): AccountLockedDurationRequest { + const message = createBaseAccountLockedDurationRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino( + message: AccountLockedDurationRequest + ): AccountLockedDurationRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + return obj; + }, + fromAminoMsg( + object: AccountLockedDurationRequestAminoMsg + ): AccountLockedDurationRequest { + return AccountLockedDurationRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedDurationRequest + ): AccountLockedDurationRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-duration-request', + value: AccountLockedDurationRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedDurationRequestProtoMsg + ): AccountLockedDurationRequest { + return AccountLockedDurationRequest.decode(message.value); + }, + toProto(message: AccountLockedDurationRequest): Uint8Array { + return AccountLockedDurationRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedDurationRequest + ): AccountLockedDurationRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedDurationRequest', + value: AccountLockedDurationRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedDurationRequest.typeUrl, + AccountLockedDurationRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedDurationRequest.aminoType, + AccountLockedDurationRequest.typeUrl +); +function createBaseAccountLockedDurationResponse(): AccountLockedDurationResponse { + return { + locks: [], + }; +} +export const AccountLockedDurationResponse = { + typeUrl: '/osmosis.lockup.AccountLockedDurationResponse', + aminoType: 'osmosis/lockup/account-locked-duration-response', + is(o: any): o is AccountLockedDurationResponse { + return ( + o && + (o.$typeUrl === AccountLockedDurationResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK(o: any): o is AccountLockedDurationResponseSDKType { + return ( + o && + (o.$typeUrl === AccountLockedDurationResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino(o: any): o is AccountLockedDurationResponseAmino { + return ( + o && + (o.$typeUrl === AccountLockedDurationResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountLockedDurationResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedDurationResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedDurationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedDurationResponse { + const message = createBaseAccountLockedDurationResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedDurationResponseAmino + ): AccountLockedDurationResponse { + const message = createBaseAccountLockedDurationResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedDurationResponse + ): AccountLockedDurationResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedDurationResponseAminoMsg + ): AccountLockedDurationResponse { + return AccountLockedDurationResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedDurationResponse + ): AccountLockedDurationResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-duration-response', + value: AccountLockedDurationResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedDurationResponseProtoMsg + ): AccountLockedDurationResponse { + return AccountLockedDurationResponse.decode(message.value); + }, + toProto(message: AccountLockedDurationResponse): Uint8Array { + return AccountLockedDurationResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedDurationResponse + ): AccountLockedDurationResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedDurationResponse', + value: AccountLockedDurationResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedDurationResponse.typeUrl, + AccountLockedDurationResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedDurationResponse.aminoType, + AccountLockedDurationResponse.typeUrl +); +function createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(): AccountLockedLongerDurationNotUnlockingOnlyRequest { + return { + owner: '', + duration: Duration.fromPartial({}), + }; +} +export const AccountLockedLongerDurationNotUnlockingOnlyRequest = { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyRequest', + aminoType: + 'osmosis/lockup/account-locked-longer-duration-not-unlocking-only-request', + is(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyRequest { + return ( + o && + (o.$typeUrl === + AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl || + (typeof o.owner === 'string' && Duration.is(o.duration))) + ); + }, + isSDK( + o: any + ): o is AccountLockedLongerDurationNotUnlockingOnlyRequestSDKType { + return ( + o && + (o.$typeUrl === + AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl || + (typeof o.owner === 'string' && Duration.isSDK(o.duration))) + ); + }, + isAmino( + o: any + ): o is AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { + return ( + o && + (o.$typeUrl === + AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl || + (typeof o.owner === 'string' && Duration.isAmino(o.duration))) + ); + }, + encode( + message: AccountLockedLongerDurationNotUnlockingOnlyRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedLongerDurationNotUnlockingOnlyRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = + createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedLongerDurationNotUnlockingOnlyRequest { + const message = + createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(); + message.owner = object.owner ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, + fromAmino( + object: AccountLockedLongerDurationNotUnlockingOnlyRequestAmino + ): AccountLockedLongerDurationNotUnlockingOnlyRequest { + const message = + createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino( + message: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + return obj; + }, + fromAminoMsg( + object: AccountLockedLongerDurationNotUnlockingOnlyRequestAminoMsg + ): AccountLockedLongerDurationNotUnlockingOnlyRequest { + return AccountLockedLongerDurationNotUnlockingOnlyRequest.fromAmino( + object.value + ); + }, + toAminoMsg( + message: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): AccountLockedLongerDurationNotUnlockingOnlyRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-longer-duration-not-unlocking-only-request', + value: + AccountLockedLongerDurationNotUnlockingOnlyRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedLongerDurationNotUnlockingOnlyRequestProtoMsg + ): AccountLockedLongerDurationNotUnlockingOnlyRequest { + return AccountLockedLongerDurationNotUnlockingOnlyRequest.decode( + message.value + ); + }, + toProto( + message: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): Uint8Array { + return AccountLockedLongerDurationNotUnlockingOnlyRequest.encode( + message + ).finish(); + }, + toProtoMsg( + message: AccountLockedLongerDurationNotUnlockingOnlyRequest + ): AccountLockedLongerDurationNotUnlockingOnlyRequestProtoMsg { + return { + typeUrl: + '/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyRequest', + value: + AccountLockedLongerDurationNotUnlockingOnlyRequest.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl, + AccountLockedLongerDurationNotUnlockingOnlyRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedLongerDurationNotUnlockingOnlyRequest.aminoType, + AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl +); +function createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(): AccountLockedLongerDurationNotUnlockingOnlyResponse { + return { + locks: [], + }; +} +export const AccountLockedLongerDurationNotUnlockingOnlyResponse = { + typeUrl: + '/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyResponse', + aminoType: + 'osmosis/lockup/account-locked-longer-duration-not-unlocking-only-response', + is(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyResponse { + return ( + o && + (o.$typeUrl === + AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK( + o: any + ): o is AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType { + return ( + o && + (o.$typeUrl === + AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino( + o: any + ): o is AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { + return ( + o && + (o.$typeUrl === + AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountLockedLongerDurationNotUnlockingOnlyResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedLongerDurationNotUnlockingOnlyResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = + createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedLongerDurationNotUnlockingOnlyResponse { + const message = + createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedLongerDurationNotUnlockingOnlyResponseAmino + ): AccountLockedLongerDurationNotUnlockingOnlyResponse { + const message = + createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedLongerDurationNotUnlockingOnlyResponse + ): AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedLongerDurationNotUnlockingOnlyResponseAminoMsg + ): AccountLockedLongerDurationNotUnlockingOnlyResponse { + return AccountLockedLongerDurationNotUnlockingOnlyResponse.fromAmino( + object.value + ); + }, + toAminoMsg( + message: AccountLockedLongerDurationNotUnlockingOnlyResponse + ): AccountLockedLongerDurationNotUnlockingOnlyResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-longer-duration-not-unlocking-only-response', + value: + AccountLockedLongerDurationNotUnlockingOnlyResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedLongerDurationNotUnlockingOnlyResponseProtoMsg + ): AccountLockedLongerDurationNotUnlockingOnlyResponse { + return AccountLockedLongerDurationNotUnlockingOnlyResponse.decode( + message.value + ); + }, + toProto( + message: AccountLockedLongerDurationNotUnlockingOnlyResponse + ): Uint8Array { + return AccountLockedLongerDurationNotUnlockingOnlyResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: AccountLockedLongerDurationNotUnlockingOnlyResponse + ): AccountLockedLongerDurationNotUnlockingOnlyResponseProtoMsg { + return { + typeUrl: + '/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyResponse', + value: + AccountLockedLongerDurationNotUnlockingOnlyResponse.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl, + AccountLockedLongerDurationNotUnlockingOnlyResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedLongerDurationNotUnlockingOnlyResponse.aminoType, + AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl +); +function createBaseAccountLockedLongerDurationDenomRequest(): AccountLockedLongerDurationDenomRequest { + return { + owner: '', + duration: Duration.fromPartial({}), + denom: '', + }; +} +export const AccountLockedLongerDurationDenomRequest = { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationDenomRequest', + aminoType: 'osmosis/lockup/account-locked-longer-duration-denom-request', + is(o: any): o is AccountLockedLongerDurationDenomRequest { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationDenomRequest.typeUrl || + (typeof o.owner === 'string' && + Duration.is(o.duration) && + typeof o.denom === 'string')) + ); + }, + isSDK(o: any): o is AccountLockedLongerDurationDenomRequestSDKType { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationDenomRequest.typeUrl || + (typeof o.owner === 'string' && + Duration.isSDK(o.duration) && + typeof o.denom === 'string')) + ); + }, + isAmino(o: any): o is AccountLockedLongerDurationDenomRequestAmino { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationDenomRequest.typeUrl || + (typeof o.owner === 'string' && + Duration.isAmino(o.duration) && + typeof o.denom === 'string')) + ); + }, + encode( + message: AccountLockedLongerDurationDenomRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + if (message.denom !== '') { + writer.uint32(26).string(message.denom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedLongerDurationDenomRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedLongerDurationDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedLongerDurationDenomRequest { + const message = createBaseAccountLockedLongerDurationDenomRequest(); + message.owner = object.owner ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.denom = object.denom ?? ''; + return message; + }, + fromAmino( + object: AccountLockedLongerDurationDenomRequestAmino + ): AccountLockedLongerDurationDenomRequest { + const message = createBaseAccountLockedLongerDurationDenomRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino( + message: AccountLockedLongerDurationDenomRequest + ): AccountLockedLongerDurationDenomRequestAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + obj.denom = message.denom === '' ? undefined : message.denom; + return obj; + }, + fromAminoMsg( + object: AccountLockedLongerDurationDenomRequestAminoMsg + ): AccountLockedLongerDurationDenomRequest { + return AccountLockedLongerDurationDenomRequest.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedLongerDurationDenomRequest + ): AccountLockedLongerDurationDenomRequestAminoMsg { + return { + type: 'osmosis/lockup/account-locked-longer-duration-denom-request', + value: AccountLockedLongerDurationDenomRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedLongerDurationDenomRequestProtoMsg + ): AccountLockedLongerDurationDenomRequest { + return AccountLockedLongerDurationDenomRequest.decode(message.value); + }, + toProto(message: AccountLockedLongerDurationDenomRequest): Uint8Array { + return AccountLockedLongerDurationDenomRequest.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedLongerDurationDenomRequest + ): AccountLockedLongerDurationDenomRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationDenomRequest', + value: AccountLockedLongerDurationDenomRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedLongerDurationDenomRequest.typeUrl, + AccountLockedLongerDurationDenomRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedLongerDurationDenomRequest.aminoType, + AccountLockedLongerDurationDenomRequest.typeUrl +); +function createBaseAccountLockedLongerDurationDenomResponse(): AccountLockedLongerDurationDenomResponse { + return { + locks: [], + }; +} +export const AccountLockedLongerDurationDenomResponse = { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationDenomResponse', + aminoType: 'osmosis/lockup/account-locked-longer-duration-denom-response', + is(o: any): o is AccountLockedLongerDurationDenomResponse { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationDenomResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.is(o.locks[0])))) + ); + }, + isSDK(o: any): o is AccountLockedLongerDurationDenomResponseSDKType { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationDenomResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isSDK(o.locks[0])))) + ); + }, + isAmino(o: any): o is AccountLockedLongerDurationDenomResponseAmino { + return ( + o && + (o.$typeUrl === AccountLockedLongerDurationDenomResponse.typeUrl || + (Array.isArray(o.locks) && + (!o.locks.length || PeriodLock.isAmino(o.locks[0])))) + ); + }, + encode( + message: AccountLockedLongerDurationDenomResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountLockedLongerDurationDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedLongerDurationDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AccountLockedLongerDurationDenomResponse { + const message = createBaseAccountLockedLongerDurationDenomResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: AccountLockedLongerDurationDenomResponseAmino + ): AccountLockedLongerDurationDenomResponse { + const message = createBaseAccountLockedLongerDurationDenomResponse(); + message.locks = object.locks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: AccountLockedLongerDurationDenomResponse + ): AccountLockedLongerDurationDenomResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.locks = message.locks; + } + return obj; + }, + fromAminoMsg( + object: AccountLockedLongerDurationDenomResponseAminoMsg + ): AccountLockedLongerDurationDenomResponse { + return AccountLockedLongerDurationDenomResponse.fromAmino(object.value); + }, + toAminoMsg( + message: AccountLockedLongerDurationDenomResponse + ): AccountLockedLongerDurationDenomResponseAminoMsg { + return { + type: 'osmosis/lockup/account-locked-longer-duration-denom-response', + value: AccountLockedLongerDurationDenomResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: AccountLockedLongerDurationDenomResponseProtoMsg + ): AccountLockedLongerDurationDenomResponse { + return AccountLockedLongerDurationDenomResponse.decode(message.value); + }, + toProto(message: AccountLockedLongerDurationDenomResponse): Uint8Array { + return AccountLockedLongerDurationDenomResponse.encode(message).finish(); + }, + toProtoMsg( + message: AccountLockedLongerDurationDenomResponse + ): AccountLockedLongerDurationDenomResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.AccountLockedLongerDurationDenomResponse', + value: AccountLockedLongerDurationDenomResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountLockedLongerDurationDenomResponse.typeUrl, + AccountLockedLongerDurationDenomResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountLockedLongerDurationDenomResponse.aminoType, + AccountLockedLongerDurationDenomResponse.typeUrl +); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: '/osmosis.lockup.QueryParamsRequest', + aminoType: 'osmosis/lockup/query-params-request', + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + encode( + _: QueryParamsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: 'osmosis/lockup/query-params-request', + value: QueryParamsRequest.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: '/osmosis.lockup.QueryParamsRequest', + value: QueryParamsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsRequest.aminoType, + QueryParamsRequest.typeUrl +); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}), + }; +} +export const QueryParamsResponse = { + typeUrl: '/osmosis.lockup.QueryParamsResponse', + aminoType: 'osmosis/lockup/query-params-response', + is(o: any): o is QueryParamsResponse { + return ( + o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)) + ); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)) + ); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)) + ); + }, + encode( + message: QueryParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: 'osmosis/lockup/query-params-response', + value: QueryParamsResponse.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.QueryParamsResponse', + value: QueryParamsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryParamsResponse.typeUrl, + QueryParamsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsResponse.aminoType, + QueryParamsResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/lockup/tx.amino.ts new file mode 100644 index 00000000..17a65bdb --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/tx.amino.ts @@ -0,0 +1,41 @@ +//@ts-nocheck +import { + MsgLockTokens, + MsgBeginUnlockingAll, + MsgBeginUnlocking, + MsgExtendLockup, + MsgForceUnlock, + MsgSetRewardReceiverAddress, +} from './tx'; +export const AminoConverter = { + '/osmosis.lockup.MsgLockTokens': { + aminoType: 'osmosis/lockup/lock-tokens', + toAmino: MsgLockTokens.toAmino, + fromAmino: MsgLockTokens.fromAmino, + }, + '/osmosis.lockup.MsgBeginUnlockingAll': { + aminoType: 'osmosis/lockup/begin-unlock-tokens', + toAmino: MsgBeginUnlockingAll.toAmino, + fromAmino: MsgBeginUnlockingAll.fromAmino, + }, + '/osmosis.lockup.MsgBeginUnlocking': { + aminoType: 'osmosis/lockup/begin-unlock-period-lock', + toAmino: MsgBeginUnlocking.toAmino, + fromAmino: MsgBeginUnlocking.fromAmino, + }, + '/osmosis.lockup.MsgExtendLockup': { + aminoType: 'osmosis/lockup/extend-lockup', + toAmino: MsgExtendLockup.toAmino, + fromAmino: MsgExtendLockup.fromAmino, + }, + '/osmosis.lockup.MsgForceUnlock': { + aminoType: 'osmosis/lockup/force-unlock-tokens', + toAmino: MsgForceUnlock.toAmino, + fromAmino: MsgForceUnlock.fromAmino, + }, + '/osmosis.lockup.MsgSetRewardReceiverAddress': { + aminoType: 'osmosis/lockup/set-reward-receiver-address', + toAmino: MsgSetRewardReceiverAddress.toAmino, + fromAmino: MsgSetRewardReceiverAddress.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/lockup/tx.registry.ts new file mode 100644 index 00000000..2cc18d4e --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/tx.registry.ts @@ -0,0 +1,140 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgLockTokens, + MsgBeginUnlockingAll, + MsgBeginUnlocking, + MsgExtendLockup, + MsgForceUnlock, + MsgSetRewardReceiverAddress, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.lockup.MsgLockTokens', MsgLockTokens], + ['/osmosis.lockup.MsgBeginUnlockingAll', MsgBeginUnlockingAll], + ['/osmosis.lockup.MsgBeginUnlocking', MsgBeginUnlocking], + ['/osmosis.lockup.MsgExtendLockup', MsgExtendLockup], + ['/osmosis.lockup.MsgForceUnlock', MsgForceUnlock], + ['/osmosis.lockup.MsgSetRewardReceiverAddress', MsgSetRewardReceiverAddress], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + lockTokens(value: MsgLockTokens) { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value: MsgLockTokens.encode(value).finish(), + }; + }, + beginUnlockingAll(value: MsgBeginUnlockingAll) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value: MsgBeginUnlockingAll.encode(value).finish(), + }; + }, + beginUnlocking(value: MsgBeginUnlocking) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value: MsgBeginUnlocking.encode(value).finish(), + }; + }, + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value: MsgExtendLockup.encode(value).finish(), + }; + }, + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value: MsgForceUnlock.encode(value).finish(), + }; + }, + setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value: MsgSetRewardReceiverAddress.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + lockTokens(value: MsgLockTokens) { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value, + }; + }, + beginUnlockingAll(value: MsgBeginUnlockingAll) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value, + }; + }, + beginUnlocking(value: MsgBeginUnlocking) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value, + }; + }, + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value, + }; + }, + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value, + }; + }, + setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value, + }; + }, + }, + fromPartial: { + lockTokens(value: MsgLockTokens) { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value: MsgLockTokens.fromPartial(value), + }; + }, + beginUnlockingAll(value: MsgBeginUnlockingAll) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value: MsgBeginUnlockingAll.fromPartial(value), + }; + }, + beginUnlocking(value: MsgBeginUnlocking) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value: MsgBeginUnlocking.fromPartial(value), + }; + }, + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value: MsgExtendLockup.fromPartial(value), + }; + }, + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value: MsgForceUnlock.fromPartial(value), + }; + }, + setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value: MsgSetRewardReceiverAddress.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/lockup/tx.rpc.msg.ts new file mode 100644 index 00000000..c384128e --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/tx.rpc.msg.ts @@ -0,0 +1,117 @@ +//@ts-nocheck +import { Rpc } from '../../helpers'; +import { BinaryReader } from '../../binary'; + +import { + MsgLockTokens, + MsgLockTokensResponse, + MsgBeginUnlockingAll, + MsgBeginUnlockingAllResponse, + MsgBeginUnlocking, + MsgBeginUnlockingResponse, + MsgExtendLockup, + MsgExtendLockupResponse, + MsgForceUnlock, + MsgForceUnlockResponse, + MsgSetRewardReceiverAddress, + MsgSetRewardReceiverAddressResponse, +} from './tx'; +/** Msg defines the Msg service. */ +export interface Msg { + /** LockTokens lock tokens */ + lockTokens(request: MsgLockTokens): Promise; + /** BeginUnlockingAll begin unlocking all tokens */ + beginUnlockingAll( + request: MsgBeginUnlockingAll + ): Promise; + /** MsgBeginUnlocking begins unlocking tokens by lock ID */ + beginUnlocking( + request: MsgBeginUnlocking + ): Promise; + /** MsgEditLockup edits the existing lockups by lock ID */ + extendLockup(request: MsgExtendLockup): Promise; + forceUnlock(request: MsgForceUnlock): Promise; + /** SetRewardReceiverAddress edits the reward receiver for the given lock ID */ + setRewardReceiverAddress( + request: MsgSetRewardReceiverAddress + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.lockTokens = this.lockTokens.bind(this); + this.beginUnlockingAll = this.beginUnlockingAll.bind(this); + this.beginUnlocking = this.beginUnlocking.bind(this); + this.extendLockup = this.extendLockup.bind(this); + this.forceUnlock = this.forceUnlock.bind(this); + this.setRewardReceiverAddress = this.setRewardReceiverAddress.bind(this); + } + lockTokens(request: MsgLockTokens): Promise { + const data = MsgLockTokens.encode(request).finish(); + const promise = this.rpc.request('osmosis.lockup.Msg', 'LockTokens', data); + return promise.then((data) => + MsgLockTokensResponse.decode(new BinaryReader(data)) + ); + } + beginUnlockingAll( + request: MsgBeginUnlockingAll + ): Promise { + const data = MsgBeginUnlockingAll.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Msg', + 'BeginUnlockingAll', + data + ); + return promise.then((data) => + MsgBeginUnlockingAllResponse.decode(new BinaryReader(data)) + ); + } + beginUnlocking( + request: MsgBeginUnlocking + ): Promise { + const data = MsgBeginUnlocking.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Msg', + 'BeginUnlocking', + data + ); + return promise.then((data) => + MsgBeginUnlockingResponse.decode(new BinaryReader(data)) + ); + } + extendLockup(request: MsgExtendLockup): Promise { + const data = MsgExtendLockup.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Msg', + 'ExtendLockup', + data + ); + return promise.then((data) => + MsgExtendLockupResponse.decode(new BinaryReader(data)) + ); + } + forceUnlock(request: MsgForceUnlock): Promise { + const data = MsgForceUnlock.encode(request).finish(); + const promise = this.rpc.request('osmosis.lockup.Msg', 'ForceUnlock', data); + return promise.then((data) => + MsgForceUnlockResponse.decode(new BinaryReader(data)) + ); + } + setRewardReceiverAddress( + request: MsgSetRewardReceiverAddress + ): Promise { + const data = MsgSetRewardReceiverAddress.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.lockup.Msg', + 'SetRewardReceiverAddress', + data + ); + return promise.then((data) => + MsgSetRewardReceiverAddressResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/lockup/tx.ts b/packages/cosmos/src/proto_export/osmosis/lockup/tx.ts new file mode 100644 index 00000000..35714e11 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/lockup/tx.ts @@ -0,0 +1,1820 @@ +//@ts-nocheck +import { + Duration, + DurationAmino, + DurationSDKType, +} from '../../google/protobuf/duration'; +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; + +import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from './lock'; +export interface MsgLockTokens { + owner: string; + duration: Duration; + coins: Coin[]; +} +export interface MsgLockTokensProtoMsg { + typeUrl: '/osmosis.lockup.MsgLockTokens'; + value: Uint8Array; +} +export interface MsgLockTokensAmino { + owner?: string; + duration?: DurationAmino; + coins?: CoinAmino[]; +} +export interface MsgLockTokensAminoMsg { + type: 'osmosis/lockup/lock-tokens'; + value: MsgLockTokensAmino; +} +export interface MsgLockTokensSDKType { + owner: string; + duration: DurationSDKType; + coins: CoinSDKType[]; +} +export interface MsgLockTokensResponse { + ID: bigint; +} +export interface MsgLockTokensResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgLockTokensResponse'; + value: Uint8Array; +} +export interface MsgLockTokensResponseAmino { + ID?: string; +} +export interface MsgLockTokensResponseAminoMsg { + type: 'osmosis/lockup/lock-tokens-response'; + value: MsgLockTokensResponseAmino; +} +export interface MsgLockTokensResponseSDKType { + ID: bigint; +} +export interface MsgBeginUnlockingAll { + owner: string; +} +export interface MsgBeginUnlockingAllProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll'; + value: Uint8Array; +} +export interface MsgBeginUnlockingAllAmino { + owner?: string; +} +export interface MsgBeginUnlockingAllAminoMsg { + type: 'osmosis/lockup/begin-unlock-tokens'; + value: MsgBeginUnlockingAllAmino; +} +export interface MsgBeginUnlockingAllSDKType { + owner: string; +} +export interface MsgBeginUnlockingAllResponse { + unlocks: PeriodLock[]; +} +export interface MsgBeginUnlockingAllResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAllResponse'; + value: Uint8Array; +} +export interface MsgBeginUnlockingAllResponseAmino { + unlocks?: PeriodLockAmino[]; +} +export interface MsgBeginUnlockingAllResponseAminoMsg { + type: 'osmosis/lockup/begin-unlocking-all-response'; + value: MsgBeginUnlockingAllResponseAmino; +} +export interface MsgBeginUnlockingAllResponseSDKType { + unlocks: PeriodLockSDKType[]; +} +export interface MsgBeginUnlocking { + owner: string; + ID: bigint; + /** Amount of unlocking coins. Unlock all if not set. */ + coins: Coin[]; +} +export interface MsgBeginUnlockingProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking'; + value: Uint8Array; +} +export interface MsgBeginUnlockingAmino { + owner?: string; + ID?: string; + /** Amount of unlocking coins. Unlock all if not set. */ + coins?: CoinAmino[]; +} +export interface MsgBeginUnlockingAminoMsg { + type: 'osmosis/lockup/begin-unlock-period-lock'; + value: MsgBeginUnlockingAmino; +} +export interface MsgBeginUnlockingSDKType { + owner: string; + ID: bigint; + coins: CoinSDKType[]; +} +export interface MsgBeginUnlockingResponse { + success: boolean; + unlockingLockID: bigint; +} +export interface MsgBeginUnlockingResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingResponse'; + value: Uint8Array; +} +export interface MsgBeginUnlockingResponseAmino { + success?: boolean; + unlockingLockID?: string; +} +export interface MsgBeginUnlockingResponseAminoMsg { + type: 'osmosis/lockup/begin-unlocking-response'; + value: MsgBeginUnlockingResponseAmino; +} +export interface MsgBeginUnlockingResponseSDKType { + success: boolean; + unlockingLockID: bigint; +} +/** + * MsgExtendLockup extends the existing lockup's duration. + * The new duration is longer than the original. + */ +export interface MsgExtendLockup { + owner: string; + ID: bigint; + /** + * duration to be set. fails if lower than the current duration, or is + * unlocking + */ + duration: Duration; +} +export interface MsgExtendLockupProtoMsg { + typeUrl: '/osmosis.lockup.MsgExtendLockup'; + value: Uint8Array; +} +/** + * MsgExtendLockup extends the existing lockup's duration. + * The new duration is longer than the original. + */ +export interface MsgExtendLockupAmino { + owner?: string; + ID?: string; + /** + * duration to be set. fails if lower than the current duration, or is + * unlocking + */ + duration?: DurationAmino; +} +export interface MsgExtendLockupAminoMsg { + type: 'osmosis/lockup/extend-lockup'; + value: MsgExtendLockupAmino; +} +/** + * MsgExtendLockup extends the existing lockup's duration. + * The new duration is longer than the original. + */ +export interface MsgExtendLockupSDKType { + owner: string; + ID: bigint; + duration: DurationSDKType; +} +export interface MsgExtendLockupResponse { + success: boolean; +} +export interface MsgExtendLockupResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgExtendLockupResponse'; + value: Uint8Array; +} +export interface MsgExtendLockupResponseAmino { + success?: boolean; +} +export interface MsgExtendLockupResponseAminoMsg { + type: 'osmosis/lockup/extend-lockup-response'; + value: MsgExtendLockupResponseAmino; +} +export interface MsgExtendLockupResponseSDKType { + success: boolean; +} +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlock { + owner: string; + ID: bigint; + /** Amount of unlocking coins. Unlock all if not set. */ + coins: Coin[]; +} +export interface MsgForceUnlockProtoMsg { + typeUrl: '/osmosis.lockup.MsgForceUnlock'; + value: Uint8Array; +} +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlockAmino { + owner?: string; + ID?: string; + /** Amount of unlocking coins. Unlock all if not set. */ + coins?: CoinAmino[]; +} +export interface MsgForceUnlockAminoMsg { + type: 'osmosis/lockup/force-unlock-tokens'; + value: MsgForceUnlockAmino; +} +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlockSDKType { + owner: string; + ID: bigint; + coins: CoinSDKType[]; +} +export interface MsgForceUnlockResponse { + success: boolean; +} +export interface MsgForceUnlockResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgForceUnlockResponse'; + value: Uint8Array; +} +export interface MsgForceUnlockResponseAmino { + success?: boolean; +} +export interface MsgForceUnlockResponseAminoMsg { + type: 'osmosis/lockup/force-unlock-response'; + value: MsgForceUnlockResponseAmino; +} +export interface MsgForceUnlockResponseSDKType { + success: boolean; +} +export interface MsgSetRewardReceiverAddress { + owner: string; + lockID: bigint; + rewardReceiver: string; +} +export interface MsgSetRewardReceiverAddressProtoMsg { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress'; + value: Uint8Array; +} +export interface MsgSetRewardReceiverAddressAmino { + owner?: string; + lockID?: string; + reward_receiver?: string; +} +export interface MsgSetRewardReceiverAddressAminoMsg { + type: 'osmosis/lockup/set-reward-receiver-address'; + value: MsgSetRewardReceiverAddressAmino; +} +export interface MsgSetRewardReceiverAddressSDKType { + owner: string; + lockID: bigint; + reward_receiver: string; +} +export interface MsgSetRewardReceiverAddressResponse { + success: boolean; +} +export interface MsgSetRewardReceiverAddressResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddressResponse'; + value: Uint8Array; +} +export interface MsgSetRewardReceiverAddressResponseAmino { + success?: boolean; +} +export interface MsgSetRewardReceiverAddressResponseAminoMsg { + type: 'osmosis/lockup/set-reward-receiver-address-response'; + value: MsgSetRewardReceiverAddressResponseAmino; +} +export interface MsgSetRewardReceiverAddressResponseSDKType { + success: boolean; +} +function createBaseMsgLockTokens(): MsgLockTokens { + return { + owner: '', + duration: Duration.fromPartial({}), + coins: [], + }; +} +export const MsgLockTokens = { + typeUrl: '/osmosis.lockup.MsgLockTokens', + aminoType: 'osmosis/lockup/lock-tokens', + is(o: any): o is MsgLockTokens { + return ( + o && + (o.$typeUrl === MsgLockTokens.typeUrl || + (typeof o.owner === 'string' && + Duration.is(o.duration) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is MsgLockTokensSDKType { + return ( + o && + (o.$typeUrl === MsgLockTokens.typeUrl || + (typeof o.owner === 'string' && + Duration.isSDK(o.duration) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is MsgLockTokensAmino { + return ( + o && + (o.$typeUrl === MsgLockTokens.typeUrl || + (typeof o.owner === 'string' && + Duration.isAmino(o.duration) && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: MsgLockTokens, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLockTokens { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLockTokens(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLockTokens { + const message = createBaseMsgLockTokens(); + message.owner = object.owner ?? ''; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgLockTokensAmino): MsgLockTokens { + const message = createBaseMsgLockTokens(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgLockTokens): MsgLockTokensAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: MsgLockTokensAminoMsg): MsgLockTokens { + return MsgLockTokens.fromAmino(object.value); + }, + toAminoMsg(message: MsgLockTokens): MsgLockTokensAminoMsg { + return { + type: 'osmosis/lockup/lock-tokens', + value: MsgLockTokens.toAmino(message), + }; + }, + fromProtoMsg(message: MsgLockTokensProtoMsg): MsgLockTokens { + return MsgLockTokens.decode(message.value); + }, + toProto(message: MsgLockTokens): Uint8Array { + return MsgLockTokens.encode(message).finish(); + }, + toProtoMsg(message: MsgLockTokens): MsgLockTokensProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value: MsgLockTokens.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgLockTokens.typeUrl, MsgLockTokens); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockTokens.aminoType, + MsgLockTokens.typeUrl +); +function createBaseMsgLockTokensResponse(): MsgLockTokensResponse { + return { + ID: BigInt(0), + }; +} +export const MsgLockTokensResponse = { + typeUrl: '/osmosis.lockup.MsgLockTokensResponse', + aminoType: 'osmosis/lockup/lock-tokens-response', + is(o: any): o is MsgLockTokensResponse { + return ( + o && + (o.$typeUrl === MsgLockTokensResponse.typeUrl || typeof o.ID === 'bigint') + ); + }, + isSDK(o: any): o is MsgLockTokensResponseSDKType { + return ( + o && + (o.$typeUrl === MsgLockTokensResponse.typeUrl || typeof o.ID === 'bigint') + ); + }, + isAmino(o: any): o is MsgLockTokensResponseAmino { + return ( + o && + (o.$typeUrl === MsgLockTokensResponse.typeUrl || typeof o.ID === 'bigint') + ); + }, + encode( + message: MsgLockTokensResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.ID !== BigInt(0)) { + writer.uint32(8).uint64(message.ID); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgLockTokensResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLockTokensResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLockTokensResponse { + const message = createBaseMsgLockTokensResponse(); + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgLockTokensResponseAmino): MsgLockTokensResponse { + const message = createBaseMsgLockTokensResponse(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + return message; + }, + toAmino(message: MsgLockTokensResponse): MsgLockTokensResponseAmino { + const obj: any = {}; + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgLockTokensResponseAminoMsg): MsgLockTokensResponse { + return MsgLockTokensResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgLockTokensResponse): MsgLockTokensResponseAminoMsg { + return { + type: 'osmosis/lockup/lock-tokens-response', + value: MsgLockTokensResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgLockTokensResponseProtoMsg): MsgLockTokensResponse { + return MsgLockTokensResponse.decode(message.value); + }, + toProto(message: MsgLockTokensResponse): Uint8Array { + return MsgLockTokensResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLockTokensResponse): MsgLockTokensResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgLockTokensResponse', + value: MsgLockTokensResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgLockTokensResponse.typeUrl, + MsgLockTokensResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockTokensResponse.aminoType, + MsgLockTokensResponse.typeUrl +); +function createBaseMsgBeginUnlockingAll(): MsgBeginUnlockingAll { + return { + owner: '', + }; +} +export const MsgBeginUnlockingAll = { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + aminoType: 'osmosis/lockup/begin-unlock-tokens', + is(o: any): o is MsgBeginUnlockingAll { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingAll.typeUrl || + typeof o.owner === 'string') + ); + }, + isSDK(o: any): o is MsgBeginUnlockingAllSDKType { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingAll.typeUrl || + typeof o.owner === 'string') + ); + }, + isAmino(o: any): o is MsgBeginUnlockingAllAmino { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingAll.typeUrl || + typeof o.owner === 'string') + ); + }, + encode( + message: MsgBeginUnlockingAll, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginUnlockingAll { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginUnlockingAll(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBeginUnlockingAll { + const message = createBaseMsgBeginUnlockingAll(); + message.owner = object.owner ?? ''; + return message; + }, + fromAmino(object: MsgBeginUnlockingAllAmino): MsgBeginUnlockingAll { + const message = createBaseMsgBeginUnlockingAll(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + return obj; + }, + fromAminoMsg(object: MsgBeginUnlockingAllAminoMsg): MsgBeginUnlockingAll { + return MsgBeginUnlockingAll.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllAminoMsg { + return { + type: 'osmosis/lockup/begin-unlock-tokens', + value: MsgBeginUnlockingAll.toAmino(message), + }; + }, + fromProtoMsg(message: MsgBeginUnlockingAllProtoMsg): MsgBeginUnlockingAll { + return MsgBeginUnlockingAll.decode(message.value); + }, + toProto(message: MsgBeginUnlockingAll): Uint8Array { + return MsgBeginUnlockingAll.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value: MsgBeginUnlockingAll.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgBeginUnlockingAll.typeUrl, + MsgBeginUnlockingAll +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlockingAll.aminoType, + MsgBeginUnlockingAll.typeUrl +); +function createBaseMsgBeginUnlockingAllResponse(): MsgBeginUnlockingAllResponse { + return { + unlocks: [], + }; +} +export const MsgBeginUnlockingAllResponse = { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAllResponse', + aminoType: 'osmosis/lockup/begin-unlocking-all-response', + is(o: any): o is MsgBeginUnlockingAllResponse { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingAllResponse.typeUrl || + (Array.isArray(o.unlocks) && + (!o.unlocks.length || PeriodLock.is(o.unlocks[0])))) + ); + }, + isSDK(o: any): o is MsgBeginUnlockingAllResponseSDKType { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingAllResponse.typeUrl || + (Array.isArray(o.unlocks) && + (!o.unlocks.length || PeriodLock.isSDK(o.unlocks[0])))) + ); + }, + isAmino(o: any): o is MsgBeginUnlockingAllResponseAmino { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingAllResponse.typeUrl || + (Array.isArray(o.unlocks) && + (!o.unlocks.length || PeriodLock.isAmino(o.unlocks[0])))) + ); + }, + encode( + message: MsgBeginUnlockingAllResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.unlocks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginUnlockingAllResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginUnlockingAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unlocks.push(PeriodLock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgBeginUnlockingAllResponse { + const message = createBaseMsgBeginUnlockingAllResponse(); + message.unlocks = + object.unlocks?.map((e) => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: MsgBeginUnlockingAllResponseAmino + ): MsgBeginUnlockingAllResponse { + const message = createBaseMsgBeginUnlockingAllResponse(); + message.unlocks = object.unlocks?.map((e) => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino( + message: MsgBeginUnlockingAllResponse + ): MsgBeginUnlockingAllResponseAmino { + const obj: any = {}; + if (message.unlocks) { + obj.unlocks = message.unlocks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ); + } else { + obj.unlocks = message.unlocks; + } + return obj; + }, + fromAminoMsg( + object: MsgBeginUnlockingAllResponseAminoMsg + ): MsgBeginUnlockingAllResponse { + return MsgBeginUnlockingAllResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgBeginUnlockingAllResponse + ): MsgBeginUnlockingAllResponseAminoMsg { + return { + type: 'osmosis/lockup/begin-unlocking-all-response', + value: MsgBeginUnlockingAllResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgBeginUnlockingAllResponseProtoMsg + ): MsgBeginUnlockingAllResponse { + return MsgBeginUnlockingAllResponse.decode(message.value); + }, + toProto(message: MsgBeginUnlockingAllResponse): Uint8Array { + return MsgBeginUnlockingAllResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgBeginUnlockingAllResponse + ): MsgBeginUnlockingAllResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAllResponse', + value: MsgBeginUnlockingAllResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgBeginUnlockingAllResponse.typeUrl, + MsgBeginUnlockingAllResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlockingAllResponse.aminoType, + MsgBeginUnlockingAllResponse.typeUrl +); +function createBaseMsgBeginUnlocking(): MsgBeginUnlocking { + return { + owner: '', + ID: BigInt(0), + coins: [], + }; +} +export const MsgBeginUnlocking = { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + aminoType: 'osmosis/lockup/begin-unlock-period-lock', + is(o: any): o is MsgBeginUnlocking { + return ( + o && + (o.$typeUrl === MsgBeginUnlocking.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is MsgBeginUnlockingSDKType { + return ( + o && + (o.$typeUrl === MsgBeginUnlocking.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is MsgBeginUnlockingAmino { + return ( + o && + (o.$typeUrl === MsgBeginUnlocking.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: MsgBeginUnlocking, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.ID !== BigInt(0)) { + writer.uint32(16).uint64(message.ID); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginUnlocking { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginUnlocking(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.ID = reader.uint64(); + break; + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBeginUnlocking { + const message = createBaseMsgBeginUnlocking(); + message.owner = object.owner ?? ''; + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBeginUnlockingAmino): MsgBeginUnlocking { + const message = createBaseMsgBeginUnlocking(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBeginUnlocking): MsgBeginUnlockingAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: MsgBeginUnlockingAminoMsg): MsgBeginUnlocking { + return MsgBeginUnlocking.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginUnlocking): MsgBeginUnlockingAminoMsg { + return { + type: 'osmosis/lockup/begin-unlock-period-lock', + value: MsgBeginUnlocking.toAmino(message), + }; + }, + fromProtoMsg(message: MsgBeginUnlockingProtoMsg): MsgBeginUnlocking { + return MsgBeginUnlocking.decode(message.value); + }, + toProto(message: MsgBeginUnlocking): Uint8Array { + return MsgBeginUnlocking.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginUnlocking): MsgBeginUnlockingProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value: MsgBeginUnlocking.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgBeginUnlocking.typeUrl, MsgBeginUnlocking); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlocking.aminoType, + MsgBeginUnlocking.typeUrl +); +function createBaseMsgBeginUnlockingResponse(): MsgBeginUnlockingResponse { + return { + success: false, + unlockingLockID: BigInt(0), + }; +} +export const MsgBeginUnlockingResponse = { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingResponse', + aminoType: 'osmosis/lockup/begin-unlocking-response', + is(o: any): o is MsgBeginUnlockingResponse { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingResponse.typeUrl || + (typeof o.success === 'boolean' && + typeof o.unlockingLockID === 'bigint')) + ); + }, + isSDK(o: any): o is MsgBeginUnlockingResponseSDKType { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingResponse.typeUrl || + (typeof o.success === 'boolean' && + typeof o.unlockingLockID === 'bigint')) + ); + }, + isAmino(o: any): o is MsgBeginUnlockingResponseAmino { + return ( + o && + (o.$typeUrl === MsgBeginUnlockingResponse.typeUrl || + (typeof o.success === 'boolean' && + typeof o.unlockingLockID === 'bigint')) + ); + }, + encode( + message: MsgBeginUnlockingResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + if (message.unlockingLockID !== BigInt(0)) { + writer.uint32(16).uint64(message.unlockingLockID); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginUnlockingResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginUnlockingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + case 2: + message.unlockingLockID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgBeginUnlockingResponse { + const message = createBaseMsgBeginUnlockingResponse(); + message.success = object.success ?? false; + message.unlockingLockID = + object.unlockingLockID !== undefined && object.unlockingLockID !== null + ? BigInt(object.unlockingLockID.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgBeginUnlockingResponseAmino): MsgBeginUnlockingResponse { + const message = createBaseMsgBeginUnlockingResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + if ( + object.unlockingLockID !== undefined && + object.unlockingLockID !== null + ) { + message.unlockingLockID = BigInt(object.unlockingLockID); + } + return message; + }, + toAmino(message: MsgBeginUnlockingResponse): MsgBeginUnlockingResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + obj.unlockingLockID = + message.unlockingLockID !== BigInt(0) + ? message.unlockingLockID.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgBeginUnlockingResponseAminoMsg + ): MsgBeginUnlockingResponse { + return MsgBeginUnlockingResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgBeginUnlockingResponse + ): MsgBeginUnlockingResponseAminoMsg { + return { + type: 'osmosis/lockup/begin-unlocking-response', + value: MsgBeginUnlockingResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgBeginUnlockingResponseProtoMsg + ): MsgBeginUnlockingResponse { + return MsgBeginUnlockingResponse.decode(message.value); + }, + toProto(message: MsgBeginUnlockingResponse): Uint8Array { + return MsgBeginUnlockingResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgBeginUnlockingResponse + ): MsgBeginUnlockingResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingResponse', + value: MsgBeginUnlockingResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgBeginUnlockingResponse.typeUrl, + MsgBeginUnlockingResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlockingResponse.aminoType, + MsgBeginUnlockingResponse.typeUrl +); +function createBaseMsgExtendLockup(): MsgExtendLockup { + return { + owner: '', + ID: BigInt(0), + duration: Duration.fromPartial({}), + }; +} +export const MsgExtendLockup = { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + aminoType: 'osmosis/lockup/extend-lockup', + is(o: any): o is MsgExtendLockup { + return ( + o && + (o.$typeUrl === MsgExtendLockup.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Duration.is(o.duration))) + ); + }, + isSDK(o: any): o is MsgExtendLockupSDKType { + return ( + o && + (o.$typeUrl === MsgExtendLockup.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Duration.isSDK(o.duration))) + ); + }, + isAmino(o: any): o is MsgExtendLockupAmino { + return ( + o && + (o.$typeUrl === MsgExtendLockup.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Duration.isAmino(o.duration))) + ); + }, + encode( + message: MsgExtendLockup, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.ID !== BigInt(0)) { + writer.uint32(16).uint64(message.ID); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExtendLockup { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExtendLockup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.ID = reader.uint64(); + break; + case 3: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExtendLockup { + const message = createBaseMsgExtendLockup(); + message.owner = object.owner ?? ''; + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0); + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, + fromAmino(object: MsgExtendLockupAmino): MsgExtendLockup { + const message = createBaseMsgExtendLockup(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino(message: MsgExtendLockup): MsgExtendLockupAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined; + return obj; + }, + fromAminoMsg(object: MsgExtendLockupAminoMsg): MsgExtendLockup { + return MsgExtendLockup.fromAmino(object.value); + }, + toAminoMsg(message: MsgExtendLockup): MsgExtendLockupAminoMsg { + return { + type: 'osmosis/lockup/extend-lockup', + value: MsgExtendLockup.toAmino(message), + }; + }, + fromProtoMsg(message: MsgExtendLockupProtoMsg): MsgExtendLockup { + return MsgExtendLockup.decode(message.value); + }, + toProto(message: MsgExtendLockup): Uint8Array { + return MsgExtendLockup.encode(message).finish(); + }, + toProtoMsg(message: MsgExtendLockup): MsgExtendLockupProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value: MsgExtendLockup.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgExtendLockup.typeUrl, MsgExtendLockup); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExtendLockup.aminoType, + MsgExtendLockup.typeUrl +); +function createBaseMsgExtendLockupResponse(): MsgExtendLockupResponse { + return { + success: false, + }; +} +export const MsgExtendLockupResponse = { + typeUrl: '/osmosis.lockup.MsgExtendLockupResponse', + aminoType: 'osmosis/lockup/extend-lockup-response', + is(o: any): o is MsgExtendLockupResponse { + return ( + o && + (o.$typeUrl === MsgExtendLockupResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isSDK(o: any): o is MsgExtendLockupResponseSDKType { + return ( + o && + (o.$typeUrl === MsgExtendLockupResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isAmino(o: any): o is MsgExtendLockupResponseAmino { + return ( + o && + (o.$typeUrl === MsgExtendLockupResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + encode( + message: MsgExtendLockupResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExtendLockupResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExtendLockupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgExtendLockupResponse { + const message = createBaseMsgExtendLockupResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgExtendLockupResponseAmino): MsgExtendLockupResponse { + const message = createBaseMsgExtendLockupResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgExtendLockupResponse): MsgExtendLockupResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg( + object: MsgExtendLockupResponseAminoMsg + ): MsgExtendLockupResponse { + return MsgExtendLockupResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgExtendLockupResponse + ): MsgExtendLockupResponseAminoMsg { + return { + type: 'osmosis/lockup/extend-lockup-response', + value: MsgExtendLockupResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgExtendLockupResponseProtoMsg + ): MsgExtendLockupResponse { + return MsgExtendLockupResponse.decode(message.value); + }, + toProto(message: MsgExtendLockupResponse): Uint8Array { + return MsgExtendLockupResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgExtendLockupResponse + ): MsgExtendLockupResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockupResponse', + value: MsgExtendLockupResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgExtendLockupResponse.typeUrl, + MsgExtendLockupResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExtendLockupResponse.aminoType, + MsgExtendLockupResponse.typeUrl +); +function createBaseMsgForceUnlock(): MsgForceUnlock { + return { + owner: '', + ID: BigInt(0), + coins: [], + }; +} +export const MsgForceUnlock = { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + aminoType: 'osmosis/lockup/force-unlock-tokens', + is(o: any): o is MsgForceUnlock { + return ( + o && + (o.$typeUrl === MsgForceUnlock.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])))) + ); + }, + isSDK(o: any): o is MsgForceUnlockSDKType { + return ( + o && + (o.$typeUrl === MsgForceUnlock.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])))) + ); + }, + isAmino(o: any): o is MsgForceUnlockAmino { + return ( + o && + (o.$typeUrl === MsgForceUnlock.typeUrl || + (typeof o.owner === 'string' && + typeof o.ID === 'bigint' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])))) + ); + }, + encode( + message: MsgForceUnlock, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.ID !== BigInt(0)) { + writer.uint32(16).uint64(message.ID); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgForceUnlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceUnlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.ID = reader.uint64(); + break; + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgForceUnlock { + const message = createBaseMsgForceUnlock(); + message.owner = object.owner ?? ''; + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0); + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgForceUnlockAmino): MsgForceUnlock { + const message = createBaseMsgForceUnlock(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgForceUnlock): MsgForceUnlockAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: MsgForceUnlockAminoMsg): MsgForceUnlock { + return MsgForceUnlock.fromAmino(object.value); + }, + toAminoMsg(message: MsgForceUnlock): MsgForceUnlockAminoMsg { + return { + type: 'osmosis/lockup/force-unlock-tokens', + value: MsgForceUnlock.toAmino(message), + }; + }, + fromProtoMsg(message: MsgForceUnlockProtoMsg): MsgForceUnlock { + return MsgForceUnlock.decode(message.value); + }, + toProto(message: MsgForceUnlock): Uint8Array { + return MsgForceUnlock.encode(message).finish(); + }, + toProtoMsg(message: MsgForceUnlock): MsgForceUnlockProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value: MsgForceUnlock.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgForceUnlock.typeUrl, MsgForceUnlock); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgForceUnlock.aminoType, + MsgForceUnlock.typeUrl +); +function createBaseMsgForceUnlockResponse(): MsgForceUnlockResponse { + return { + success: false, + }; +} +export const MsgForceUnlockResponse = { + typeUrl: '/osmosis.lockup.MsgForceUnlockResponse', + aminoType: 'osmosis/lockup/force-unlock-response', + is(o: any): o is MsgForceUnlockResponse { + return ( + o && + (o.$typeUrl === MsgForceUnlockResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isSDK(o: any): o is MsgForceUnlockResponseSDKType { + return ( + o && + (o.$typeUrl === MsgForceUnlockResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isAmino(o: any): o is MsgForceUnlockResponseAmino { + return ( + o && + (o.$typeUrl === MsgForceUnlockResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + encode( + message: MsgForceUnlockResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgForceUnlockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceUnlockResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgForceUnlockResponse { + const message = createBaseMsgForceUnlockResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgForceUnlockResponseAmino): MsgForceUnlockResponse { + const message = createBaseMsgForceUnlockResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgForceUnlockResponse): MsgForceUnlockResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg(object: MsgForceUnlockResponseAminoMsg): MsgForceUnlockResponse { + return MsgForceUnlockResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgForceUnlockResponse): MsgForceUnlockResponseAminoMsg { + return { + type: 'osmosis/lockup/force-unlock-response', + value: MsgForceUnlockResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgForceUnlockResponseProtoMsg + ): MsgForceUnlockResponse { + return MsgForceUnlockResponse.decode(message.value); + }, + toProto(message: MsgForceUnlockResponse): Uint8Array { + return MsgForceUnlockResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgForceUnlockResponse): MsgForceUnlockResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlockResponse', + value: MsgForceUnlockResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgForceUnlockResponse.typeUrl, + MsgForceUnlockResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgForceUnlockResponse.aminoType, + MsgForceUnlockResponse.typeUrl +); +function createBaseMsgSetRewardReceiverAddress(): MsgSetRewardReceiverAddress { + return { + owner: '', + lockID: BigInt(0), + rewardReceiver: '', + }; +} +export const MsgSetRewardReceiverAddress = { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + aminoType: 'osmosis/lockup/set-reward-receiver-address', + is(o: any): o is MsgSetRewardReceiverAddress { + return ( + o && + (o.$typeUrl === MsgSetRewardReceiverAddress.typeUrl || + (typeof o.owner === 'string' && + typeof o.lockID === 'bigint' && + typeof o.rewardReceiver === 'string')) + ); + }, + isSDK(o: any): o is MsgSetRewardReceiverAddressSDKType { + return ( + o && + (o.$typeUrl === MsgSetRewardReceiverAddress.typeUrl || + (typeof o.owner === 'string' && + typeof o.lockID === 'bigint' && + typeof o.reward_receiver === 'string')) + ); + }, + isAmino(o: any): o is MsgSetRewardReceiverAddressAmino { + return ( + o && + (o.$typeUrl === MsgSetRewardReceiverAddress.typeUrl || + (typeof o.owner === 'string' && + typeof o.lockID === 'bigint' && + typeof o.reward_receiver === 'string')) + ); + }, + encode( + message: MsgSetRewardReceiverAddress, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.lockID !== BigInt(0)) { + writer.uint32(16).uint64(message.lockID); + } + if (message.rewardReceiver !== '') { + writer.uint32(26).string(message.rewardReceiver); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetRewardReceiverAddress { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetRewardReceiverAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.lockID = reader.uint64(); + break; + case 3: + message.rewardReceiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetRewardReceiverAddress { + const message = createBaseMsgSetRewardReceiverAddress(); + message.owner = object.owner ?? ''; + message.lockID = + object.lockID !== undefined && object.lockID !== null + ? BigInt(object.lockID.toString()) + : BigInt(0); + message.rewardReceiver = object.rewardReceiver ?? ''; + return message; + }, + fromAmino( + object: MsgSetRewardReceiverAddressAmino + ): MsgSetRewardReceiverAddress { + const message = createBaseMsgSetRewardReceiverAddress(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + if ( + object.reward_receiver !== undefined && + object.reward_receiver !== null + ) { + message.rewardReceiver = object.reward_receiver; + } + return message; + }, + toAmino( + message: MsgSetRewardReceiverAddress + ): MsgSetRewardReceiverAddressAmino { + const obj: any = {}; + obj.owner = message.owner === '' ? undefined : message.owner; + obj.lockID = + message.lockID !== BigInt(0) ? message.lockID.toString() : undefined; + obj.reward_receiver = + message.rewardReceiver === '' ? undefined : message.rewardReceiver; + return obj; + }, + fromAminoMsg( + object: MsgSetRewardReceiverAddressAminoMsg + ): MsgSetRewardReceiverAddress { + return MsgSetRewardReceiverAddress.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetRewardReceiverAddress + ): MsgSetRewardReceiverAddressAminoMsg { + return { + type: 'osmosis/lockup/set-reward-receiver-address', + value: MsgSetRewardReceiverAddress.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetRewardReceiverAddressProtoMsg + ): MsgSetRewardReceiverAddress { + return MsgSetRewardReceiverAddress.decode(message.value); + }, + toProto(message: MsgSetRewardReceiverAddress): Uint8Array { + return MsgSetRewardReceiverAddress.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetRewardReceiverAddress + ): MsgSetRewardReceiverAddressProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value: MsgSetRewardReceiverAddress.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetRewardReceiverAddress.typeUrl, + MsgSetRewardReceiverAddress +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetRewardReceiverAddress.aminoType, + MsgSetRewardReceiverAddress.typeUrl +); +function createBaseMsgSetRewardReceiverAddressResponse(): MsgSetRewardReceiverAddressResponse { + return { + success: false, + }; +} +export const MsgSetRewardReceiverAddressResponse = { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddressResponse', + aminoType: 'osmosis/lockup/set-reward-receiver-address-response', + is(o: any): o is MsgSetRewardReceiverAddressResponse { + return ( + o && + (o.$typeUrl === MsgSetRewardReceiverAddressResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isSDK(o: any): o is MsgSetRewardReceiverAddressResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSetRewardReceiverAddressResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isAmino(o: any): o is MsgSetRewardReceiverAddressResponseAmino { + return ( + o && + (o.$typeUrl === MsgSetRewardReceiverAddressResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + encode( + message: MsgSetRewardReceiverAddressResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetRewardReceiverAddressResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetRewardReceiverAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetRewardReceiverAddressResponse { + const message = createBaseMsgSetRewardReceiverAddressResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino( + object: MsgSetRewardReceiverAddressResponseAmino + ): MsgSetRewardReceiverAddressResponse { + const message = createBaseMsgSetRewardReceiverAddressResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino( + message: MsgSetRewardReceiverAddressResponse + ): MsgSetRewardReceiverAddressResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg( + object: MsgSetRewardReceiverAddressResponseAminoMsg + ): MsgSetRewardReceiverAddressResponse { + return MsgSetRewardReceiverAddressResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetRewardReceiverAddressResponse + ): MsgSetRewardReceiverAddressResponseAminoMsg { + return { + type: 'osmosis/lockup/set-reward-receiver-address-response', + value: MsgSetRewardReceiverAddressResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetRewardReceiverAddressResponseProtoMsg + ): MsgSetRewardReceiverAddressResponse { + return MsgSetRewardReceiverAddressResponse.decode(message.value); + }, + toProto(message: MsgSetRewardReceiverAddressResponse): Uint8Array { + return MsgSetRewardReceiverAddressResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetRewardReceiverAddressResponse + ): MsgSetRewardReceiverAddressResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddressResponse', + value: MsgSetRewardReceiverAddressResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetRewardReceiverAddressResponse.typeUrl, + MsgSetRewardReceiverAddressResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetRewardReceiverAddressResponse.aminoType, + MsgSetRewardReceiverAddressResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/genesis.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/genesis.ts new file mode 100644 index 00000000..d36019f7 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/genesis.ts @@ -0,0 +1,1429 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + ModuleRoute, + ModuleRouteAmino, + ModuleRouteSDKType, +} from './module_route'; +import { + DenomPairTakerFee, + DenomPairTakerFeeAmino, + DenomPairTakerFeeSDKType, +} from './tx'; +/** Params holds parameters for the poolmanager module */ +export interface Params { + poolCreationFee: Coin[]; + /** taker_fee_params is the container of taker fee parameters. */ + takerFeeParams: TakerFeeParams; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a concentrated pool. We limit the quote assets to a + * small set for the purposes of having convenient price increments stemming + * from tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. + */ + authorizedQuoteDenoms: string[]; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.Params'; + value: Uint8Array; +} +/** Params holds parameters for the poolmanager module */ +export interface ParamsAmino { + pool_creation_fee?: CoinAmino[]; + /** taker_fee_params is the container of taker fee parameters. */ + taker_fee_params?: TakerFeeParamsAmino; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a concentrated pool. We limit the quote assets to a + * small set for the purposes of having convenient price increments stemming + * from tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. + */ + authorized_quote_denoms?: string[]; +} +export interface ParamsAminoMsg { + type: 'osmosis/poolmanager/params'; + value: ParamsAmino; +} +/** Params holds parameters for the poolmanager module */ +export interface ParamsSDKType { + pool_creation_fee: CoinSDKType[]; + taker_fee_params: TakerFeeParamsSDKType; + authorized_quote_denoms: string[]; +} +/** GenesisState defines the poolmanager module's genesis state. */ +export interface GenesisState { + /** the next_pool_id */ + nextPoolId: bigint; + /** params is the container of poolmanager parameters. */ + params: Params; + /** pool_routes is the container of the mappings from pool id to pool type. */ + poolRoutes: ModuleRoute[]; + /** KVStore state */ + takerFeesTracker?: TakerFeesTracker; + poolVolumes: PoolVolume[]; + denomPairTakerFeeStore: DenomPairTakerFee[]; +} +export interface GenesisStateProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.GenesisState'; + value: Uint8Array; +} +/** GenesisState defines the poolmanager module's genesis state. */ +export interface GenesisStateAmino { + /** the next_pool_id */ + next_pool_id?: string; + /** params is the container of poolmanager parameters. */ + params?: ParamsAmino; + /** pool_routes is the container of the mappings from pool id to pool type. */ + pool_routes?: ModuleRouteAmino[]; + /** KVStore state */ + taker_fees_tracker?: TakerFeesTrackerAmino; + pool_volumes?: PoolVolumeAmino[]; + denom_pair_taker_fee_store?: DenomPairTakerFeeAmino[]; +} +export interface GenesisStateAminoMsg { + type: 'osmosis/poolmanager/genesis-state'; + value: GenesisStateAmino; +} +/** GenesisState defines the poolmanager module's genesis state. */ +export interface GenesisStateSDKType { + next_pool_id: bigint; + params: ParamsSDKType; + pool_routes: ModuleRouteSDKType[]; + taker_fees_tracker?: TakerFeesTrackerSDKType; + pool_volumes: PoolVolumeSDKType[]; + denom_pair_taker_fee_store: DenomPairTakerFeeSDKType[]; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParams { + /** + * default_taker_fee is the fee used when creating a new pool that doesn't + * fall under a custom pool taker fee or stableswap taker fee category. + */ + defaultTakerFee: string; + /** + * osmo_taker_fee_distribution defines the distribution of taker fees + * generated in OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets distributed to + * stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. + */ + osmoTakerFeeDistribution: TakerFeeDistributionPercentage; + /** + * non_osmo_taker_fee_distribution defines the distribution of taker fees + * generated in non-OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets swapped to OSMO + * and then distributed to stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. Note: If the non-OSMO asset is an authorized_quote_denom, + * that denom is sent directly to the community pool. Otherwise, it is + * swapped to the community_pool_denom_to_swap_non_whitelisted_assets_to and + * then sent to the community pool as that denom. + */ + nonOsmoTakerFeeDistribution: TakerFeeDistributionPercentage; + /** + * admin_addresses is a list of addresses that are allowed to set and remove + * custom taker fees for denom pairs. Governance also has the ability to set + * and remove custom taker fees for denom pairs, but with the normal + * governance delay. + */ + adminAddresses: string[]; + /** + * community_pool_denom_to_swap_non_whitelisted_assets_to is the denom that + * non-whitelisted taker fees will be swapped to before being sent to + * the community pool. + */ + communityPoolDenomToSwapNonWhitelistedAssetsTo: string; + /** + * reduced_fee_whitelist is a list of addresses that are + * allowed to pay a reduce taker fee when performing a swap + * (i.e. swap without paying the taker fee). + * It is intended to be used for integrators who meet qualifying factors + * that are approved by governance. + * Initially, the taker fee is allowed to be bypassed completely. However + * In the future, we will charge a reduced taker fee instead of no fee at all. + */ + reducedFeeWhitelist: string[]; +} +export interface TakerFeeParamsProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeeParams'; + value: Uint8Array; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParamsAmino { + /** + * default_taker_fee is the fee used when creating a new pool that doesn't + * fall under a custom pool taker fee or stableswap taker fee category. + */ + default_taker_fee?: string; + /** + * osmo_taker_fee_distribution defines the distribution of taker fees + * generated in OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets distributed to + * stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. + */ + osmo_taker_fee_distribution?: TakerFeeDistributionPercentageAmino; + /** + * non_osmo_taker_fee_distribution defines the distribution of taker fees + * generated in non-OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets swapped to OSMO + * and then distributed to stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. Note: If the non-OSMO asset is an authorized_quote_denom, + * that denom is sent directly to the community pool. Otherwise, it is + * swapped to the community_pool_denom_to_swap_non_whitelisted_assets_to and + * then sent to the community pool as that denom. + */ + non_osmo_taker_fee_distribution?: TakerFeeDistributionPercentageAmino; + /** + * admin_addresses is a list of addresses that are allowed to set and remove + * custom taker fees for denom pairs. Governance also has the ability to set + * and remove custom taker fees for denom pairs, but with the normal + * governance delay. + */ + admin_addresses?: string[]; + /** + * community_pool_denom_to_swap_non_whitelisted_assets_to is the denom that + * non-whitelisted taker fees will be swapped to before being sent to + * the community pool. + */ + community_pool_denom_to_swap_non_whitelisted_assets_to?: string; + /** + * reduced_fee_whitelist is a list of addresses that are + * allowed to pay a reduce taker fee when performing a swap + * (i.e. swap without paying the taker fee). + * It is intended to be used for integrators who meet qualifying factors + * that are approved by governance. + * Initially, the taker fee is allowed to be bypassed completely. However + * In the future, we will charge a reduced taker fee instead of no fee at all. + */ + reduced_fee_whitelist?: string[]; +} +export interface TakerFeeParamsAminoMsg { + type: 'osmosis/poolmanager/taker-fee-params'; + value: TakerFeeParamsAmino; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParamsSDKType { + default_taker_fee: string; + osmo_taker_fee_distribution: TakerFeeDistributionPercentageSDKType; + non_osmo_taker_fee_distribution: TakerFeeDistributionPercentageSDKType; + admin_addresses: string[]; + community_pool_denom_to_swap_non_whitelisted_assets_to: string; + reduced_fee_whitelist: string[]; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentage { + stakingRewards: string; + communityPool: string; +} +export interface TakerFeeDistributionPercentageProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage'; + value: Uint8Array; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentageAmino { + staking_rewards?: string; + community_pool?: string; +} +export interface TakerFeeDistributionPercentageAminoMsg { + type: 'osmosis/poolmanager/taker-fee-distribution-percentage'; + value: TakerFeeDistributionPercentageAmino; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentageSDKType { + staking_rewards: string; + community_pool: string; +} +export interface TakerFeesTracker { + takerFeesToStakers: Coin[]; + takerFeesToCommunityPool: Coin[]; + heightAccountingStartsFrom: bigint; +} +export interface TakerFeesTrackerProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeesTracker'; + value: Uint8Array; +} +export interface TakerFeesTrackerAmino { + taker_fees_to_stakers?: CoinAmino[]; + taker_fees_to_community_pool?: CoinAmino[]; + height_accounting_starts_from?: string; +} +export interface TakerFeesTrackerAminoMsg { + type: 'osmosis/poolmanager/taker-fees-tracker'; + value: TakerFeesTrackerAmino; +} +export interface TakerFeesTrackerSDKType { + taker_fees_to_stakers: CoinSDKType[]; + taker_fees_to_community_pool: CoinSDKType[]; + height_accounting_starts_from: bigint; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolume { + /** pool_id is the id of the pool. */ + poolId: bigint; + /** pool_volume is the cumulative volume of the pool. */ + poolVolume: Coin[]; +} +export interface PoolVolumeProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.PoolVolume'; + value: Uint8Array; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolumeAmino { + /** pool_id is the id of the pool. */ + pool_id?: string; + /** pool_volume is the cumulative volume of the pool. */ + pool_volume?: CoinAmino[]; +} +export interface PoolVolumeAminoMsg { + type: 'osmosis/poolmanager/pool-volume'; + value: PoolVolumeAmino; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolumeSDKType { + pool_id: bigint; + pool_volume: CoinSDKType[]; +} +function createBaseParams(): Params { + return { + poolCreationFee: [], + takerFeeParams: TakerFeeParams.fromPartial({}), + authorizedQuoteDenoms: [], + }; +} +export const Params = { + typeUrl: '/osmosis.poolmanager.v1beta1.Params', + aminoType: 'osmosis/poolmanager/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.poolCreationFee) && + (!o.poolCreationFee.length || Coin.is(o.poolCreationFee[0])) && + TakerFeeParams.is(o.takerFeeParams) && + Array.isArray(o.authorizedQuoteDenoms) && + (!o.authorizedQuoteDenoms.length || + typeof o.authorizedQuoteDenoms[0] === 'string'))) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.pool_creation_fee) && + (!o.pool_creation_fee.length || Coin.isSDK(o.pool_creation_fee[0])) && + TakerFeeParams.isSDK(o.taker_fee_params) && + Array.isArray(o.authorized_quote_denoms) && + (!o.authorized_quote_denoms.length || + typeof o.authorized_quote_denoms[0] === 'string'))) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.pool_creation_fee) && + (!o.pool_creation_fee.length || + Coin.isAmino(o.pool_creation_fee[0])) && + TakerFeeParams.isAmino(o.taker_fee_params) && + Array.isArray(o.authorized_quote_denoms) && + (!o.authorized_quote_denoms.length || + typeof o.authorized_quote_denoms[0] === 'string'))) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.poolCreationFee) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.takerFeeParams !== undefined) { + TakerFeeParams.encode( + message.takerFeeParams, + writer.uint32(18).fork() + ).ldelim(); + } + for (const v of message.authorizedQuoteDenoms) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.takerFeeParams = TakerFeeParams.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.authorizedQuoteDenoms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.poolCreationFee = + object.poolCreationFee?.map((e) => Coin.fromPartial(e)) || []; + message.takerFeeParams = + object.takerFeeParams !== undefined && object.takerFeeParams !== null + ? TakerFeeParams.fromPartial(object.takerFeeParams) + : undefined; + message.authorizedQuoteDenoms = + object.authorizedQuoteDenoms?.map((e) => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.poolCreationFee = + object.pool_creation_fee?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.taker_fee_params !== undefined && + object.taker_fee_params !== null + ) { + message.takerFeeParams = TakerFeeParams.fromAmino( + object.taker_fee_params + ); + } + message.authorizedQuoteDenoms = + object.authorized_quote_denoms?.map((e) => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.poolCreationFee) { + obj.pool_creation_fee = message.poolCreationFee.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.pool_creation_fee = message.poolCreationFee; + } + obj.taker_fee_params = message.takerFeeParams + ? TakerFeeParams.toAmino(message.takerFeeParams) + : undefined; + if (message.authorizedQuoteDenoms) { + obj.authorized_quote_denoms = message.authorizedQuoteDenoms.map((e) => e); + } else { + obj.authorized_quote_denoms = message.authorizedQuoteDenoms; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/poolmanager/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); +function createBaseGenesisState(): GenesisState { + return { + nextPoolId: BigInt(0), + params: Params.fromPartial({}), + poolRoutes: [], + takerFeesTracker: undefined, + poolVolumes: [], + denomPairTakerFeeStore: [], + }; +} +export const GenesisState = { + typeUrl: '/osmosis.poolmanager.v1beta1.GenesisState', + aminoType: 'osmosis/poolmanager/genesis-state', + is(o: any): o is GenesisState { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.nextPoolId === 'bigint' && + Params.is(o.params) && + Array.isArray(o.poolRoutes) && + (!o.poolRoutes.length || ModuleRoute.is(o.poolRoutes[0])) && + Array.isArray(o.poolVolumes) && + (!o.poolVolumes.length || PoolVolume.is(o.poolVolumes[0])) && + Array.isArray(o.denomPairTakerFeeStore) && + (!o.denomPairTakerFeeStore.length || + DenomPairTakerFee.is(o.denomPairTakerFeeStore[0])))) + ); + }, + isSDK(o: any): o is GenesisStateSDKType { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.next_pool_id === 'bigint' && + Params.isSDK(o.params) && + Array.isArray(o.pool_routes) && + (!o.pool_routes.length || ModuleRoute.isSDK(o.pool_routes[0])) && + Array.isArray(o.pool_volumes) && + (!o.pool_volumes.length || PoolVolume.isSDK(o.pool_volumes[0])) && + Array.isArray(o.denom_pair_taker_fee_store) && + (!o.denom_pair_taker_fee_store.length || + DenomPairTakerFee.isSDK(o.denom_pair_taker_fee_store[0])))) + ); + }, + isAmino(o: any): o is GenesisStateAmino { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.next_pool_id === 'bigint' && + Params.isAmino(o.params) && + Array.isArray(o.pool_routes) && + (!o.pool_routes.length || ModuleRoute.isAmino(o.pool_routes[0])) && + Array.isArray(o.pool_volumes) && + (!o.pool_volumes.length || PoolVolume.isAmino(o.pool_volumes[0])) && + Array.isArray(o.denom_pair_taker_fee_store) && + (!o.denom_pair_taker_fee_store.length || + DenomPairTakerFee.isAmino(o.denom_pair_taker_fee_store[0])))) + ); + }, + encode( + message: GenesisState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.nextPoolId !== BigInt(0)) { + writer.uint32(8).uint64(message.nextPoolId); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.poolRoutes) { + ModuleRoute.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.takerFeesTracker !== undefined) { + TakerFeesTracker.encode( + message.takerFeesTracker, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.poolVolumes) { + PoolVolume.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.denomPairTakerFeeStore) { + DenomPairTakerFee.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextPoolId = reader.uint64(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + case 3: + message.poolRoutes.push(ModuleRoute.decode(reader, reader.uint32())); + break; + case 4: + message.takerFeesTracker = TakerFeesTracker.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.poolVolumes.push(PoolVolume.decode(reader, reader.uint32())); + break; + case 6: + message.denomPairTakerFeeStore.push( + DenomPairTakerFee.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.nextPoolId = + object.nextPoolId !== undefined && object.nextPoolId !== null + ? BigInt(object.nextPoolId.toString()) + : BigInt(0); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + message.poolRoutes = + object.poolRoutes?.map((e) => ModuleRoute.fromPartial(e)) || []; + message.takerFeesTracker = + object.takerFeesTracker !== undefined && object.takerFeesTracker !== null + ? TakerFeesTracker.fromPartial(object.takerFeesTracker) + : undefined; + message.poolVolumes = + object.poolVolumes?.map((e) => PoolVolume.fromPartial(e)) || []; + message.denomPairTakerFeeStore = + object.denomPairTakerFeeStore?.map((e) => + DenomPairTakerFee.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.next_pool_id !== undefined && object.next_pool_id !== null) { + message.nextPoolId = BigInt(object.next_pool_id); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.poolRoutes = + object.pool_routes?.map((e) => ModuleRoute.fromAmino(e)) || []; + if ( + object.taker_fees_tracker !== undefined && + object.taker_fees_tracker !== null + ) { + message.takerFeesTracker = TakerFeesTracker.fromAmino( + object.taker_fees_tracker + ); + } + message.poolVolumes = + object.pool_volumes?.map((e) => PoolVolume.fromAmino(e)) || []; + message.denomPairTakerFeeStore = + object.denom_pair_taker_fee_store?.map((e) => + DenomPairTakerFee.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.next_pool_id = + message.nextPoolId !== BigInt(0) + ? message.nextPoolId.toString() + : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.poolRoutes) { + obj.pool_routes = message.poolRoutes.map((e) => + e ? ModuleRoute.toAmino(e) : undefined + ); + } else { + obj.pool_routes = message.poolRoutes; + } + obj.taker_fees_tracker = message.takerFeesTracker + ? TakerFeesTracker.toAmino(message.takerFeesTracker) + : undefined; + if (message.poolVolumes) { + obj.pool_volumes = message.poolVolumes.map((e) => + e ? PoolVolume.toAmino(e) : undefined + ); + } else { + obj.pool_volumes = message.poolVolumes; + } + if (message.denomPairTakerFeeStore) { + obj.denom_pair_taker_fee_store = message.denomPairTakerFeeStore.map((e) => + e ? DenomPairTakerFee.toAmino(e) : undefined + ); + } else { + obj.denom_pair_taker_fee_store = message.denomPairTakerFeeStore; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/poolmanager/genesis-state', + value: GenesisState.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.GenesisState', + value: GenesisState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisState.aminoType, + GenesisState.typeUrl +); +function createBaseTakerFeeParams(): TakerFeeParams { + return { + defaultTakerFee: '', + osmoTakerFeeDistribution: TakerFeeDistributionPercentage.fromPartial({}), + nonOsmoTakerFeeDistribution: TakerFeeDistributionPercentage.fromPartial({}), + adminAddresses: [], + communityPoolDenomToSwapNonWhitelistedAssetsTo: '', + reducedFeeWhitelist: [], + }; +} +export const TakerFeeParams = { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeeParams', + aminoType: 'osmosis/poolmanager/taker-fee-params', + is(o: any): o is TakerFeeParams { + return ( + o && + (o.$typeUrl === TakerFeeParams.typeUrl || + (typeof o.defaultTakerFee === 'string' && + TakerFeeDistributionPercentage.is(o.osmoTakerFeeDistribution) && + TakerFeeDistributionPercentage.is(o.nonOsmoTakerFeeDistribution) && + Array.isArray(o.adminAddresses) && + (!o.adminAddresses.length || + typeof o.adminAddresses[0] === 'string') && + typeof o.communityPoolDenomToSwapNonWhitelistedAssetsTo === + 'string' && + Array.isArray(o.reducedFeeWhitelist) && + (!o.reducedFeeWhitelist.length || + typeof o.reducedFeeWhitelist[0] === 'string'))) + ); + }, + isSDK(o: any): o is TakerFeeParamsSDKType { + return ( + o && + (o.$typeUrl === TakerFeeParams.typeUrl || + (typeof o.default_taker_fee === 'string' && + TakerFeeDistributionPercentage.isSDK(o.osmo_taker_fee_distribution) && + TakerFeeDistributionPercentage.isSDK( + o.non_osmo_taker_fee_distribution + ) && + Array.isArray(o.admin_addresses) && + (!o.admin_addresses.length || + typeof o.admin_addresses[0] === 'string') && + typeof o.community_pool_denom_to_swap_non_whitelisted_assets_to === + 'string' && + Array.isArray(o.reduced_fee_whitelist) && + (!o.reduced_fee_whitelist.length || + typeof o.reduced_fee_whitelist[0] === 'string'))) + ); + }, + isAmino(o: any): o is TakerFeeParamsAmino { + return ( + o && + (o.$typeUrl === TakerFeeParams.typeUrl || + (typeof o.default_taker_fee === 'string' && + TakerFeeDistributionPercentage.isAmino( + o.osmo_taker_fee_distribution + ) && + TakerFeeDistributionPercentage.isAmino( + o.non_osmo_taker_fee_distribution + ) && + Array.isArray(o.admin_addresses) && + (!o.admin_addresses.length || + typeof o.admin_addresses[0] === 'string') && + typeof o.community_pool_denom_to_swap_non_whitelisted_assets_to === + 'string' && + Array.isArray(o.reduced_fee_whitelist) && + (!o.reduced_fee_whitelist.length || + typeof o.reduced_fee_whitelist[0] === 'string'))) + ); + }, + encode( + message: TakerFeeParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.defaultTakerFee !== '') { + writer + .uint32(10) + .string(Decimal.fromUserInput(message.defaultTakerFee, 18).atomics); + } + if (message.osmoTakerFeeDistribution !== undefined) { + TakerFeeDistributionPercentage.encode( + message.osmoTakerFeeDistribution, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.nonOsmoTakerFeeDistribution !== undefined) { + TakerFeeDistributionPercentage.encode( + message.nonOsmoTakerFeeDistribution, + writer.uint32(26).fork() + ).ldelim(); + } + for (const v of message.adminAddresses) { + writer.uint32(34).string(v!); + } + if (message.communityPoolDenomToSwapNonWhitelistedAssetsTo !== '') { + writer + .uint32(42) + .string(message.communityPoolDenomToSwapNonWhitelistedAssetsTo); + } + for (const v of message.reducedFeeWhitelist) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeeParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaultTakerFee = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 2: + message.osmoTakerFeeDistribution = + TakerFeeDistributionPercentage.decode(reader, reader.uint32()); + break; + case 3: + message.nonOsmoTakerFeeDistribution = + TakerFeeDistributionPercentage.decode(reader, reader.uint32()); + break; + case 4: + message.adminAddresses.push(reader.string()); + break; + case 5: + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = + reader.string(); + break; + case 6: + message.reducedFeeWhitelist.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TakerFeeParams { + const message = createBaseTakerFeeParams(); + message.defaultTakerFee = object.defaultTakerFee ?? ''; + message.osmoTakerFeeDistribution = + object.osmoTakerFeeDistribution !== undefined && + object.osmoTakerFeeDistribution !== null + ? TakerFeeDistributionPercentage.fromPartial( + object.osmoTakerFeeDistribution + ) + : undefined; + message.nonOsmoTakerFeeDistribution = + object.nonOsmoTakerFeeDistribution !== undefined && + object.nonOsmoTakerFeeDistribution !== null + ? TakerFeeDistributionPercentage.fromPartial( + object.nonOsmoTakerFeeDistribution + ) + : undefined; + message.adminAddresses = object.adminAddresses?.map((e) => e) || []; + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = + object.communityPoolDenomToSwapNonWhitelistedAssetsTo ?? ''; + message.reducedFeeWhitelist = + object.reducedFeeWhitelist?.map((e) => e) || []; + return message; + }, + fromAmino(object: TakerFeeParamsAmino): TakerFeeParams { + const message = createBaseTakerFeeParams(); + if ( + object.default_taker_fee !== undefined && + object.default_taker_fee !== null + ) { + message.defaultTakerFee = object.default_taker_fee; + } + if ( + object.osmo_taker_fee_distribution !== undefined && + object.osmo_taker_fee_distribution !== null + ) { + message.osmoTakerFeeDistribution = + TakerFeeDistributionPercentage.fromAmino( + object.osmo_taker_fee_distribution + ); + } + if ( + object.non_osmo_taker_fee_distribution !== undefined && + object.non_osmo_taker_fee_distribution !== null + ) { + message.nonOsmoTakerFeeDistribution = + TakerFeeDistributionPercentage.fromAmino( + object.non_osmo_taker_fee_distribution + ); + } + message.adminAddresses = object.admin_addresses?.map((e) => e) || []; + if ( + object.community_pool_denom_to_swap_non_whitelisted_assets_to !== + undefined && + object.community_pool_denom_to_swap_non_whitelisted_assets_to !== null + ) { + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = + object.community_pool_denom_to_swap_non_whitelisted_assets_to; + } + message.reducedFeeWhitelist = + object.reduced_fee_whitelist?.map((e) => e) || []; + return message; + }, + toAmino(message: TakerFeeParams): TakerFeeParamsAmino { + const obj: any = {}; + obj.default_taker_fee = + message.defaultTakerFee === '' ? undefined : message.defaultTakerFee; + obj.osmo_taker_fee_distribution = message.osmoTakerFeeDistribution + ? TakerFeeDistributionPercentage.toAmino(message.osmoTakerFeeDistribution) + : undefined; + obj.non_osmo_taker_fee_distribution = message.nonOsmoTakerFeeDistribution + ? TakerFeeDistributionPercentage.toAmino( + message.nonOsmoTakerFeeDistribution + ) + : undefined; + if (message.adminAddresses) { + obj.admin_addresses = message.adminAddresses.map((e) => e); + } else { + obj.admin_addresses = message.adminAddresses; + } + obj.community_pool_denom_to_swap_non_whitelisted_assets_to = + message.communityPoolDenomToSwapNonWhitelistedAssetsTo === '' + ? undefined + : message.communityPoolDenomToSwapNonWhitelistedAssetsTo; + if (message.reducedFeeWhitelist) { + obj.reduced_fee_whitelist = message.reducedFeeWhitelist.map((e) => e); + } else { + obj.reduced_fee_whitelist = message.reducedFeeWhitelist; + } + return obj; + }, + fromAminoMsg(object: TakerFeeParamsAminoMsg): TakerFeeParams { + return TakerFeeParams.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeeParams): TakerFeeParamsAminoMsg { + return { + type: 'osmosis/poolmanager/taker-fee-params', + value: TakerFeeParams.toAmino(message), + }; + }, + fromProtoMsg(message: TakerFeeParamsProtoMsg): TakerFeeParams { + return TakerFeeParams.decode(message.value); + }, + toProto(message: TakerFeeParams): Uint8Array { + return TakerFeeParams.encode(message).finish(); + }, + toProtoMsg(message: TakerFeeParams): TakerFeeParamsProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeeParams', + value: TakerFeeParams.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(TakerFeeParams.typeUrl, TakerFeeParams); +GlobalDecoderRegistry.registerAminoProtoMapping( + TakerFeeParams.aminoType, + TakerFeeParams.typeUrl +); +function createBaseTakerFeeDistributionPercentage(): TakerFeeDistributionPercentage { + return { + stakingRewards: '', + communityPool: '', + }; +} +export const TakerFeeDistributionPercentage = { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage', + aminoType: 'osmosis/poolmanager/taker-fee-distribution-percentage', + is(o: any): o is TakerFeeDistributionPercentage { + return ( + o && + (o.$typeUrl === TakerFeeDistributionPercentage.typeUrl || + (typeof o.stakingRewards === 'string' && + typeof o.communityPool === 'string')) + ); + }, + isSDK(o: any): o is TakerFeeDistributionPercentageSDKType { + return ( + o && + (o.$typeUrl === TakerFeeDistributionPercentage.typeUrl || + (typeof o.staking_rewards === 'string' && + typeof o.community_pool === 'string')) + ); + }, + isAmino(o: any): o is TakerFeeDistributionPercentageAmino { + return ( + o && + (o.$typeUrl === TakerFeeDistributionPercentage.typeUrl || + (typeof o.staking_rewards === 'string' && + typeof o.community_pool === 'string')) + ); + }, + encode( + message: TakerFeeDistributionPercentage, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.stakingRewards !== '') { + writer + .uint32(10) + .string(Decimal.fromUserInput(message.stakingRewards, 18).atomics); + } + if (message.communityPool !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.communityPool, 18).atomics); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): TakerFeeDistributionPercentage { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeDistributionPercentage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stakingRewards = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 2: + message.communityPool = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): TakerFeeDistributionPercentage { + const message = createBaseTakerFeeDistributionPercentage(); + message.stakingRewards = object.stakingRewards ?? ''; + message.communityPool = object.communityPool ?? ''; + return message; + }, + fromAmino( + object: TakerFeeDistributionPercentageAmino + ): TakerFeeDistributionPercentage { + const message = createBaseTakerFeeDistributionPercentage(); + if ( + object.staking_rewards !== undefined && + object.staking_rewards !== null + ) { + message.stakingRewards = object.staking_rewards; + } + if (object.community_pool !== undefined && object.community_pool !== null) { + message.communityPool = object.community_pool; + } + return message; + }, + toAmino( + message: TakerFeeDistributionPercentage + ): TakerFeeDistributionPercentageAmino { + const obj: any = {}; + obj.staking_rewards = + message.stakingRewards === '' ? undefined : message.stakingRewards; + obj.community_pool = + message.communityPool === '' ? undefined : message.communityPool; + return obj; + }, + fromAminoMsg( + object: TakerFeeDistributionPercentageAminoMsg + ): TakerFeeDistributionPercentage { + return TakerFeeDistributionPercentage.fromAmino(object.value); + }, + toAminoMsg( + message: TakerFeeDistributionPercentage + ): TakerFeeDistributionPercentageAminoMsg { + return { + type: 'osmosis/poolmanager/taker-fee-distribution-percentage', + value: TakerFeeDistributionPercentage.toAmino(message), + }; + }, + fromProtoMsg( + message: TakerFeeDistributionPercentageProtoMsg + ): TakerFeeDistributionPercentage { + return TakerFeeDistributionPercentage.decode(message.value); + }, + toProto(message: TakerFeeDistributionPercentage): Uint8Array { + return TakerFeeDistributionPercentage.encode(message).finish(); + }, + toProtoMsg( + message: TakerFeeDistributionPercentage + ): TakerFeeDistributionPercentageProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage', + value: TakerFeeDistributionPercentage.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + TakerFeeDistributionPercentage.typeUrl, + TakerFeeDistributionPercentage +); +GlobalDecoderRegistry.registerAminoProtoMapping( + TakerFeeDistributionPercentage.aminoType, + TakerFeeDistributionPercentage.typeUrl +); +function createBaseTakerFeesTracker(): TakerFeesTracker { + return { + takerFeesToStakers: [], + takerFeesToCommunityPool: [], + heightAccountingStartsFrom: BigInt(0), + }; +} +export const TakerFeesTracker = { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeesTracker', + aminoType: 'osmosis/poolmanager/taker-fees-tracker', + is(o: any): o is TakerFeesTracker { + return ( + o && + (o.$typeUrl === TakerFeesTracker.typeUrl || + (Array.isArray(o.takerFeesToStakers) && + (!o.takerFeesToStakers.length || Coin.is(o.takerFeesToStakers[0])) && + Array.isArray(o.takerFeesToCommunityPool) && + (!o.takerFeesToCommunityPool.length || + Coin.is(o.takerFeesToCommunityPool[0])) && + typeof o.heightAccountingStartsFrom === 'bigint')) + ); + }, + isSDK(o: any): o is TakerFeesTrackerSDKType { + return ( + o && + (o.$typeUrl === TakerFeesTracker.typeUrl || + (Array.isArray(o.taker_fees_to_stakers) && + (!o.taker_fees_to_stakers.length || + Coin.isSDK(o.taker_fees_to_stakers[0])) && + Array.isArray(o.taker_fees_to_community_pool) && + (!o.taker_fees_to_community_pool.length || + Coin.isSDK(o.taker_fees_to_community_pool[0])) && + typeof o.height_accounting_starts_from === 'bigint')) + ); + }, + isAmino(o: any): o is TakerFeesTrackerAmino { + return ( + o && + (o.$typeUrl === TakerFeesTracker.typeUrl || + (Array.isArray(o.taker_fees_to_stakers) && + (!o.taker_fees_to_stakers.length || + Coin.isAmino(o.taker_fees_to_stakers[0])) && + Array.isArray(o.taker_fees_to_community_pool) && + (!o.taker_fees_to_community_pool.length || + Coin.isAmino(o.taker_fees_to_community_pool[0])) && + typeof o.height_accounting_starts_from === 'bigint')) + ); + }, + encode( + message: TakerFeesTracker, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.takerFeesToStakers) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.takerFeesToCommunityPool) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.heightAccountingStartsFrom !== BigInt(0)) { + writer.uint32(24).int64(message.heightAccountingStartsFrom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeesTracker { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeesTracker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFeesToStakers.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.takerFeesToCommunityPool.push( + Coin.decode(reader, reader.uint32()) + ); + break; + case 3: + message.heightAccountingStartsFrom = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TakerFeesTracker { + const message = createBaseTakerFeesTracker(); + message.takerFeesToStakers = + object.takerFeesToStakers?.map((e) => Coin.fromPartial(e)) || []; + message.takerFeesToCommunityPool = + object.takerFeesToCommunityPool?.map((e) => Coin.fromPartial(e)) || []; + message.heightAccountingStartsFrom = + object.heightAccountingStartsFrom !== undefined && + object.heightAccountingStartsFrom !== null + ? BigInt(object.heightAccountingStartsFrom.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: TakerFeesTrackerAmino): TakerFeesTracker { + const message = createBaseTakerFeesTracker(); + message.takerFeesToStakers = + object.taker_fees_to_stakers?.map((e) => Coin.fromAmino(e)) || []; + message.takerFeesToCommunityPool = + object.taker_fees_to_community_pool?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.height_accounting_starts_from !== undefined && + object.height_accounting_starts_from !== null + ) { + message.heightAccountingStartsFrom = BigInt( + object.height_accounting_starts_from + ); + } + return message; + }, + toAmino(message: TakerFeesTracker): TakerFeesTrackerAmino { + const obj: any = {}; + if (message.takerFeesToStakers) { + obj.taker_fees_to_stakers = message.takerFeesToStakers.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.taker_fees_to_stakers = message.takerFeesToStakers; + } + if (message.takerFeesToCommunityPool) { + obj.taker_fees_to_community_pool = message.takerFeesToCommunityPool.map( + (e) => (e ? Coin.toAmino(e) : undefined) + ); + } else { + obj.taker_fees_to_community_pool = message.takerFeesToCommunityPool; + } + obj.height_accounting_starts_from = + message.heightAccountingStartsFrom !== BigInt(0) + ? message.heightAccountingStartsFrom.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: TakerFeesTrackerAminoMsg): TakerFeesTracker { + return TakerFeesTracker.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeesTracker): TakerFeesTrackerAminoMsg { + return { + type: 'osmosis/poolmanager/taker-fees-tracker', + value: TakerFeesTracker.toAmino(message), + }; + }, + fromProtoMsg(message: TakerFeesTrackerProtoMsg): TakerFeesTracker { + return TakerFeesTracker.decode(message.value); + }, + toProto(message: TakerFeesTracker): Uint8Array { + return TakerFeesTracker.encode(message).finish(); + }, + toProtoMsg(message: TakerFeesTracker): TakerFeesTrackerProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.TakerFeesTracker', + value: TakerFeesTracker.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(TakerFeesTracker.typeUrl, TakerFeesTracker); +GlobalDecoderRegistry.registerAminoProtoMapping( + TakerFeesTracker.aminoType, + TakerFeesTracker.typeUrl +); +function createBasePoolVolume(): PoolVolume { + return { + poolId: BigInt(0), + poolVolume: [], + }; +} +export const PoolVolume = { + typeUrl: '/osmosis.poolmanager.v1beta1.PoolVolume', + aminoType: 'osmosis/poolmanager/pool-volume', + is(o: any): o is PoolVolume { + return ( + o && + (o.$typeUrl === PoolVolume.typeUrl || + (typeof o.poolId === 'bigint' && + Array.isArray(o.poolVolume) && + (!o.poolVolume.length || Coin.is(o.poolVolume[0])))) + ); + }, + isSDK(o: any): o is PoolVolumeSDKType { + return ( + o && + (o.$typeUrl === PoolVolume.typeUrl || + (typeof o.pool_id === 'bigint' && + Array.isArray(o.pool_volume) && + (!o.pool_volume.length || Coin.isSDK(o.pool_volume[0])))) + ); + }, + isAmino(o: any): o is PoolVolumeAmino { + return ( + o && + (o.$typeUrl === PoolVolume.typeUrl || + (typeof o.pool_id === 'bigint' && + Array.isArray(o.pool_volume) && + (!o.pool_volume.length || Coin.isAmino(o.pool_volume[0])))) + ); + }, + encode( + message: PoolVolume, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + for (const v of message.poolVolume) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolVolume { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.poolVolume.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PoolVolume { + const message = createBasePoolVolume(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.poolVolume = + object.poolVolume?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PoolVolumeAmino): PoolVolume { + const message = createBasePoolVolume(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.poolVolume = + object.pool_volume?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: PoolVolume): PoolVolumeAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + if (message.poolVolume) { + obj.pool_volume = message.poolVolume.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.pool_volume = message.poolVolume; + } + return obj; + }, + fromAminoMsg(object: PoolVolumeAminoMsg): PoolVolume { + return PoolVolume.fromAmino(object.value); + }, + toAminoMsg(message: PoolVolume): PoolVolumeAminoMsg { + return { + type: 'osmosis/poolmanager/pool-volume', + value: PoolVolume.toAmino(message), + }; + }, + fromProtoMsg(message: PoolVolumeProtoMsg): PoolVolume { + return PoolVolume.decode(message.value); + }, + toProto(message: PoolVolume): Uint8Array { + return PoolVolume.encode(message).finish(); + }, + toProtoMsg(message: PoolVolume): PoolVolumeProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.PoolVolume', + value: PoolVolume.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(PoolVolume.typeUrl, PoolVolume); +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolVolume.aminoType, + PoolVolume.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/module_route.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/module_route.ts new file mode 100644 index 00000000..e9e5de23 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/module_route.ts @@ -0,0 +1,206 @@ +//@ts-nocheck +import { isSet } from '../../../helpers'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** PoolType is an enumeration of all supported pool types. */ +export enum PoolType { + /** Balancer - Balancer is the standard xy=k curve. Its pool model is defined in x/gamm. */ + Balancer = 0, + /** + * Stableswap - Stableswap is the Solidly cfmm stable swap curve. Its pool model is defined + * in x/gamm. + */ + Stableswap = 1, + /** + * Concentrated - Concentrated is the pool model specific to concentrated liquidity. It is + * defined in x/concentrated-liquidity. + */ + Concentrated = 2, + /** + * CosmWasm - CosmWasm is the pool model specific to CosmWasm. It is defined in + * x/cosmwasmpool. + */ + CosmWasm = 3, + UNRECOGNIZED = -1, +} +export const PoolTypeSDKType = PoolType; +export const PoolTypeAmino = PoolType; +export function poolTypeFromJSON(object: any): PoolType { + switch (object) { + case 0: + case 'Balancer': + return PoolType.Balancer; + case 1: + case 'Stableswap': + return PoolType.Stableswap; + case 2: + case 'Concentrated': + return PoolType.Concentrated; + case 3: + case 'CosmWasm': + return PoolType.CosmWasm; + case -1: + case 'UNRECOGNIZED': + default: + return PoolType.UNRECOGNIZED; + } +} +export function poolTypeToJSON(object: PoolType): string { + switch (object) { + case PoolType.Balancer: + return 'Balancer'; + case PoolType.Stableswap: + return 'Stableswap'; + case PoolType.Concentrated: + return 'Concentrated'; + case PoolType.CosmWasm: + return 'CosmWasm'; + case PoolType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +/** + * ModuleRouter defines a route encapsulating pool type. + * It is used as the value of a mapping from pool id to the pool type, + * allowing the pool manager to know which module to route swaps to given the + * pool id. + */ +export interface ModuleRoute { + /** pool_type specifies the type of the pool */ + poolType: PoolType; + poolId?: bigint; +} +export interface ModuleRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.ModuleRoute'; + value: Uint8Array; +} +/** + * ModuleRouter defines a route encapsulating pool type. + * It is used as the value of a mapping from pool id to the pool type, + * allowing the pool manager to know which module to route swaps to given the + * pool id. + */ +export interface ModuleRouteAmino { + /** pool_type specifies the type of the pool */ + pool_type?: PoolType; + pool_id?: string; +} +export interface ModuleRouteAminoMsg { + type: 'osmosis/poolmanager/module-route'; + value: ModuleRouteAmino; +} +/** + * ModuleRouter defines a route encapsulating pool type. + * It is used as the value of a mapping from pool id to the pool type, + * allowing the pool manager to know which module to route swaps to given the + * pool id. + */ +export interface ModuleRouteSDKType { + pool_type: PoolType; + pool_id?: bigint; +} +function createBaseModuleRoute(): ModuleRoute { + return { + poolType: 0, + poolId: undefined, + }; +} +export const ModuleRoute = { + typeUrl: '/osmosis.poolmanager.v1beta1.ModuleRoute', + aminoType: 'osmosis/poolmanager/module-route', + is(o: any): o is ModuleRoute { + return o && (o.$typeUrl === ModuleRoute.typeUrl || isSet(o.poolType)); + }, + isSDK(o: any): o is ModuleRouteSDKType { + return o && (o.$typeUrl === ModuleRoute.typeUrl || isSet(o.pool_type)); + }, + isAmino(o: any): o is ModuleRouteAmino { + return o && (o.$typeUrl === ModuleRoute.typeUrl || isSet(o.pool_type)); + }, + encode( + message: ModuleRoute, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolType !== 0) { + writer.uint32(8).int32(message.poolType); + } + if (message.poolId !== undefined) { + writer.uint32(16).uint64(message.poolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleRoute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolType = reader.int32() as any; + break; + case 2: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleRoute { + const message = createBaseModuleRoute(); + message.poolType = object.poolType ?? 0; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : undefined; + return message; + }, + fromAmino(object: ModuleRouteAmino): ModuleRoute { + const message = createBaseModuleRoute(); + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = object.pool_type; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino(message: ModuleRoute): ModuleRouteAmino { + const obj: any = {}; + obj.pool_type = message.poolType === 0 ? undefined : message.poolType; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ModuleRouteAminoMsg): ModuleRoute { + return ModuleRoute.fromAmino(object.value); + }, + toAminoMsg(message: ModuleRoute): ModuleRouteAminoMsg { + return { + type: 'osmosis/poolmanager/module-route', + value: ModuleRoute.toAmino(message), + }; + }, + fromProtoMsg(message: ModuleRouteProtoMsg): ModuleRoute { + return ModuleRoute.decode(message.value); + }, + toProto(message: ModuleRoute): Uint8Array { + return ModuleRoute.encode(message).finish(); + }, + toProtoMsg(message: ModuleRoute): ModuleRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.ModuleRoute', + value: ModuleRoute.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(ModuleRoute.typeUrl, ModuleRoute); +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleRoute.aminoType, + ModuleRoute.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/swap_route.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/swap_route.ts new file mode 100644 index 00000000..6547497e --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/swap_route.ts @@ -0,0 +1,607 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +export interface SwapAmountInRoute { + poolId: bigint; + tokenOutDenom: string; +} +export interface SwapAmountInRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInRoute'; + value: Uint8Array; +} +export interface SwapAmountInRouteAmino { + pool_id?: string; + token_out_denom?: string; +} +export interface SwapAmountInRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-in-route'; + value: SwapAmountInRouteAmino; +} +export interface SwapAmountInRouteSDKType { + pool_id: bigint; + token_out_denom: string; +} +export interface SwapAmountOutRoute { + poolId: bigint; + tokenInDenom: string; +} +export interface SwapAmountOutRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutRoute'; + value: Uint8Array; +} +export interface SwapAmountOutRouteAmino { + pool_id?: string; + token_in_denom?: string; +} +export interface SwapAmountOutRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-out-route'; + value: SwapAmountOutRouteAmino; +} +export interface SwapAmountOutRouteSDKType { + pool_id: bigint; + token_in_denom: string; +} +export interface SwapAmountInSplitRoute { + pools: SwapAmountInRoute[]; + tokenInAmount: string; +} +export interface SwapAmountInSplitRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInSplitRoute'; + value: Uint8Array; +} +export interface SwapAmountInSplitRouteAmino { + pools?: SwapAmountInRouteAmino[]; + token_in_amount?: string; +} +export interface SwapAmountInSplitRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-in-split-route'; + value: SwapAmountInSplitRouteAmino; +} +export interface SwapAmountInSplitRouteSDKType { + pools: SwapAmountInRouteSDKType[]; + token_in_amount: string; +} +export interface SwapAmountOutSplitRoute { + pools: SwapAmountOutRoute[]; + tokenOutAmount: string; +} +export interface SwapAmountOutSplitRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutSplitRoute'; + value: Uint8Array; +} +export interface SwapAmountOutSplitRouteAmino { + pools?: SwapAmountOutRouteAmino[]; + token_out_amount?: string; +} +export interface SwapAmountOutSplitRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-out-split-route'; + value: SwapAmountOutSplitRouteAmino; +} +export interface SwapAmountOutSplitRouteSDKType { + pools: SwapAmountOutRouteSDKType[]; + token_out_amount: string; +} +function createBaseSwapAmountInRoute(): SwapAmountInRoute { + return { + poolId: BigInt(0), + tokenOutDenom: '', + }; +} +export const SwapAmountInRoute = { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInRoute', + aminoType: 'osmosis/poolmanager/swap-amount-in-route', + is(o: any): o is SwapAmountInRoute { + return ( + o && + (o.$typeUrl === SwapAmountInRoute.typeUrl || + (typeof o.poolId === 'bigint' && typeof o.tokenOutDenom === 'string')) + ); + }, + isSDK(o: any): o is SwapAmountInRouteSDKType { + return ( + o && + (o.$typeUrl === SwapAmountInRoute.typeUrl || + (typeof o.pool_id === 'bigint' && + typeof o.token_out_denom === 'string')) + ); + }, + isAmino(o: any): o is SwapAmountInRouteAmino { + return ( + o && + (o.$typeUrl === SwapAmountInRoute.typeUrl || + (typeof o.pool_id === 'bigint' && + typeof o.token_out_denom === 'string')) + ); + }, + encode( + message: SwapAmountInRoute, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenOutDenom !== '') { + writer.uint32(18).string(message.tokenOutDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SwapAmountInRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSwapAmountInRoute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenOutDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SwapAmountInRoute { + const message = createBaseSwapAmountInRoute(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.tokenOutDenom = object.tokenOutDenom ?? ''; + return message; + }, + fromAmino(object: SwapAmountInRouteAmino): SwapAmountInRoute { + const message = createBaseSwapAmountInRoute(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if ( + object.token_out_denom !== undefined && + object.token_out_denom !== null + ) { + message.tokenOutDenom = object.token_out_denom; + } + return message; + }, + toAmino(message: SwapAmountInRoute): SwapAmountInRouteAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.token_out_denom = + message.tokenOutDenom === '' ? undefined : message.tokenOutDenom; + return obj; + }, + fromAminoMsg(object: SwapAmountInRouteAminoMsg): SwapAmountInRoute { + return SwapAmountInRoute.fromAmino(object.value); + }, + toAminoMsg(message: SwapAmountInRoute): SwapAmountInRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-in-route', + value: SwapAmountInRoute.toAmino(message), + }; + }, + fromProtoMsg(message: SwapAmountInRouteProtoMsg): SwapAmountInRoute { + return SwapAmountInRoute.decode(message.value); + }, + toProto(message: SwapAmountInRoute): Uint8Array { + return SwapAmountInRoute.encode(message).finish(); + }, + toProtoMsg(message: SwapAmountInRoute): SwapAmountInRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInRoute', + value: SwapAmountInRoute.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SwapAmountInRoute.typeUrl, SwapAmountInRoute); +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountInRoute.aminoType, + SwapAmountInRoute.typeUrl +); +function createBaseSwapAmountOutRoute(): SwapAmountOutRoute { + return { + poolId: BigInt(0), + tokenInDenom: '', + }; +} +export const SwapAmountOutRoute = { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutRoute', + aminoType: 'osmosis/poolmanager/swap-amount-out-route', + is(o: any): o is SwapAmountOutRoute { + return ( + o && + (o.$typeUrl === SwapAmountOutRoute.typeUrl || + (typeof o.poolId === 'bigint' && typeof o.tokenInDenom === 'string')) + ); + }, + isSDK(o: any): o is SwapAmountOutRouteSDKType { + return ( + o && + (o.$typeUrl === SwapAmountOutRoute.typeUrl || + (typeof o.pool_id === 'bigint' && typeof o.token_in_denom === 'string')) + ); + }, + isAmino(o: any): o is SwapAmountOutRouteAmino { + return ( + o && + (o.$typeUrl === SwapAmountOutRoute.typeUrl || + (typeof o.pool_id === 'bigint' && typeof o.token_in_denom === 'string')) + ); + }, + encode( + message: SwapAmountOutRoute, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenInDenom !== '') { + writer.uint32(18).string(message.tokenInDenom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SwapAmountOutRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSwapAmountOutRoute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenInDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SwapAmountOutRoute { + const message = createBaseSwapAmountOutRoute(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.tokenInDenom = object.tokenInDenom ?? ''; + return message; + }, + fromAmino(object: SwapAmountOutRouteAmino): SwapAmountOutRoute { + const message = createBaseSwapAmountOutRoute(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + return message; + }, + toAmino(message: SwapAmountOutRoute): SwapAmountOutRouteAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.token_in_denom = + message.tokenInDenom === '' ? undefined : message.tokenInDenom; + return obj; + }, + fromAminoMsg(object: SwapAmountOutRouteAminoMsg): SwapAmountOutRoute { + return SwapAmountOutRoute.fromAmino(object.value); + }, + toAminoMsg(message: SwapAmountOutRoute): SwapAmountOutRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-out-route', + value: SwapAmountOutRoute.toAmino(message), + }; + }, + fromProtoMsg(message: SwapAmountOutRouteProtoMsg): SwapAmountOutRoute { + return SwapAmountOutRoute.decode(message.value); + }, + toProto(message: SwapAmountOutRoute): Uint8Array { + return SwapAmountOutRoute.encode(message).finish(); + }, + toProtoMsg(message: SwapAmountOutRoute): SwapAmountOutRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutRoute', + value: SwapAmountOutRoute.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SwapAmountOutRoute.typeUrl, SwapAmountOutRoute); +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountOutRoute.aminoType, + SwapAmountOutRoute.typeUrl +); +function createBaseSwapAmountInSplitRoute(): SwapAmountInSplitRoute { + return { + pools: [], + tokenInAmount: '', + }; +} +export const SwapAmountInSplitRoute = { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInSplitRoute', + aminoType: 'osmosis/poolmanager/swap-amount-in-split-route', + is(o: any): o is SwapAmountInSplitRoute { + return ( + o && + (o.$typeUrl === SwapAmountInSplitRoute.typeUrl || + (Array.isArray(o.pools) && + (!o.pools.length || SwapAmountInRoute.is(o.pools[0])) && + typeof o.tokenInAmount === 'string')) + ); + }, + isSDK(o: any): o is SwapAmountInSplitRouteSDKType { + return ( + o && + (o.$typeUrl === SwapAmountInSplitRoute.typeUrl || + (Array.isArray(o.pools) && + (!o.pools.length || SwapAmountInRoute.isSDK(o.pools[0])) && + typeof o.token_in_amount === 'string')) + ); + }, + isAmino(o: any): o is SwapAmountInSplitRouteAmino { + return ( + o && + (o.$typeUrl === SwapAmountInSplitRoute.typeUrl || + (Array.isArray(o.pools) && + (!o.pools.length || SwapAmountInRoute.isAmino(o.pools[0])) && + typeof o.token_in_amount === 'string')) + ); + }, + encode( + message: SwapAmountInSplitRoute, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.pools) { + SwapAmountInRoute.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tokenInAmount !== '') { + writer.uint32(18).string(message.tokenInAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SwapAmountInSplitRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSwapAmountInSplitRoute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pools.push(SwapAmountInRoute.decode(reader, reader.uint32())); + break; + case 2: + message.tokenInAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SwapAmountInSplitRoute { + const message = createBaseSwapAmountInSplitRoute(); + message.pools = + object.pools?.map((e) => SwapAmountInRoute.fromPartial(e)) || []; + message.tokenInAmount = object.tokenInAmount ?? ''; + return message; + }, + fromAmino(object: SwapAmountInSplitRouteAmino): SwapAmountInSplitRoute { + const message = createBaseSwapAmountInSplitRoute(); + message.pools = + object.pools?.map((e) => SwapAmountInRoute.fromAmino(e)) || []; + if ( + object.token_in_amount !== undefined && + object.token_in_amount !== null + ) { + message.tokenInAmount = object.token_in_amount; + } + return message; + }, + toAmino(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteAmino { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map((e) => + e ? SwapAmountInRoute.toAmino(e) : undefined + ); + } else { + obj.pools = message.pools; + } + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount; + return obj; + }, + fromAminoMsg(object: SwapAmountInSplitRouteAminoMsg): SwapAmountInSplitRoute { + return SwapAmountInSplitRoute.fromAmino(object.value); + }, + toAminoMsg(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-in-split-route', + value: SwapAmountInSplitRoute.toAmino(message), + }; + }, + fromProtoMsg( + message: SwapAmountInSplitRouteProtoMsg + ): SwapAmountInSplitRoute { + return SwapAmountInSplitRoute.decode(message.value); + }, + toProto(message: SwapAmountInSplitRoute): Uint8Array { + return SwapAmountInSplitRoute.encode(message).finish(); + }, + toProtoMsg(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInSplitRoute', + value: SwapAmountInSplitRoute.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SwapAmountInSplitRoute.typeUrl, + SwapAmountInSplitRoute +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountInSplitRoute.aminoType, + SwapAmountInSplitRoute.typeUrl +); +function createBaseSwapAmountOutSplitRoute(): SwapAmountOutSplitRoute { + return { + pools: [], + tokenOutAmount: '', + }; +} +export const SwapAmountOutSplitRoute = { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutSplitRoute', + aminoType: 'osmosis/poolmanager/swap-amount-out-split-route', + is(o: any): o is SwapAmountOutSplitRoute { + return ( + o && + (o.$typeUrl === SwapAmountOutSplitRoute.typeUrl || + (Array.isArray(o.pools) && + (!o.pools.length || SwapAmountOutRoute.is(o.pools[0])) && + typeof o.tokenOutAmount === 'string')) + ); + }, + isSDK(o: any): o is SwapAmountOutSplitRouteSDKType { + return ( + o && + (o.$typeUrl === SwapAmountOutSplitRoute.typeUrl || + (Array.isArray(o.pools) && + (!o.pools.length || SwapAmountOutRoute.isSDK(o.pools[0])) && + typeof o.token_out_amount === 'string')) + ); + }, + isAmino(o: any): o is SwapAmountOutSplitRouteAmino { + return ( + o && + (o.$typeUrl === SwapAmountOutSplitRoute.typeUrl || + (Array.isArray(o.pools) && + (!o.pools.length || SwapAmountOutRoute.isAmino(o.pools[0])) && + typeof o.token_out_amount === 'string')) + ); + }, + encode( + message: SwapAmountOutSplitRoute, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.pools) { + SwapAmountOutRoute.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tokenOutAmount !== '') { + writer.uint32(18).string(message.tokenOutAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SwapAmountOutSplitRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSwapAmountOutSplitRoute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pools.push( + SwapAmountOutRoute.decode(reader, reader.uint32()) + ); + break; + case 2: + message.tokenOutAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SwapAmountOutSplitRoute { + const message = createBaseSwapAmountOutSplitRoute(); + message.pools = + object.pools?.map((e) => SwapAmountOutRoute.fromPartial(e)) || []; + message.tokenOutAmount = object.tokenOutAmount ?? ''; + return message; + }, + fromAmino(object: SwapAmountOutSplitRouteAmino): SwapAmountOutSplitRoute { + const message = createBaseSwapAmountOutSplitRoute(); + message.pools = + object.pools?.map((e) => SwapAmountOutRoute.fromAmino(e)) || []; + if ( + object.token_out_amount !== undefined && + object.token_out_amount !== null + ) { + message.tokenOutAmount = object.token_out_amount; + } + return message; + }, + toAmino(message: SwapAmountOutSplitRoute): SwapAmountOutSplitRouteAmino { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map((e) => + e ? SwapAmountOutRoute.toAmino(e) : undefined + ); + } else { + obj.pools = message.pools; + } + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount; + return obj; + }, + fromAminoMsg( + object: SwapAmountOutSplitRouteAminoMsg + ): SwapAmountOutSplitRoute { + return SwapAmountOutSplitRoute.fromAmino(object.value); + }, + toAminoMsg( + message: SwapAmountOutSplitRoute + ): SwapAmountOutSplitRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-out-split-route', + value: SwapAmountOutSplitRoute.toAmino(message), + }; + }, + fromProtoMsg( + message: SwapAmountOutSplitRouteProtoMsg + ): SwapAmountOutSplitRoute { + return SwapAmountOutSplitRoute.decode(message.value); + }, + toProto(message: SwapAmountOutSplitRoute): Uint8Array { + return SwapAmountOutSplitRoute.encode(message).finish(); + }, + toProtoMsg( + message: SwapAmountOutSplitRoute + ): SwapAmountOutSplitRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutSplitRoute', + value: SwapAmountOutSplitRoute.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SwapAmountOutSplitRoute.typeUrl, + SwapAmountOutSplitRoute +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountOutSplitRoute.aminoType, + SwapAmountOutSplitRoute.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.amino.ts new file mode 100644 index 00000000..a6d513dc --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.amino.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { + MsgSwapExactAmountIn, + MsgSwapExactAmountOut, + MsgSplitRouteSwapExactAmountIn, + MsgSplitRouteSwapExactAmountOut, + MsgSetDenomPairTakerFee, +} from './tx'; +export const AminoConverter = { + '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn': { + aminoType: 'osmosis/poolmanager/swap-exact-amount-in', + toAmino: MsgSwapExactAmountIn.toAmino, + fromAmino: MsgSwapExactAmountIn.fromAmino, + }, + '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut': { + aminoType: 'osmosis/poolmanager/swap-exact-amount-out', + toAmino: MsgSwapExactAmountOut.toAmino, + fromAmino: MsgSwapExactAmountOut.fromAmino, + }, + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn': { + aminoType: 'osmosis/poolmanager/split-amount-in', + toAmino: MsgSplitRouteSwapExactAmountIn.toAmino, + fromAmino: MsgSplitRouteSwapExactAmountIn.fromAmino, + }, + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut': { + aminoType: 'osmosis/poolmanager/split-amount-out', + toAmino: MsgSplitRouteSwapExactAmountOut.toAmino, + fromAmino: MsgSplitRouteSwapExactAmountOut.fromAmino, + }, + '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee': { + aminoType: 'osmosis/poolmanager/set-denom-pair-taker-fee', + toAmino: MsgSetDenomPairTakerFee.toAmino, + fromAmino: MsgSetDenomPairTakerFee.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.registry.ts new file mode 100644 index 00000000..22e21bec --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.registry.ts @@ -0,0 +1,129 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgSwapExactAmountIn, + MsgSwapExactAmountOut, + MsgSplitRouteSwapExactAmountIn, + MsgSplitRouteSwapExactAmountOut, + MsgSetDenomPairTakerFee, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', MsgSwapExactAmountIn], + ['/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', MsgSwapExactAmountOut], + [ + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + MsgSplitRouteSwapExactAmountIn, + ], + [ + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + MsgSplitRouteSwapExactAmountOut, + ], + [ + '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + MsgSetDenomPairTakerFee, + ], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(value).finish(), + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(value).finish(), + }; + }, + splitRouteSwapExactAmountIn(value: MsgSplitRouteSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value: MsgSplitRouteSwapExactAmountIn.encode(value).finish(), + }; + }, + splitRouteSwapExactAmountOut(value: MsgSplitRouteSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + value: MsgSplitRouteSwapExactAmountOut.encode(value).finish(), + }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + value: MsgSetDenomPairTakerFee.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value, + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value, + }; + }, + splitRouteSwapExactAmountIn(value: MsgSplitRouteSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value, + }; + }, + splitRouteSwapExactAmountOut(value: MsgSplitRouteSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + value, + }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + value, + }; + }, + }, + fromPartial: { + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.fromPartial(value), + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.fromPartial(value), + }; + }, + splitRouteSwapExactAmountIn(value: MsgSplitRouteSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value: MsgSplitRouteSwapExactAmountIn.fromPartial(value), + }; + }, + splitRouteSwapExactAmountOut(value: MsgSplitRouteSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + value: MsgSplitRouteSwapExactAmountOut.fromPartial(value), + }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + value: MsgSetDenomPairTakerFee.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..4d096456 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,114 @@ +//@ts-nocheck +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; + +import { + MsgSwapExactAmountIn, + MsgSwapExactAmountInResponse, + MsgSwapExactAmountOut, + MsgSwapExactAmountOutResponse, + MsgSplitRouteSwapExactAmountIn, + MsgSplitRouteSwapExactAmountInResponse, + MsgSplitRouteSwapExactAmountOut, + MsgSplitRouteSwapExactAmountOutResponse, + MsgSetDenomPairTakerFee, + MsgSetDenomPairTakerFeeResponse, +} from './tx'; +export interface Msg { + swapExactAmountIn( + request: MsgSwapExactAmountIn + ): Promise; + swapExactAmountOut( + request: MsgSwapExactAmountOut + ): Promise; + splitRouteSwapExactAmountIn( + request: MsgSplitRouteSwapExactAmountIn + ): Promise; + splitRouteSwapExactAmountOut( + request: MsgSplitRouteSwapExactAmountOut + ): Promise; + setDenomPairTakerFee( + request: MsgSetDenomPairTakerFee + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.swapExactAmountIn = this.swapExactAmountIn.bind(this); + this.swapExactAmountOut = this.swapExactAmountOut.bind(this); + this.splitRouteSwapExactAmountIn = + this.splitRouteSwapExactAmountIn.bind(this); + this.splitRouteSwapExactAmountOut = + this.splitRouteSwapExactAmountOut.bind(this); + this.setDenomPairTakerFee = this.setDenomPairTakerFee.bind(this); + } + swapExactAmountIn( + request: MsgSwapExactAmountIn + ): Promise { + const data = MsgSwapExactAmountIn.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.poolmanager.v1beta1.Msg', + 'SwapExactAmountIn', + data + ); + return promise.then((data) => + MsgSwapExactAmountInResponse.decode(new BinaryReader(data)) + ); + } + swapExactAmountOut( + request: MsgSwapExactAmountOut + ): Promise { + const data = MsgSwapExactAmountOut.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.poolmanager.v1beta1.Msg', + 'SwapExactAmountOut', + data + ); + return promise.then((data) => + MsgSwapExactAmountOutResponse.decode(new BinaryReader(data)) + ); + } + splitRouteSwapExactAmountIn( + request: MsgSplitRouteSwapExactAmountIn + ): Promise { + const data = MsgSplitRouteSwapExactAmountIn.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.poolmanager.v1beta1.Msg', + 'SplitRouteSwapExactAmountIn', + data + ); + return promise.then((data) => + MsgSplitRouteSwapExactAmountInResponse.decode(new BinaryReader(data)) + ); + } + splitRouteSwapExactAmountOut( + request: MsgSplitRouteSwapExactAmountOut + ): Promise { + const data = MsgSplitRouteSwapExactAmountOut.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.poolmanager.v1beta1.Msg', + 'SplitRouteSwapExactAmountOut', + data + ); + return promise.then((data) => + MsgSplitRouteSwapExactAmountOutResponse.decode(new BinaryReader(data)) + ); + } + setDenomPairTakerFee( + request: MsgSetDenomPairTakerFee + ): Promise { + const data = MsgSetDenomPairTakerFee.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.poolmanager.v1beta1.Msg', + 'SetDenomPairTakerFee', + data + ); + return promise.then((data) => + MsgSetDenomPairTakerFeeResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.ts new file mode 100644 index 00000000..80b78734 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v1beta1/tx.ts @@ -0,0 +1,1888 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + SwapAmountInRoute, + SwapAmountInRouteAmino, + SwapAmountInRouteSDKType, + SwapAmountOutRoute, + SwapAmountOutRouteAmino, + SwapAmountOutRouteSDKType, + SwapAmountInSplitRoute, + SwapAmountInSplitRouteAmino, + SwapAmountInSplitRouteSDKType, + SwapAmountOutSplitRoute, + SwapAmountOutSplitRouteAmino, + SwapAmountOutSplitRouteSDKType, +} from './swap_route'; + +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountIn { + sender: string; + routes: SwapAmountInRoute[]; + tokenIn: Coin; + tokenOutMinAmount: string; +} +export interface MsgSwapExactAmountInProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn'; + value: Uint8Array; +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInAmino { + sender?: string; + routes?: SwapAmountInRouteAmino[]; + token_in?: CoinAmino; + token_out_min_amount?: string; +} +export interface MsgSwapExactAmountInAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-in'; + value: MsgSwapExactAmountInAmino; +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInSDKType { + sender: string; + routes: SwapAmountInRouteSDKType[]; + token_in: CoinSDKType; + token_out_min_amount: string; +} +export interface MsgSwapExactAmountInResponse { + tokenOutAmount: string; +} +export interface MsgSwapExactAmountInResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountInResponse'; + value: Uint8Array; +} +export interface MsgSwapExactAmountInResponseAmino { + token_out_amount?: string; +} +export interface MsgSwapExactAmountInResponseAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-in-response'; + value: MsgSwapExactAmountInResponseAmino; +} +export interface MsgSwapExactAmountInResponseSDKType { + token_out_amount: string; +} +/** ===================== MsgSplitRouteSwapExactAmountIn */ +export interface MsgSplitRouteSwapExactAmountIn { + sender: string; + routes: SwapAmountInSplitRoute[]; + tokenInDenom: string; + tokenOutMinAmount: string; +} +export interface MsgSplitRouteSwapExactAmountInProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn'; + value: Uint8Array; +} +/** ===================== MsgSplitRouteSwapExactAmountIn */ +export interface MsgSplitRouteSwapExactAmountInAmino { + sender?: string; + routes?: SwapAmountInSplitRouteAmino[]; + token_in_denom?: string; + token_out_min_amount?: string; +} +export interface MsgSplitRouteSwapExactAmountInAminoMsg { + type: 'osmosis/poolmanager/split-amount-in'; + value: MsgSplitRouteSwapExactAmountInAmino; +} +/** ===================== MsgSplitRouteSwapExactAmountIn */ +export interface MsgSplitRouteSwapExactAmountInSDKType { + sender: string; + routes: SwapAmountInSplitRouteSDKType[]; + token_in_denom: string; + token_out_min_amount: string; +} +export interface MsgSplitRouteSwapExactAmountInResponse { + tokenOutAmount: string; +} +export interface MsgSplitRouteSwapExactAmountInResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountInResponse'; + value: Uint8Array; +} +export interface MsgSplitRouteSwapExactAmountInResponseAmino { + token_out_amount?: string; +} +export interface MsgSplitRouteSwapExactAmountInResponseAminoMsg { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-in-response'; + value: MsgSplitRouteSwapExactAmountInResponseAmino; +} +export interface MsgSplitRouteSwapExactAmountInResponseSDKType { + token_out_amount: string; +} +/** ===================== MsgSwapExactAmountOut */ +export interface MsgSwapExactAmountOut { + sender: string; + routes: SwapAmountOutRoute[]; + tokenInMaxAmount: string; + tokenOut: Coin; +} +export interface MsgSwapExactAmountOutProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut'; + value: Uint8Array; +} +/** ===================== MsgSwapExactAmountOut */ +export interface MsgSwapExactAmountOutAmino { + sender?: string; + routes?: SwapAmountOutRouteAmino[]; + token_in_max_amount?: string; + token_out?: CoinAmino; +} +export interface MsgSwapExactAmountOutAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-out'; + value: MsgSwapExactAmountOutAmino; +} +/** ===================== MsgSwapExactAmountOut */ +export interface MsgSwapExactAmountOutSDKType { + sender: string; + routes: SwapAmountOutRouteSDKType[]; + token_in_max_amount: string; + token_out: CoinSDKType; +} +export interface MsgSwapExactAmountOutResponse { + tokenInAmount: string; +} +export interface MsgSwapExactAmountOutResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOutResponse'; + value: Uint8Array; +} +export interface MsgSwapExactAmountOutResponseAmino { + token_in_amount?: string; +} +export interface MsgSwapExactAmountOutResponseAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-out-response'; + value: MsgSwapExactAmountOutResponseAmino; +} +export interface MsgSwapExactAmountOutResponseSDKType { + token_in_amount: string; +} +/** ===================== MsgSplitRouteSwapExactAmountOut */ +export interface MsgSplitRouteSwapExactAmountOut { + sender: string; + routes: SwapAmountOutSplitRoute[]; + tokenOutDenom: string; + tokenInMaxAmount: string; +} +export interface MsgSplitRouteSwapExactAmountOutProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut'; + value: Uint8Array; +} +/** ===================== MsgSplitRouteSwapExactAmountOut */ +export interface MsgSplitRouteSwapExactAmountOutAmino { + sender?: string; + routes?: SwapAmountOutSplitRouteAmino[]; + token_out_denom?: string; + token_in_max_amount?: string; +} +export interface MsgSplitRouteSwapExactAmountOutAminoMsg { + type: 'osmosis/poolmanager/split-amount-out'; + value: MsgSplitRouteSwapExactAmountOutAmino; +} +/** ===================== MsgSplitRouteSwapExactAmountOut */ +export interface MsgSplitRouteSwapExactAmountOutSDKType { + sender: string; + routes: SwapAmountOutSplitRouteSDKType[]; + token_out_denom: string; + token_in_max_amount: string; +} +export interface MsgSplitRouteSwapExactAmountOutResponse { + tokenInAmount: string; +} +export interface MsgSplitRouteSwapExactAmountOutResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOutResponse'; + value: Uint8Array; +} +export interface MsgSplitRouteSwapExactAmountOutResponseAmino { + token_in_amount?: string; +} +export interface MsgSplitRouteSwapExactAmountOutResponseAminoMsg { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-out-response'; + value: MsgSplitRouteSwapExactAmountOutResponseAmino; +} +export interface MsgSplitRouteSwapExactAmountOutResponseSDKType { + token_in_amount: string; +} +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFee { + sender: string; + denomPairTakerFee: DenomPairTakerFee[]; +} +export interface MsgSetDenomPairTakerFeeProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee'; + value: Uint8Array; +} +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFeeAmino { + sender?: string; + denom_pair_taker_fee?: DenomPairTakerFeeAmino[]; +} +export interface MsgSetDenomPairTakerFeeAminoMsg { + type: 'osmosis/poolmanager/set-denom-pair-taker-fee'; + value: MsgSetDenomPairTakerFeeAmino; +} +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFeeSDKType { + sender: string; + denom_pair_taker_fee: DenomPairTakerFeeSDKType[]; +} +export interface MsgSetDenomPairTakerFeeResponse { + success: boolean; +} +export interface MsgSetDenomPairTakerFeeResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse'; + value: Uint8Array; +} +export interface MsgSetDenomPairTakerFeeResponseAmino { + success?: boolean; +} +export interface MsgSetDenomPairTakerFeeResponseAminoMsg { + type: 'osmosis/poolmanager/set-denom-pair-taker-fee-response'; + value: MsgSetDenomPairTakerFeeResponseAmino; +} +export interface MsgSetDenomPairTakerFeeResponseSDKType { + success: boolean; +} +export interface DenomPairTakerFee { + /** + * denom0 and denom1 get automatically lexigographically sorted + * when being stored, so the order of input here does not matter. + */ + denom0: string; + denom1: string; + takerFee: string; +} +export interface DenomPairTakerFeeProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.DenomPairTakerFee'; + value: Uint8Array; +} +export interface DenomPairTakerFeeAmino { + /** + * denom0 and denom1 get automatically lexigographically sorted + * when being stored, so the order of input here does not matter. + */ + denom0?: string; + denom1?: string; + taker_fee?: string; +} +export interface DenomPairTakerFeeAminoMsg { + type: 'osmosis/poolmanager/denom-pair-taker-fee'; + value: DenomPairTakerFeeAmino; +} +export interface DenomPairTakerFeeSDKType { + denom0: string; + denom1: string; + taker_fee: string; +} +function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { + return { + sender: '', + routes: [], + tokenIn: Coin.fromPartial({}), + tokenOutMinAmount: '', + }; +} +export const MsgSwapExactAmountIn = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + aminoType: 'osmosis/poolmanager/swap-exact-amount-in', + is(o: any): o is MsgSwapExactAmountIn { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInRoute.is(o.routes[0])) && + Coin.is(o.tokenIn) && + typeof o.tokenOutMinAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgSwapExactAmountInSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInRoute.isSDK(o.routes[0])) && + Coin.isSDK(o.token_in) && + typeof o.token_out_min_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgSwapExactAmountInAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInRoute.isAmino(o.routes[0])) && + Coin.isAmino(o.token_in) && + typeof o.token_out_min_amount === 'string')) + ); + }, + encode( + message: MsgSwapExactAmountIn, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.routes) { + SwapAmountInRoute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.tokenIn !== undefined) { + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim(); + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(34).string(message.tokenOutMinAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountIn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.routes.push( + SwapAmountInRoute.decode(reader, reader.uint32()) + ); + break; + case 3: + message.tokenIn = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.tokenOutMinAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSwapExactAmountIn { + const message = createBaseMsgSwapExactAmountIn(); + message.sender = object.sender ?? ''; + message.routes = + object.routes?.map((e) => SwapAmountInRoute.fromPartial(e)) || []; + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined; + message.tokenOutMinAmount = object.tokenOutMinAmount ?? ''; + return message; + }, + fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { + const message = createBaseMsgSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = + object.routes?.map((e) => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if ( + object.token_out_min_amount !== undefined && + object.token_out_min_amount !== null + ) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; + }, + toAmino(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountInRoute.toAmino(e) : undefined + ); + } else { + obj.routes = message.routes; + } + obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined; + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount; + return obj; + }, + fromAminoMsg(object: MsgSwapExactAmountInAminoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.fromAmino(object.value); + }, + toAminoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-in', + value: MsgSwapExactAmountIn.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSwapExactAmountInProtoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.decode(message.value); + }, + toProto(message: MsgSwapExactAmountIn): Uint8Array { + return MsgSwapExactAmountIn.encode(message).finish(); + }, + toProtoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountIn.typeUrl, + MsgSwapExactAmountIn +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountIn.aminoType, + MsgSwapExactAmountIn.typeUrl +); +function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse { + return { + tokenOutAmount: '', + }; +} +export const MsgSwapExactAmountInResponse = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountInResponse', + aminoType: 'osmosis/poolmanager/swap-exact-amount-in-response', + is(o: any): o is MsgSwapExactAmountInResponse { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || + typeof o.tokenOutAmount === 'string') + ); + }, + isSDK(o: any): o is MsgSwapExactAmountInResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + isAmino(o: any): o is MsgSwapExactAmountInResponseAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + encode( + message: MsgSwapExactAmountInResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenOutAmount !== '') { + writer.uint32(10).string(message.tokenOutAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountInResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountInResponse { + const message = createBaseMsgSwapExactAmountInResponse(); + message.tokenOutAmount = object.tokenOutAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSwapExactAmountInResponseAmino + ): MsgSwapExactAmountInResponse { + const message = createBaseMsgSwapExactAmountInResponse(); + if ( + object.token_out_amount !== undefined && + object.token_out_amount !== null + ) { + message.tokenOutAmount = object.token_out_amount; + } + return message; + }, + toAmino( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseAmino { + const obj: any = {}; + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount; + return obj; + }, + fromAminoMsg( + object: MsgSwapExactAmountInResponseAminoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-in-response', + value: MsgSwapExactAmountInResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSwapExactAmountInResponseProtoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.decode(message.value); + }, + toProto(message: MsgSwapExactAmountInResponse): Uint8Array { + return MsgSwapExactAmountInResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountInResponse', + value: MsgSwapExactAmountInResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountInResponse.typeUrl, + MsgSwapExactAmountInResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountInResponse.aminoType, + MsgSwapExactAmountInResponse.typeUrl +); +function createBaseMsgSplitRouteSwapExactAmountIn(): MsgSplitRouteSwapExactAmountIn { + return { + sender: '', + routes: [], + tokenInDenom: '', + tokenOutMinAmount: '', + }; +} +export const MsgSplitRouteSwapExactAmountIn = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + aminoType: 'osmosis/poolmanager/split-amount-in', + is(o: any): o is MsgSplitRouteSwapExactAmountIn { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInSplitRoute.is(o.routes[0])) && + typeof o.tokenInDenom === 'string' && + typeof o.tokenOutMinAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountInSDKType { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInSplitRoute.isSDK(o.routes[0])) && + typeof o.token_in_denom === 'string' && + typeof o.token_out_min_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountInAmino { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountIn.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountInSplitRoute.isAmino(o.routes[0])) && + typeof o.token_in_denom === 'string' && + typeof o.token_out_min_amount === 'string')) + ); + }, + encode( + message: MsgSplitRouteSwapExactAmountIn, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.routes) { + SwapAmountInSplitRoute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.tokenInDenom !== '') { + writer.uint32(26).string(message.tokenInDenom); + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(34).string(message.tokenOutMinAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSplitRouteSwapExactAmountIn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.routes.push( + SwapAmountInSplitRoute.decode(reader, reader.uint32()) + ); + break; + case 3: + message.tokenInDenom = reader.string(); + break; + case 4: + message.tokenOutMinAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountIn { + const message = createBaseMsgSplitRouteSwapExactAmountIn(); + message.sender = object.sender ?? ''; + message.routes = + object.routes?.map((e) => SwapAmountInSplitRoute.fromPartial(e)) || []; + message.tokenInDenom = object.tokenInDenom ?? ''; + message.tokenOutMinAmount = object.tokenOutMinAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountInAmino + ): MsgSplitRouteSwapExactAmountIn { + const message = createBaseMsgSplitRouteSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = + object.routes?.map((e) => SwapAmountInSplitRoute.fromAmino(e)) || []; + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if ( + object.token_out_min_amount !== undefined && + object.token_out_min_amount !== null + ) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; + }, + toAmino( + message: MsgSplitRouteSwapExactAmountIn + ): MsgSplitRouteSwapExactAmountInAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountInSplitRoute.toAmino(e) : undefined + ); + } else { + obj.routes = message.routes; + } + obj.token_in_denom = + message.tokenInDenom === '' ? undefined : message.tokenInDenom; + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount; + return obj; + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountInAminoMsg + ): MsgSplitRouteSwapExactAmountIn { + return MsgSplitRouteSwapExactAmountIn.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountIn + ): MsgSplitRouteSwapExactAmountInAminoMsg { + return { + type: 'osmosis/poolmanager/split-amount-in', + value: MsgSplitRouteSwapExactAmountIn.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountInProtoMsg + ): MsgSplitRouteSwapExactAmountIn { + return MsgSplitRouteSwapExactAmountIn.decode(message.value); + }, + toProto(message: MsgSplitRouteSwapExactAmountIn): Uint8Array { + return MsgSplitRouteSwapExactAmountIn.encode(message).finish(); + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountIn + ): MsgSplitRouteSwapExactAmountInProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value: MsgSplitRouteSwapExactAmountIn.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSplitRouteSwapExactAmountIn.typeUrl, + MsgSplitRouteSwapExactAmountIn +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSplitRouteSwapExactAmountIn.aminoType, + MsgSplitRouteSwapExactAmountIn.typeUrl +); +function createBaseMsgSplitRouteSwapExactAmountInResponse(): MsgSplitRouteSwapExactAmountInResponse { + return { + tokenOutAmount: '', + }; +} +export const MsgSplitRouteSwapExactAmountInResponse = { + typeUrl: + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountInResponse', + aminoType: 'osmosis/poolmanager/split-route-swap-exact-amount-in-response', + is(o: any): o is MsgSplitRouteSwapExactAmountInResponse { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountInResponse.typeUrl || + typeof o.tokenOutAmount === 'string') + ); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountInResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountInResponseAmino { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountInResponse.typeUrl || + typeof o.token_out_amount === 'string') + ); + }, + encode( + message: MsgSplitRouteSwapExactAmountInResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenOutAmount !== '') { + writer.uint32(10).string(message.tokenOutAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSplitRouteSwapExactAmountInResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountInResponse { + const message = createBaseMsgSplitRouteSwapExactAmountInResponse(); + message.tokenOutAmount = object.tokenOutAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountInResponseAmino + ): MsgSplitRouteSwapExactAmountInResponse { + const message = createBaseMsgSplitRouteSwapExactAmountInResponse(); + if ( + object.token_out_amount !== undefined && + object.token_out_amount !== null + ) { + message.tokenOutAmount = object.token_out_amount; + } + return message; + }, + toAmino( + message: MsgSplitRouteSwapExactAmountInResponse + ): MsgSplitRouteSwapExactAmountInResponseAmino { + const obj: any = {}; + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount; + return obj; + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountInResponseAminoMsg + ): MsgSplitRouteSwapExactAmountInResponse { + return MsgSplitRouteSwapExactAmountInResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountInResponse + ): MsgSplitRouteSwapExactAmountInResponseAminoMsg { + return { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-in-response', + value: MsgSplitRouteSwapExactAmountInResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountInResponseProtoMsg + ): MsgSplitRouteSwapExactAmountInResponse { + return MsgSplitRouteSwapExactAmountInResponse.decode(message.value); + }, + toProto(message: MsgSplitRouteSwapExactAmountInResponse): Uint8Array { + return MsgSplitRouteSwapExactAmountInResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountInResponse + ): MsgSplitRouteSwapExactAmountInResponseProtoMsg { + return { + typeUrl: + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountInResponse', + value: MsgSplitRouteSwapExactAmountInResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSplitRouteSwapExactAmountInResponse.typeUrl, + MsgSplitRouteSwapExactAmountInResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSplitRouteSwapExactAmountInResponse.aminoType, + MsgSplitRouteSwapExactAmountInResponse.typeUrl +); +function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { + return { + sender: '', + routes: [], + tokenInMaxAmount: '', + tokenOut: Coin.fromPartial({}), + }; +} +export const MsgSwapExactAmountOut = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + aminoType: 'osmosis/poolmanager/swap-exact-amount-out', + is(o: any): o is MsgSwapExactAmountOut { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutRoute.is(o.routes[0])) && + typeof o.tokenInMaxAmount === 'string' && + Coin.is(o.tokenOut))) + ); + }, + isSDK(o: any): o is MsgSwapExactAmountOutSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutRoute.isSDK(o.routes[0])) && + typeof o.token_in_max_amount === 'string' && + Coin.isSDK(o.token_out))) + ); + }, + isAmino(o: any): o is MsgSwapExactAmountOutAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutRoute.isAmino(o.routes[0])) && + typeof o.token_in_max_amount === 'string' && + Coin.isAmino(o.token_out))) + ); + }, + encode( + message: MsgSwapExactAmountOut, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.routes) { + SwapAmountOutRoute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(26).string(message.tokenInMaxAmount); + } + if (message.tokenOut !== undefined) { + Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountOut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.routes.push( + SwapAmountOutRoute.decode(reader, reader.uint32()) + ); + break; + case 3: + message.tokenInMaxAmount = reader.string(); + break; + case 4: + message.tokenOut = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSwapExactAmountOut { + const message = createBaseMsgSwapExactAmountOut(); + message.sender = object.sender ?? ''; + message.routes = + object.routes?.map((e) => SwapAmountOutRoute.fromPartial(e)) || []; + message.tokenInMaxAmount = object.tokenInMaxAmount ?? ''; + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined; + return message; + }, + fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { + const message = createBaseMsgSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = + object.routes?.map((e) => SwapAmountOutRoute.fromAmino(e)) || []; + if ( + object.token_in_max_amount !== undefined && + object.token_in_max_amount !== null + ) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; + }, + toAmino(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountOutRoute.toAmino(e) : undefined + ); + } else { + obj.routes = message.routes; + } + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount; + obj.token_out = message.tokenOut + ? Coin.toAmino(message.tokenOut) + : undefined; + return obj; + }, + fromAminoMsg(object: MsgSwapExactAmountOutAminoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.fromAmino(object.value); + }, + toAminoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-out', + value: MsgSwapExactAmountOut.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSwapExactAmountOutProtoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.decode(message.value); + }, + toProto(message: MsgSwapExactAmountOut): Uint8Array { + return MsgSwapExactAmountOut.encode(message).finish(); + }, + toProtoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountOut.typeUrl, + MsgSwapExactAmountOut +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOut.aminoType, + MsgSwapExactAmountOut.typeUrl +); +function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutResponse { + return { + tokenInAmount: '', + }; +} +export const MsgSwapExactAmountOutResponse = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOutResponse', + aminoType: 'osmosis/poolmanager/swap-exact-amount-out-response', + is(o: any): o is MsgSwapExactAmountOutResponse { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || + typeof o.tokenInAmount === 'string') + ); + }, + isSDK(o: any): o is MsgSwapExactAmountOutResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + isAmino(o: any): o is MsgSwapExactAmountOutResponseAmino { + return ( + o && + (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + encode( + message: MsgSwapExactAmountOutResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenInAmount !== '') { + writer.uint32(10).string(message.tokenInAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSwapExactAmountOutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountOutResponse { + const message = createBaseMsgSwapExactAmountOutResponse(); + message.tokenInAmount = object.tokenInAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSwapExactAmountOutResponseAmino + ): MsgSwapExactAmountOutResponse { + const message = createBaseMsgSwapExactAmountOutResponse(); + if ( + object.token_in_amount !== undefined && + object.token_in_amount !== null + ) { + message.tokenInAmount = object.token_in_amount; + } + return message; + }, + toAmino( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseAmino { + const obj: any = {}; + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount; + return obj; + }, + fromAminoMsg( + object: MsgSwapExactAmountOutResponseAminoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-out-response', + value: MsgSwapExactAmountOutResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSwapExactAmountOutResponseProtoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.decode(message.value); + }, + toProto(message: MsgSwapExactAmountOutResponse): Uint8Array { + return MsgSwapExactAmountOutResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOutResponse', + value: MsgSwapExactAmountOutResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSwapExactAmountOutResponse.typeUrl, + MsgSwapExactAmountOutResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOutResponse.aminoType, + MsgSwapExactAmountOutResponse.typeUrl +); +function createBaseMsgSplitRouteSwapExactAmountOut(): MsgSplitRouteSwapExactAmountOut { + return { + sender: '', + routes: [], + tokenOutDenom: '', + tokenInMaxAmount: '', + }; +} +export const MsgSplitRouteSwapExactAmountOut = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + aminoType: 'osmosis/poolmanager/split-amount-out', + is(o: any): o is MsgSplitRouteSwapExactAmountOut { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutSplitRoute.is(o.routes[0])) && + typeof o.tokenOutDenom === 'string' && + typeof o.tokenInMaxAmount === 'string')) + ); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountOutSDKType { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutSplitRoute.isSDK(o.routes[0])) && + typeof o.token_out_denom === 'string' && + typeof o.token_in_max_amount === 'string')) + ); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountOutAmino { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountOut.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.routes) && + (!o.routes.length || SwapAmountOutSplitRoute.isAmino(o.routes[0])) && + typeof o.token_out_denom === 'string' && + typeof o.token_in_max_amount === 'string')) + ); + }, + encode( + message: MsgSplitRouteSwapExactAmountOut, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.routes) { + SwapAmountOutSplitRoute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.tokenOutDenom !== '') { + writer.uint32(26).string(message.tokenOutDenom); + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(34).string(message.tokenInMaxAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSplitRouteSwapExactAmountOut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.routes.push( + SwapAmountOutSplitRoute.decode(reader, reader.uint32()) + ); + break; + case 3: + message.tokenOutDenom = reader.string(); + break; + case 4: + message.tokenInMaxAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountOut { + const message = createBaseMsgSplitRouteSwapExactAmountOut(); + message.sender = object.sender ?? ''; + message.routes = + object.routes?.map((e) => SwapAmountOutSplitRoute.fromPartial(e)) || []; + message.tokenOutDenom = object.tokenOutDenom ?? ''; + message.tokenInMaxAmount = object.tokenInMaxAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountOutAmino + ): MsgSplitRouteSwapExactAmountOut { + const message = createBaseMsgSplitRouteSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = + object.routes?.map((e) => SwapAmountOutSplitRoute.fromAmino(e)) || []; + if ( + object.token_out_denom !== undefined && + object.token_out_denom !== null + ) { + message.tokenOutDenom = object.token_out_denom; + } + if ( + object.token_in_max_amount !== undefined && + object.token_in_max_amount !== null + ) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + return message; + }, + toAmino( + message: MsgSplitRouteSwapExactAmountOut + ): MsgSplitRouteSwapExactAmountOutAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountOutSplitRoute.toAmino(e) : undefined + ); + } else { + obj.routes = message.routes; + } + obj.token_out_denom = + message.tokenOutDenom === '' ? undefined : message.tokenOutDenom; + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount; + return obj; + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountOutAminoMsg + ): MsgSplitRouteSwapExactAmountOut { + return MsgSplitRouteSwapExactAmountOut.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountOut + ): MsgSplitRouteSwapExactAmountOutAminoMsg { + return { + type: 'osmosis/poolmanager/split-amount-out', + value: MsgSplitRouteSwapExactAmountOut.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountOutProtoMsg + ): MsgSplitRouteSwapExactAmountOut { + return MsgSplitRouteSwapExactAmountOut.decode(message.value); + }, + toProto(message: MsgSplitRouteSwapExactAmountOut): Uint8Array { + return MsgSplitRouteSwapExactAmountOut.encode(message).finish(); + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountOut + ): MsgSplitRouteSwapExactAmountOutProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + value: MsgSplitRouteSwapExactAmountOut.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSplitRouteSwapExactAmountOut.typeUrl, + MsgSplitRouteSwapExactAmountOut +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSplitRouteSwapExactAmountOut.aminoType, + MsgSplitRouteSwapExactAmountOut.typeUrl +); +function createBaseMsgSplitRouteSwapExactAmountOutResponse(): MsgSplitRouteSwapExactAmountOutResponse { + return { + tokenInAmount: '', + }; +} +export const MsgSplitRouteSwapExactAmountOutResponse = { + typeUrl: + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOutResponse', + aminoType: 'osmosis/poolmanager/split-route-swap-exact-amount-out-response', + is(o: any): o is MsgSplitRouteSwapExactAmountOutResponse { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountOutResponse.typeUrl || + typeof o.tokenInAmount === 'string') + ); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountOutResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountOutResponseAmino { + return ( + o && + (o.$typeUrl === MsgSplitRouteSwapExactAmountOutResponse.typeUrl || + typeof o.token_in_amount === 'string') + ); + }, + encode( + message: MsgSplitRouteSwapExactAmountOutResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.tokenInAmount !== '') { + writer.uint32(10).string(message.tokenInAmount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSplitRouteSwapExactAmountOutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountOutResponse { + const message = createBaseMsgSplitRouteSwapExactAmountOutResponse(); + message.tokenInAmount = object.tokenInAmount ?? ''; + return message; + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountOutResponseAmino + ): MsgSplitRouteSwapExactAmountOutResponse { + const message = createBaseMsgSplitRouteSwapExactAmountOutResponse(); + if ( + object.token_in_amount !== undefined && + object.token_in_amount !== null + ) { + message.tokenInAmount = object.token_in_amount; + } + return message; + }, + toAmino( + message: MsgSplitRouteSwapExactAmountOutResponse + ): MsgSplitRouteSwapExactAmountOutResponseAmino { + const obj: any = {}; + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount; + return obj; + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountOutResponseAminoMsg + ): MsgSplitRouteSwapExactAmountOutResponse { + return MsgSplitRouteSwapExactAmountOutResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountOutResponse + ): MsgSplitRouteSwapExactAmountOutResponseAminoMsg { + return { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-out-response', + value: MsgSplitRouteSwapExactAmountOutResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountOutResponseProtoMsg + ): MsgSplitRouteSwapExactAmountOutResponse { + return MsgSplitRouteSwapExactAmountOutResponse.decode(message.value); + }, + toProto(message: MsgSplitRouteSwapExactAmountOutResponse): Uint8Array { + return MsgSplitRouteSwapExactAmountOutResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountOutResponse + ): MsgSplitRouteSwapExactAmountOutResponseProtoMsg { + return { + typeUrl: + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOutResponse', + value: MsgSplitRouteSwapExactAmountOutResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSplitRouteSwapExactAmountOutResponse.typeUrl, + MsgSplitRouteSwapExactAmountOutResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSplitRouteSwapExactAmountOutResponse.aminoType, + MsgSplitRouteSwapExactAmountOutResponse.typeUrl +); +function createBaseMsgSetDenomPairTakerFee(): MsgSetDenomPairTakerFee { + return { + sender: '', + denomPairTakerFee: [], + }; +} +export const MsgSetDenomPairTakerFee = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + aminoType: 'osmosis/poolmanager/set-denom-pair-taker-fee', + is(o: any): o is MsgSetDenomPairTakerFee { + return ( + o && + (o.$typeUrl === MsgSetDenomPairTakerFee.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.denomPairTakerFee) && + (!o.denomPairTakerFee.length || + DenomPairTakerFee.is(o.denomPairTakerFee[0])))) + ); + }, + isSDK(o: any): o is MsgSetDenomPairTakerFeeSDKType { + return ( + o && + (o.$typeUrl === MsgSetDenomPairTakerFee.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.denom_pair_taker_fee) && + (!o.denom_pair_taker_fee.length || + DenomPairTakerFee.isSDK(o.denom_pair_taker_fee[0])))) + ); + }, + isAmino(o: any): o is MsgSetDenomPairTakerFeeAmino { + return ( + o && + (o.$typeUrl === MsgSetDenomPairTakerFee.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.denom_pair_taker_fee) && + (!o.denom_pair_taker_fee.length || + DenomPairTakerFee.isAmino(o.denom_pair_taker_fee[0])))) + ); + }, + encode( + message: MsgSetDenomPairTakerFee, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.denomPairTakerFee) { + DenomPairTakerFee.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDenomPairTakerFee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomPairTakerFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denomPairTakerFee.push( + DenomPairTakerFee.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetDenomPairTakerFee { + const message = createBaseMsgSetDenomPairTakerFee(); + message.sender = object.sender ?? ''; + message.denomPairTakerFee = + object.denomPairTakerFee?.map((e) => DenomPairTakerFee.fromPartial(e)) || + []; + return message; + }, + fromAmino(object: MsgSetDenomPairTakerFeeAmino): MsgSetDenomPairTakerFee { + const message = createBaseMsgSetDenomPairTakerFee(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.denomPairTakerFee = + object.denom_pair_taker_fee?.map((e) => DenomPairTakerFee.fromAmino(e)) || + []; + return message; + }, + toAmino(message: MsgSetDenomPairTakerFee): MsgSetDenomPairTakerFeeAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.denomPairTakerFee) { + obj.denom_pair_taker_fee = message.denomPairTakerFee.map((e) => + e ? DenomPairTakerFee.toAmino(e) : undefined + ); + } else { + obj.denom_pair_taker_fee = message.denomPairTakerFee; + } + return obj; + }, + fromAminoMsg( + object: MsgSetDenomPairTakerFeeAminoMsg + ): MsgSetDenomPairTakerFee { + return MsgSetDenomPairTakerFee.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetDenomPairTakerFee + ): MsgSetDenomPairTakerFeeAminoMsg { + return { + type: 'osmosis/poolmanager/set-denom-pair-taker-fee', + value: MsgSetDenomPairTakerFee.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetDenomPairTakerFeeProtoMsg + ): MsgSetDenomPairTakerFee { + return MsgSetDenomPairTakerFee.decode(message.value); + }, + toProto(message: MsgSetDenomPairTakerFee): Uint8Array { + return MsgSetDenomPairTakerFee.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetDenomPairTakerFee + ): MsgSetDenomPairTakerFeeProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + value: MsgSetDenomPairTakerFee.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetDenomPairTakerFee.typeUrl, + MsgSetDenomPairTakerFee +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDenomPairTakerFee.aminoType, + MsgSetDenomPairTakerFee.typeUrl +); +function createBaseMsgSetDenomPairTakerFeeResponse(): MsgSetDenomPairTakerFeeResponse { + return { + success: false, + }; +} +export const MsgSetDenomPairTakerFeeResponse = { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse', + aminoType: 'osmosis/poolmanager/set-denom-pair-taker-fee-response', + is(o: any): o is MsgSetDenomPairTakerFeeResponse { + return ( + o && + (o.$typeUrl === MsgSetDenomPairTakerFeeResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isSDK(o: any): o is MsgSetDenomPairTakerFeeResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSetDenomPairTakerFeeResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isAmino(o: any): o is MsgSetDenomPairTakerFeeResponseAmino { + return ( + o && + (o.$typeUrl === MsgSetDenomPairTakerFeeResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + encode( + message: MsgSetDenomPairTakerFeeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDenomPairTakerFeeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetDenomPairTakerFeeResponse { + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino( + object: MsgSetDenomPairTakerFeeResponseAmino + ): MsgSetDenomPairTakerFeeResponse { + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino( + message: MsgSetDenomPairTakerFeeResponse + ): MsgSetDenomPairTakerFeeResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg( + object: MsgSetDenomPairTakerFeeResponseAminoMsg + ): MsgSetDenomPairTakerFeeResponse { + return MsgSetDenomPairTakerFeeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetDenomPairTakerFeeResponse + ): MsgSetDenomPairTakerFeeResponseAminoMsg { + return { + type: 'osmosis/poolmanager/set-denom-pair-taker-fee-response', + value: MsgSetDenomPairTakerFeeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetDenomPairTakerFeeResponseProtoMsg + ): MsgSetDenomPairTakerFeeResponse { + return MsgSetDenomPairTakerFeeResponse.decode(message.value); + }, + toProto(message: MsgSetDenomPairTakerFeeResponse): Uint8Array { + return MsgSetDenomPairTakerFeeResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetDenomPairTakerFeeResponse + ): MsgSetDenomPairTakerFeeResponseProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse', + value: MsgSetDenomPairTakerFeeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetDenomPairTakerFeeResponse.typeUrl, + MsgSetDenomPairTakerFeeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDenomPairTakerFeeResponse.aminoType, + MsgSetDenomPairTakerFeeResponse.typeUrl +); +function createBaseDenomPairTakerFee(): DenomPairTakerFee { + return { + denom0: '', + denom1: '', + takerFee: '', + }; +} +export const DenomPairTakerFee = { + typeUrl: '/osmosis.poolmanager.v1beta1.DenomPairTakerFee', + aminoType: 'osmosis/poolmanager/denom-pair-taker-fee', + is(o: any): o is DenomPairTakerFee { + return ( + o && + (o.$typeUrl === DenomPairTakerFee.typeUrl || + (typeof o.denom0 === 'string' && + typeof o.denom1 === 'string' && + typeof o.takerFee === 'string')) + ); + }, + isSDK(o: any): o is DenomPairTakerFeeSDKType { + return ( + o && + (o.$typeUrl === DenomPairTakerFee.typeUrl || + (typeof o.denom0 === 'string' && + typeof o.denom1 === 'string' && + typeof o.taker_fee === 'string')) + ); + }, + isAmino(o: any): o is DenomPairTakerFeeAmino { + return ( + o && + (o.$typeUrl === DenomPairTakerFee.typeUrl || + (typeof o.denom0 === 'string' && + typeof o.denom1 === 'string' && + typeof o.taker_fee === 'string')) + ); + }, + encode( + message: DenomPairTakerFee, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom0 !== '') { + writer.uint32(10).string(message.denom0); + } + if (message.denom1 !== '') { + writer.uint32(18).string(message.denom1); + } + if (message.takerFee !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.takerFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomPairTakerFee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomPairTakerFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom0 = reader.string(); + break; + case 2: + message.denom1 = reader.string(); + break; + case 3: + message.takerFee = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomPairTakerFee { + const message = createBaseDenomPairTakerFee(); + message.denom0 = object.denom0 ?? ''; + message.denom1 = object.denom1 ?? ''; + message.takerFee = object.takerFee ?? ''; + return message; + }, + fromAmino(object: DenomPairTakerFeeAmino): DenomPairTakerFee { + const message = createBaseDenomPairTakerFee(); + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.taker_fee !== undefined && object.taker_fee !== null) { + message.takerFee = object.taker_fee; + } + return message; + }, + toAmino(message: DenomPairTakerFee): DenomPairTakerFeeAmino { + const obj: any = {}; + obj.denom0 = message.denom0 === '' ? undefined : message.denom0; + obj.denom1 = message.denom1 === '' ? undefined : message.denom1; + obj.taker_fee = message.takerFee === '' ? undefined : message.takerFee; + return obj; + }, + fromAminoMsg(object: DenomPairTakerFeeAminoMsg): DenomPairTakerFee { + return DenomPairTakerFee.fromAmino(object.value); + }, + toAminoMsg(message: DenomPairTakerFee): DenomPairTakerFeeAminoMsg { + return { + type: 'osmosis/poolmanager/denom-pair-taker-fee', + value: DenomPairTakerFee.toAmino(message), + }; + }, + fromProtoMsg(message: DenomPairTakerFeeProtoMsg): DenomPairTakerFee { + return DenomPairTakerFee.decode(message.value); + }, + toProto(message: DenomPairTakerFee): Uint8Array { + return DenomPairTakerFee.encode(message).finish(); + }, + toProtoMsg(message: DenomPairTakerFee): DenomPairTakerFeeProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.DenomPairTakerFee', + value: DenomPairTakerFee.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(DenomPairTakerFee.typeUrl, DenomPairTakerFee); +GlobalDecoderRegistry.registerAminoProtoMapping( + DenomPairTakerFee.aminoType, + DenomPairTakerFee.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.lcd.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.lcd.ts new file mode 100644 index 00000000..d079a705 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.lcd.ts @@ -0,0 +1,31 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; + +import { SpotPriceRequest, SpotPriceResponseSDKType } from './query'; +export class LCDQueryClient { + req: LCDClient; + constructor({ requestClient }: { requestClient: LCDClient }) { + this.req = requestClient; + this.spotPriceV2 = this.spotPriceV2.bind(this); + } + /* SpotPriceV2 defines a gRPC query handler that returns the spot price given + a base denomination and a quote denomination. + The returned spot price has 36 decimal places. However, some of + modules perform sig fig rounding so most of the rightmost decimals can be + zeroes. */ + async spotPriceV2( + params: SpotPriceRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.baseAssetDenom !== 'undefined') { + options.params.base_asset_denom = params.baseAssetDenom; + } + if (typeof params?.quoteAssetDenom !== 'undefined') { + options.params.quote_asset_denom = params.quoteAssetDenom; + } + const endpoint = `osmosis/poolmanager/v2/pools/${params.poolId}/prices`; + return await this.req.get(endpoint, options); + } +} diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.rpc.Query.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.rpc.Query.ts new file mode 100644 index 00000000..cbf13410 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.rpc.Query.ts @@ -0,0 +1,93 @@ +//@ts-nocheck +import { + QueryClient, + createProtobufRpcClient, + ProtobufRpcClient, +} from '@cosmjs/stargate'; +import { useQuery } from '@tanstack/react-query'; + +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; +import { ReactQueryParams } from '../../../react-query'; + +import { SpotPriceRequest, SpotPriceResponse } from './query'; +export interface Query { + /** + * SpotPriceV2 defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + * The returned spot price has 36 decimal places. However, some of + * modules perform sig fig rounding so most of the rightmost decimals can be + * zeroes. + */ + spotPriceV2(request: SpotPriceRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.spotPriceV2 = this.spotPriceV2.bind(this); + } + spotPriceV2(request: SpotPriceRequest): Promise { + const data = SpotPriceRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.poolmanager.v2.Query', + 'SpotPriceV2', + data + ); + return promise.then((data) => + SpotPriceResponse.decode(new BinaryReader(data)) + ); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + spotPriceV2(request: SpotPriceRequest): Promise { + return queryService.spotPriceV2(request); + }, + }; +}; +export interface UseSpotPriceV2Query + extends ReactQueryParams { + request: SpotPriceRequest; +} +const _queryClients: WeakMap = + new WeakMap(); +const getQueryService = ( + rpc: ProtobufRpcClient | undefined +): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useSpotPriceV2 = ({ + request, + options, + }: UseSpotPriceV2Query) => { + return useQuery( + ['spotPriceV2Query', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.spotPriceV2(request); + }, + options + ); + }; + return { + /** + * SpotPriceV2 defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + * The returned spot price has 36 decimal places. However, some of + * modules perform sig fig rounding so most of the rightmost decimals can be + * zeroes. + */ + useSpotPriceV2, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.ts b/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.ts new file mode 100644 index 00000000..b4665830 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/poolmanager/v2/query.ts @@ -0,0 +1,311 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequest { + poolId: bigint; + baseAssetDenom: string; + quoteAssetDenom: string; +} +export interface SpotPriceRequestProtoMsg { + typeUrl: '/osmosis.poolmanager.v2.SpotPriceRequest'; + value: Uint8Array; +} +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequestAmino { + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; +} +export interface SpotPriceRequestAminoMsg { + type: 'osmosis/poolmanager/v2/spot-price-request'; + value: SpotPriceRequestAmino; +} +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequestSDKType { + pool_id: bigint; + base_asset_denom: string; + quote_asset_denom: string; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponse { + /** String of the BigDec. Ex) 10.203uatom */ + spotPrice: string; +} +export interface SpotPriceResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v2.SpotPriceResponse'; + value: Uint8Array; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponseAmino { + /** String of the BigDec. Ex) 10.203uatom */ + spot_price?: string; +} +export interface SpotPriceResponseAminoMsg { + type: 'osmosis/poolmanager/v2/spot-price-response'; + value: SpotPriceResponseAmino; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponseSDKType { + spot_price: string; +} +function createBaseSpotPriceRequest(): SpotPriceRequest { + return { + poolId: BigInt(0), + baseAssetDenom: '', + quoteAssetDenom: '', + }; +} +export const SpotPriceRequest = { + typeUrl: '/osmosis.poolmanager.v2.SpotPriceRequest', + aminoType: 'osmosis/poolmanager/v2/spot-price-request', + is(o: any): o is SpotPriceRequest { + return ( + o && + (o.$typeUrl === SpotPriceRequest.typeUrl || + (typeof o.poolId === 'bigint' && + typeof o.baseAssetDenom === 'string' && + typeof o.quoteAssetDenom === 'string')) + ); + }, + isSDK(o: any): o is SpotPriceRequestSDKType { + return ( + o && + (o.$typeUrl === SpotPriceRequest.typeUrl || + (typeof o.pool_id === 'bigint' && + typeof o.base_asset_denom === 'string' && + typeof o.quote_asset_denom === 'string')) + ); + }, + isAmino(o: any): o is SpotPriceRequestAmino { + return ( + o && + (o.$typeUrl === SpotPriceRequest.typeUrl || + (typeof o.pool_id === 'bigint' && + typeof o.base_asset_denom === 'string' && + typeof o.quote_asset_denom === 'string')) + ); + }, + encode( + message: SpotPriceRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.baseAssetDenom !== '') { + writer.uint32(18).string(message.baseAssetDenom); + } + if (message.quoteAssetDenom !== '') { + writer.uint32(26).string(message.quoteAssetDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.baseAssetDenom = reader.string(); + break; + case 3: + message.quoteAssetDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + message.baseAssetDenom = object.baseAssetDenom ?? ''; + message.quoteAssetDenom = object.quoteAssetDenom ?? ''; + return message; + }, + fromAmino(object: SpotPriceRequestAmino): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if ( + object.base_asset_denom !== undefined && + object.base_asset_denom !== null + ) { + message.baseAssetDenom = object.base_asset_denom; + } + if ( + object.quote_asset_denom !== undefined && + object.quote_asset_denom !== null + ) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; + }, + toAmino(message: SpotPriceRequest): SpotPriceRequestAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + obj.base_asset_denom = + message.baseAssetDenom === '' ? undefined : message.baseAssetDenom; + obj.quote_asset_denom = + message.quoteAssetDenom === '' ? undefined : message.quoteAssetDenom; + return obj; + }, + fromAminoMsg(object: SpotPriceRequestAminoMsg): SpotPriceRequest { + return SpotPriceRequest.fromAmino(object.value); + }, + toAminoMsg(message: SpotPriceRequest): SpotPriceRequestAminoMsg { + return { + type: 'osmosis/poolmanager/v2/spot-price-request', + value: SpotPriceRequest.toAmino(message), + }; + }, + fromProtoMsg(message: SpotPriceRequestProtoMsg): SpotPriceRequest { + return SpotPriceRequest.decode(message.value); + }, + toProto(message: SpotPriceRequest): Uint8Array { + return SpotPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: SpotPriceRequest): SpotPriceRequestProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v2.SpotPriceRequest', + value: SpotPriceRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SpotPriceRequest.typeUrl, SpotPriceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + SpotPriceRequest.aminoType, + SpotPriceRequest.typeUrl +); +function createBaseSpotPriceResponse(): SpotPriceResponse { + return { + spotPrice: '', + }; +} +export const SpotPriceResponse = { + typeUrl: '/osmosis.poolmanager.v2.SpotPriceResponse', + aminoType: 'osmosis/poolmanager/v2/spot-price-response', + is(o: any): o is SpotPriceResponse { + return ( + o && + (o.$typeUrl === SpotPriceResponse.typeUrl || + typeof o.spotPrice === 'string') + ); + }, + isSDK(o: any): o is SpotPriceResponseSDKType { + return ( + o && + (o.$typeUrl === SpotPriceResponse.typeUrl || + typeof o.spot_price === 'string') + ); + }, + isAmino(o: any): o is SpotPriceResponseAmino { + return ( + o && + (o.$typeUrl === SpotPriceResponse.typeUrl || + typeof o.spot_price === 'string') + ); + }, + encode( + message: SpotPriceResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.spotPrice !== '') { + writer.uint32(10).string(message.spotPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spotPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SpotPriceResponse { + const message = createBaseSpotPriceResponse(); + message.spotPrice = object.spotPrice ?? ''; + return message; + }, + fromAmino(object: SpotPriceResponseAmino): SpotPriceResponse { + const message = createBaseSpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; + }, + toAmino(message: SpotPriceResponse): SpotPriceResponseAmino { + const obj: any = {}; + obj.spot_price = message.spotPrice === '' ? undefined : message.spotPrice; + return obj; + }, + fromAminoMsg(object: SpotPriceResponseAminoMsg): SpotPriceResponse { + return SpotPriceResponse.fromAmino(object.value); + }, + toAminoMsg(message: SpotPriceResponse): SpotPriceResponseAminoMsg { + return { + type: 'osmosis/poolmanager/v2/spot-price-response', + value: SpotPriceResponse.toAmino(message), + }; + }, + fromProtoMsg(message: SpotPriceResponseProtoMsg): SpotPriceResponse { + return SpotPriceResponse.decode(message.value); + }, + toProto(message: SpotPriceResponse): Uint8Array { + return SpotPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: SpotPriceResponse): SpotPriceResponseProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v2.SpotPriceResponse', + value: SpotPriceResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SpotPriceResponse.typeUrl, SpotPriceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping( + SpotPriceResponse.aminoType, + SpotPriceResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/genesis.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/genesis.ts new file mode 100644 index 00000000..add2ef4d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/genesis.ts @@ -0,0 +1,537 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + TokenPairArbRoutes, + TokenPairArbRoutesAmino, + TokenPairArbRoutesSDKType, + BaseDenom, + BaseDenomAmino, + BaseDenomSDKType, + InfoByPoolType, + InfoByPoolTypeAmino, + InfoByPoolTypeSDKType, + CyclicArbTracker, + CyclicArbTrackerAmino, + CyclicArbTrackerSDKType, +} from './protorev'; +import { Params, ParamsAmino, ParamsSDKType } from './params'; +/** GenesisState defines the protorev module's genesis state. */ +export interface GenesisState { + /** Parameters for the protorev module. */ + params: Params; + /** Token pair arb routes for the protorev module (hot routes). */ + tokenPairArbRoutes: TokenPairArbRoutes[]; + /** + * The base denominations being used to create cyclic arbitrage routes via the + * highest liquidity method. + */ + baseDenoms: BaseDenom[]; + /** The number of days since module genesis. */ + daysSinceModuleGenesis: bigint; + /** The fees the developer account has accumulated over time. */ + developerFees: Coin[]; + /** The latest block height that the module has processed. */ + latestBlockHeight: bigint; + /** The developer account address of the module. */ + developerAddress: string; + /** + * Max pool points per block i.e. the maximum compute time (in ms) + * that protorev can use per block. + */ + maxPoolPointsPerBlock: bigint; + /** + * Max pool points per tx i.e. the maximum compute time (in ms) that + * protorev can use per tx. + */ + maxPoolPointsPerTx: bigint; + /** The number of pool points that have been consumed in the current block. */ + pointCountForBlock: bigint; + /** All of the profits that have been accumulated by the module. */ + profits: Coin[]; + /** + * Information that is used to estimate execution time / gas + * consumption of a swap on a given pool type. + */ + infoByPoolType: InfoByPoolType; + cyclicArbTracker?: CyclicArbTracker; +} +export interface GenesisStateProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.GenesisState'; + value: Uint8Array; +} +/** GenesisState defines the protorev module's genesis state. */ +export interface GenesisStateAmino { + /** Parameters for the protorev module. */ + params?: ParamsAmino; + /** Token pair arb routes for the protorev module (hot routes). */ + token_pair_arb_routes?: TokenPairArbRoutesAmino[]; + /** + * The base denominations being used to create cyclic arbitrage routes via the + * highest liquidity method. + */ + base_denoms?: BaseDenomAmino[]; + /** The number of days since module genesis. */ + days_since_module_genesis?: string; + /** The fees the developer account has accumulated over time. */ + developer_fees?: CoinAmino[]; + /** The latest block height that the module has processed. */ + latest_block_height?: string; + /** The developer account address of the module. */ + developer_address?: string; + /** + * Max pool points per block i.e. the maximum compute time (in ms) + * that protorev can use per block. + */ + max_pool_points_per_block?: string; + /** + * Max pool points per tx i.e. the maximum compute time (in ms) that + * protorev can use per tx. + */ + max_pool_points_per_tx?: string; + /** The number of pool points that have been consumed in the current block. */ + point_count_for_block?: string; + /** All of the profits that have been accumulated by the module. */ + profits?: CoinAmino[]; + /** + * Information that is used to estimate execution time / gas + * consumption of a swap on a given pool type. + */ + info_by_pool_type?: InfoByPoolTypeAmino; + cyclic_arb_tracker?: CyclicArbTrackerAmino; +} +export interface GenesisStateAminoMsg { + type: 'osmosis/protorev/genesis-state'; + value: GenesisStateAmino; +} +/** GenesisState defines the protorev module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + token_pair_arb_routes: TokenPairArbRoutesSDKType[]; + base_denoms: BaseDenomSDKType[]; + days_since_module_genesis: bigint; + developer_fees: CoinSDKType[]; + latest_block_height: bigint; + developer_address: string; + max_pool_points_per_block: bigint; + max_pool_points_per_tx: bigint; + point_count_for_block: bigint; + profits: CoinSDKType[]; + info_by_pool_type: InfoByPoolTypeSDKType; + cyclic_arb_tracker?: CyclicArbTrackerSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + tokenPairArbRoutes: [], + baseDenoms: [], + daysSinceModuleGenesis: BigInt(0), + developerFees: [], + latestBlockHeight: BigInt(0), + developerAddress: '', + maxPoolPointsPerBlock: BigInt(0), + maxPoolPointsPerTx: BigInt(0), + pointCountForBlock: BigInt(0), + profits: [], + infoByPoolType: InfoByPoolType.fromPartial({}), + cyclicArbTracker: undefined, + }; +} +export const GenesisState = { + typeUrl: '/osmosis.protorev.v1beta1.GenesisState', + aminoType: 'osmosis/protorev/genesis-state', + is(o: any): o is GenesisState { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.is(o.params) && + Array.isArray(o.tokenPairArbRoutes) && + (!o.tokenPairArbRoutes.length || + TokenPairArbRoutes.is(o.tokenPairArbRoutes[0])) && + Array.isArray(o.baseDenoms) && + (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0])) && + typeof o.daysSinceModuleGenesis === 'bigint' && + Array.isArray(o.developerFees) && + (!o.developerFees.length || Coin.is(o.developerFees[0])) && + typeof o.latestBlockHeight === 'bigint' && + typeof o.developerAddress === 'string' && + typeof o.maxPoolPointsPerBlock === 'bigint' && + typeof o.maxPoolPointsPerTx === 'bigint' && + typeof o.pointCountForBlock === 'bigint' && + Array.isArray(o.profits) && + (!o.profits.length || Coin.is(o.profits[0])) && + InfoByPoolType.is(o.infoByPoolType))) + ); + }, + isSDK(o: any): o is GenesisStateSDKType { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.isSDK(o.params) && + Array.isArray(o.token_pair_arb_routes) && + (!o.token_pair_arb_routes.length || + TokenPairArbRoutes.isSDK(o.token_pair_arb_routes[0])) && + Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0])) && + typeof o.days_since_module_genesis === 'bigint' && + Array.isArray(o.developer_fees) && + (!o.developer_fees.length || Coin.isSDK(o.developer_fees[0])) && + typeof o.latest_block_height === 'bigint' && + typeof o.developer_address === 'string' && + typeof o.max_pool_points_per_block === 'bigint' && + typeof o.max_pool_points_per_tx === 'bigint' && + typeof o.point_count_for_block === 'bigint' && + Array.isArray(o.profits) && + (!o.profits.length || Coin.isSDK(o.profits[0])) && + InfoByPoolType.isSDK(o.info_by_pool_type))) + ); + }, + isAmino(o: any): o is GenesisStateAmino { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.isAmino(o.params) && + Array.isArray(o.token_pair_arb_routes) && + (!o.token_pair_arb_routes.length || + TokenPairArbRoutes.isAmino(o.token_pair_arb_routes[0])) && + Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0])) && + typeof o.days_since_module_genesis === 'bigint' && + Array.isArray(o.developer_fees) && + (!o.developer_fees.length || Coin.isAmino(o.developer_fees[0])) && + typeof o.latest_block_height === 'bigint' && + typeof o.developer_address === 'string' && + typeof o.max_pool_points_per_block === 'bigint' && + typeof o.max_pool_points_per_tx === 'bigint' && + typeof o.point_count_for_block === 'bigint' && + Array.isArray(o.profits) && + (!o.profits.length || Coin.isAmino(o.profits[0])) && + InfoByPoolType.isAmino(o.info_by_pool_type))) + ); + }, + encode( + message: GenesisState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.tokenPairArbRoutes) { + TokenPairArbRoutes.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.baseDenoms) { + BaseDenom.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.daysSinceModuleGenesis !== BigInt(0)) { + writer.uint32(40).uint64(message.daysSinceModuleGenesis); + } + for (const v of message.developerFees) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.latestBlockHeight !== BigInt(0)) { + writer.uint32(56).uint64(message.latestBlockHeight); + } + if (message.developerAddress !== '') { + writer.uint32(66).string(message.developerAddress); + } + if (message.maxPoolPointsPerBlock !== BigInt(0)) { + writer.uint32(72).uint64(message.maxPoolPointsPerBlock); + } + if (message.maxPoolPointsPerTx !== BigInt(0)) { + writer.uint32(80).uint64(message.maxPoolPointsPerTx); + } + if (message.pointCountForBlock !== BigInt(0)) { + writer.uint32(88).uint64(message.pointCountForBlock); + } + for (const v of message.profits) { + Coin.encode(v!, writer.uint32(98).fork()).ldelim(); + } + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode( + message.infoByPoolType, + writer.uint32(106).fork() + ).ldelim(); + } + if (message.cyclicArbTracker !== undefined) { + CyclicArbTracker.encode( + message.cyclicArbTracker, + writer.uint32(114).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.tokenPairArbRoutes.push( + TokenPairArbRoutes.decode(reader, reader.uint32()) + ); + break; + case 3: + message.baseDenoms.push(BaseDenom.decode(reader, reader.uint32())); + break; + case 5: + message.daysSinceModuleGenesis = reader.uint64(); + break; + case 6: + message.developerFees.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + message.latestBlockHeight = reader.uint64(); + break; + case 8: + message.developerAddress = reader.string(); + break; + case 9: + message.maxPoolPointsPerBlock = reader.uint64(); + break; + case 10: + message.maxPoolPointsPerTx = reader.uint64(); + break; + case 11: + message.pointCountForBlock = reader.uint64(); + break; + case 12: + message.profits.push(Coin.decode(reader, reader.uint32())); + break; + case 13: + message.infoByPoolType = InfoByPoolType.decode( + reader, + reader.uint32() + ); + break; + case 14: + message.cyclicArbTracker = CyclicArbTracker.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + message.tokenPairArbRoutes = + object.tokenPairArbRoutes?.map((e) => + TokenPairArbRoutes.fromPartial(e) + ) || []; + message.baseDenoms = + object.baseDenoms?.map((e) => BaseDenom.fromPartial(e)) || []; + message.daysSinceModuleGenesis = + object.daysSinceModuleGenesis !== undefined && + object.daysSinceModuleGenesis !== null + ? BigInt(object.daysSinceModuleGenesis.toString()) + : BigInt(0); + message.developerFees = + object.developerFees?.map((e) => Coin.fromPartial(e)) || []; + message.latestBlockHeight = + object.latestBlockHeight !== undefined && + object.latestBlockHeight !== null + ? BigInt(object.latestBlockHeight.toString()) + : BigInt(0); + message.developerAddress = object.developerAddress ?? ''; + message.maxPoolPointsPerBlock = + object.maxPoolPointsPerBlock !== undefined && + object.maxPoolPointsPerBlock !== null + ? BigInt(object.maxPoolPointsPerBlock.toString()) + : BigInt(0); + message.maxPoolPointsPerTx = + object.maxPoolPointsPerTx !== undefined && + object.maxPoolPointsPerTx !== null + ? BigInt(object.maxPoolPointsPerTx.toString()) + : BigInt(0); + message.pointCountForBlock = + object.pointCountForBlock !== undefined && + object.pointCountForBlock !== null + ? BigInt(object.pointCountForBlock.toString()) + : BigInt(0); + message.profits = object.profits?.map((e) => Coin.fromPartial(e)) || []; + message.infoByPoolType = + object.infoByPoolType !== undefined && object.infoByPoolType !== null + ? InfoByPoolType.fromPartial(object.infoByPoolType) + : undefined; + message.cyclicArbTracker = + object.cyclicArbTracker !== undefined && object.cyclicArbTracker !== null + ? CyclicArbTracker.fromPartial(object.cyclicArbTracker) + : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.tokenPairArbRoutes = + object.token_pair_arb_routes?.map((e) => + TokenPairArbRoutes.fromAmino(e) + ) || []; + message.baseDenoms = + object.base_denoms?.map((e) => BaseDenom.fromAmino(e)) || []; + if ( + object.days_since_module_genesis !== undefined && + object.days_since_module_genesis !== null + ) { + message.daysSinceModuleGenesis = BigInt(object.days_since_module_genesis); + } + message.developerFees = + object.developer_fees?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.latest_block_height !== undefined && + object.latest_block_height !== null + ) { + message.latestBlockHeight = BigInt(object.latest_block_height); + } + if ( + object.developer_address !== undefined && + object.developer_address !== null + ) { + message.developerAddress = object.developer_address; + } + if ( + object.max_pool_points_per_block !== undefined && + object.max_pool_points_per_block !== null + ) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + if ( + object.max_pool_points_per_tx !== undefined && + object.max_pool_points_per_tx !== null + ) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + if ( + object.point_count_for_block !== undefined && + object.point_count_for_block !== null + ) { + message.pointCountForBlock = BigInt(object.point_count_for_block); + } + message.profits = object.profits?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.info_by_pool_type !== undefined && + object.info_by_pool_type !== null + ) { + message.infoByPoolType = InfoByPoolType.fromAmino( + object.info_by_pool_type + ); + } + if ( + object.cyclic_arb_tracker !== undefined && + object.cyclic_arb_tracker !== null + ) { + message.cyclicArbTracker = CyclicArbTracker.fromAmino( + object.cyclic_arb_tracker + ); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.tokenPairArbRoutes) { + obj.token_pair_arb_routes = message.tokenPairArbRoutes.map((e) => + e ? TokenPairArbRoutes.toAmino(e) : undefined + ); + } else { + obj.token_pair_arb_routes = message.tokenPairArbRoutes; + } + if (message.baseDenoms) { + obj.base_denoms = message.baseDenoms.map((e) => + e ? BaseDenom.toAmino(e) : undefined + ); + } else { + obj.base_denoms = message.baseDenoms; + } + obj.days_since_module_genesis = + message.daysSinceModuleGenesis !== BigInt(0) + ? message.daysSinceModuleGenesis.toString() + : undefined; + if (message.developerFees) { + obj.developer_fees = message.developerFees.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.developer_fees = message.developerFees; + } + obj.latest_block_height = + message.latestBlockHeight !== BigInt(0) + ? message.latestBlockHeight.toString() + : undefined; + obj.developer_address = + message.developerAddress === '' ? undefined : message.developerAddress; + obj.max_pool_points_per_block = + message.maxPoolPointsPerBlock !== BigInt(0) + ? message.maxPoolPointsPerBlock.toString() + : undefined; + obj.max_pool_points_per_tx = + message.maxPoolPointsPerTx !== BigInt(0) + ? message.maxPoolPointsPerTx.toString() + : undefined; + obj.point_count_for_block = + message.pointCountForBlock !== BigInt(0) + ? message.pointCountForBlock.toString() + : undefined; + if (message.profits) { + obj.profits = message.profits.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.profits = message.profits; + } + obj.info_by_pool_type = message.infoByPoolType + ? InfoByPoolType.toAmino(message.infoByPoolType) + : undefined; + obj.cyclic_arb_tracker = message.cyclicArbTracker + ? CyclicArbTracker.toAmino(message.cyclicArbTracker) + : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/protorev/genesis-state', + value: GenesisState.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.GenesisState', + value: GenesisState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisState.aminoType, + GenesisState.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/gov.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/gov.ts new file mode 100644 index 00000000..a1b847b2 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/gov.ts @@ -0,0 +1,384 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * SetProtoRevEnabledProposal is a gov Content type to update whether the + * protorev module is enabled + */ +export interface SetProtoRevEnabledProposal { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal'; + title: string; + description: string; + enabled: boolean; +} +export interface SetProtoRevEnabledProposalProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal'; + value: Uint8Array; +} +/** + * SetProtoRevEnabledProposal is a gov Content type to update whether the + * protorev module is enabled + */ +export interface SetProtoRevEnabledProposalAmino { + title?: string; + description?: string; + enabled?: boolean; +} +export interface SetProtoRevEnabledProposalAminoMsg { + type: 'osmosis/SetProtoRevEnabledProposal'; + value: SetProtoRevEnabledProposalAmino; +} +/** + * SetProtoRevEnabledProposal is a gov Content type to update whether the + * protorev module is enabled + */ +export interface SetProtoRevEnabledProposalSDKType { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal'; + title: string; + description: string; + enabled: boolean; +} +/** + * SetProtoRevAdminAccountProposal is a gov Content type to set the admin + * account that will receive permissions to alter hot routes and set the + * developer address that will be receiving a share of profits from the module + */ +export interface SetProtoRevAdminAccountProposal { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal'; + title: string; + description: string; + account: string; +} +export interface SetProtoRevAdminAccountProposalProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal'; + value: Uint8Array; +} +/** + * SetProtoRevAdminAccountProposal is a gov Content type to set the admin + * account that will receive permissions to alter hot routes and set the + * developer address that will be receiving a share of profits from the module + */ +export interface SetProtoRevAdminAccountProposalAmino { + title?: string; + description?: string; + account?: string; +} +export interface SetProtoRevAdminAccountProposalAminoMsg { + type: 'osmosis/SetProtoRevAdminAccountProposal'; + value: SetProtoRevAdminAccountProposalAmino; +} +/** + * SetProtoRevAdminAccountProposal is a gov Content type to set the admin + * account that will receive permissions to alter hot routes and set the + * developer address that will be receiving a share of profits from the module + */ +export interface SetProtoRevAdminAccountProposalSDKType { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal'; + title: string; + description: string; + account: string; +} +function createBaseSetProtoRevEnabledProposal(): SetProtoRevEnabledProposal { + return { + $typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal', + title: '', + description: '', + enabled: false, + }; +} +export const SetProtoRevEnabledProposal = { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal', + aminoType: 'osmosis/SetProtoRevEnabledProposal', + is(o: any): o is SetProtoRevEnabledProposal { + return ( + o && + (o.$typeUrl === SetProtoRevEnabledProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.enabled === 'boolean')) + ); + }, + isSDK(o: any): o is SetProtoRevEnabledProposalSDKType { + return ( + o && + (o.$typeUrl === SetProtoRevEnabledProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.enabled === 'boolean')) + ); + }, + isAmino(o: any): o is SetProtoRevEnabledProposalAmino { + return ( + o && + (o.$typeUrl === SetProtoRevEnabledProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.enabled === 'boolean')) + ); + }, + encode( + message: SetProtoRevEnabledProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + if (message.enabled === true) { + writer.uint32(24).bool(message.enabled); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SetProtoRevEnabledProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetProtoRevEnabledProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SetProtoRevEnabledProposal { + const message = createBaseSetProtoRevEnabledProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino( + object: SetProtoRevEnabledProposalAmino + ): SetProtoRevEnabledProposal { + const message = createBaseSetProtoRevEnabledProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino( + message: SetProtoRevEnabledProposal + ): SetProtoRevEnabledProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + obj.enabled = message.enabled === false ? undefined : message.enabled; + return obj; + }, + fromAminoMsg( + object: SetProtoRevEnabledProposalAminoMsg + ): SetProtoRevEnabledProposal { + return SetProtoRevEnabledProposal.fromAmino(object.value); + }, + toAminoMsg( + message: SetProtoRevEnabledProposal + ): SetProtoRevEnabledProposalAminoMsg { + return { + type: 'osmosis/SetProtoRevEnabledProposal', + value: SetProtoRevEnabledProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: SetProtoRevEnabledProposalProtoMsg + ): SetProtoRevEnabledProposal { + return SetProtoRevEnabledProposal.decode(message.value); + }, + toProto(message: SetProtoRevEnabledProposal): Uint8Array { + return SetProtoRevEnabledProposal.encode(message).finish(); + }, + toProtoMsg( + message: SetProtoRevEnabledProposal + ): SetProtoRevEnabledProposalProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal', + value: SetProtoRevEnabledProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SetProtoRevEnabledProposal.typeUrl, + SetProtoRevEnabledProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SetProtoRevEnabledProposal.aminoType, + SetProtoRevEnabledProposal.typeUrl +); +function createBaseSetProtoRevAdminAccountProposal(): SetProtoRevAdminAccountProposal { + return { + $typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal', + title: '', + description: '', + account: '', + }; +} +export const SetProtoRevAdminAccountProposal = { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal', + aminoType: 'osmosis/SetProtoRevAdminAccountProposal', + is(o: any): o is SetProtoRevAdminAccountProposal { + return ( + o && + (o.$typeUrl === SetProtoRevAdminAccountProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.account === 'string')) + ); + }, + isSDK(o: any): o is SetProtoRevAdminAccountProposalSDKType { + return ( + o && + (o.$typeUrl === SetProtoRevAdminAccountProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.account === 'string')) + ); + }, + isAmino(o: any): o is SetProtoRevAdminAccountProposalAmino { + return ( + o && + (o.$typeUrl === SetProtoRevAdminAccountProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + typeof o.account === 'string')) + ); + }, + encode( + message: SetProtoRevAdminAccountProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + if (message.account !== '') { + writer.uint32(26).string(message.account); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SetProtoRevAdminAccountProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetProtoRevAdminAccountProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SetProtoRevAdminAccountProposal { + const message = createBaseSetProtoRevAdminAccountProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.account = object.account ?? ''; + return message; + }, + fromAmino( + object: SetProtoRevAdminAccountProposalAmino + ): SetProtoRevAdminAccountProposal { + const message = createBaseSetProtoRevAdminAccountProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino( + message: SetProtoRevAdminAccountProposal + ): SetProtoRevAdminAccountProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + obj.account = message.account === '' ? undefined : message.account; + return obj; + }, + fromAminoMsg( + object: SetProtoRevAdminAccountProposalAminoMsg + ): SetProtoRevAdminAccountProposal { + return SetProtoRevAdminAccountProposal.fromAmino(object.value); + }, + toAminoMsg( + message: SetProtoRevAdminAccountProposal + ): SetProtoRevAdminAccountProposalAminoMsg { + return { + type: 'osmosis/SetProtoRevAdminAccountProposal', + value: SetProtoRevAdminAccountProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: SetProtoRevAdminAccountProposalProtoMsg + ): SetProtoRevAdminAccountProposal { + return SetProtoRevAdminAccountProposal.decode(message.value); + }, + toProto(message: SetProtoRevAdminAccountProposal): Uint8Array { + return SetProtoRevAdminAccountProposal.encode(message).finish(); + }, + toProtoMsg( + message: SetProtoRevAdminAccountProposal + ): SetProtoRevAdminAccountProposalProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal', + value: SetProtoRevAdminAccountProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SetProtoRevAdminAccountProposal.typeUrl, + SetProtoRevAdminAccountProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SetProtoRevAdminAccountProposal.aminoType, + SetProtoRevAdminAccountProposal.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/params.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/params.ts new file mode 100644 index 00000000..fabf50c3 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/params.ts @@ -0,0 +1,142 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** Params defines the parameters for the module. */ +export interface Params { + /** Boolean whether the protorev module is enabled. */ + enabled: boolean; + /** The admin account (settings manager) of the protorev module. */ + admin: string; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.Params'; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + /** Boolean whether the protorev module is enabled. */ + enabled?: boolean; + /** The admin account (settings manager) of the protorev module. */ + admin?: string; +} +export interface ParamsAminoMsg { + type: 'osmosis/protorev/params'; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + enabled: boolean; + admin: string; +} +function createBaseParams(): Params { + return { + enabled: false, + admin: '', + }; +} +export const Params = { + typeUrl: '/osmosis.protorev.v1beta1.Params', + aminoType: 'osmosis/protorev/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.enabled === 'boolean' && typeof o.admin === 'string')) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.enabled === 'boolean' && typeof o.admin === 'string')) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.enabled === 'boolean' && typeof o.admin === 'string')) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.admin !== '') { + writer.uint32(18).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.enabled = object.enabled ?? false; + message.admin = object.admin ?? ''; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.enabled = message.enabled === false ? undefined : message.enabled; + obj.admin = message.admin === '' ? undefined : message.admin; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/protorev/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/protorev.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/protorev.ts new file mode 100644 index 00000000..3ab6debf --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/protorev.ts @@ -0,0 +1,2507 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { + TakerFeesTracker, + TakerFeesTrackerAmino, + TakerFeesTrackerSDKType, +} from '../../poolmanager/v1beta1/genesis'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ +export interface TokenPairArbRoutes { + /** Stores all of the possible hot paths for a given pair of tokens */ + arbRoutes: Route[]; + /** Token denomination of the first asset */ + tokenIn: string; + /** Token denomination of the second asset */ + tokenOut: string; +} +export interface TokenPairArbRoutesProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.TokenPairArbRoutes'; + value: Uint8Array; +} +/** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ +export interface TokenPairArbRoutesAmino { + /** Stores all of the possible hot paths for a given pair of tokens */ + arb_routes?: RouteAmino[]; + /** Token denomination of the first asset */ + token_in?: string; + /** Token denomination of the second asset */ + token_out?: string; +} +export interface TokenPairArbRoutesAminoMsg { + type: 'osmosis/protorev/token-pair-arb-routes'; + value: TokenPairArbRoutesAmino; +} +/** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ +export interface TokenPairArbRoutesSDKType { + arb_routes: RouteSDKType[]; + token_in: string; + token_out: string; +} +/** Route is a hot route for a given pair of tokens */ +export interface Route { + /** + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left + * -> right) + */ + trades: Trade[]; + /** + * The step size that will be used to find the optimal swap amount in the + * binary search + */ + stepSize: string; +} +export interface RouteProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.Route'; + value: Uint8Array; +} +/** Route is a hot route for a given pair of tokens */ +export interface RouteAmino { + /** + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left + * -> right) + */ + trades?: TradeAmino[]; + /** + * The step size that will be used to find the optimal swap amount in the + * binary search + */ + step_size?: string; +} +export interface RouteAminoMsg { + type: 'osmosis/protorev/route'; + value: RouteAmino; +} +/** Route is a hot route for a given pair of tokens */ +export interface RouteSDKType { + trades: TradeSDKType[]; + step_size: string; +} +/** Trade is a single trade in a route */ +export interface Trade { + /** The pool id of the pool that is traded on */ + pool: bigint; + /** The denom of the token that is traded */ + tokenIn: string; + /** The denom of the token that is received */ + tokenOut: string; +} +export interface TradeProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.Trade'; + value: Uint8Array; +} +/** Trade is a single trade in a route */ +export interface TradeAmino { + /** The pool id of the pool that is traded on */ + pool?: string; + /** The denom of the token that is traded */ + token_in?: string; + /** The denom of the token that is received */ + token_out?: string; +} +export interface TradeAminoMsg { + type: 'osmosis/protorev/trade'; + value: TradeAmino; +} +/** Trade is a single trade in a route */ +export interface TradeSDKType { + pool: bigint; + token_in: string; + token_out: string; +} +/** + * RouteStatistics contains the number of trades the module has executed after a + * swap on a given route and the profits from the trades + */ +export interface RouteStatistics { + /** profits is the total profit from all trades on this route */ + profits: Coin[]; + /** + * number_of_trades is the number of trades the module has executed using this + * route + */ + numberOfTrades: string; + /** route is the route that was used (pool ids along the arbitrage route) */ + route: bigint[]; +} +export interface RouteStatisticsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.RouteStatistics'; + value: Uint8Array; +} +/** + * RouteStatistics contains the number of trades the module has executed after a + * swap on a given route and the profits from the trades + */ +export interface RouteStatisticsAmino { + /** profits is the total profit from all trades on this route */ + profits?: CoinAmino[]; + /** + * number_of_trades is the number of trades the module has executed using this + * route + */ + number_of_trades?: string; + /** route is the route that was used (pool ids along the arbitrage route) */ + route?: string[]; +} +export interface RouteStatisticsAminoMsg { + type: 'osmosis/protorev/route-statistics'; + value: RouteStatisticsAmino; +} +/** + * RouteStatistics contains the number of trades the module has executed after a + * swap on a given route and the profits from the trades + */ +export interface RouteStatisticsSDKType { + profits: CoinSDKType[]; + number_of_trades: string; + route: bigint[]; +} +/** + * PoolWeights contains the weights of all of the different pool types. This + * distinction is made and necessary because the execution time ranges + * significantly between the different pool types. Each weight roughly + * corresponds to the amount of time (in ms) it takes to execute a swap on that + * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. + */ +export interface PoolWeights { + /** The weight of a stableswap pool */ + stableWeight: bigint; + /** The weight of a balancer pool */ + balancerWeight: bigint; + /** The weight of a concentrated pool */ + concentratedWeight: bigint; + /** The weight of a cosmwasm pool */ + cosmwasmWeight: bigint; +} +export interface PoolWeightsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.PoolWeights'; + value: Uint8Array; +} +/** + * PoolWeights contains the weights of all of the different pool types. This + * distinction is made and necessary because the execution time ranges + * significantly between the different pool types. Each weight roughly + * corresponds to the amount of time (in ms) it takes to execute a swap on that + * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. + */ +export interface PoolWeightsAmino { + /** The weight of a stableswap pool */ + stable_weight?: string; + /** The weight of a balancer pool */ + balancer_weight?: string; + /** The weight of a concentrated pool */ + concentrated_weight?: string; + /** The weight of a cosmwasm pool */ + cosmwasm_weight?: string; +} +export interface PoolWeightsAminoMsg { + type: 'osmosis/protorev/pool-weights'; + value: PoolWeightsAmino; +} +/** + * PoolWeights contains the weights of all of the different pool types. This + * distinction is made and necessary because the execution time ranges + * significantly between the different pool types. Each weight roughly + * corresponds to the amount of time (in ms) it takes to execute a swap on that + * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. + */ +export interface PoolWeightsSDKType { + stable_weight: bigint; + balancer_weight: bigint; + concentrated_weight: bigint; + cosmwasm_weight: bigint; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolType { + /** The stable pool info */ + stable: StablePoolInfo; + /** The balancer pool info */ + balancer: BalancerPoolInfo; + /** The concentrated pool info */ + concentrated: ConcentratedPoolInfo; + /** The cosmwasm pool info */ + cosmwasm: CosmwasmPoolInfo; +} +export interface InfoByPoolTypeProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.InfoByPoolType'; + value: Uint8Array; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolTypeAmino { + /** The stable pool info */ + stable?: StablePoolInfoAmino; + /** The balancer pool info */ + balancer?: BalancerPoolInfoAmino; + /** The concentrated pool info */ + concentrated?: ConcentratedPoolInfoAmino; + /** The cosmwasm pool info */ + cosmwasm?: CosmwasmPoolInfoAmino; +} +export interface InfoByPoolTypeAminoMsg { + type: 'osmosis/protorev/info-by-pool-type'; + value: InfoByPoolTypeAmino; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolTypeSDKType { + stable: StablePoolInfoSDKType; + balancer: BalancerPoolInfoSDKType; + concentrated: ConcentratedPoolInfoSDKType; + cosmwasm: CosmwasmPoolInfoSDKType; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfo { + /** The weight of a stableswap pool */ + weight: bigint; +} +export interface StablePoolInfoProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.StablePoolInfo'; + value: Uint8Array; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfoAmino { + /** The weight of a stableswap pool */ + weight?: string; +} +export interface StablePoolInfoAminoMsg { + type: 'osmosis/protorev/stable-pool-info'; + value: StablePoolInfoAmino; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfoSDKType { + weight: bigint; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfo { + /** The weight of a balancer pool */ + weight: bigint; +} +export interface BalancerPoolInfoProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.BalancerPoolInfo'; + value: Uint8Array; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfoAmino { + /** The weight of a balancer pool */ + weight?: string; +} +export interface BalancerPoolInfoAminoMsg { + type: 'osmosis/protorev/balancer-pool-info'; + value: BalancerPoolInfoAmino; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfoSDKType { + weight: bigint; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfo { + /** The weight of a concentrated pool */ + weight: bigint; + /** The maximum number of ticks we can move when rebalancing */ + maxTicksCrossed: bigint; +} +export interface ConcentratedPoolInfoProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.ConcentratedPoolInfo'; + value: Uint8Array; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfoAmino { + /** The weight of a concentrated pool */ + weight?: string; + /** The maximum number of ticks we can move when rebalancing */ + max_ticks_crossed?: string; +} +export interface ConcentratedPoolInfoAminoMsg { + type: 'osmosis/protorev/concentrated-pool-info'; + value: ConcentratedPoolInfoAmino; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfoSDKType { + weight: bigint; + max_ticks_crossed: bigint; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfo { + /** The weight of a cosmwasm pool (by contract address) */ + weightMaps: WeightMap[]; +} +export interface CosmwasmPoolInfoProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.CosmwasmPoolInfo'; + value: Uint8Array; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfoAmino { + /** The weight of a cosmwasm pool (by contract address) */ + weight_maps?: WeightMapAmino[]; +} +export interface CosmwasmPoolInfoAminoMsg { + type: 'osmosis/protorev/cosmwasm-pool-info'; + value: CosmwasmPoolInfoAmino; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfoSDKType { + weight_maps: WeightMapSDKType[]; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMap { + /** The weight of a cosmwasm pool (by contract address) */ + weight: bigint; + /** The contract address */ + contractAddress: string; +} +export interface WeightMapProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.WeightMap'; + value: Uint8Array; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMapAmino { + /** The weight of a cosmwasm pool (by contract address) */ + weight?: string; + /** The contract address */ + contract_address?: string; +} +export interface WeightMapAminoMsg { + type: 'osmosis/protorev/weight-map'; + value: WeightMapAmino; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMapSDKType { + weight: bigint; + contract_address: string; +} +/** + * BaseDenom represents a single base denom that the module uses for its + * arbitrage trades. It contains the denom name alongside the step size of the + * binary search that is used to find the optimal swap amount + */ +export interface BaseDenom { + /** The denom i.e. name of the base denom (ex. uosmo) */ + denom: string; + /** + * The step size of the binary search that is used to find the optimal swap + * amount + */ + stepSize: string; +} +export interface BaseDenomProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenom'; + value: Uint8Array; +} +/** + * BaseDenom represents a single base denom that the module uses for its + * arbitrage trades. It contains the denom name alongside the step size of the + * binary search that is used to find the optimal swap amount + */ +export interface BaseDenomAmino { + /** The denom i.e. name of the base denom (ex. uosmo) */ + denom?: string; + /** + * The step size of the binary search that is used to find the optimal swap + * amount + */ + step_size?: string; +} +export interface BaseDenomAminoMsg { + type: 'osmosis/protorev/base-denom'; + value: BaseDenomAmino; +} +/** + * BaseDenom represents a single base denom that the module uses for its + * arbitrage trades. It contains the denom name alongside the step size of the + * binary search that is used to find the optimal swap amount + */ +export interface BaseDenomSDKType { + denom: string; + step_size: string; +} +/** + * BaseDenoms represents all of the base denoms that the module uses for its + * arbitrage trades. + */ +export interface BaseDenoms { + baseDenoms: BaseDenom[]; +} +export interface BaseDenomsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenoms'; + value: Uint8Array; +} +/** + * BaseDenoms represents all of the base denoms that the module uses for its + * arbitrage trades. + */ +export interface BaseDenomsAmino { + base_denoms?: BaseDenomAmino[]; +} +export interface BaseDenomsAminoMsg { + type: 'osmosis/protorev/base-denoms'; + value: BaseDenomsAmino; +} +/** + * BaseDenoms represents all of the base denoms that the module uses for its + * arbitrage trades. + */ +export interface BaseDenomsSDKType { + base_denoms: BaseDenomSDKType[]; +} +export interface AllProtocolRevenue { + takerFeesTracker: TakerFeesTracker; + cyclicArbTracker: CyclicArbTracker; +} +export interface AllProtocolRevenueProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.AllProtocolRevenue'; + value: Uint8Array; +} +export interface AllProtocolRevenueAmino { + taker_fees_tracker?: TakerFeesTrackerAmino; + cyclic_arb_tracker?: CyclicArbTrackerAmino; +} +export interface AllProtocolRevenueAminoMsg { + type: 'osmosis/protorev/all-protocol-revenue'; + value: AllProtocolRevenueAmino; +} +export interface AllProtocolRevenueSDKType { + taker_fees_tracker: TakerFeesTrackerSDKType; + cyclic_arb_tracker: CyclicArbTrackerSDKType; +} +export interface CyclicArbTracker { + cyclicArb: Coin[]; + heightAccountingStartsFrom: bigint; +} +export interface CyclicArbTrackerProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.CyclicArbTracker'; + value: Uint8Array; +} +export interface CyclicArbTrackerAmino { + cyclic_arb?: CoinAmino[]; + height_accounting_starts_from?: string; +} +export interface CyclicArbTrackerAminoMsg { + type: 'osmosis/protorev/cyclic-arb-tracker'; + value: CyclicArbTrackerAmino; +} +export interface CyclicArbTrackerSDKType { + cyclic_arb: CoinSDKType[]; + height_accounting_starts_from: bigint; +} +function createBaseTokenPairArbRoutes(): TokenPairArbRoutes { + return { + arbRoutes: [], + tokenIn: '', + tokenOut: '', + }; +} +export const TokenPairArbRoutes = { + typeUrl: '/osmosis.protorev.v1beta1.TokenPairArbRoutes', + aminoType: 'osmosis/protorev/token-pair-arb-routes', + is(o: any): o is TokenPairArbRoutes { + return ( + o && + (o.$typeUrl === TokenPairArbRoutes.typeUrl || + (Array.isArray(o.arbRoutes) && + (!o.arbRoutes.length || Route.is(o.arbRoutes[0])) && + typeof o.tokenIn === 'string' && + typeof o.tokenOut === 'string')) + ); + }, + isSDK(o: any): o is TokenPairArbRoutesSDKType { + return ( + o && + (o.$typeUrl === TokenPairArbRoutes.typeUrl || + (Array.isArray(o.arb_routes) && + (!o.arb_routes.length || Route.isSDK(o.arb_routes[0])) && + typeof o.token_in === 'string' && + typeof o.token_out === 'string')) + ); + }, + isAmino(o: any): o is TokenPairArbRoutesAmino { + return ( + o && + (o.$typeUrl === TokenPairArbRoutes.typeUrl || + (Array.isArray(o.arb_routes) && + (!o.arb_routes.length || Route.isAmino(o.arb_routes[0])) && + typeof o.token_in === 'string' && + typeof o.token_out === 'string')) + ); + }, + encode( + message: TokenPairArbRoutes, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.arbRoutes) { + Route.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tokenIn !== '') { + writer.uint32(18).string(message.tokenIn); + } + if (message.tokenOut !== '') { + writer.uint32(26).string(message.tokenOut); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): TokenPairArbRoutes { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTokenPairArbRoutes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.arbRoutes.push(Route.decode(reader, reader.uint32())); + break; + case 2: + message.tokenIn = reader.string(); + break; + case 3: + message.tokenOut = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TokenPairArbRoutes { + const message = createBaseTokenPairArbRoutes(); + message.arbRoutes = + object.arbRoutes?.map((e) => Route.fromPartial(e)) || []; + message.tokenIn = object.tokenIn ?? ''; + message.tokenOut = object.tokenOut ?? ''; + return message; + }, + fromAmino(object: TokenPairArbRoutesAmino): TokenPairArbRoutes { + const message = createBaseTokenPairArbRoutes(); + message.arbRoutes = object.arb_routes?.map((e) => Route.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; + }, + toAmino(message: TokenPairArbRoutes): TokenPairArbRoutesAmino { + const obj: any = {}; + if (message.arbRoutes) { + obj.arb_routes = message.arbRoutes.map((e) => + e ? Route.toAmino(e) : undefined + ); + } else { + obj.arb_routes = message.arbRoutes; + } + obj.token_in = message.tokenIn === '' ? undefined : message.tokenIn; + obj.token_out = message.tokenOut === '' ? undefined : message.tokenOut; + return obj; + }, + fromAminoMsg(object: TokenPairArbRoutesAminoMsg): TokenPairArbRoutes { + return TokenPairArbRoutes.fromAmino(object.value); + }, + toAminoMsg(message: TokenPairArbRoutes): TokenPairArbRoutesAminoMsg { + return { + type: 'osmosis/protorev/token-pair-arb-routes', + value: TokenPairArbRoutes.toAmino(message), + }; + }, + fromProtoMsg(message: TokenPairArbRoutesProtoMsg): TokenPairArbRoutes { + return TokenPairArbRoutes.decode(message.value); + }, + toProto(message: TokenPairArbRoutes): Uint8Array { + return TokenPairArbRoutes.encode(message).finish(); + }, + toProtoMsg(message: TokenPairArbRoutes): TokenPairArbRoutesProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.TokenPairArbRoutes', + value: TokenPairArbRoutes.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(TokenPairArbRoutes.typeUrl, TokenPairArbRoutes); +GlobalDecoderRegistry.registerAminoProtoMapping( + TokenPairArbRoutes.aminoType, + TokenPairArbRoutes.typeUrl +); +function createBaseRoute(): Route { + return { + trades: [], + stepSize: '', + }; +} +export const Route = { + typeUrl: '/osmosis.protorev.v1beta1.Route', + aminoType: 'osmosis/protorev/route', + is(o: any): o is Route { + return ( + o && + (o.$typeUrl === Route.typeUrl || + (Array.isArray(o.trades) && + (!o.trades.length || Trade.is(o.trades[0])) && + typeof o.stepSize === 'string')) + ); + }, + isSDK(o: any): o is RouteSDKType { + return ( + o && + (o.$typeUrl === Route.typeUrl || + (Array.isArray(o.trades) && + (!o.trades.length || Trade.isSDK(o.trades[0])) && + typeof o.step_size === 'string')) + ); + }, + isAmino(o: any): o is RouteAmino { + return ( + o && + (o.$typeUrl === Route.typeUrl || + (Array.isArray(o.trades) && + (!o.trades.length || Trade.isAmino(o.trades[0])) && + typeof o.step_size === 'string')) + ); + }, + encode( + message: Route, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.trades) { + Trade.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.stepSize !== '') { + writer.uint32(18).string(message.stepSize); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Route { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRoute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trades.push(Trade.decode(reader, reader.uint32())); + break; + case 2: + message.stepSize = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Route { + const message = createBaseRoute(); + message.trades = object.trades?.map((e) => Trade.fromPartial(e)) || []; + message.stepSize = object.stepSize ?? ''; + return message; + }, + fromAmino(object: RouteAmino): Route { + const message = createBaseRoute(); + message.trades = object.trades?.map((e) => Trade.fromAmino(e)) || []; + if (object.step_size !== undefined && object.step_size !== null) { + message.stepSize = object.step_size; + } + return message; + }, + toAmino(message: Route): RouteAmino { + const obj: any = {}; + if (message.trades) { + obj.trades = message.trades.map((e) => + e ? Trade.toAmino(e) : undefined + ); + } else { + obj.trades = message.trades; + } + obj.step_size = message.stepSize === '' ? undefined : message.stepSize; + return obj; + }, + fromAminoMsg(object: RouteAminoMsg): Route { + return Route.fromAmino(object.value); + }, + toAminoMsg(message: Route): RouteAminoMsg { + return { + type: 'osmosis/protorev/route', + value: Route.toAmino(message), + }; + }, + fromProtoMsg(message: RouteProtoMsg): Route { + return Route.decode(message.value); + }, + toProto(message: Route): Uint8Array { + return Route.encode(message).finish(); + }, + toProtoMsg(message: Route): RouteProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.Route', + value: Route.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Route.typeUrl, Route); +GlobalDecoderRegistry.registerAminoProtoMapping(Route.aminoType, Route.typeUrl); +function createBaseTrade(): Trade { + return { + pool: BigInt(0), + tokenIn: '', + tokenOut: '', + }; +} +export const Trade = { + typeUrl: '/osmosis.protorev.v1beta1.Trade', + aminoType: 'osmosis/protorev/trade', + is(o: any): o is Trade { + return ( + o && + (o.$typeUrl === Trade.typeUrl || + (typeof o.pool === 'bigint' && + typeof o.tokenIn === 'string' && + typeof o.tokenOut === 'string')) + ); + }, + isSDK(o: any): o is TradeSDKType { + return ( + o && + (o.$typeUrl === Trade.typeUrl || + (typeof o.pool === 'bigint' && + typeof o.token_in === 'string' && + typeof o.token_out === 'string')) + ); + }, + isAmino(o: any): o is TradeAmino { + return ( + o && + (o.$typeUrl === Trade.typeUrl || + (typeof o.pool === 'bigint' && + typeof o.token_in === 'string' && + typeof o.token_out === 'string')) + ); + }, + encode( + message: Trade, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.pool !== BigInt(0)) { + writer.uint32(8).uint64(message.pool); + } + if (message.tokenIn !== '') { + writer.uint32(18).string(message.tokenIn); + } + if (message.tokenOut !== '') { + writer.uint32(26).string(message.tokenOut); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Trade { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool = reader.uint64(); + break; + case 2: + message.tokenIn = reader.string(); + break; + case 3: + message.tokenOut = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Trade { + const message = createBaseTrade(); + message.pool = + object.pool !== undefined && object.pool !== null + ? BigInt(object.pool.toString()) + : BigInt(0); + message.tokenIn = object.tokenIn ?? ''; + message.tokenOut = object.tokenOut ?? ''; + return message; + }, + fromAmino(object: TradeAmino): Trade { + const message = createBaseTrade(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = BigInt(object.pool); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; + }, + toAmino(message: Trade): TradeAmino { + const obj: any = {}; + obj.pool = message.pool !== BigInt(0) ? message.pool.toString() : undefined; + obj.token_in = message.tokenIn === '' ? undefined : message.tokenIn; + obj.token_out = message.tokenOut === '' ? undefined : message.tokenOut; + return obj; + }, + fromAminoMsg(object: TradeAminoMsg): Trade { + return Trade.fromAmino(object.value); + }, + toAminoMsg(message: Trade): TradeAminoMsg { + return { + type: 'osmosis/protorev/trade', + value: Trade.toAmino(message), + }; + }, + fromProtoMsg(message: TradeProtoMsg): Trade { + return Trade.decode(message.value); + }, + toProto(message: Trade): Uint8Array { + return Trade.encode(message).finish(); + }, + toProtoMsg(message: Trade): TradeProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.Trade', + value: Trade.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Trade.typeUrl, Trade); +GlobalDecoderRegistry.registerAminoProtoMapping(Trade.aminoType, Trade.typeUrl); +function createBaseRouteStatistics(): RouteStatistics { + return { + profits: [], + numberOfTrades: '', + route: [], + }; +} +export const RouteStatistics = { + typeUrl: '/osmosis.protorev.v1beta1.RouteStatistics', + aminoType: 'osmosis/protorev/route-statistics', + is(o: any): o is RouteStatistics { + return ( + o && + (o.$typeUrl === RouteStatistics.typeUrl || + (Array.isArray(o.profits) && + (!o.profits.length || Coin.is(o.profits[0])) && + typeof o.numberOfTrades === 'string' && + Array.isArray(o.route) && + (!o.route.length || typeof o.route[0] === 'bigint'))) + ); + }, + isSDK(o: any): o is RouteStatisticsSDKType { + return ( + o && + (o.$typeUrl === RouteStatistics.typeUrl || + (Array.isArray(o.profits) && + (!o.profits.length || Coin.isSDK(o.profits[0])) && + typeof o.number_of_trades === 'string' && + Array.isArray(o.route) && + (!o.route.length || typeof o.route[0] === 'bigint'))) + ); + }, + isAmino(o: any): o is RouteStatisticsAmino { + return ( + o && + (o.$typeUrl === RouteStatistics.typeUrl || + (Array.isArray(o.profits) && + (!o.profits.length || Coin.isAmino(o.profits[0])) && + typeof o.number_of_trades === 'string' && + Array.isArray(o.route) && + (!o.route.length || typeof o.route[0] === 'bigint'))) + ); + }, + encode( + message: RouteStatistics, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.profits) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.numberOfTrades !== '') { + writer.uint32(18).string(message.numberOfTrades); + } + writer.uint32(26).fork(); + for (const v of message.route) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RouteStatistics { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRouteStatistics(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.profits.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.numberOfTrades = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.route.push(reader.uint64()); + } + } else { + message.route.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RouteStatistics { + const message = createBaseRouteStatistics(); + message.profits = object.profits?.map((e) => Coin.fromPartial(e)) || []; + message.numberOfTrades = object.numberOfTrades ?? ''; + message.route = object.route?.map((e) => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: RouteStatisticsAmino): RouteStatistics { + const message = createBaseRouteStatistics(); + message.profits = object.profits?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.number_of_trades !== undefined && + object.number_of_trades !== null + ) { + message.numberOfTrades = object.number_of_trades; + } + message.route = object.route?.map((e) => BigInt(e)) || []; + return message; + }, + toAmino(message: RouteStatistics): RouteStatisticsAmino { + const obj: any = {}; + if (message.profits) { + obj.profits = message.profits.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.profits = message.profits; + } + obj.number_of_trades = + message.numberOfTrades === '' ? undefined : message.numberOfTrades; + if (message.route) { + obj.route = message.route.map((e) => e.toString()); + } else { + obj.route = message.route; + } + return obj; + }, + fromAminoMsg(object: RouteStatisticsAminoMsg): RouteStatistics { + return RouteStatistics.fromAmino(object.value); + }, + toAminoMsg(message: RouteStatistics): RouteStatisticsAminoMsg { + return { + type: 'osmosis/protorev/route-statistics', + value: RouteStatistics.toAmino(message), + }; + }, + fromProtoMsg(message: RouteStatisticsProtoMsg): RouteStatistics { + return RouteStatistics.decode(message.value); + }, + toProto(message: RouteStatistics): Uint8Array { + return RouteStatistics.encode(message).finish(); + }, + toProtoMsg(message: RouteStatistics): RouteStatisticsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.RouteStatistics', + value: RouteStatistics.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(RouteStatistics.typeUrl, RouteStatistics); +GlobalDecoderRegistry.registerAminoProtoMapping( + RouteStatistics.aminoType, + RouteStatistics.typeUrl +); +function createBasePoolWeights(): PoolWeights { + return { + stableWeight: BigInt(0), + balancerWeight: BigInt(0), + concentratedWeight: BigInt(0), + cosmwasmWeight: BigInt(0), + }; +} +export const PoolWeights = { + typeUrl: '/osmosis.protorev.v1beta1.PoolWeights', + aminoType: 'osmosis/protorev/pool-weights', + is(o: any): o is PoolWeights { + return ( + o && + (o.$typeUrl === PoolWeights.typeUrl || + (typeof o.stableWeight === 'bigint' && + typeof o.balancerWeight === 'bigint' && + typeof o.concentratedWeight === 'bigint' && + typeof o.cosmwasmWeight === 'bigint')) + ); + }, + isSDK(o: any): o is PoolWeightsSDKType { + return ( + o && + (o.$typeUrl === PoolWeights.typeUrl || + (typeof o.stable_weight === 'bigint' && + typeof o.balancer_weight === 'bigint' && + typeof o.concentrated_weight === 'bigint' && + typeof o.cosmwasm_weight === 'bigint')) + ); + }, + isAmino(o: any): o is PoolWeightsAmino { + return ( + o && + (o.$typeUrl === PoolWeights.typeUrl || + (typeof o.stable_weight === 'bigint' && + typeof o.balancer_weight === 'bigint' && + typeof o.concentrated_weight === 'bigint' && + typeof o.cosmwasm_weight === 'bigint')) + ); + }, + encode( + message: PoolWeights, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.stableWeight !== BigInt(0)) { + writer.uint32(8).uint64(message.stableWeight); + } + if (message.balancerWeight !== BigInt(0)) { + writer.uint32(16).uint64(message.balancerWeight); + } + if (message.concentratedWeight !== BigInt(0)) { + writer.uint32(24).uint64(message.concentratedWeight); + } + if (message.cosmwasmWeight !== BigInt(0)) { + writer.uint32(32).uint64(message.cosmwasmWeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolWeights { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolWeights(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stableWeight = reader.uint64(); + break; + case 2: + message.balancerWeight = reader.uint64(); + break; + case 3: + message.concentratedWeight = reader.uint64(); + break; + case 4: + message.cosmwasmWeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PoolWeights { + const message = createBasePoolWeights(); + message.stableWeight = + object.stableWeight !== undefined && object.stableWeight !== null + ? BigInt(object.stableWeight.toString()) + : BigInt(0); + message.balancerWeight = + object.balancerWeight !== undefined && object.balancerWeight !== null + ? BigInt(object.balancerWeight.toString()) + : BigInt(0); + message.concentratedWeight = + object.concentratedWeight !== undefined && + object.concentratedWeight !== null + ? BigInt(object.concentratedWeight.toString()) + : BigInt(0); + message.cosmwasmWeight = + object.cosmwasmWeight !== undefined && object.cosmwasmWeight !== null + ? BigInt(object.cosmwasmWeight.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: PoolWeightsAmino): PoolWeights { + const message = createBasePoolWeights(); + if (object.stable_weight !== undefined && object.stable_weight !== null) { + message.stableWeight = BigInt(object.stable_weight); + } + if ( + object.balancer_weight !== undefined && + object.balancer_weight !== null + ) { + message.balancerWeight = BigInt(object.balancer_weight); + } + if ( + object.concentrated_weight !== undefined && + object.concentrated_weight !== null + ) { + message.concentratedWeight = BigInt(object.concentrated_weight); + } + if ( + object.cosmwasm_weight !== undefined && + object.cosmwasm_weight !== null + ) { + message.cosmwasmWeight = BigInt(object.cosmwasm_weight); + } + return message; + }, + toAmino(message: PoolWeights): PoolWeightsAmino { + const obj: any = {}; + obj.stable_weight = + message.stableWeight !== BigInt(0) + ? message.stableWeight.toString() + : undefined; + obj.balancer_weight = + message.balancerWeight !== BigInt(0) + ? message.balancerWeight.toString() + : undefined; + obj.concentrated_weight = + message.concentratedWeight !== BigInt(0) + ? message.concentratedWeight.toString() + : undefined; + obj.cosmwasm_weight = + message.cosmwasmWeight !== BigInt(0) + ? message.cosmwasmWeight.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: PoolWeightsAminoMsg): PoolWeights { + return PoolWeights.fromAmino(object.value); + }, + toAminoMsg(message: PoolWeights): PoolWeightsAminoMsg { + return { + type: 'osmosis/protorev/pool-weights', + value: PoolWeights.toAmino(message), + }; + }, + fromProtoMsg(message: PoolWeightsProtoMsg): PoolWeights { + return PoolWeights.decode(message.value); + }, + toProto(message: PoolWeights): Uint8Array { + return PoolWeights.encode(message).finish(); + }, + toProtoMsg(message: PoolWeights): PoolWeightsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.PoolWeights', + value: PoolWeights.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(PoolWeights.typeUrl, PoolWeights); +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolWeights.aminoType, + PoolWeights.typeUrl +); +function createBaseInfoByPoolType(): InfoByPoolType { + return { + stable: StablePoolInfo.fromPartial({}), + balancer: BalancerPoolInfo.fromPartial({}), + concentrated: ConcentratedPoolInfo.fromPartial({}), + cosmwasm: CosmwasmPoolInfo.fromPartial({}), + }; +} +export const InfoByPoolType = { + typeUrl: '/osmosis.protorev.v1beta1.InfoByPoolType', + aminoType: 'osmosis/protorev/info-by-pool-type', + is(o: any): o is InfoByPoolType { + return ( + o && + (o.$typeUrl === InfoByPoolType.typeUrl || + (StablePoolInfo.is(o.stable) && + BalancerPoolInfo.is(o.balancer) && + ConcentratedPoolInfo.is(o.concentrated) && + CosmwasmPoolInfo.is(o.cosmwasm))) + ); + }, + isSDK(o: any): o is InfoByPoolTypeSDKType { + return ( + o && + (o.$typeUrl === InfoByPoolType.typeUrl || + (StablePoolInfo.isSDK(o.stable) && + BalancerPoolInfo.isSDK(o.balancer) && + ConcentratedPoolInfo.isSDK(o.concentrated) && + CosmwasmPoolInfo.isSDK(o.cosmwasm))) + ); + }, + isAmino(o: any): o is InfoByPoolTypeAmino { + return ( + o && + (o.$typeUrl === InfoByPoolType.typeUrl || + (StablePoolInfo.isAmino(o.stable) && + BalancerPoolInfo.isAmino(o.balancer) && + ConcentratedPoolInfo.isAmino(o.concentrated) && + CosmwasmPoolInfo.isAmino(o.cosmwasm))) + ); + }, + encode( + message: InfoByPoolType, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.stable !== undefined) { + StablePoolInfo.encode(message.stable, writer.uint32(10).fork()).ldelim(); + } + if (message.balancer !== undefined) { + BalancerPoolInfo.encode( + message.balancer, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.concentrated !== undefined) { + ConcentratedPoolInfo.encode( + message.concentrated, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.cosmwasm !== undefined) { + CosmwasmPoolInfo.encode( + message.cosmwasm, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InfoByPoolType { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInfoByPoolType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stable = StablePoolInfo.decode(reader, reader.uint32()); + break; + case 2: + message.balancer = BalancerPoolInfo.decode(reader, reader.uint32()); + break; + case 3: + message.concentrated = ConcentratedPoolInfo.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.cosmwasm = CosmwasmPoolInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InfoByPoolType { + const message = createBaseInfoByPoolType(); + message.stable = + object.stable !== undefined && object.stable !== null + ? StablePoolInfo.fromPartial(object.stable) + : undefined; + message.balancer = + object.balancer !== undefined && object.balancer !== null + ? BalancerPoolInfo.fromPartial(object.balancer) + : undefined; + message.concentrated = + object.concentrated !== undefined && object.concentrated !== null + ? ConcentratedPoolInfo.fromPartial(object.concentrated) + : undefined; + message.cosmwasm = + object.cosmwasm !== undefined && object.cosmwasm !== null + ? CosmwasmPoolInfo.fromPartial(object.cosmwasm) + : undefined; + return message; + }, + fromAmino(object: InfoByPoolTypeAmino): InfoByPoolType { + const message = createBaseInfoByPoolType(); + if (object.stable !== undefined && object.stable !== null) { + message.stable = StablePoolInfo.fromAmino(object.stable); + } + if (object.balancer !== undefined && object.balancer !== null) { + message.balancer = BalancerPoolInfo.fromAmino(object.balancer); + } + if (object.concentrated !== undefined && object.concentrated !== null) { + message.concentrated = ConcentratedPoolInfo.fromAmino( + object.concentrated + ); + } + if (object.cosmwasm !== undefined && object.cosmwasm !== null) { + message.cosmwasm = CosmwasmPoolInfo.fromAmino(object.cosmwasm); + } + return message; + }, + toAmino(message: InfoByPoolType): InfoByPoolTypeAmino { + const obj: any = {}; + obj.stable = message.stable + ? StablePoolInfo.toAmino(message.stable) + : undefined; + obj.balancer = message.balancer + ? BalancerPoolInfo.toAmino(message.balancer) + : undefined; + obj.concentrated = message.concentrated + ? ConcentratedPoolInfo.toAmino(message.concentrated) + : undefined; + obj.cosmwasm = message.cosmwasm + ? CosmwasmPoolInfo.toAmino(message.cosmwasm) + : undefined; + return obj; + }, + fromAminoMsg(object: InfoByPoolTypeAminoMsg): InfoByPoolType { + return InfoByPoolType.fromAmino(object.value); + }, + toAminoMsg(message: InfoByPoolType): InfoByPoolTypeAminoMsg { + return { + type: 'osmosis/protorev/info-by-pool-type', + value: InfoByPoolType.toAmino(message), + }; + }, + fromProtoMsg(message: InfoByPoolTypeProtoMsg): InfoByPoolType { + return InfoByPoolType.decode(message.value); + }, + toProto(message: InfoByPoolType): Uint8Array { + return InfoByPoolType.encode(message).finish(); + }, + toProtoMsg(message: InfoByPoolType): InfoByPoolTypeProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.InfoByPoolType', + value: InfoByPoolType.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(InfoByPoolType.typeUrl, InfoByPoolType); +GlobalDecoderRegistry.registerAminoProtoMapping( + InfoByPoolType.aminoType, + InfoByPoolType.typeUrl +); +function createBaseStablePoolInfo(): StablePoolInfo { + return { + weight: BigInt(0), + }; +} +export const StablePoolInfo = { + typeUrl: '/osmosis.protorev.v1beta1.StablePoolInfo', + aminoType: 'osmosis/protorev/stable-pool-info', + is(o: any): o is StablePoolInfo { + return ( + o && + (o.$typeUrl === StablePoolInfo.typeUrl || typeof o.weight === 'bigint') + ); + }, + isSDK(o: any): o is StablePoolInfoSDKType { + return ( + o && + (o.$typeUrl === StablePoolInfo.typeUrl || typeof o.weight === 'bigint') + ); + }, + isAmino(o: any): o is StablePoolInfoAmino { + return ( + o && + (o.$typeUrl === StablePoolInfo.typeUrl || typeof o.weight === 'bigint') + ); + }, + encode( + message: StablePoolInfo, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StablePoolInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStablePoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StablePoolInfo { + const message = createBaseStablePoolInfo(); + message.weight = + object.weight !== undefined && object.weight !== null + ? BigInt(object.weight.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: StablePoolInfoAmino): StablePoolInfo { + const message = createBaseStablePoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + return message; + }, + toAmino(message: StablePoolInfo): StablePoolInfoAmino { + const obj: any = {}; + obj.weight = + message.weight !== BigInt(0) ? message.weight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: StablePoolInfoAminoMsg): StablePoolInfo { + return StablePoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: StablePoolInfo): StablePoolInfoAminoMsg { + return { + type: 'osmosis/protorev/stable-pool-info', + value: StablePoolInfo.toAmino(message), + }; + }, + fromProtoMsg(message: StablePoolInfoProtoMsg): StablePoolInfo { + return StablePoolInfo.decode(message.value); + }, + toProto(message: StablePoolInfo): Uint8Array { + return StablePoolInfo.encode(message).finish(); + }, + toProtoMsg(message: StablePoolInfo): StablePoolInfoProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.StablePoolInfo', + value: StablePoolInfo.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(StablePoolInfo.typeUrl, StablePoolInfo); +GlobalDecoderRegistry.registerAminoProtoMapping( + StablePoolInfo.aminoType, + StablePoolInfo.typeUrl +); +function createBaseBalancerPoolInfo(): BalancerPoolInfo { + return { + weight: BigInt(0), + }; +} +export const BalancerPoolInfo = { + typeUrl: '/osmosis.protorev.v1beta1.BalancerPoolInfo', + aminoType: 'osmosis/protorev/balancer-pool-info', + is(o: any): o is BalancerPoolInfo { + return ( + o && + (o.$typeUrl === BalancerPoolInfo.typeUrl || typeof o.weight === 'bigint') + ); + }, + isSDK(o: any): o is BalancerPoolInfoSDKType { + return ( + o && + (o.$typeUrl === BalancerPoolInfo.typeUrl || typeof o.weight === 'bigint') + ); + }, + isAmino(o: any): o is BalancerPoolInfoAmino { + return ( + o && + (o.$typeUrl === BalancerPoolInfo.typeUrl || typeof o.weight === 'bigint') + ); + }, + encode( + message: BalancerPoolInfo, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BalancerPoolInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalancerPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BalancerPoolInfo { + const message = createBaseBalancerPoolInfo(); + message.weight = + object.weight !== undefined && object.weight !== null + ? BigInt(object.weight.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: BalancerPoolInfoAmino): BalancerPoolInfo { + const message = createBaseBalancerPoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + return message; + }, + toAmino(message: BalancerPoolInfo): BalancerPoolInfoAmino { + const obj: any = {}; + obj.weight = + message.weight !== BigInt(0) ? message.weight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BalancerPoolInfoAminoMsg): BalancerPoolInfo { + return BalancerPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: BalancerPoolInfo): BalancerPoolInfoAminoMsg { + return { + type: 'osmosis/protorev/balancer-pool-info', + value: BalancerPoolInfo.toAmino(message), + }; + }, + fromProtoMsg(message: BalancerPoolInfoProtoMsg): BalancerPoolInfo { + return BalancerPoolInfo.decode(message.value); + }, + toProto(message: BalancerPoolInfo): Uint8Array { + return BalancerPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: BalancerPoolInfo): BalancerPoolInfoProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.BalancerPoolInfo', + value: BalancerPoolInfo.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(BalancerPoolInfo.typeUrl, BalancerPoolInfo); +GlobalDecoderRegistry.registerAminoProtoMapping( + BalancerPoolInfo.aminoType, + BalancerPoolInfo.typeUrl +); +function createBaseConcentratedPoolInfo(): ConcentratedPoolInfo { + return { + weight: BigInt(0), + maxTicksCrossed: BigInt(0), + }; +} +export const ConcentratedPoolInfo = { + typeUrl: '/osmosis.protorev.v1beta1.ConcentratedPoolInfo', + aminoType: 'osmosis/protorev/concentrated-pool-info', + is(o: any): o is ConcentratedPoolInfo { + return ( + o && + (o.$typeUrl === ConcentratedPoolInfo.typeUrl || + (typeof o.weight === 'bigint' && typeof o.maxTicksCrossed === 'bigint')) + ); + }, + isSDK(o: any): o is ConcentratedPoolInfoSDKType { + return ( + o && + (o.$typeUrl === ConcentratedPoolInfo.typeUrl || + (typeof o.weight === 'bigint' && + typeof o.max_ticks_crossed === 'bigint')) + ); + }, + isAmino(o: any): o is ConcentratedPoolInfoAmino { + return ( + o && + (o.$typeUrl === ConcentratedPoolInfo.typeUrl || + (typeof o.weight === 'bigint' && + typeof o.max_ticks_crossed === 'bigint')) + ); + }, + encode( + message: ConcentratedPoolInfo, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + if (message.maxTicksCrossed !== BigInt(0)) { + writer.uint32(16).uint64(message.maxTicksCrossed); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ConcentratedPoolInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConcentratedPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + case 2: + message.maxTicksCrossed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConcentratedPoolInfo { + const message = createBaseConcentratedPoolInfo(); + message.weight = + object.weight !== undefined && object.weight !== null + ? BigInt(object.weight.toString()) + : BigInt(0); + message.maxTicksCrossed = + object.maxTicksCrossed !== undefined && object.maxTicksCrossed !== null + ? BigInt(object.maxTicksCrossed.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: ConcentratedPoolInfoAmino): ConcentratedPoolInfo { + const message = createBaseConcentratedPoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + if ( + object.max_ticks_crossed !== undefined && + object.max_ticks_crossed !== null + ) { + message.maxTicksCrossed = BigInt(object.max_ticks_crossed); + } + return message; + }, + toAmino(message: ConcentratedPoolInfo): ConcentratedPoolInfoAmino { + const obj: any = {}; + obj.weight = + message.weight !== BigInt(0) ? message.weight.toString() : undefined; + obj.max_ticks_crossed = + message.maxTicksCrossed !== BigInt(0) + ? message.maxTicksCrossed.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: ConcentratedPoolInfoAminoMsg): ConcentratedPoolInfo { + return ConcentratedPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: ConcentratedPoolInfo): ConcentratedPoolInfoAminoMsg { + return { + type: 'osmosis/protorev/concentrated-pool-info', + value: ConcentratedPoolInfo.toAmino(message), + }; + }, + fromProtoMsg(message: ConcentratedPoolInfoProtoMsg): ConcentratedPoolInfo { + return ConcentratedPoolInfo.decode(message.value); + }, + toProto(message: ConcentratedPoolInfo): Uint8Array { + return ConcentratedPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: ConcentratedPoolInfo): ConcentratedPoolInfoProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.ConcentratedPoolInfo', + value: ConcentratedPoolInfo.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ConcentratedPoolInfo.typeUrl, + ConcentratedPoolInfo +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ConcentratedPoolInfo.aminoType, + ConcentratedPoolInfo.typeUrl +); +function createBaseCosmwasmPoolInfo(): CosmwasmPoolInfo { + return { + weightMaps: [], + }; +} +export const CosmwasmPoolInfo = { + typeUrl: '/osmosis.protorev.v1beta1.CosmwasmPoolInfo', + aminoType: 'osmosis/protorev/cosmwasm-pool-info', + is(o: any): o is CosmwasmPoolInfo { + return ( + o && + (o.$typeUrl === CosmwasmPoolInfo.typeUrl || + (Array.isArray(o.weightMaps) && + (!o.weightMaps.length || WeightMap.is(o.weightMaps[0])))) + ); + }, + isSDK(o: any): o is CosmwasmPoolInfoSDKType { + return ( + o && + (o.$typeUrl === CosmwasmPoolInfo.typeUrl || + (Array.isArray(o.weight_maps) && + (!o.weight_maps.length || WeightMap.isSDK(o.weight_maps[0])))) + ); + }, + isAmino(o: any): o is CosmwasmPoolInfoAmino { + return ( + o && + (o.$typeUrl === CosmwasmPoolInfo.typeUrl || + (Array.isArray(o.weight_maps) && + (!o.weight_maps.length || WeightMap.isAmino(o.weight_maps[0])))) + ); + }, + encode( + message: CosmwasmPoolInfo, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.weightMaps) { + WeightMap.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CosmwasmPoolInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCosmwasmPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weightMaps.push(WeightMap.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CosmwasmPoolInfo { + const message = createBaseCosmwasmPoolInfo(); + message.weightMaps = + object.weightMaps?.map((e) => WeightMap.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CosmwasmPoolInfoAmino): CosmwasmPoolInfo { + const message = createBaseCosmwasmPoolInfo(); + message.weightMaps = + object.weight_maps?.map((e) => WeightMap.fromAmino(e)) || []; + return message; + }, + toAmino(message: CosmwasmPoolInfo): CosmwasmPoolInfoAmino { + const obj: any = {}; + if (message.weightMaps) { + obj.weight_maps = message.weightMaps.map((e) => + e ? WeightMap.toAmino(e) : undefined + ); + } else { + obj.weight_maps = message.weightMaps; + } + return obj; + }, + fromAminoMsg(object: CosmwasmPoolInfoAminoMsg): CosmwasmPoolInfo { + return CosmwasmPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: CosmwasmPoolInfo): CosmwasmPoolInfoAminoMsg { + return { + type: 'osmosis/protorev/cosmwasm-pool-info', + value: CosmwasmPoolInfo.toAmino(message), + }; + }, + fromProtoMsg(message: CosmwasmPoolInfoProtoMsg): CosmwasmPoolInfo { + return CosmwasmPoolInfo.decode(message.value); + }, + toProto(message: CosmwasmPoolInfo): Uint8Array { + return CosmwasmPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: CosmwasmPoolInfo): CosmwasmPoolInfoProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.CosmwasmPoolInfo', + value: CosmwasmPoolInfo.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(CosmwasmPoolInfo.typeUrl, CosmwasmPoolInfo); +GlobalDecoderRegistry.registerAminoProtoMapping( + CosmwasmPoolInfo.aminoType, + CosmwasmPoolInfo.typeUrl +); +function createBaseWeightMap(): WeightMap { + return { + weight: BigInt(0), + contractAddress: '', + }; +} +export const WeightMap = { + typeUrl: '/osmosis.protorev.v1beta1.WeightMap', + aminoType: 'osmosis/protorev/weight-map', + is(o: any): o is WeightMap { + return ( + o && + (o.$typeUrl === WeightMap.typeUrl || + (typeof o.weight === 'bigint' && typeof o.contractAddress === 'string')) + ); + }, + isSDK(o: any): o is WeightMapSDKType { + return ( + o && + (o.$typeUrl === WeightMap.typeUrl || + (typeof o.weight === 'bigint' && + typeof o.contract_address === 'string')) + ); + }, + isAmino(o: any): o is WeightMapAmino { + return ( + o && + (o.$typeUrl === WeightMap.typeUrl || + (typeof o.weight === 'bigint' && + typeof o.contract_address === 'string')) + ); + }, + encode( + message: WeightMap, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + if (message.contractAddress !== '') { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): WeightMap { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightMap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WeightMap { + const message = createBaseWeightMap(); + message.weight = + object.weight !== undefined && object.weight !== null + ? BigInt(object.weight.toString()) + : BigInt(0); + message.contractAddress = object.contractAddress ?? ''; + return message; + }, + fromAmino(object: WeightMapAmino): WeightMap { + const message = createBaseWeightMap(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + if ( + object.contract_address !== undefined && + object.contract_address !== null + ) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: WeightMap): WeightMapAmino { + const obj: any = {}; + obj.weight = + message.weight !== BigInt(0) ? message.weight.toString() : undefined; + obj.contract_address = + message.contractAddress === '' ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: WeightMapAminoMsg): WeightMap { + return WeightMap.fromAmino(object.value); + }, + toAminoMsg(message: WeightMap): WeightMapAminoMsg { + return { + type: 'osmosis/protorev/weight-map', + value: WeightMap.toAmino(message), + }; + }, + fromProtoMsg(message: WeightMapProtoMsg): WeightMap { + return WeightMap.decode(message.value); + }, + toProto(message: WeightMap): Uint8Array { + return WeightMap.encode(message).finish(); + }, + toProtoMsg(message: WeightMap): WeightMapProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.WeightMap', + value: WeightMap.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(WeightMap.typeUrl, WeightMap); +GlobalDecoderRegistry.registerAminoProtoMapping( + WeightMap.aminoType, + WeightMap.typeUrl +); +function createBaseBaseDenom(): BaseDenom { + return { + denom: '', + stepSize: '', + }; +} +export const BaseDenom = { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenom', + aminoType: 'osmosis/protorev/base-denom', + is(o: any): o is BaseDenom { + return ( + o && + (o.$typeUrl === BaseDenom.typeUrl || + (typeof o.denom === 'string' && typeof o.stepSize === 'string')) + ); + }, + isSDK(o: any): o is BaseDenomSDKType { + return ( + o && + (o.$typeUrl === BaseDenom.typeUrl || + (typeof o.denom === 'string' && typeof o.step_size === 'string')) + ); + }, + isAmino(o: any): o is BaseDenomAmino { + return ( + o && + (o.$typeUrl === BaseDenom.typeUrl || + (typeof o.denom === 'string' && typeof o.step_size === 'string')) + ); + }, + encode( + message: BaseDenom, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.stepSize !== '') { + writer.uint32(18).string(message.stepSize); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseDenom { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.stepSize = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BaseDenom { + const message = createBaseBaseDenom(); + message.denom = object.denom ?? ''; + message.stepSize = object.stepSize ?? ''; + return message; + }, + fromAmino(object: BaseDenomAmino): BaseDenom { + const message = createBaseBaseDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.step_size !== undefined && object.step_size !== null) { + message.stepSize = object.step_size; + } + return message; + }, + toAmino(message: BaseDenom): BaseDenomAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.step_size = message.stepSize === '' ? undefined : message.stepSize; + return obj; + }, + fromAminoMsg(object: BaseDenomAminoMsg): BaseDenom { + return BaseDenom.fromAmino(object.value); + }, + toAminoMsg(message: BaseDenom): BaseDenomAminoMsg { + return { + type: 'osmosis/protorev/base-denom', + value: BaseDenom.toAmino(message), + }; + }, + fromProtoMsg(message: BaseDenomProtoMsg): BaseDenom { + return BaseDenom.decode(message.value); + }, + toProto(message: BaseDenom): Uint8Array { + return BaseDenom.encode(message).finish(); + }, + toProtoMsg(message: BaseDenom): BaseDenomProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenom', + value: BaseDenom.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(BaseDenom.typeUrl, BaseDenom); +GlobalDecoderRegistry.registerAminoProtoMapping( + BaseDenom.aminoType, + BaseDenom.typeUrl +); +function createBaseBaseDenoms(): BaseDenoms { + return { + baseDenoms: [], + }; +} +export const BaseDenoms = { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenoms', + aminoType: 'osmosis/protorev/base-denoms', + is(o: any): o is BaseDenoms { + return ( + o && + (o.$typeUrl === BaseDenoms.typeUrl || + (Array.isArray(o.baseDenoms) && + (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0])))) + ); + }, + isSDK(o: any): o is BaseDenomsSDKType { + return ( + o && + (o.$typeUrl === BaseDenoms.typeUrl || + (Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0])))) + ); + }, + isAmino(o: any): o is BaseDenomsAmino { + return ( + o && + (o.$typeUrl === BaseDenoms.typeUrl || + (Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0])))) + ); + }, + encode( + message: BaseDenoms, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.baseDenoms) { + BaseDenom.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseDenoms { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseDenoms(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseDenoms.push(BaseDenom.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BaseDenoms { + const message = createBaseBaseDenoms(); + message.baseDenoms = + object.baseDenoms?.map((e) => BaseDenom.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BaseDenomsAmino): BaseDenoms { + const message = createBaseBaseDenoms(); + message.baseDenoms = + object.base_denoms?.map((e) => BaseDenom.fromAmino(e)) || []; + return message; + }, + toAmino(message: BaseDenoms): BaseDenomsAmino { + const obj: any = {}; + if (message.baseDenoms) { + obj.base_denoms = message.baseDenoms.map((e) => + e ? BaseDenom.toAmino(e) : undefined + ); + } else { + obj.base_denoms = message.baseDenoms; + } + return obj; + }, + fromAminoMsg(object: BaseDenomsAminoMsg): BaseDenoms { + return BaseDenoms.fromAmino(object.value); + }, + toAminoMsg(message: BaseDenoms): BaseDenomsAminoMsg { + return { + type: 'osmosis/protorev/base-denoms', + value: BaseDenoms.toAmino(message), + }; + }, + fromProtoMsg(message: BaseDenomsProtoMsg): BaseDenoms { + return BaseDenoms.decode(message.value); + }, + toProto(message: BaseDenoms): Uint8Array { + return BaseDenoms.encode(message).finish(); + }, + toProtoMsg(message: BaseDenoms): BaseDenomsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenoms', + value: BaseDenoms.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(BaseDenoms.typeUrl, BaseDenoms); +GlobalDecoderRegistry.registerAminoProtoMapping( + BaseDenoms.aminoType, + BaseDenoms.typeUrl +); +function createBaseAllProtocolRevenue(): AllProtocolRevenue { + return { + takerFeesTracker: TakerFeesTracker.fromPartial({}), + cyclicArbTracker: CyclicArbTracker.fromPartial({}), + }; +} +export const AllProtocolRevenue = { + typeUrl: '/osmosis.protorev.v1beta1.AllProtocolRevenue', + aminoType: 'osmosis/protorev/all-protocol-revenue', + is(o: any): o is AllProtocolRevenue { + return ( + o && + (o.$typeUrl === AllProtocolRevenue.typeUrl || + (TakerFeesTracker.is(o.takerFeesTracker) && + CyclicArbTracker.is(o.cyclicArbTracker))) + ); + }, + isSDK(o: any): o is AllProtocolRevenueSDKType { + return ( + o && + (o.$typeUrl === AllProtocolRevenue.typeUrl || + (TakerFeesTracker.isSDK(o.taker_fees_tracker) && + CyclicArbTracker.isSDK(o.cyclic_arb_tracker))) + ); + }, + isAmino(o: any): o is AllProtocolRevenueAmino { + return ( + o && + (o.$typeUrl === AllProtocolRevenue.typeUrl || + (TakerFeesTracker.isAmino(o.taker_fees_tracker) && + CyclicArbTracker.isAmino(o.cyclic_arb_tracker))) + ); + }, + encode( + message: AllProtocolRevenue, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.takerFeesTracker !== undefined) { + TakerFeesTracker.encode( + message.takerFeesTracker, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.cyclicArbTracker !== undefined) { + CyclicArbTracker.encode( + message.cyclicArbTracker, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AllProtocolRevenue { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllProtocolRevenue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFeesTracker = TakerFeesTracker.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.cyclicArbTracker = CyclicArbTracker.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllProtocolRevenue { + const message = createBaseAllProtocolRevenue(); + message.takerFeesTracker = + object.takerFeesTracker !== undefined && object.takerFeesTracker !== null + ? TakerFeesTracker.fromPartial(object.takerFeesTracker) + : undefined; + message.cyclicArbTracker = + object.cyclicArbTracker !== undefined && object.cyclicArbTracker !== null + ? CyclicArbTracker.fromPartial(object.cyclicArbTracker) + : undefined; + return message; + }, + fromAmino(object: AllProtocolRevenueAmino): AllProtocolRevenue { + const message = createBaseAllProtocolRevenue(); + if ( + object.taker_fees_tracker !== undefined && + object.taker_fees_tracker !== null + ) { + message.takerFeesTracker = TakerFeesTracker.fromAmino( + object.taker_fees_tracker + ); + } + if ( + object.cyclic_arb_tracker !== undefined && + object.cyclic_arb_tracker !== null + ) { + message.cyclicArbTracker = CyclicArbTracker.fromAmino( + object.cyclic_arb_tracker + ); + } + return message; + }, + toAmino(message: AllProtocolRevenue): AllProtocolRevenueAmino { + const obj: any = {}; + obj.taker_fees_tracker = message.takerFeesTracker + ? TakerFeesTracker.toAmino(message.takerFeesTracker) + : undefined; + obj.cyclic_arb_tracker = message.cyclicArbTracker + ? CyclicArbTracker.toAmino(message.cyclicArbTracker) + : undefined; + return obj; + }, + fromAminoMsg(object: AllProtocolRevenueAminoMsg): AllProtocolRevenue { + return AllProtocolRevenue.fromAmino(object.value); + }, + toAminoMsg(message: AllProtocolRevenue): AllProtocolRevenueAminoMsg { + return { + type: 'osmosis/protorev/all-protocol-revenue', + value: AllProtocolRevenue.toAmino(message), + }; + }, + fromProtoMsg(message: AllProtocolRevenueProtoMsg): AllProtocolRevenue { + return AllProtocolRevenue.decode(message.value); + }, + toProto(message: AllProtocolRevenue): Uint8Array { + return AllProtocolRevenue.encode(message).finish(); + }, + toProtoMsg(message: AllProtocolRevenue): AllProtocolRevenueProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.AllProtocolRevenue', + value: AllProtocolRevenue.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(AllProtocolRevenue.typeUrl, AllProtocolRevenue); +GlobalDecoderRegistry.registerAminoProtoMapping( + AllProtocolRevenue.aminoType, + AllProtocolRevenue.typeUrl +); +function createBaseCyclicArbTracker(): CyclicArbTracker { + return { + cyclicArb: [], + heightAccountingStartsFrom: BigInt(0), + }; +} +export const CyclicArbTracker = { + typeUrl: '/osmosis.protorev.v1beta1.CyclicArbTracker', + aminoType: 'osmosis/protorev/cyclic-arb-tracker', + is(o: any): o is CyclicArbTracker { + return ( + o && + (o.$typeUrl === CyclicArbTracker.typeUrl || + (Array.isArray(o.cyclicArb) && + (!o.cyclicArb.length || Coin.is(o.cyclicArb[0])) && + typeof o.heightAccountingStartsFrom === 'bigint')) + ); + }, + isSDK(o: any): o is CyclicArbTrackerSDKType { + return ( + o && + (o.$typeUrl === CyclicArbTracker.typeUrl || + (Array.isArray(o.cyclic_arb) && + (!o.cyclic_arb.length || Coin.isSDK(o.cyclic_arb[0])) && + typeof o.height_accounting_starts_from === 'bigint')) + ); + }, + isAmino(o: any): o is CyclicArbTrackerAmino { + return ( + o && + (o.$typeUrl === CyclicArbTracker.typeUrl || + (Array.isArray(o.cyclic_arb) && + (!o.cyclic_arb.length || Coin.isAmino(o.cyclic_arb[0])) && + typeof o.height_accounting_starts_from === 'bigint')) + ); + }, + encode( + message: CyclicArbTracker, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.cyclicArb) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.heightAccountingStartsFrom !== BigInt(0)) { + writer.uint32(16).int64(message.heightAccountingStartsFrom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CyclicArbTracker { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCyclicArbTracker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cyclicArb.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.heightAccountingStartsFrom = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CyclicArbTracker { + const message = createBaseCyclicArbTracker(); + message.cyclicArb = object.cyclicArb?.map((e) => Coin.fromPartial(e)) || []; + message.heightAccountingStartsFrom = + object.heightAccountingStartsFrom !== undefined && + object.heightAccountingStartsFrom !== null + ? BigInt(object.heightAccountingStartsFrom.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: CyclicArbTrackerAmino): CyclicArbTracker { + const message = createBaseCyclicArbTracker(); + message.cyclicArb = object.cyclic_arb?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.height_accounting_starts_from !== undefined && + object.height_accounting_starts_from !== null + ) { + message.heightAccountingStartsFrom = BigInt( + object.height_accounting_starts_from + ); + } + return message; + }, + toAmino(message: CyclicArbTracker): CyclicArbTrackerAmino { + const obj: any = {}; + if (message.cyclicArb) { + obj.cyclic_arb = message.cyclicArb.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.cyclic_arb = message.cyclicArb; + } + obj.height_accounting_starts_from = + message.heightAccountingStartsFrom !== BigInt(0) + ? message.heightAccountingStartsFrom.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: CyclicArbTrackerAminoMsg): CyclicArbTracker { + return CyclicArbTracker.fromAmino(object.value); + }, + toAminoMsg(message: CyclicArbTracker): CyclicArbTrackerAminoMsg { + return { + type: 'osmosis/protorev/cyclic-arb-tracker', + value: CyclicArbTracker.toAmino(message), + }; + }, + fromProtoMsg(message: CyclicArbTrackerProtoMsg): CyclicArbTracker { + return CyclicArbTracker.decode(message.value); + }, + toProto(message: CyclicArbTracker): Uint8Array { + return CyclicArbTracker.encode(message).finish(); + }, + toProtoMsg(message: CyclicArbTracker): CyclicArbTrackerProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.CyclicArbTracker', + value: CyclicArbTracker.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(CyclicArbTracker.typeUrl, CyclicArbTracker); +GlobalDecoderRegistry.registerAminoProtoMapping( + CyclicArbTracker.aminoType, + CyclicArbTracker.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.lcd.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.lcd.ts new file mode 100644 index 00000000..cd8bbee6 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.lcd.ts @@ -0,0 +1,240 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; + +import { + QueryParamsRequest, + QueryParamsResponseSDKType, + QueryGetProtoRevNumberOfTradesRequest, + QueryGetProtoRevNumberOfTradesResponseSDKType, + QueryGetProtoRevProfitsByDenomRequest, + QueryGetProtoRevProfitsByDenomResponseSDKType, + QueryGetProtoRevAllProfitsRequest, + QueryGetProtoRevAllProfitsResponseSDKType, + QueryGetProtoRevStatisticsByRouteRequest, + QueryGetProtoRevStatisticsByRouteResponseSDKType, + QueryGetProtoRevAllRouteStatisticsRequest, + QueryGetProtoRevAllRouteStatisticsResponseSDKType, + QueryGetProtoRevTokenPairArbRoutesRequest, + QueryGetProtoRevTokenPairArbRoutesResponseSDKType, + QueryGetProtoRevAdminAccountRequest, + QueryGetProtoRevAdminAccountResponseSDKType, + QueryGetProtoRevDeveloperAccountRequest, + QueryGetProtoRevDeveloperAccountResponseSDKType, + QueryGetProtoRevInfoByPoolTypeRequest, + QueryGetProtoRevInfoByPoolTypeResponseSDKType, + QueryGetProtoRevMaxPoolPointsPerTxRequest, + QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType, + QueryGetProtoRevMaxPoolPointsPerBlockRequest, + QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType, + QueryGetProtoRevBaseDenomsRequest, + QueryGetProtoRevBaseDenomsResponseSDKType, + QueryGetProtoRevEnabledRequest, + QueryGetProtoRevEnabledResponseSDKType, + QueryGetProtoRevPoolRequest, + QueryGetProtoRevPoolResponseSDKType, + QueryGetAllProtocolRevenueRequest, + QueryGetAllProtocolRevenueResponseSDKType, +} from './query'; +export class LCDQueryClient { + req: LCDClient; + constructor({ requestClient }: { requestClient: LCDClient }) { + this.req = requestClient; + this.params = this.params.bind(this); + this.getProtoRevNumberOfTrades = this.getProtoRevNumberOfTrades.bind(this); + this.getProtoRevProfitsByDenom = this.getProtoRevProfitsByDenom.bind(this); + this.getProtoRevAllProfits = this.getProtoRevAllProfits.bind(this); + this.getProtoRevStatisticsByRoute = + this.getProtoRevStatisticsByRoute.bind(this); + this.getProtoRevAllRouteStatistics = + this.getProtoRevAllRouteStatistics.bind(this); + this.getProtoRevTokenPairArbRoutes = + this.getProtoRevTokenPairArbRoutes.bind(this); + this.getProtoRevAdminAccount = this.getProtoRevAdminAccount.bind(this); + this.getProtoRevDeveloperAccount = + this.getProtoRevDeveloperAccount.bind(this); + this.getProtoRevInfoByPoolType = this.getProtoRevInfoByPoolType.bind(this); + this.getProtoRevMaxPoolPointsPerTx = + this.getProtoRevMaxPoolPointsPerTx.bind(this); + this.getProtoRevMaxPoolPointsPerBlock = + this.getProtoRevMaxPoolPointsPerBlock.bind(this); + this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); + this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); + this.getProtoRevPool = this.getProtoRevPool.bind(this); + this.getAllProtocolRevenue = this.getAllProtocolRevenue.bind(this); + } + /* Params queries the parameters of the module. */ + async params( + _params: QueryParamsRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/params`; + return await this.req.get(endpoint); + } + /* GetProtoRevNumberOfTrades queries the number of arbitrage trades the module + has executed */ + async getProtoRevNumberOfTrades( + _params: QueryGetProtoRevNumberOfTradesRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/number_of_trades`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevProfitsByDenom queries the profits of the module by denom */ + async getProtoRevProfitsByDenom( + params: QueryGetProtoRevProfitsByDenomRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.denom !== 'undefined') { + options.params.denom = params.denom; + } + const endpoint = `osmosis/protorev/profits_by_denom`; + return await this.req.get( + endpoint, + options + ); + } + /* GetProtoRevAllProfits queries all of the profits from the module */ + async getProtoRevAllProfits( + _params: QueryGetProtoRevAllProfitsRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/all_profits`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevStatisticsByRoute queries the number of arbitrages and profits + that have been executed for a given route */ + async getProtoRevStatisticsByRoute( + params: QueryGetProtoRevStatisticsByRouteRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.route !== 'undefined') { + options.params.route = params.route; + } + const endpoint = `osmosis/protorev/statistics_by_route`; + return await this.req.get( + endpoint, + options + ); + } + /* GetProtoRevAllRouteStatistics queries all of routes that the module has + arbitraged against and the number of trades and profits that have been + accumulated for each route */ + async getProtoRevAllRouteStatistics( + _params: QueryGetProtoRevAllRouteStatisticsRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/all_route_statistics`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevTokenPairArbRoutes queries all of the hot routes that the module + is currently arbitraging */ + async getProtoRevTokenPairArbRoutes( + _params: QueryGetProtoRevTokenPairArbRoutesRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/token_pair_arb_routes`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevAdminAccount queries the admin account of the module */ + async getProtoRevAdminAccount( + _params: QueryGetProtoRevAdminAccountRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/admin_account`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevDeveloperAccount queries the developer account of the module */ + async getProtoRevDeveloperAccount( + _params: QueryGetProtoRevDeveloperAccountRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/developer_account`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevInfoByPoolType queries pool type information that is currently + being utilized by the module */ + async getProtoRevInfoByPoolType( + _params: QueryGetProtoRevInfoByPoolTypeRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/info_by_pool_type`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points + that can be consumed per transaction */ + async getProtoRevMaxPoolPointsPerTx( + _params: QueryGetProtoRevMaxPoolPointsPerTxRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/max_pool_points_per_tx`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevMaxPoolPointsPerBlock queries the maximum number of pool points + that can consumed per block */ + async getProtoRevMaxPoolPointsPerBlock( + _params: QueryGetProtoRevMaxPoolPointsPerBlockRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/max_pool_points_per_block`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevBaseDenoms queries the base denoms that the module is currently + utilizing for arbitrage */ + async getProtoRevBaseDenoms( + _params: QueryGetProtoRevBaseDenomsRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/base_denoms`; + return await this.req.get( + endpoint + ); + } + /* GetProtoRevEnabled queries whether the module is enabled or not */ + async getProtoRevEnabled( + _params: QueryGetProtoRevEnabledRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/enabled`; + return await this.req.get(endpoint); + } + /* GetProtoRevPool queries the pool id used via the highest liquidity method + for arbitrage route building given a pair of denominations */ + async getProtoRevPool( + params: QueryGetProtoRevPoolRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.baseDenom !== 'undefined') { + options.params.base_denom = params.baseDenom; + } + if (typeof params?.otherDenom !== 'undefined') { + options.params.other_denom = params.otherDenom; + } + const endpoint = `osmosis/protorev/pool`; + return await this.req.get( + endpoint, + options + ); + } + /* GetAllProtocolRevenue queries all of the protocol revenue that has been + accumulated by any module */ + async getAllProtocolRevenue( + _params: QueryGetAllProtocolRevenueRequest = {} + ): Promise { + const endpoint = `osmosis/protorev/all_protocol_revenue`; + return await this.req.get( + endpoint + ); + } +} diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.rpc.Query.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..2b865259 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.rpc.Query.ts @@ -0,0 +1,848 @@ +//@ts-nocheck +import { + QueryClient, + createProtobufRpcClient, + ProtobufRpcClient, +} from '@cosmjs/stargate'; +import { useQuery } from '@tanstack/react-query'; + +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; +import { ReactQueryParams } from '../../../react-query'; + +import { + QueryParamsRequest, + QueryParamsResponse, + QueryGetProtoRevNumberOfTradesRequest, + QueryGetProtoRevNumberOfTradesResponse, + QueryGetProtoRevProfitsByDenomRequest, + QueryGetProtoRevProfitsByDenomResponse, + QueryGetProtoRevAllProfitsRequest, + QueryGetProtoRevAllProfitsResponse, + QueryGetProtoRevStatisticsByRouteRequest, + QueryGetProtoRevStatisticsByRouteResponse, + QueryGetProtoRevAllRouteStatisticsRequest, + QueryGetProtoRevAllRouteStatisticsResponse, + QueryGetProtoRevTokenPairArbRoutesRequest, + QueryGetProtoRevTokenPairArbRoutesResponse, + QueryGetProtoRevAdminAccountRequest, + QueryGetProtoRevAdminAccountResponse, + QueryGetProtoRevDeveloperAccountRequest, + QueryGetProtoRevDeveloperAccountResponse, + QueryGetProtoRevInfoByPoolTypeRequest, + QueryGetProtoRevInfoByPoolTypeResponse, + QueryGetProtoRevMaxPoolPointsPerTxRequest, + QueryGetProtoRevMaxPoolPointsPerTxResponse, + QueryGetProtoRevMaxPoolPointsPerBlockRequest, + QueryGetProtoRevMaxPoolPointsPerBlockResponse, + QueryGetProtoRevBaseDenomsRequest, + QueryGetProtoRevBaseDenomsResponse, + QueryGetProtoRevEnabledRequest, + QueryGetProtoRevEnabledResponse, + QueryGetProtoRevPoolRequest, + QueryGetProtoRevPoolResponse, + QueryGetAllProtocolRevenueRequest, + QueryGetAllProtocolRevenueResponse, +} from './query'; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Params queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + /** + * GetProtoRevNumberOfTrades queries the number of arbitrage trades the module + * has executed + */ + getProtoRevNumberOfTrades( + request?: QueryGetProtoRevNumberOfTradesRequest + ): Promise; + /** GetProtoRevProfitsByDenom queries the profits of the module by denom */ + getProtoRevProfitsByDenom( + request: QueryGetProtoRevProfitsByDenomRequest + ): Promise; + /** GetProtoRevAllProfits queries all of the profits from the module */ + getProtoRevAllProfits( + request?: QueryGetProtoRevAllProfitsRequest + ): Promise; + /** + * GetProtoRevStatisticsByRoute queries the number of arbitrages and profits + * that have been executed for a given route + */ + getProtoRevStatisticsByRoute( + request: QueryGetProtoRevStatisticsByRouteRequest + ): Promise; + /** + * GetProtoRevAllRouteStatistics queries all of routes that the module has + * arbitraged against and the number of trades and profits that have been + * accumulated for each route + */ + getProtoRevAllRouteStatistics( + request?: QueryGetProtoRevAllRouteStatisticsRequest + ): Promise; + /** + * GetProtoRevTokenPairArbRoutes queries all of the hot routes that the module + * is currently arbitraging + */ + getProtoRevTokenPairArbRoutes( + request?: QueryGetProtoRevTokenPairArbRoutesRequest + ): Promise; + /** GetProtoRevAdminAccount queries the admin account of the module */ + getProtoRevAdminAccount( + request?: QueryGetProtoRevAdminAccountRequest + ): Promise; + /** GetProtoRevDeveloperAccount queries the developer account of the module */ + getProtoRevDeveloperAccount( + request?: QueryGetProtoRevDeveloperAccountRequest + ): Promise; + /** + * GetProtoRevInfoByPoolType queries pool type information that is currently + * being utilized by the module + */ + getProtoRevInfoByPoolType( + request?: QueryGetProtoRevInfoByPoolTypeRequest + ): Promise; + /** + * GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points + * that can be consumed per transaction + */ + getProtoRevMaxPoolPointsPerTx( + request?: QueryGetProtoRevMaxPoolPointsPerTxRequest + ): Promise; + /** + * GetProtoRevMaxPoolPointsPerBlock queries the maximum number of pool points + * that can consumed per block + */ + getProtoRevMaxPoolPointsPerBlock( + request?: QueryGetProtoRevMaxPoolPointsPerBlockRequest + ): Promise; + /** + * GetProtoRevBaseDenoms queries the base denoms that the module is currently + * utilizing for arbitrage + */ + getProtoRevBaseDenoms( + request?: QueryGetProtoRevBaseDenomsRequest + ): Promise; + /** GetProtoRevEnabled queries whether the module is enabled or not */ + getProtoRevEnabled( + request?: QueryGetProtoRevEnabledRequest + ): Promise; + /** + * GetProtoRevPool queries the pool id used via the highest liquidity method + * for arbitrage route building given a pair of denominations + */ + getProtoRevPool( + request: QueryGetProtoRevPoolRequest + ): Promise; + /** + * GetAllProtocolRevenue queries all of the protocol revenue that has been + * accumulated by any module + */ + getAllProtocolRevenue( + request?: QueryGetAllProtocolRevenueRequest + ): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.getProtoRevNumberOfTrades = this.getProtoRevNumberOfTrades.bind(this); + this.getProtoRevProfitsByDenom = this.getProtoRevProfitsByDenom.bind(this); + this.getProtoRevAllProfits = this.getProtoRevAllProfits.bind(this); + this.getProtoRevStatisticsByRoute = + this.getProtoRevStatisticsByRoute.bind(this); + this.getProtoRevAllRouteStatistics = + this.getProtoRevAllRouteStatistics.bind(this); + this.getProtoRevTokenPairArbRoutes = + this.getProtoRevTokenPairArbRoutes.bind(this); + this.getProtoRevAdminAccount = this.getProtoRevAdminAccount.bind(this); + this.getProtoRevDeveloperAccount = + this.getProtoRevDeveloperAccount.bind(this); + this.getProtoRevInfoByPoolType = this.getProtoRevInfoByPoolType.bind(this); + this.getProtoRevMaxPoolPointsPerTx = + this.getProtoRevMaxPoolPointsPerTx.bind(this); + this.getProtoRevMaxPoolPointsPerBlock = + this.getProtoRevMaxPoolPointsPerBlock.bind(this); + this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); + this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); + this.getProtoRevPool = this.getProtoRevPool.bind(this); + this.getAllProtocolRevenue = this.getAllProtocolRevenue.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'Params', + data + ); + return promise.then((data) => + QueryParamsResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevNumberOfTrades( + request: QueryGetProtoRevNumberOfTradesRequest = {} + ): Promise { + const data = QueryGetProtoRevNumberOfTradesRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevNumberOfTrades', + data + ); + return promise.then((data) => + QueryGetProtoRevNumberOfTradesResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevProfitsByDenom( + request: QueryGetProtoRevProfitsByDenomRequest + ): Promise { + const data = QueryGetProtoRevProfitsByDenomRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevProfitsByDenom', + data + ); + return promise.then((data) => + QueryGetProtoRevProfitsByDenomResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevAllProfits( + request: QueryGetProtoRevAllProfitsRequest = {} + ): Promise { + const data = QueryGetProtoRevAllProfitsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevAllProfits', + data + ); + return promise.then((data) => + QueryGetProtoRevAllProfitsResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevStatisticsByRoute( + request: QueryGetProtoRevStatisticsByRouteRequest + ): Promise { + const data = + QueryGetProtoRevStatisticsByRouteRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevStatisticsByRoute', + data + ); + return promise.then((data) => + QueryGetProtoRevStatisticsByRouteResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevAllRouteStatistics( + request: QueryGetProtoRevAllRouteStatisticsRequest = {} + ): Promise { + const data = + QueryGetProtoRevAllRouteStatisticsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevAllRouteStatistics', + data + ); + return promise.then((data) => + QueryGetProtoRevAllRouteStatisticsResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevTokenPairArbRoutes( + request: QueryGetProtoRevTokenPairArbRoutesRequest = {} + ): Promise { + const data = + QueryGetProtoRevTokenPairArbRoutesRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevTokenPairArbRoutes', + data + ); + return promise.then((data) => + QueryGetProtoRevTokenPairArbRoutesResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevAdminAccount( + request: QueryGetProtoRevAdminAccountRequest = {} + ): Promise { + const data = QueryGetProtoRevAdminAccountRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevAdminAccount', + data + ); + return promise.then((data) => + QueryGetProtoRevAdminAccountResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevDeveloperAccount( + request: QueryGetProtoRevDeveloperAccountRequest = {} + ): Promise { + const data = + QueryGetProtoRevDeveloperAccountRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevDeveloperAccount', + data + ); + return promise.then((data) => + QueryGetProtoRevDeveloperAccountResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevInfoByPoolType( + request: QueryGetProtoRevInfoByPoolTypeRequest = {} + ): Promise { + const data = QueryGetProtoRevInfoByPoolTypeRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevInfoByPoolType', + data + ); + return promise.then((data) => + QueryGetProtoRevInfoByPoolTypeResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevMaxPoolPointsPerTx( + request: QueryGetProtoRevMaxPoolPointsPerTxRequest = {} + ): Promise { + const data = + QueryGetProtoRevMaxPoolPointsPerTxRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevMaxPoolPointsPerTx', + data + ); + return promise.then((data) => + QueryGetProtoRevMaxPoolPointsPerTxResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevMaxPoolPointsPerBlock( + request: QueryGetProtoRevMaxPoolPointsPerBlockRequest = {} + ): Promise { + const data = + QueryGetProtoRevMaxPoolPointsPerBlockRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevMaxPoolPointsPerBlock', + data + ); + return promise.then((data) => + QueryGetProtoRevMaxPoolPointsPerBlockResponse.decode( + new BinaryReader(data) + ) + ); + } + getProtoRevBaseDenoms( + request: QueryGetProtoRevBaseDenomsRequest = {} + ): Promise { + const data = QueryGetProtoRevBaseDenomsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevBaseDenoms', + data + ); + return promise.then((data) => + QueryGetProtoRevBaseDenomsResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevEnabled( + request: QueryGetProtoRevEnabledRequest = {} + ): Promise { + const data = QueryGetProtoRevEnabledRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevEnabled', + data + ); + return promise.then((data) => + QueryGetProtoRevEnabledResponse.decode(new BinaryReader(data)) + ); + } + getProtoRevPool( + request: QueryGetProtoRevPoolRequest + ): Promise { + const data = QueryGetProtoRevPoolRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetProtoRevPool', + data + ); + return promise.then((data) => + QueryGetProtoRevPoolResponse.decode(new BinaryReader(data)) + ); + } + getAllProtocolRevenue( + request: QueryGetAllProtocolRevenueRequest = {} + ): Promise { + const data = QueryGetAllProtocolRevenueRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Query', + 'GetAllProtocolRevenue', + data + ); + return promise.then((data) => + QueryGetAllProtocolRevenueResponse.decode(new BinaryReader(data)) + ); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + getProtoRevNumberOfTrades( + request?: QueryGetProtoRevNumberOfTradesRequest + ): Promise { + return queryService.getProtoRevNumberOfTrades(request); + }, + getProtoRevProfitsByDenom( + request: QueryGetProtoRevProfitsByDenomRequest + ): Promise { + return queryService.getProtoRevProfitsByDenom(request); + }, + getProtoRevAllProfits( + request?: QueryGetProtoRevAllProfitsRequest + ): Promise { + return queryService.getProtoRevAllProfits(request); + }, + getProtoRevStatisticsByRoute( + request: QueryGetProtoRevStatisticsByRouteRequest + ): Promise { + return queryService.getProtoRevStatisticsByRoute(request); + }, + getProtoRevAllRouteStatistics( + request?: QueryGetProtoRevAllRouteStatisticsRequest + ): Promise { + return queryService.getProtoRevAllRouteStatistics(request); + }, + getProtoRevTokenPairArbRoutes( + request?: QueryGetProtoRevTokenPairArbRoutesRequest + ): Promise { + return queryService.getProtoRevTokenPairArbRoutes(request); + }, + getProtoRevAdminAccount( + request?: QueryGetProtoRevAdminAccountRequest + ): Promise { + return queryService.getProtoRevAdminAccount(request); + }, + getProtoRevDeveloperAccount( + request?: QueryGetProtoRevDeveloperAccountRequest + ): Promise { + return queryService.getProtoRevDeveloperAccount(request); + }, + getProtoRevInfoByPoolType( + request?: QueryGetProtoRevInfoByPoolTypeRequest + ): Promise { + return queryService.getProtoRevInfoByPoolType(request); + }, + getProtoRevMaxPoolPointsPerTx( + request?: QueryGetProtoRevMaxPoolPointsPerTxRequest + ): Promise { + return queryService.getProtoRevMaxPoolPointsPerTx(request); + }, + getProtoRevMaxPoolPointsPerBlock( + request?: QueryGetProtoRevMaxPoolPointsPerBlockRequest + ): Promise { + return queryService.getProtoRevMaxPoolPointsPerBlock(request); + }, + getProtoRevBaseDenoms( + request?: QueryGetProtoRevBaseDenomsRequest + ): Promise { + return queryService.getProtoRevBaseDenoms(request); + }, + getProtoRevEnabled( + request?: QueryGetProtoRevEnabledRequest + ): Promise { + return queryService.getProtoRevEnabled(request); + }, + getProtoRevPool( + request: QueryGetProtoRevPoolRequest + ): Promise { + return queryService.getProtoRevPool(request); + }, + getAllProtocolRevenue( + request?: QueryGetAllProtocolRevenueRequest + ): Promise { + return queryService.getAllProtocolRevenue(request); + }, + }; +}; +export interface UseParamsQuery + extends ReactQueryParams { + request?: QueryParamsRequest; +} +export interface UseGetProtoRevNumberOfTradesQuery + extends ReactQueryParams { + request?: QueryGetProtoRevNumberOfTradesRequest; +} +export interface UseGetProtoRevProfitsByDenomQuery + extends ReactQueryParams { + request: QueryGetProtoRevProfitsByDenomRequest; +} +export interface UseGetProtoRevAllProfitsQuery + extends ReactQueryParams { + request?: QueryGetProtoRevAllProfitsRequest; +} +export interface UseGetProtoRevStatisticsByRouteQuery + extends ReactQueryParams { + request: QueryGetProtoRevStatisticsByRouteRequest; +} +export interface UseGetProtoRevAllRouteStatisticsQuery + extends ReactQueryParams { + request?: QueryGetProtoRevAllRouteStatisticsRequest; +} +export interface UseGetProtoRevTokenPairArbRoutesQuery + extends ReactQueryParams { + request?: QueryGetProtoRevTokenPairArbRoutesRequest; +} +export interface UseGetProtoRevAdminAccountQuery + extends ReactQueryParams { + request?: QueryGetProtoRevAdminAccountRequest; +} +export interface UseGetProtoRevDeveloperAccountQuery + extends ReactQueryParams { + request?: QueryGetProtoRevDeveloperAccountRequest; +} +export interface UseGetProtoRevInfoByPoolTypeQuery + extends ReactQueryParams { + request?: QueryGetProtoRevInfoByPoolTypeRequest; +} +export interface UseGetProtoRevMaxPoolPointsPerTxQuery + extends ReactQueryParams { + request?: QueryGetProtoRevMaxPoolPointsPerTxRequest; +} +export interface UseGetProtoRevMaxPoolPointsPerBlockQuery + extends ReactQueryParams< + QueryGetProtoRevMaxPoolPointsPerBlockResponse, + TData + > { + request?: QueryGetProtoRevMaxPoolPointsPerBlockRequest; +} +export interface UseGetProtoRevBaseDenomsQuery + extends ReactQueryParams { + request?: QueryGetProtoRevBaseDenomsRequest; +} +export interface UseGetProtoRevEnabledQuery + extends ReactQueryParams { + request?: QueryGetProtoRevEnabledRequest; +} +export interface UseGetProtoRevPoolQuery + extends ReactQueryParams { + request: QueryGetProtoRevPoolRequest; +} +export interface UseGetAllProtocolRevenueQuery + extends ReactQueryParams { + request?: QueryGetAllProtocolRevenueRequest; +} +const _queryClients: WeakMap = + new WeakMap(); +const getQueryService = ( + rpc: ProtobufRpcClient | undefined +): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useParams = ({ + request, + options, + }: UseParamsQuery) => { + return useQuery( + ['paramsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.params(request); + }, + options + ); + }; + const useGetProtoRevNumberOfTrades = < + TData = QueryGetProtoRevNumberOfTradesResponse + >({ + request, + options, + }: UseGetProtoRevNumberOfTradesQuery) => { + return useQuery( + ['getProtoRevNumberOfTradesQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevNumberOfTrades(request); + }, + options + ); + }; + const useGetProtoRevProfitsByDenom = < + TData = QueryGetProtoRevProfitsByDenomResponse + >({ + request, + options, + }: UseGetProtoRevProfitsByDenomQuery) => { + return useQuery( + ['getProtoRevProfitsByDenomQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevProfitsByDenom(request); + }, + options + ); + }; + const useGetProtoRevAllProfits = < + TData = QueryGetProtoRevAllProfitsResponse + >({ + request, + options, + }: UseGetProtoRevAllProfitsQuery) => { + return useQuery( + ['getProtoRevAllProfitsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevAllProfits(request); + }, + options + ); + }; + const useGetProtoRevStatisticsByRoute = < + TData = QueryGetProtoRevStatisticsByRouteResponse + >({ + request, + options, + }: UseGetProtoRevStatisticsByRouteQuery) => { + return useQuery( + ['getProtoRevStatisticsByRouteQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevStatisticsByRoute(request); + }, + options + ); + }; + const useGetProtoRevAllRouteStatistics = < + TData = QueryGetProtoRevAllRouteStatisticsResponse + >({ + request, + options, + }: UseGetProtoRevAllRouteStatisticsQuery) => { + return useQuery( + ['getProtoRevAllRouteStatisticsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevAllRouteStatistics(request); + }, + options + ); + }; + const useGetProtoRevTokenPairArbRoutes = < + TData = QueryGetProtoRevTokenPairArbRoutesResponse + >({ + request, + options, + }: UseGetProtoRevTokenPairArbRoutesQuery) => { + return useQuery( + ['getProtoRevTokenPairArbRoutesQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevTokenPairArbRoutes(request); + }, + options + ); + }; + const useGetProtoRevAdminAccount = < + TData = QueryGetProtoRevAdminAccountResponse + >({ + request, + options, + }: UseGetProtoRevAdminAccountQuery) => { + return useQuery( + ['getProtoRevAdminAccountQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevAdminAccount(request); + }, + options + ); + }; + const useGetProtoRevDeveloperAccount = < + TData = QueryGetProtoRevDeveloperAccountResponse + >({ + request, + options, + }: UseGetProtoRevDeveloperAccountQuery) => { + return useQuery( + ['getProtoRevDeveloperAccountQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevDeveloperAccount(request); + }, + options + ); + }; + const useGetProtoRevInfoByPoolType = < + TData = QueryGetProtoRevInfoByPoolTypeResponse + >({ + request, + options, + }: UseGetProtoRevInfoByPoolTypeQuery) => { + return useQuery( + ['getProtoRevInfoByPoolTypeQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevInfoByPoolType(request); + }, + options + ); + }; + const useGetProtoRevMaxPoolPointsPerTx = < + TData = QueryGetProtoRevMaxPoolPointsPerTxResponse + >({ + request, + options, + }: UseGetProtoRevMaxPoolPointsPerTxQuery) => { + return useQuery( + ['getProtoRevMaxPoolPointsPerTxQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevMaxPoolPointsPerTx(request); + }, + options + ); + }; + const useGetProtoRevMaxPoolPointsPerBlock = < + TData = QueryGetProtoRevMaxPoolPointsPerBlockResponse + >({ + request, + options, + }: UseGetProtoRevMaxPoolPointsPerBlockQuery) => { + return useQuery< + QueryGetProtoRevMaxPoolPointsPerBlockResponse, + Error, + TData + >( + ['getProtoRevMaxPoolPointsPerBlockQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevMaxPoolPointsPerBlock(request); + }, + options + ); + }; + const useGetProtoRevBaseDenoms = < + TData = QueryGetProtoRevBaseDenomsResponse + >({ + request, + options, + }: UseGetProtoRevBaseDenomsQuery) => { + return useQuery( + ['getProtoRevBaseDenomsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevBaseDenoms(request); + }, + options + ); + }; + const useGetProtoRevEnabled = ({ + request, + options, + }: UseGetProtoRevEnabledQuery) => { + return useQuery( + ['getProtoRevEnabledQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevEnabled(request); + }, + options + ); + }; + const useGetProtoRevPool = ({ + request, + options, + }: UseGetProtoRevPoolQuery) => { + return useQuery( + ['getProtoRevPoolQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getProtoRevPool(request); + }, + options + ); + }; + const useGetAllProtocolRevenue = < + TData = QueryGetAllProtocolRevenueResponse + >({ + request, + options, + }: UseGetAllProtocolRevenueQuery) => { + return useQuery( + ['getAllProtocolRevenueQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getAllProtocolRevenue(request); + }, + options + ); + }; + return { + /** Params queries the parameters of the module. */ useParams, + /** + * GetProtoRevNumberOfTrades queries the number of arbitrage trades the module + * has executed + */ + useGetProtoRevNumberOfTrades, + /** GetProtoRevProfitsByDenom queries the profits of the module by denom */ useGetProtoRevProfitsByDenom, + /** GetProtoRevAllProfits queries all of the profits from the module */ useGetProtoRevAllProfits, + /** + * GetProtoRevStatisticsByRoute queries the number of arbitrages and profits + * that have been executed for a given route + */ + useGetProtoRevStatisticsByRoute, + /** + * GetProtoRevAllRouteStatistics queries all of routes that the module has + * arbitraged against and the number of trades and profits that have been + * accumulated for each route + */ + useGetProtoRevAllRouteStatistics, + /** + * GetProtoRevTokenPairArbRoutes queries all of the hot routes that the module + * is currently arbitraging + */ + useGetProtoRevTokenPairArbRoutes, + /** GetProtoRevAdminAccount queries the admin account of the module */ useGetProtoRevAdminAccount, + /** GetProtoRevDeveloperAccount queries the developer account of the module */ useGetProtoRevDeveloperAccount, + /** + * GetProtoRevInfoByPoolType queries pool type information that is currently + * being utilized by the module + */ + useGetProtoRevInfoByPoolType, + /** + * GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points + * that can be consumed per transaction + */ + useGetProtoRevMaxPoolPointsPerTx, + /** + * GetProtoRevMaxPoolPointsPerBlock queries the maximum number of pool points + * that can consumed per block + */ + useGetProtoRevMaxPoolPointsPerBlock, + /** + * GetProtoRevBaseDenoms queries the base denoms that the module is currently + * utilizing for arbitrage + */ + useGetProtoRevBaseDenoms, + /** GetProtoRevEnabled queries whether the module is enabled or not */ useGetProtoRevEnabled, + /** + * GetProtoRevPool queries the pool id used via the highest liquidity method + * for arbitrage route building given a pair of denominations + */ + useGetProtoRevPool, + /** + * GetAllProtocolRevenue queries all of the protocol revenue that has been + * accumulated by any module + */ + useGetAllProtocolRevenue, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.ts new file mode 100644 index 00000000..0de459a0 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/query.ts @@ -0,0 +1,4602 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + RouteStatistics, + RouteStatisticsAmino, + RouteStatisticsSDKType, + TokenPairArbRoutes, + TokenPairArbRoutesAmino, + TokenPairArbRoutesSDKType, + InfoByPoolType, + InfoByPoolTypeAmino, + InfoByPoolTypeSDKType, + BaseDenom, + BaseDenomAmino, + BaseDenomSDKType, + AllProtocolRevenue, + AllProtocolRevenueAmino, + AllProtocolRevenueSDKType, +} from './protorev'; +import { Params, ParamsAmino, ParamsSDKType } from './params'; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryParamsRequest'; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: 'osmosis/protorev/query-params-request'; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryParamsResponse'; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: 'osmosis/protorev/query-params-response'; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** + * QueryGetProtoRevNumberOfTradesRequest is request type for the + * Query/GetProtoRevNumberOfTrades RPC method. + */ +export interface QueryGetProtoRevNumberOfTradesRequest {} +export interface QueryGetProtoRevNumberOfTradesRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevNumberOfTradesRequest is request type for the + * Query/GetProtoRevNumberOfTrades RPC method. + */ +export interface QueryGetProtoRevNumberOfTradesRequestAmino {} +export interface QueryGetProtoRevNumberOfTradesRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-number-of-trades-request'; + value: QueryGetProtoRevNumberOfTradesRequestAmino; +} +/** + * QueryGetProtoRevNumberOfTradesRequest is request type for the + * Query/GetProtoRevNumberOfTrades RPC method. + */ +export interface QueryGetProtoRevNumberOfTradesRequestSDKType {} +/** + * QueryGetProtoRevNumberOfTradesResponse is response type for the + * Query/GetProtoRevNumberOfTrades RPC method. + */ +export interface QueryGetProtoRevNumberOfTradesResponse { + /** number_of_trades is the number of trades the module has executed */ + numberOfTrades: string; +} +export interface QueryGetProtoRevNumberOfTradesResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevNumberOfTradesResponse is response type for the + * Query/GetProtoRevNumberOfTrades RPC method. + */ +export interface QueryGetProtoRevNumberOfTradesResponseAmino { + /** number_of_trades is the number of trades the module has executed */ + number_of_trades?: string; +} +export interface QueryGetProtoRevNumberOfTradesResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-number-of-trades-response'; + value: QueryGetProtoRevNumberOfTradesResponseAmino; +} +/** + * QueryGetProtoRevNumberOfTradesResponse is response type for the + * Query/GetProtoRevNumberOfTrades RPC method. + */ +export interface QueryGetProtoRevNumberOfTradesResponseSDKType { + number_of_trades: string; +} +/** + * QueryGetProtoRevProfitsByDenomRequest is request type for the + * Query/GetProtoRevProfitsByDenom RPC method. + */ +export interface QueryGetProtoRevProfitsByDenomRequest { + /** denom is the denom to query profits by */ + denom: string; +} +export interface QueryGetProtoRevProfitsByDenomRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevProfitsByDenomRequest is request type for the + * Query/GetProtoRevProfitsByDenom RPC method. + */ +export interface QueryGetProtoRevProfitsByDenomRequestAmino { + /** denom is the denom to query profits by */ + denom?: string; +} +export interface QueryGetProtoRevProfitsByDenomRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-profits-by-denom-request'; + value: QueryGetProtoRevProfitsByDenomRequestAmino; +} +/** + * QueryGetProtoRevProfitsByDenomRequest is request type for the + * Query/GetProtoRevProfitsByDenom RPC method. + */ +export interface QueryGetProtoRevProfitsByDenomRequestSDKType { + denom: string; +} +/** + * QueryGetProtoRevProfitsByDenomResponse is response type for the + * Query/GetProtoRevProfitsByDenom RPC method. + */ +export interface QueryGetProtoRevProfitsByDenomResponse { + /** profit is the profits of the module by the selected denom */ + profit?: Coin; +} +export interface QueryGetProtoRevProfitsByDenomResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevProfitsByDenomResponse is response type for the + * Query/GetProtoRevProfitsByDenom RPC method. + */ +export interface QueryGetProtoRevProfitsByDenomResponseAmino { + /** profit is the profits of the module by the selected denom */ + profit?: CoinAmino; +} +export interface QueryGetProtoRevProfitsByDenomResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-profits-by-denom-response'; + value: QueryGetProtoRevProfitsByDenomResponseAmino; +} +/** + * QueryGetProtoRevProfitsByDenomResponse is response type for the + * Query/GetProtoRevProfitsByDenom RPC method. + */ +export interface QueryGetProtoRevProfitsByDenomResponseSDKType { + profit?: CoinSDKType; +} +/** + * QueryGetProtoRevAllProfitsRequest is request type for the + * Query/GetProtoRevAllProfits RPC method. + */ +export interface QueryGetProtoRevAllProfitsRequest {} +export interface QueryGetProtoRevAllProfitsRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevAllProfitsRequest is request type for the + * Query/GetProtoRevAllProfits RPC method. + */ +export interface QueryGetProtoRevAllProfitsRequestAmino {} +export interface QueryGetProtoRevAllProfitsRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-all-profits-request'; + value: QueryGetProtoRevAllProfitsRequestAmino; +} +/** + * QueryGetProtoRevAllProfitsRequest is request type for the + * Query/GetProtoRevAllProfits RPC method. + */ +export interface QueryGetProtoRevAllProfitsRequestSDKType {} +/** + * QueryGetProtoRevAllProfitsResponse is response type for the + * Query/GetProtoRevAllProfits RPC method. + */ +export interface QueryGetProtoRevAllProfitsResponse { + /** profits is a list of all of the profits from the module */ + profits: Coin[]; +} +export interface QueryGetProtoRevAllProfitsResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevAllProfitsResponse is response type for the + * Query/GetProtoRevAllProfits RPC method. + */ +export interface QueryGetProtoRevAllProfitsResponseAmino { + /** profits is a list of all of the profits from the module */ + profits?: CoinAmino[]; +} +export interface QueryGetProtoRevAllProfitsResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-all-profits-response'; + value: QueryGetProtoRevAllProfitsResponseAmino; +} +/** + * QueryGetProtoRevAllProfitsResponse is response type for the + * Query/GetProtoRevAllProfits RPC method. + */ +export interface QueryGetProtoRevAllProfitsResponseSDKType { + profits: CoinSDKType[]; +} +/** + * QueryGetProtoRevStatisticsByPoolRequest is request type for the + * Query/GetProtoRevStatisticsByRoute RPC method. + */ +export interface QueryGetProtoRevStatisticsByRouteRequest { + /** route is the set of pool ids to query statistics by i.e. 1,2,3 */ + route: bigint[]; +} +export interface QueryGetProtoRevStatisticsByRouteRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevStatisticsByPoolRequest is request type for the + * Query/GetProtoRevStatisticsByRoute RPC method. + */ +export interface QueryGetProtoRevStatisticsByRouteRequestAmino { + /** route is the set of pool ids to query statistics by i.e. 1,2,3 */ + route?: string[]; +} +export interface QueryGetProtoRevStatisticsByRouteRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-statistics-by-route-request'; + value: QueryGetProtoRevStatisticsByRouteRequestAmino; +} +/** + * QueryGetProtoRevStatisticsByPoolRequest is request type for the + * Query/GetProtoRevStatisticsByRoute RPC method. + */ +export interface QueryGetProtoRevStatisticsByRouteRequestSDKType { + route: bigint[]; +} +/** + * QueryGetProtoRevStatisticsByRouteResponse is response type for the + * Query/GetProtoRevStatisticsByRoute RPC method. + */ +export interface QueryGetProtoRevStatisticsByRouteResponse { + /** + * statistics contains the number of trades the module has executed after a + * swap on a given pool and the profits from the trades + */ + statistics: RouteStatistics; +} +export interface QueryGetProtoRevStatisticsByRouteResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevStatisticsByRouteResponse is response type for the + * Query/GetProtoRevStatisticsByRoute RPC method. + */ +export interface QueryGetProtoRevStatisticsByRouteResponseAmino { + /** + * statistics contains the number of trades the module has executed after a + * swap on a given pool and the profits from the trades + */ + statistics?: RouteStatisticsAmino; +} +export interface QueryGetProtoRevStatisticsByRouteResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-statistics-by-route-response'; + value: QueryGetProtoRevStatisticsByRouteResponseAmino; +} +/** + * QueryGetProtoRevStatisticsByRouteResponse is response type for the + * Query/GetProtoRevStatisticsByRoute RPC method. + */ +export interface QueryGetProtoRevStatisticsByRouteResponseSDKType { + statistics: RouteStatisticsSDKType; +} +/** + * QueryGetProtoRevAllRouteStatisticsRequest is request type for the + * Query/GetProtoRevAllRouteStatistics RPC method. + */ +export interface QueryGetProtoRevAllRouteStatisticsRequest {} +export interface QueryGetProtoRevAllRouteStatisticsRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevAllRouteStatisticsRequest is request type for the + * Query/GetProtoRevAllRouteStatistics RPC method. + */ +export interface QueryGetProtoRevAllRouteStatisticsRequestAmino {} +export interface QueryGetProtoRevAllRouteStatisticsRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-all-route-statistics-request'; + value: QueryGetProtoRevAllRouteStatisticsRequestAmino; +} +/** + * QueryGetProtoRevAllRouteStatisticsRequest is request type for the + * Query/GetProtoRevAllRouteStatistics RPC method. + */ +export interface QueryGetProtoRevAllRouteStatisticsRequestSDKType {} +/** + * QueryGetProtoRevAllRouteStatisticsResponse is response type for the + * Query/GetProtoRevAllRouteStatistics RPC method. + */ +export interface QueryGetProtoRevAllRouteStatisticsResponse { + /** + * statistics contains the number of trades/profits the module has executed on + * all routes it has successfully executed a trade on + */ + statistics: RouteStatistics[]; +} +export interface QueryGetProtoRevAllRouteStatisticsResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevAllRouteStatisticsResponse is response type for the + * Query/GetProtoRevAllRouteStatistics RPC method. + */ +export interface QueryGetProtoRevAllRouteStatisticsResponseAmino { + /** + * statistics contains the number of trades/profits the module has executed on + * all routes it has successfully executed a trade on + */ + statistics?: RouteStatisticsAmino[]; +} +export interface QueryGetProtoRevAllRouteStatisticsResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-all-route-statistics-response'; + value: QueryGetProtoRevAllRouteStatisticsResponseAmino; +} +/** + * QueryGetProtoRevAllRouteStatisticsResponse is response type for the + * Query/GetProtoRevAllRouteStatistics RPC method. + */ +export interface QueryGetProtoRevAllRouteStatisticsResponseSDKType { + statistics: RouteStatisticsSDKType[]; +} +/** + * QueryGetProtoRevTokenPairArbRoutesRequest is request type for the + * Query/GetProtoRevTokenPairArbRoutes RPC method. + */ +export interface QueryGetProtoRevTokenPairArbRoutesRequest {} +export interface QueryGetProtoRevTokenPairArbRoutesRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevTokenPairArbRoutesRequest is request type for the + * Query/GetProtoRevTokenPairArbRoutes RPC method. + */ +export interface QueryGetProtoRevTokenPairArbRoutesRequestAmino {} +export interface QueryGetProtoRevTokenPairArbRoutesRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-request'; + value: QueryGetProtoRevTokenPairArbRoutesRequestAmino; +} +/** + * QueryGetProtoRevTokenPairArbRoutesRequest is request type for the + * Query/GetProtoRevTokenPairArbRoutes RPC method. + */ +export interface QueryGetProtoRevTokenPairArbRoutesRequestSDKType {} +/** + * QueryGetProtoRevTokenPairArbRoutesResponse is response type for the + * Query/GetProtoRevTokenPairArbRoutes RPC method. + */ +export interface QueryGetProtoRevTokenPairArbRoutesResponse { + /** + * routes is a list of all of the hot routes that the module is currently + * arbitraging + */ + routes: TokenPairArbRoutes[]; +} +export interface QueryGetProtoRevTokenPairArbRoutesResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevTokenPairArbRoutesResponse is response type for the + * Query/GetProtoRevTokenPairArbRoutes RPC method. + */ +export interface QueryGetProtoRevTokenPairArbRoutesResponseAmino { + /** + * routes is a list of all of the hot routes that the module is currently + * arbitraging + */ + routes?: TokenPairArbRoutesAmino[]; +} +export interface QueryGetProtoRevTokenPairArbRoutesResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-response'; + value: QueryGetProtoRevTokenPairArbRoutesResponseAmino; +} +/** + * QueryGetProtoRevTokenPairArbRoutesResponse is response type for the + * Query/GetProtoRevTokenPairArbRoutes RPC method. + */ +export interface QueryGetProtoRevTokenPairArbRoutesResponseSDKType { + routes: TokenPairArbRoutesSDKType[]; +} +/** + * QueryGetProtoRevAdminAccountRequest is request type for the + * Query/GetProtoRevAdminAccount RPC method. + */ +export interface QueryGetProtoRevAdminAccountRequest {} +export interface QueryGetProtoRevAdminAccountRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevAdminAccountRequest is request type for the + * Query/GetProtoRevAdminAccount RPC method. + */ +export interface QueryGetProtoRevAdminAccountRequestAmino {} +export interface QueryGetProtoRevAdminAccountRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-admin-account-request'; + value: QueryGetProtoRevAdminAccountRequestAmino; +} +/** + * QueryGetProtoRevAdminAccountRequest is request type for the + * Query/GetProtoRevAdminAccount RPC method. + */ +export interface QueryGetProtoRevAdminAccountRequestSDKType {} +/** + * QueryGetProtoRevAdminAccountResponse is response type for the + * Query/GetProtoRevAdminAccount RPC method. + */ +export interface QueryGetProtoRevAdminAccountResponse { + /** admin_account is the admin account of the module */ + adminAccount: string; +} +export interface QueryGetProtoRevAdminAccountResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevAdminAccountResponse is response type for the + * Query/GetProtoRevAdminAccount RPC method. + */ +export interface QueryGetProtoRevAdminAccountResponseAmino { + /** admin_account is the admin account of the module */ + admin_account?: string; +} +export interface QueryGetProtoRevAdminAccountResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-admin-account-response'; + value: QueryGetProtoRevAdminAccountResponseAmino; +} +/** + * QueryGetProtoRevAdminAccountResponse is response type for the + * Query/GetProtoRevAdminAccount RPC method. + */ +export interface QueryGetProtoRevAdminAccountResponseSDKType { + admin_account: string; +} +/** + * QueryGetProtoRevDeveloperAccountRequest is request type for the + * Query/GetProtoRevDeveloperAccount RPC method. + */ +export interface QueryGetProtoRevDeveloperAccountRequest {} +export interface QueryGetProtoRevDeveloperAccountRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevDeveloperAccountRequest is request type for the + * Query/GetProtoRevDeveloperAccount RPC method. + */ +export interface QueryGetProtoRevDeveloperAccountRequestAmino {} +export interface QueryGetProtoRevDeveloperAccountRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-developer-account-request'; + value: QueryGetProtoRevDeveloperAccountRequestAmino; +} +/** + * QueryGetProtoRevDeveloperAccountRequest is request type for the + * Query/GetProtoRevDeveloperAccount RPC method. + */ +export interface QueryGetProtoRevDeveloperAccountRequestSDKType {} +/** + * QueryGetProtoRevDeveloperAccountResponse is response type for the + * Query/GetProtoRevDeveloperAccount RPC method. + */ +export interface QueryGetProtoRevDeveloperAccountResponse { + /** developer_account is the developer account of the module */ + developerAccount: string; +} +export interface QueryGetProtoRevDeveloperAccountResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevDeveloperAccountResponse is response type for the + * Query/GetProtoRevDeveloperAccount RPC method. + */ +export interface QueryGetProtoRevDeveloperAccountResponseAmino { + /** developer_account is the developer account of the module */ + developer_account?: string; +} +export interface QueryGetProtoRevDeveloperAccountResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-developer-account-response'; + value: QueryGetProtoRevDeveloperAccountResponseAmino; +} +/** + * QueryGetProtoRevDeveloperAccountResponse is response type for the + * Query/GetProtoRevDeveloperAccount RPC method. + */ +export interface QueryGetProtoRevDeveloperAccountResponseSDKType { + developer_account: string; +} +/** + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. + */ +export interface QueryGetProtoRevInfoByPoolTypeRequest {} +export interface QueryGetProtoRevInfoByPoolTypeRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. + */ +export interface QueryGetProtoRevInfoByPoolTypeRequestAmino {} +export interface QueryGetProtoRevInfoByPoolTypeRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-info-by-pool-type-request'; + value: QueryGetProtoRevInfoByPoolTypeRequestAmino; +} +/** + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. + */ +export interface QueryGetProtoRevInfoByPoolTypeRequestSDKType {} +/** + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. + */ +export interface QueryGetProtoRevInfoByPoolTypeResponse { + /** + * InfoByPoolType contains all information pertaining to how different + * pool types are handled by the module. + */ + infoByPoolType: InfoByPoolType; +} +export interface QueryGetProtoRevInfoByPoolTypeResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. + */ +export interface QueryGetProtoRevInfoByPoolTypeResponseAmino { + /** + * InfoByPoolType contains all information pertaining to how different + * pool types are handled by the module. + */ + info_by_pool_type?: InfoByPoolTypeAmino; +} +export interface QueryGetProtoRevInfoByPoolTypeResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-info-by-pool-type-response'; + value: QueryGetProtoRevInfoByPoolTypeResponseAmino; +} +/** + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. + */ +export interface QueryGetProtoRevInfoByPoolTypeResponseSDKType { + info_by_pool_type: InfoByPoolTypeSDKType; +} +/** + * QueryGetProtoRevMaxPoolPointsPerBlockRequest is request type for the + * Query/GetProtoRevMaxPoolPointsPerBlock RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerBlockRequest {} +export interface QueryGetProtoRevMaxPoolPointsPerBlockRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevMaxPoolPointsPerBlockRequest is request type for the + * Query/GetProtoRevMaxPoolPointsPerBlock RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino {} +export interface QueryGetProtoRevMaxPoolPointsPerBlockRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-request'; + value: QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino; +} +/** + * QueryGetProtoRevMaxPoolPointsPerBlockRequest is request type for the + * Query/GetProtoRevMaxPoolPointsPerBlock RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerBlockRequestSDKType {} +/** + * QueryGetProtoRevMaxPoolPointsPerBlockResponse is response type for the + * Query/GetProtoRevMaxPoolPointsPerBlock RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerBlockResponse { + /** + * max_pool_points_per_block is the maximum number of pool points that can be + * consumed per block + */ + maxPoolPointsPerBlock: bigint; +} +export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevMaxPoolPointsPerBlockResponse is response type for the + * Query/GetProtoRevMaxPoolPointsPerBlock RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { + /** + * max_pool_points_per_block is the maximum number of pool points that can be + * consumed per block + */ + max_pool_points_per_block?: string; +} +export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-response'; + value: QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino; +} +/** + * QueryGetProtoRevMaxPoolPointsPerBlockResponse is response type for the + * Query/GetProtoRevMaxPoolPointsPerBlock RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType { + max_pool_points_per_block: bigint; +} +/** + * QueryGetProtoRevMaxPoolPointsPerTxRequest is request type for the + * Query/GetProtoRevMaxPoolPointsPerTx RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerTxRequest {} +export interface QueryGetProtoRevMaxPoolPointsPerTxRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevMaxPoolPointsPerTxRequest is request type for the + * Query/GetProtoRevMaxPoolPointsPerTx RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerTxRequestAmino {} +export interface QueryGetProtoRevMaxPoolPointsPerTxRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-request'; + value: QueryGetProtoRevMaxPoolPointsPerTxRequestAmino; +} +/** + * QueryGetProtoRevMaxPoolPointsPerTxRequest is request type for the + * Query/GetProtoRevMaxPoolPointsPerTx RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerTxRequestSDKType {} +/** + * QueryGetProtoRevMaxPoolPointsPerTxResponse is response type for the + * Query/GetProtoRevMaxPoolPointsPerTx RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerTxResponse { + /** + * max_pool_points_per_tx is the maximum number of pool points that can be + * consumed per transaction + */ + maxPoolPointsPerTx: bigint; +} +export interface QueryGetProtoRevMaxPoolPointsPerTxResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevMaxPoolPointsPerTxResponse is response type for the + * Query/GetProtoRevMaxPoolPointsPerTx RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { + /** + * max_pool_points_per_tx is the maximum number of pool points that can be + * consumed per transaction + */ + max_pool_points_per_tx?: string; +} +export interface QueryGetProtoRevMaxPoolPointsPerTxResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-response'; + value: QueryGetProtoRevMaxPoolPointsPerTxResponseAmino; +} +/** + * QueryGetProtoRevMaxPoolPointsPerTxResponse is response type for the + * Query/GetProtoRevMaxPoolPointsPerTx RPC method. + */ +export interface QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType { + max_pool_points_per_tx: bigint; +} +/** + * QueryGetProtoRevBaseDenomsRequest is request type for the + * Query/GetProtoRevBaseDenoms RPC method. + */ +export interface QueryGetProtoRevBaseDenomsRequest {} +export interface QueryGetProtoRevBaseDenomsRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevBaseDenomsRequest is request type for the + * Query/GetProtoRevBaseDenoms RPC method. + */ +export interface QueryGetProtoRevBaseDenomsRequestAmino {} +export interface QueryGetProtoRevBaseDenomsRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-base-denoms-request'; + value: QueryGetProtoRevBaseDenomsRequestAmino; +} +/** + * QueryGetProtoRevBaseDenomsRequest is request type for the + * Query/GetProtoRevBaseDenoms RPC method. + */ +export interface QueryGetProtoRevBaseDenomsRequestSDKType {} +/** + * QueryGetProtoRevBaseDenomsResponse is response type for the + * Query/GetProtoRevBaseDenoms RPC method. + */ +export interface QueryGetProtoRevBaseDenomsResponse { + /** base_denoms is a list of all of the base denoms and step sizes */ + baseDenoms: BaseDenom[]; +} +export interface QueryGetProtoRevBaseDenomsResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevBaseDenomsResponse is response type for the + * Query/GetProtoRevBaseDenoms RPC method. + */ +export interface QueryGetProtoRevBaseDenomsResponseAmino { + /** base_denoms is a list of all of the base denoms and step sizes */ + base_denoms?: BaseDenomAmino[]; +} +export interface QueryGetProtoRevBaseDenomsResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-base-denoms-response'; + value: QueryGetProtoRevBaseDenomsResponseAmino; +} +/** + * QueryGetProtoRevBaseDenomsResponse is response type for the + * Query/GetProtoRevBaseDenoms RPC method. + */ +export interface QueryGetProtoRevBaseDenomsResponseSDKType { + base_denoms: BaseDenomSDKType[]; +} +/** + * QueryGetProtoRevEnabledRequest is request type for the + * Query/GetProtoRevEnabled RPC method. + */ +export interface QueryGetProtoRevEnabledRequest {} +export interface QueryGetProtoRevEnabledRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevEnabledRequest is request type for the + * Query/GetProtoRevEnabled RPC method. + */ +export interface QueryGetProtoRevEnabledRequestAmino {} +export interface QueryGetProtoRevEnabledRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-enabled-request'; + value: QueryGetProtoRevEnabledRequestAmino; +} +/** + * QueryGetProtoRevEnabledRequest is request type for the + * Query/GetProtoRevEnabled RPC method. + */ +export interface QueryGetProtoRevEnabledRequestSDKType {} +/** + * QueryGetProtoRevEnabledResponse is response type for the + * Query/GetProtoRevEnabled RPC method. + */ +export interface QueryGetProtoRevEnabledResponse { + /** enabled is whether the module is enabled */ + enabled: boolean; +} +export interface QueryGetProtoRevEnabledResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevEnabledResponse is response type for the + * Query/GetProtoRevEnabled RPC method. + */ +export interface QueryGetProtoRevEnabledResponseAmino { + /** enabled is whether the module is enabled */ + enabled?: boolean; +} +export interface QueryGetProtoRevEnabledResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-enabled-response'; + value: QueryGetProtoRevEnabledResponseAmino; +} +/** + * QueryGetProtoRevEnabledResponse is response type for the + * Query/GetProtoRevEnabled RPC method. + */ +export interface QueryGetProtoRevEnabledResponseSDKType { + enabled: boolean; +} +/** + * QueryGetProtoRevPoolRequest is request type for the + * Query/GetProtoRevPool RPC method. + */ +export interface QueryGetProtoRevPoolRequest { + /** + * base_denom is the base denom set in protorev for the denom pair to pool + * mapping + */ + baseDenom: string; + /** other_denom is the other denom for the denom pair to pool mapping */ + otherDenom: string; +} +export interface QueryGetProtoRevPoolRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevPoolRequest'; + value: Uint8Array; +} +/** + * QueryGetProtoRevPoolRequest is request type for the + * Query/GetProtoRevPool RPC method. + */ +export interface QueryGetProtoRevPoolRequestAmino { + /** + * base_denom is the base denom set in protorev for the denom pair to pool + * mapping + */ + base_denom?: string; + /** other_denom is the other denom for the denom pair to pool mapping */ + other_denom?: string; +} +export interface QueryGetProtoRevPoolRequestAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-pool-request'; + value: QueryGetProtoRevPoolRequestAmino; +} +/** + * QueryGetProtoRevPoolRequest is request type for the + * Query/GetProtoRevPool RPC method. + */ +export interface QueryGetProtoRevPoolRequestSDKType { + base_denom: string; + other_denom: string; +} +/** + * QueryGetProtoRevPoolResponse is response type for the + * Query/GetProtoRevPool RPC method. + */ +export interface QueryGetProtoRevPoolResponse { + /** pool_id is the pool_id stored for the denom pair */ + poolId: bigint; +} +export interface QueryGetProtoRevPoolResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevPoolResponse'; + value: Uint8Array; +} +/** + * QueryGetProtoRevPoolResponse is response type for the + * Query/GetProtoRevPool RPC method. + */ +export interface QueryGetProtoRevPoolResponseAmino { + /** pool_id is the pool_id stored for the denom pair */ + pool_id?: string; +} +export interface QueryGetProtoRevPoolResponseAminoMsg { + type: 'osmosis/protorev/query-get-proto-rev-pool-response'; + value: QueryGetProtoRevPoolResponseAmino; +} +/** + * QueryGetProtoRevPoolResponse is response type for the + * Query/GetProtoRevPool RPC method. + */ +export interface QueryGetProtoRevPoolResponseSDKType { + pool_id: bigint; +} +export interface QueryGetAllProtocolRevenueRequest {} +export interface QueryGetAllProtocolRevenueRequestProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest'; + value: Uint8Array; +} +export interface QueryGetAllProtocolRevenueRequestAmino {} +export interface QueryGetAllProtocolRevenueRequestAminoMsg { + type: 'osmosis/protorev/query-get-all-protocol-revenue-request'; + value: QueryGetAllProtocolRevenueRequestAmino; +} +export interface QueryGetAllProtocolRevenueRequestSDKType {} +export interface QueryGetAllProtocolRevenueResponse { + allProtocolRevenue: AllProtocolRevenue; +} +export interface QueryGetAllProtocolRevenueResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse'; + value: Uint8Array; +} +export interface QueryGetAllProtocolRevenueResponseAmino { + all_protocol_revenue?: AllProtocolRevenueAmino; +} +export interface QueryGetAllProtocolRevenueResponseAminoMsg { + type: 'osmosis/protorev/query-get-all-protocol-revenue-response'; + value: QueryGetAllProtocolRevenueResponseAmino; +} +export interface QueryGetAllProtocolRevenueResponseSDKType { + all_protocol_revenue: AllProtocolRevenueSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryParamsRequest', + aminoType: 'osmosis/protorev/query-params-request', + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + encode( + _: QueryParamsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: 'osmosis/protorev/query-params-request', + value: QueryParamsRequest.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryParamsRequest', + value: QueryParamsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsRequest.aminoType, + QueryParamsRequest.typeUrl +); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}), + }; +} +export const QueryParamsResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryParamsResponse', + aminoType: 'osmosis/protorev/query-params-response', + is(o: any): o is QueryParamsResponse { + return ( + o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)) + ); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)) + ); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)) + ); + }, + encode( + message: QueryParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: 'osmosis/protorev/query-params-response', + value: QueryParamsResponse.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryParamsResponse', + value: QueryParamsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryParamsResponse.typeUrl, + QueryParamsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsResponse.aminoType, + QueryParamsResponse.typeUrl +); +function createBaseQueryGetProtoRevNumberOfTradesRequest(): QueryGetProtoRevNumberOfTradesRequest { + return {}; +} +export const QueryGetProtoRevNumberOfTradesRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-number-of-trades-request', + is(o: any): o is QueryGetProtoRevNumberOfTradesRequest { + return o && o.$typeUrl === QueryGetProtoRevNumberOfTradesRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevNumberOfTradesRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevNumberOfTradesRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevNumberOfTradesRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevNumberOfTradesRequest.typeUrl; + }, + encode( + _: QueryGetProtoRevNumberOfTradesRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevNumberOfTradesRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevNumberOfTradesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevNumberOfTradesRequest { + const message = createBaseQueryGetProtoRevNumberOfTradesRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevNumberOfTradesRequestAmino + ): QueryGetProtoRevNumberOfTradesRequest { + const message = createBaseQueryGetProtoRevNumberOfTradesRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevNumberOfTradesRequest + ): QueryGetProtoRevNumberOfTradesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevNumberOfTradesRequestAminoMsg + ): QueryGetProtoRevNumberOfTradesRequest { + return QueryGetProtoRevNumberOfTradesRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevNumberOfTradesRequest + ): QueryGetProtoRevNumberOfTradesRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-number-of-trades-request', + value: QueryGetProtoRevNumberOfTradesRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevNumberOfTradesRequestProtoMsg + ): QueryGetProtoRevNumberOfTradesRequest { + return QueryGetProtoRevNumberOfTradesRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevNumberOfTradesRequest): Uint8Array { + return QueryGetProtoRevNumberOfTradesRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevNumberOfTradesRequest + ): QueryGetProtoRevNumberOfTradesRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesRequest', + value: QueryGetProtoRevNumberOfTradesRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevNumberOfTradesRequest.typeUrl, + QueryGetProtoRevNumberOfTradesRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevNumberOfTradesRequest.aminoType, + QueryGetProtoRevNumberOfTradesRequest.typeUrl +); +function createBaseQueryGetProtoRevNumberOfTradesResponse(): QueryGetProtoRevNumberOfTradesResponse { + return { + numberOfTrades: '', + }; +} +export const QueryGetProtoRevNumberOfTradesResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-number-of-trades-response', + is(o: any): o is QueryGetProtoRevNumberOfTradesResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevNumberOfTradesResponse.typeUrl || + typeof o.numberOfTrades === 'string') + ); + }, + isSDK(o: any): o is QueryGetProtoRevNumberOfTradesResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevNumberOfTradesResponse.typeUrl || + typeof o.number_of_trades === 'string') + ); + }, + isAmino(o: any): o is QueryGetProtoRevNumberOfTradesResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevNumberOfTradesResponse.typeUrl || + typeof o.number_of_trades === 'string') + ); + }, + encode( + message: QueryGetProtoRevNumberOfTradesResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.numberOfTrades !== '') { + writer.uint32(10).string(message.numberOfTrades); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevNumberOfTradesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevNumberOfTradesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numberOfTrades = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevNumberOfTradesResponse { + const message = createBaseQueryGetProtoRevNumberOfTradesResponse(); + message.numberOfTrades = object.numberOfTrades ?? ''; + return message; + }, + fromAmino( + object: QueryGetProtoRevNumberOfTradesResponseAmino + ): QueryGetProtoRevNumberOfTradesResponse { + const message = createBaseQueryGetProtoRevNumberOfTradesResponse(); + if ( + object.number_of_trades !== undefined && + object.number_of_trades !== null + ) { + message.numberOfTrades = object.number_of_trades; + } + return message; + }, + toAmino( + message: QueryGetProtoRevNumberOfTradesResponse + ): QueryGetProtoRevNumberOfTradesResponseAmino { + const obj: any = {}; + obj.number_of_trades = + message.numberOfTrades === '' ? undefined : message.numberOfTrades; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevNumberOfTradesResponseAminoMsg + ): QueryGetProtoRevNumberOfTradesResponse { + return QueryGetProtoRevNumberOfTradesResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevNumberOfTradesResponse + ): QueryGetProtoRevNumberOfTradesResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-number-of-trades-response', + value: QueryGetProtoRevNumberOfTradesResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevNumberOfTradesResponseProtoMsg + ): QueryGetProtoRevNumberOfTradesResponse { + return QueryGetProtoRevNumberOfTradesResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevNumberOfTradesResponse): Uint8Array { + return QueryGetProtoRevNumberOfTradesResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevNumberOfTradesResponse + ): QueryGetProtoRevNumberOfTradesResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesResponse', + value: QueryGetProtoRevNumberOfTradesResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevNumberOfTradesResponse.typeUrl, + QueryGetProtoRevNumberOfTradesResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevNumberOfTradesResponse.aminoType, + QueryGetProtoRevNumberOfTradesResponse.typeUrl +); +function createBaseQueryGetProtoRevProfitsByDenomRequest(): QueryGetProtoRevProfitsByDenomRequest { + return { + denom: '', + }; +} +export const QueryGetProtoRevProfitsByDenomRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-profits-by-denom-request', + is(o: any): o is QueryGetProtoRevProfitsByDenomRequest { + return ( + o && + (o.$typeUrl === QueryGetProtoRevProfitsByDenomRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isSDK(o: any): o is QueryGetProtoRevProfitsByDenomRequestSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevProfitsByDenomRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isAmino(o: any): o is QueryGetProtoRevProfitsByDenomRequestAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevProfitsByDenomRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + encode( + message: QueryGetProtoRevProfitsByDenomRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevProfitsByDenomRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevProfitsByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevProfitsByDenomRequest { + const message = createBaseQueryGetProtoRevProfitsByDenomRequest(); + message.denom = object.denom ?? ''; + return message; + }, + fromAmino( + object: QueryGetProtoRevProfitsByDenomRequestAmino + ): QueryGetProtoRevProfitsByDenomRequest { + const message = createBaseQueryGetProtoRevProfitsByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino( + message: QueryGetProtoRevProfitsByDenomRequest + ): QueryGetProtoRevProfitsByDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevProfitsByDenomRequestAminoMsg + ): QueryGetProtoRevProfitsByDenomRequest { + return QueryGetProtoRevProfitsByDenomRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevProfitsByDenomRequest + ): QueryGetProtoRevProfitsByDenomRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-profits-by-denom-request', + value: QueryGetProtoRevProfitsByDenomRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevProfitsByDenomRequestProtoMsg + ): QueryGetProtoRevProfitsByDenomRequest { + return QueryGetProtoRevProfitsByDenomRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevProfitsByDenomRequest): Uint8Array { + return QueryGetProtoRevProfitsByDenomRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevProfitsByDenomRequest + ): QueryGetProtoRevProfitsByDenomRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomRequest', + value: QueryGetProtoRevProfitsByDenomRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevProfitsByDenomRequest.typeUrl, + QueryGetProtoRevProfitsByDenomRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevProfitsByDenomRequest.aminoType, + QueryGetProtoRevProfitsByDenomRequest.typeUrl +); +function createBaseQueryGetProtoRevProfitsByDenomResponse(): QueryGetProtoRevProfitsByDenomResponse { + return { + profit: undefined, + }; +} +export const QueryGetProtoRevProfitsByDenomResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-profits-by-denom-response', + is(o: any): o is QueryGetProtoRevProfitsByDenomResponse { + return o && o.$typeUrl === QueryGetProtoRevProfitsByDenomResponse.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevProfitsByDenomResponseSDKType { + return o && o.$typeUrl === QueryGetProtoRevProfitsByDenomResponse.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevProfitsByDenomResponseAmino { + return o && o.$typeUrl === QueryGetProtoRevProfitsByDenomResponse.typeUrl; + }, + encode( + message: QueryGetProtoRevProfitsByDenomResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.profit !== undefined) { + Coin.encode(message.profit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevProfitsByDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevProfitsByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.profit = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevProfitsByDenomResponse { + const message = createBaseQueryGetProtoRevProfitsByDenomResponse(); + message.profit = + object.profit !== undefined && object.profit !== null + ? Coin.fromPartial(object.profit) + : undefined; + return message; + }, + fromAmino( + object: QueryGetProtoRevProfitsByDenomResponseAmino + ): QueryGetProtoRevProfitsByDenomResponse { + const message = createBaseQueryGetProtoRevProfitsByDenomResponse(); + if (object.profit !== undefined && object.profit !== null) { + message.profit = Coin.fromAmino(object.profit); + } + return message; + }, + toAmino( + message: QueryGetProtoRevProfitsByDenomResponse + ): QueryGetProtoRevProfitsByDenomResponseAmino { + const obj: any = {}; + obj.profit = message.profit ? Coin.toAmino(message.profit) : undefined; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevProfitsByDenomResponseAminoMsg + ): QueryGetProtoRevProfitsByDenomResponse { + return QueryGetProtoRevProfitsByDenomResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevProfitsByDenomResponse + ): QueryGetProtoRevProfitsByDenomResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-profits-by-denom-response', + value: QueryGetProtoRevProfitsByDenomResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevProfitsByDenomResponseProtoMsg + ): QueryGetProtoRevProfitsByDenomResponse { + return QueryGetProtoRevProfitsByDenomResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevProfitsByDenomResponse): Uint8Array { + return QueryGetProtoRevProfitsByDenomResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevProfitsByDenomResponse + ): QueryGetProtoRevProfitsByDenomResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomResponse', + value: QueryGetProtoRevProfitsByDenomResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevProfitsByDenomResponse.typeUrl, + QueryGetProtoRevProfitsByDenomResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevProfitsByDenomResponse.aminoType, + QueryGetProtoRevProfitsByDenomResponse.typeUrl +); +function createBaseQueryGetProtoRevAllProfitsRequest(): QueryGetProtoRevAllProfitsRequest { + return {}; +} +export const QueryGetProtoRevAllProfitsRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-all-profits-request', + is(o: any): o is QueryGetProtoRevAllProfitsRequest { + return o && o.$typeUrl === QueryGetProtoRevAllProfitsRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevAllProfitsRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevAllProfitsRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevAllProfitsRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevAllProfitsRequest.typeUrl; + }, + encode( + _: QueryGetProtoRevAllProfitsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevAllProfitsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevAllProfitsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevAllProfitsRequest { + const message = createBaseQueryGetProtoRevAllProfitsRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevAllProfitsRequestAmino + ): QueryGetProtoRevAllProfitsRequest { + const message = createBaseQueryGetProtoRevAllProfitsRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevAllProfitsRequest + ): QueryGetProtoRevAllProfitsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevAllProfitsRequestAminoMsg + ): QueryGetProtoRevAllProfitsRequest { + return QueryGetProtoRevAllProfitsRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevAllProfitsRequest + ): QueryGetProtoRevAllProfitsRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-all-profits-request', + value: QueryGetProtoRevAllProfitsRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevAllProfitsRequestProtoMsg + ): QueryGetProtoRevAllProfitsRequest { + return QueryGetProtoRevAllProfitsRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevAllProfitsRequest): Uint8Array { + return QueryGetProtoRevAllProfitsRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevAllProfitsRequest + ): QueryGetProtoRevAllProfitsRequestProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsRequest', + value: QueryGetProtoRevAllProfitsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevAllProfitsRequest.typeUrl, + QueryGetProtoRevAllProfitsRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevAllProfitsRequest.aminoType, + QueryGetProtoRevAllProfitsRequest.typeUrl +); +function createBaseQueryGetProtoRevAllProfitsResponse(): QueryGetProtoRevAllProfitsResponse { + return { + profits: [], + }; +} +export const QueryGetProtoRevAllProfitsResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-all-profits-response', + is(o: any): o is QueryGetProtoRevAllProfitsResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAllProfitsResponse.typeUrl || + (Array.isArray(o.profits) && + (!o.profits.length || Coin.is(o.profits[0])))) + ); + }, + isSDK(o: any): o is QueryGetProtoRevAllProfitsResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAllProfitsResponse.typeUrl || + (Array.isArray(o.profits) && + (!o.profits.length || Coin.isSDK(o.profits[0])))) + ); + }, + isAmino(o: any): o is QueryGetProtoRevAllProfitsResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAllProfitsResponse.typeUrl || + (Array.isArray(o.profits) && + (!o.profits.length || Coin.isAmino(o.profits[0])))) + ); + }, + encode( + message: QueryGetProtoRevAllProfitsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.profits) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevAllProfitsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevAllProfitsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.profits.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevAllProfitsResponse { + const message = createBaseQueryGetProtoRevAllProfitsResponse(); + message.profits = object.profits?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: QueryGetProtoRevAllProfitsResponseAmino + ): QueryGetProtoRevAllProfitsResponse { + const message = createBaseQueryGetProtoRevAllProfitsResponse(); + message.profits = object.profits?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: QueryGetProtoRevAllProfitsResponse + ): QueryGetProtoRevAllProfitsResponseAmino { + const obj: any = {}; + if (message.profits) { + obj.profits = message.profits.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.profits = message.profits; + } + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevAllProfitsResponseAminoMsg + ): QueryGetProtoRevAllProfitsResponse { + return QueryGetProtoRevAllProfitsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevAllProfitsResponse + ): QueryGetProtoRevAllProfitsResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-all-profits-response', + value: QueryGetProtoRevAllProfitsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevAllProfitsResponseProtoMsg + ): QueryGetProtoRevAllProfitsResponse { + return QueryGetProtoRevAllProfitsResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevAllProfitsResponse): Uint8Array { + return QueryGetProtoRevAllProfitsResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevAllProfitsResponse + ): QueryGetProtoRevAllProfitsResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsResponse', + value: QueryGetProtoRevAllProfitsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevAllProfitsResponse.typeUrl, + QueryGetProtoRevAllProfitsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevAllProfitsResponse.aminoType, + QueryGetProtoRevAllProfitsResponse.typeUrl +); +function createBaseQueryGetProtoRevStatisticsByRouteRequest(): QueryGetProtoRevStatisticsByRouteRequest { + return { + route: [], + }; +} +export const QueryGetProtoRevStatisticsByRouteRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-statistics-by-route-request', + is(o: any): o is QueryGetProtoRevStatisticsByRouteRequest { + return ( + o && + (o.$typeUrl === QueryGetProtoRevStatisticsByRouteRequest.typeUrl || + (Array.isArray(o.route) && + (!o.route.length || typeof o.route[0] === 'bigint'))) + ); + }, + isSDK(o: any): o is QueryGetProtoRevStatisticsByRouteRequestSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevStatisticsByRouteRequest.typeUrl || + (Array.isArray(o.route) && + (!o.route.length || typeof o.route[0] === 'bigint'))) + ); + }, + isAmino(o: any): o is QueryGetProtoRevStatisticsByRouteRequestAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevStatisticsByRouteRequest.typeUrl || + (Array.isArray(o.route) && + (!o.route.length || typeof o.route[0] === 'bigint'))) + ); + }, + encode( + message: QueryGetProtoRevStatisticsByRouteRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.route) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevStatisticsByRouteRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevStatisticsByRouteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.route.push(reader.uint64()); + } + } else { + message.route.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevStatisticsByRouteRequest { + const message = createBaseQueryGetProtoRevStatisticsByRouteRequest(); + message.route = object.route?.map((e) => BigInt(e.toString())) || []; + return message; + }, + fromAmino( + object: QueryGetProtoRevStatisticsByRouteRequestAmino + ): QueryGetProtoRevStatisticsByRouteRequest { + const message = createBaseQueryGetProtoRevStatisticsByRouteRequest(); + message.route = object.route?.map((e) => BigInt(e)) || []; + return message; + }, + toAmino( + message: QueryGetProtoRevStatisticsByRouteRequest + ): QueryGetProtoRevStatisticsByRouteRequestAmino { + const obj: any = {}; + if (message.route) { + obj.route = message.route.map((e) => e.toString()); + } else { + obj.route = message.route; + } + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevStatisticsByRouteRequestAminoMsg + ): QueryGetProtoRevStatisticsByRouteRequest { + return QueryGetProtoRevStatisticsByRouteRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevStatisticsByRouteRequest + ): QueryGetProtoRevStatisticsByRouteRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-statistics-by-route-request', + value: QueryGetProtoRevStatisticsByRouteRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevStatisticsByRouteRequestProtoMsg + ): QueryGetProtoRevStatisticsByRouteRequest { + return QueryGetProtoRevStatisticsByRouteRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevStatisticsByRouteRequest): Uint8Array { + return QueryGetProtoRevStatisticsByRouteRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevStatisticsByRouteRequest + ): QueryGetProtoRevStatisticsByRouteRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteRequest', + value: QueryGetProtoRevStatisticsByRouteRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevStatisticsByRouteRequest.typeUrl, + QueryGetProtoRevStatisticsByRouteRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevStatisticsByRouteRequest.aminoType, + QueryGetProtoRevStatisticsByRouteRequest.typeUrl +); +function createBaseQueryGetProtoRevStatisticsByRouteResponse(): QueryGetProtoRevStatisticsByRouteResponse { + return { + statistics: RouteStatistics.fromPartial({}), + }; +} +export const QueryGetProtoRevStatisticsByRouteResponse = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteResponse', + aminoType: + 'osmosis/protorev/query-get-proto-rev-statistics-by-route-response', + is(o: any): o is QueryGetProtoRevStatisticsByRouteResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevStatisticsByRouteResponse.typeUrl || + RouteStatistics.is(o.statistics)) + ); + }, + isSDK(o: any): o is QueryGetProtoRevStatisticsByRouteResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevStatisticsByRouteResponse.typeUrl || + RouteStatistics.isSDK(o.statistics)) + ); + }, + isAmino(o: any): o is QueryGetProtoRevStatisticsByRouteResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevStatisticsByRouteResponse.typeUrl || + RouteStatistics.isAmino(o.statistics)) + ); + }, + encode( + message: QueryGetProtoRevStatisticsByRouteResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.statistics !== undefined) { + RouteStatistics.encode( + message.statistics, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevStatisticsByRouteResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevStatisticsByRouteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.statistics = RouteStatistics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevStatisticsByRouteResponse { + const message = createBaseQueryGetProtoRevStatisticsByRouteResponse(); + message.statistics = + object.statistics !== undefined && object.statistics !== null + ? RouteStatistics.fromPartial(object.statistics) + : undefined; + return message; + }, + fromAmino( + object: QueryGetProtoRevStatisticsByRouteResponseAmino + ): QueryGetProtoRevStatisticsByRouteResponse { + const message = createBaseQueryGetProtoRevStatisticsByRouteResponse(); + if (object.statistics !== undefined && object.statistics !== null) { + message.statistics = RouteStatistics.fromAmino(object.statistics); + } + return message; + }, + toAmino( + message: QueryGetProtoRevStatisticsByRouteResponse + ): QueryGetProtoRevStatisticsByRouteResponseAmino { + const obj: any = {}; + obj.statistics = message.statistics + ? RouteStatistics.toAmino(message.statistics) + : undefined; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevStatisticsByRouteResponseAminoMsg + ): QueryGetProtoRevStatisticsByRouteResponse { + return QueryGetProtoRevStatisticsByRouteResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevStatisticsByRouteResponse + ): QueryGetProtoRevStatisticsByRouteResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-statistics-by-route-response', + value: QueryGetProtoRevStatisticsByRouteResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevStatisticsByRouteResponseProtoMsg + ): QueryGetProtoRevStatisticsByRouteResponse { + return QueryGetProtoRevStatisticsByRouteResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevStatisticsByRouteResponse): Uint8Array { + return QueryGetProtoRevStatisticsByRouteResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevStatisticsByRouteResponse + ): QueryGetProtoRevStatisticsByRouteResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteResponse', + value: QueryGetProtoRevStatisticsByRouteResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevStatisticsByRouteResponse.typeUrl, + QueryGetProtoRevStatisticsByRouteResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevStatisticsByRouteResponse.aminoType, + QueryGetProtoRevStatisticsByRouteResponse.typeUrl +); +function createBaseQueryGetProtoRevAllRouteStatisticsRequest(): QueryGetProtoRevAllRouteStatisticsRequest { + return {}; +} +export const QueryGetProtoRevAllRouteStatisticsRequest = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsRequest', + aminoType: + 'osmosis/protorev/query-get-proto-rev-all-route-statistics-request', + is(o: any): o is QueryGetProtoRevAllRouteStatisticsRequest { + return ( + o && o.$typeUrl === QueryGetProtoRevAllRouteStatisticsRequest.typeUrl + ); + }, + isSDK(o: any): o is QueryGetProtoRevAllRouteStatisticsRequestSDKType { + return ( + o && o.$typeUrl === QueryGetProtoRevAllRouteStatisticsRequest.typeUrl + ); + }, + isAmino(o: any): o is QueryGetProtoRevAllRouteStatisticsRequestAmino { + return ( + o && o.$typeUrl === QueryGetProtoRevAllRouteStatisticsRequest.typeUrl + ); + }, + encode( + _: QueryGetProtoRevAllRouteStatisticsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevAllRouteStatisticsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevAllRouteStatisticsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevAllRouteStatisticsRequest { + const message = createBaseQueryGetProtoRevAllRouteStatisticsRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevAllRouteStatisticsRequestAmino + ): QueryGetProtoRevAllRouteStatisticsRequest { + const message = createBaseQueryGetProtoRevAllRouteStatisticsRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevAllRouteStatisticsRequest + ): QueryGetProtoRevAllRouteStatisticsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevAllRouteStatisticsRequestAminoMsg + ): QueryGetProtoRevAllRouteStatisticsRequest { + return QueryGetProtoRevAllRouteStatisticsRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevAllRouteStatisticsRequest + ): QueryGetProtoRevAllRouteStatisticsRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-all-route-statistics-request', + value: QueryGetProtoRevAllRouteStatisticsRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevAllRouteStatisticsRequestProtoMsg + ): QueryGetProtoRevAllRouteStatisticsRequest { + return QueryGetProtoRevAllRouteStatisticsRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevAllRouteStatisticsRequest): Uint8Array { + return QueryGetProtoRevAllRouteStatisticsRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevAllRouteStatisticsRequest + ): QueryGetProtoRevAllRouteStatisticsRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsRequest', + value: QueryGetProtoRevAllRouteStatisticsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevAllRouteStatisticsRequest.typeUrl, + QueryGetProtoRevAllRouteStatisticsRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevAllRouteStatisticsRequest.aminoType, + QueryGetProtoRevAllRouteStatisticsRequest.typeUrl +); +function createBaseQueryGetProtoRevAllRouteStatisticsResponse(): QueryGetProtoRevAllRouteStatisticsResponse { + return { + statistics: [], + }; +} +export const QueryGetProtoRevAllRouteStatisticsResponse = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsResponse', + aminoType: + 'osmosis/protorev/query-get-proto-rev-all-route-statistics-response', + is(o: any): o is QueryGetProtoRevAllRouteStatisticsResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAllRouteStatisticsResponse.typeUrl || + (Array.isArray(o.statistics) && + (!o.statistics.length || RouteStatistics.is(o.statistics[0])))) + ); + }, + isSDK(o: any): o is QueryGetProtoRevAllRouteStatisticsResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAllRouteStatisticsResponse.typeUrl || + (Array.isArray(o.statistics) && + (!o.statistics.length || RouteStatistics.isSDK(o.statistics[0])))) + ); + }, + isAmino(o: any): o is QueryGetProtoRevAllRouteStatisticsResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAllRouteStatisticsResponse.typeUrl || + (Array.isArray(o.statistics) && + (!o.statistics.length || RouteStatistics.isAmino(o.statistics[0])))) + ); + }, + encode( + message: QueryGetProtoRevAllRouteStatisticsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.statistics) { + RouteStatistics.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevAllRouteStatisticsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevAllRouteStatisticsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.statistics.push( + RouteStatistics.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevAllRouteStatisticsResponse { + const message = createBaseQueryGetProtoRevAllRouteStatisticsResponse(); + message.statistics = + object.statistics?.map((e) => RouteStatistics.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: QueryGetProtoRevAllRouteStatisticsResponseAmino + ): QueryGetProtoRevAllRouteStatisticsResponse { + const message = createBaseQueryGetProtoRevAllRouteStatisticsResponse(); + message.statistics = + object.statistics?.map((e) => RouteStatistics.fromAmino(e)) || []; + return message; + }, + toAmino( + message: QueryGetProtoRevAllRouteStatisticsResponse + ): QueryGetProtoRevAllRouteStatisticsResponseAmino { + const obj: any = {}; + if (message.statistics) { + obj.statistics = message.statistics.map((e) => + e ? RouteStatistics.toAmino(e) : undefined + ); + } else { + obj.statistics = message.statistics; + } + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevAllRouteStatisticsResponseAminoMsg + ): QueryGetProtoRevAllRouteStatisticsResponse { + return QueryGetProtoRevAllRouteStatisticsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevAllRouteStatisticsResponse + ): QueryGetProtoRevAllRouteStatisticsResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-all-route-statistics-response', + value: QueryGetProtoRevAllRouteStatisticsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevAllRouteStatisticsResponseProtoMsg + ): QueryGetProtoRevAllRouteStatisticsResponse { + return QueryGetProtoRevAllRouteStatisticsResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevAllRouteStatisticsResponse): Uint8Array { + return QueryGetProtoRevAllRouteStatisticsResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevAllRouteStatisticsResponse + ): QueryGetProtoRevAllRouteStatisticsResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsResponse', + value: + QueryGetProtoRevAllRouteStatisticsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevAllRouteStatisticsResponse.typeUrl, + QueryGetProtoRevAllRouteStatisticsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevAllRouteStatisticsResponse.aminoType, + QueryGetProtoRevAllRouteStatisticsResponse.typeUrl +); +function createBaseQueryGetProtoRevTokenPairArbRoutesRequest(): QueryGetProtoRevTokenPairArbRoutesRequest { + return {}; +} +export const QueryGetProtoRevTokenPairArbRoutesRequest = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesRequest', + aminoType: + 'osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-request', + is(o: any): o is QueryGetProtoRevTokenPairArbRoutesRequest { + return ( + o && o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl + ); + }, + isSDK(o: any): o is QueryGetProtoRevTokenPairArbRoutesRequestSDKType { + return ( + o && o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl + ); + }, + isAmino(o: any): o is QueryGetProtoRevTokenPairArbRoutesRequestAmino { + return ( + o && o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl + ); + }, + encode( + _: QueryGetProtoRevTokenPairArbRoutesRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevTokenPairArbRoutesRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevTokenPairArbRoutesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevTokenPairArbRoutesRequest { + const message = createBaseQueryGetProtoRevTokenPairArbRoutesRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevTokenPairArbRoutesRequestAmino + ): QueryGetProtoRevTokenPairArbRoutesRequest { + const message = createBaseQueryGetProtoRevTokenPairArbRoutesRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevTokenPairArbRoutesRequest + ): QueryGetProtoRevTokenPairArbRoutesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevTokenPairArbRoutesRequestAminoMsg + ): QueryGetProtoRevTokenPairArbRoutesRequest { + return QueryGetProtoRevTokenPairArbRoutesRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevTokenPairArbRoutesRequest + ): QueryGetProtoRevTokenPairArbRoutesRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-request', + value: QueryGetProtoRevTokenPairArbRoutesRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevTokenPairArbRoutesRequestProtoMsg + ): QueryGetProtoRevTokenPairArbRoutesRequest { + return QueryGetProtoRevTokenPairArbRoutesRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevTokenPairArbRoutesRequest): Uint8Array { + return QueryGetProtoRevTokenPairArbRoutesRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevTokenPairArbRoutesRequest + ): QueryGetProtoRevTokenPairArbRoutesRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesRequest', + value: QueryGetProtoRevTokenPairArbRoutesRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl, + QueryGetProtoRevTokenPairArbRoutesRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevTokenPairArbRoutesRequest.aminoType, + QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl +); +function createBaseQueryGetProtoRevTokenPairArbRoutesResponse(): QueryGetProtoRevTokenPairArbRoutesResponse { + return { + routes: [], + }; +} +export const QueryGetProtoRevTokenPairArbRoutesResponse = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesResponse', + aminoType: + 'osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-response', + is(o: any): o is QueryGetProtoRevTokenPairArbRoutesResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl || + (Array.isArray(o.routes) && + (!o.routes.length || TokenPairArbRoutes.is(o.routes[0])))) + ); + }, + isSDK(o: any): o is QueryGetProtoRevTokenPairArbRoutesResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl || + (Array.isArray(o.routes) && + (!o.routes.length || TokenPairArbRoutes.isSDK(o.routes[0])))) + ); + }, + isAmino(o: any): o is QueryGetProtoRevTokenPairArbRoutesResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl || + (Array.isArray(o.routes) && + (!o.routes.length || TokenPairArbRoutes.isAmino(o.routes[0])))) + ); + }, + encode( + message: QueryGetProtoRevTokenPairArbRoutesResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.routes) { + TokenPairArbRoutes.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevTokenPairArbRoutesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevTokenPairArbRoutesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.routes.push( + TokenPairArbRoutes.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevTokenPairArbRoutesResponse { + const message = createBaseQueryGetProtoRevTokenPairArbRoutesResponse(); + message.routes = + object.routes?.map((e) => TokenPairArbRoutes.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: QueryGetProtoRevTokenPairArbRoutesResponseAmino + ): QueryGetProtoRevTokenPairArbRoutesResponse { + const message = createBaseQueryGetProtoRevTokenPairArbRoutesResponse(); + message.routes = + object.routes?.map((e) => TokenPairArbRoutes.fromAmino(e)) || []; + return message; + }, + toAmino( + message: QueryGetProtoRevTokenPairArbRoutesResponse + ): QueryGetProtoRevTokenPairArbRoutesResponseAmino { + const obj: any = {}; + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? TokenPairArbRoutes.toAmino(e) : undefined + ); + } else { + obj.routes = message.routes; + } + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevTokenPairArbRoutesResponseAminoMsg + ): QueryGetProtoRevTokenPairArbRoutesResponse { + return QueryGetProtoRevTokenPairArbRoutesResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevTokenPairArbRoutesResponse + ): QueryGetProtoRevTokenPairArbRoutesResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-response', + value: QueryGetProtoRevTokenPairArbRoutesResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevTokenPairArbRoutesResponseProtoMsg + ): QueryGetProtoRevTokenPairArbRoutesResponse { + return QueryGetProtoRevTokenPairArbRoutesResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevTokenPairArbRoutesResponse): Uint8Array { + return QueryGetProtoRevTokenPairArbRoutesResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevTokenPairArbRoutesResponse + ): QueryGetProtoRevTokenPairArbRoutesResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesResponse', + value: + QueryGetProtoRevTokenPairArbRoutesResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl, + QueryGetProtoRevTokenPairArbRoutesResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevTokenPairArbRoutesResponse.aminoType, + QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl +); +function createBaseQueryGetProtoRevAdminAccountRequest(): QueryGetProtoRevAdminAccountRequest { + return {}; +} +export const QueryGetProtoRevAdminAccountRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-admin-account-request', + is(o: any): o is QueryGetProtoRevAdminAccountRequest { + return o && o.$typeUrl === QueryGetProtoRevAdminAccountRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevAdminAccountRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevAdminAccountRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevAdminAccountRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevAdminAccountRequest.typeUrl; + }, + encode( + _: QueryGetProtoRevAdminAccountRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevAdminAccountRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevAdminAccountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevAdminAccountRequest { + const message = createBaseQueryGetProtoRevAdminAccountRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevAdminAccountRequestAmino + ): QueryGetProtoRevAdminAccountRequest { + const message = createBaseQueryGetProtoRevAdminAccountRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevAdminAccountRequest + ): QueryGetProtoRevAdminAccountRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevAdminAccountRequestAminoMsg + ): QueryGetProtoRevAdminAccountRequest { + return QueryGetProtoRevAdminAccountRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevAdminAccountRequest + ): QueryGetProtoRevAdminAccountRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-admin-account-request', + value: QueryGetProtoRevAdminAccountRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevAdminAccountRequestProtoMsg + ): QueryGetProtoRevAdminAccountRequest { + return QueryGetProtoRevAdminAccountRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevAdminAccountRequest): Uint8Array { + return QueryGetProtoRevAdminAccountRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevAdminAccountRequest + ): QueryGetProtoRevAdminAccountRequestProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountRequest', + value: QueryGetProtoRevAdminAccountRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevAdminAccountRequest.typeUrl, + QueryGetProtoRevAdminAccountRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevAdminAccountRequest.aminoType, + QueryGetProtoRevAdminAccountRequest.typeUrl +); +function createBaseQueryGetProtoRevAdminAccountResponse(): QueryGetProtoRevAdminAccountResponse { + return { + adminAccount: '', + }; +} +export const QueryGetProtoRevAdminAccountResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-admin-account-response', + is(o: any): o is QueryGetProtoRevAdminAccountResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAdminAccountResponse.typeUrl || + typeof o.adminAccount === 'string') + ); + }, + isSDK(o: any): o is QueryGetProtoRevAdminAccountResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAdminAccountResponse.typeUrl || + typeof o.admin_account === 'string') + ); + }, + isAmino(o: any): o is QueryGetProtoRevAdminAccountResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevAdminAccountResponse.typeUrl || + typeof o.admin_account === 'string') + ); + }, + encode( + message: QueryGetProtoRevAdminAccountResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.adminAccount !== '') { + writer.uint32(10).string(message.adminAccount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevAdminAccountResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevAdminAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.adminAccount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevAdminAccountResponse { + const message = createBaseQueryGetProtoRevAdminAccountResponse(); + message.adminAccount = object.adminAccount ?? ''; + return message; + }, + fromAmino( + object: QueryGetProtoRevAdminAccountResponseAmino + ): QueryGetProtoRevAdminAccountResponse { + const message = createBaseQueryGetProtoRevAdminAccountResponse(); + if (object.admin_account !== undefined && object.admin_account !== null) { + message.adminAccount = object.admin_account; + } + return message; + }, + toAmino( + message: QueryGetProtoRevAdminAccountResponse + ): QueryGetProtoRevAdminAccountResponseAmino { + const obj: any = {}; + obj.admin_account = + message.adminAccount === '' ? undefined : message.adminAccount; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevAdminAccountResponseAminoMsg + ): QueryGetProtoRevAdminAccountResponse { + return QueryGetProtoRevAdminAccountResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevAdminAccountResponse + ): QueryGetProtoRevAdminAccountResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-admin-account-response', + value: QueryGetProtoRevAdminAccountResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevAdminAccountResponseProtoMsg + ): QueryGetProtoRevAdminAccountResponse { + return QueryGetProtoRevAdminAccountResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevAdminAccountResponse): Uint8Array { + return QueryGetProtoRevAdminAccountResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevAdminAccountResponse + ): QueryGetProtoRevAdminAccountResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountResponse', + value: QueryGetProtoRevAdminAccountResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevAdminAccountResponse.typeUrl, + QueryGetProtoRevAdminAccountResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevAdminAccountResponse.aminoType, + QueryGetProtoRevAdminAccountResponse.typeUrl +); +function createBaseQueryGetProtoRevDeveloperAccountRequest(): QueryGetProtoRevDeveloperAccountRequest { + return {}; +} +export const QueryGetProtoRevDeveloperAccountRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-developer-account-request', + is(o: any): o is QueryGetProtoRevDeveloperAccountRequest { + return o && o.$typeUrl === QueryGetProtoRevDeveloperAccountRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevDeveloperAccountRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevDeveloperAccountRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevDeveloperAccountRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevDeveloperAccountRequest.typeUrl; + }, + encode( + _: QueryGetProtoRevDeveloperAccountRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevDeveloperAccountRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevDeveloperAccountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevDeveloperAccountRequest { + const message = createBaseQueryGetProtoRevDeveloperAccountRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevDeveloperAccountRequestAmino + ): QueryGetProtoRevDeveloperAccountRequest { + const message = createBaseQueryGetProtoRevDeveloperAccountRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevDeveloperAccountRequest + ): QueryGetProtoRevDeveloperAccountRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevDeveloperAccountRequestAminoMsg + ): QueryGetProtoRevDeveloperAccountRequest { + return QueryGetProtoRevDeveloperAccountRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevDeveloperAccountRequest + ): QueryGetProtoRevDeveloperAccountRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-developer-account-request', + value: QueryGetProtoRevDeveloperAccountRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevDeveloperAccountRequestProtoMsg + ): QueryGetProtoRevDeveloperAccountRequest { + return QueryGetProtoRevDeveloperAccountRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevDeveloperAccountRequest): Uint8Array { + return QueryGetProtoRevDeveloperAccountRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevDeveloperAccountRequest + ): QueryGetProtoRevDeveloperAccountRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountRequest', + value: QueryGetProtoRevDeveloperAccountRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevDeveloperAccountRequest.typeUrl, + QueryGetProtoRevDeveloperAccountRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevDeveloperAccountRequest.aminoType, + QueryGetProtoRevDeveloperAccountRequest.typeUrl +); +function createBaseQueryGetProtoRevDeveloperAccountResponse(): QueryGetProtoRevDeveloperAccountResponse { + return { + developerAccount: '', + }; +} +export const QueryGetProtoRevDeveloperAccountResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-developer-account-response', + is(o: any): o is QueryGetProtoRevDeveloperAccountResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevDeveloperAccountResponse.typeUrl || + typeof o.developerAccount === 'string') + ); + }, + isSDK(o: any): o is QueryGetProtoRevDeveloperAccountResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevDeveloperAccountResponse.typeUrl || + typeof o.developer_account === 'string') + ); + }, + isAmino(o: any): o is QueryGetProtoRevDeveloperAccountResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevDeveloperAccountResponse.typeUrl || + typeof o.developer_account === 'string') + ); + }, + encode( + message: QueryGetProtoRevDeveloperAccountResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.developerAccount !== '') { + writer.uint32(10).string(message.developerAccount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevDeveloperAccountResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevDeveloperAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.developerAccount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevDeveloperAccountResponse { + const message = createBaseQueryGetProtoRevDeveloperAccountResponse(); + message.developerAccount = object.developerAccount ?? ''; + return message; + }, + fromAmino( + object: QueryGetProtoRevDeveloperAccountResponseAmino + ): QueryGetProtoRevDeveloperAccountResponse { + const message = createBaseQueryGetProtoRevDeveloperAccountResponse(); + if ( + object.developer_account !== undefined && + object.developer_account !== null + ) { + message.developerAccount = object.developer_account; + } + return message; + }, + toAmino( + message: QueryGetProtoRevDeveloperAccountResponse + ): QueryGetProtoRevDeveloperAccountResponseAmino { + const obj: any = {}; + obj.developer_account = + message.developerAccount === '' ? undefined : message.developerAccount; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevDeveloperAccountResponseAminoMsg + ): QueryGetProtoRevDeveloperAccountResponse { + return QueryGetProtoRevDeveloperAccountResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevDeveloperAccountResponse + ): QueryGetProtoRevDeveloperAccountResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-developer-account-response', + value: QueryGetProtoRevDeveloperAccountResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevDeveloperAccountResponseProtoMsg + ): QueryGetProtoRevDeveloperAccountResponse { + return QueryGetProtoRevDeveloperAccountResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevDeveloperAccountResponse): Uint8Array { + return QueryGetProtoRevDeveloperAccountResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevDeveloperAccountResponse + ): QueryGetProtoRevDeveloperAccountResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountResponse', + value: QueryGetProtoRevDeveloperAccountResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevDeveloperAccountResponse.typeUrl, + QueryGetProtoRevDeveloperAccountResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevDeveloperAccountResponse.aminoType, + QueryGetProtoRevDeveloperAccountResponse.typeUrl +); +function createBaseQueryGetProtoRevInfoByPoolTypeRequest(): QueryGetProtoRevInfoByPoolTypeRequest { + return {}; +} +export const QueryGetProtoRevInfoByPoolTypeRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-info-by-pool-type-request', + is(o: any): o is QueryGetProtoRevInfoByPoolTypeRequest { + return o && o.$typeUrl === QueryGetProtoRevInfoByPoolTypeRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevInfoByPoolTypeRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevInfoByPoolTypeRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevInfoByPoolTypeRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevInfoByPoolTypeRequest.typeUrl; + }, + encode( + _: QueryGetProtoRevInfoByPoolTypeRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevInfoByPoolTypeRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevInfoByPoolTypeRequest { + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevInfoByPoolTypeRequestAmino + ): QueryGetProtoRevInfoByPoolTypeRequest { + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevInfoByPoolTypeRequest + ): QueryGetProtoRevInfoByPoolTypeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevInfoByPoolTypeRequestAminoMsg + ): QueryGetProtoRevInfoByPoolTypeRequest { + return QueryGetProtoRevInfoByPoolTypeRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevInfoByPoolTypeRequest + ): QueryGetProtoRevInfoByPoolTypeRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-info-by-pool-type-request', + value: QueryGetProtoRevInfoByPoolTypeRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevInfoByPoolTypeRequestProtoMsg + ): QueryGetProtoRevInfoByPoolTypeRequest { + return QueryGetProtoRevInfoByPoolTypeRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevInfoByPoolTypeRequest): Uint8Array { + return QueryGetProtoRevInfoByPoolTypeRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevInfoByPoolTypeRequest + ): QueryGetProtoRevInfoByPoolTypeRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest', + value: QueryGetProtoRevInfoByPoolTypeRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevInfoByPoolTypeRequest.typeUrl, + QueryGetProtoRevInfoByPoolTypeRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevInfoByPoolTypeRequest.aminoType, + QueryGetProtoRevInfoByPoolTypeRequest.typeUrl +); +function createBaseQueryGetProtoRevInfoByPoolTypeResponse(): QueryGetProtoRevInfoByPoolTypeResponse { + return { + infoByPoolType: InfoByPoolType.fromPartial({}), + }; +} +export const QueryGetProtoRevInfoByPoolTypeResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-info-by-pool-type-response', + is(o: any): o is QueryGetProtoRevInfoByPoolTypeResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevInfoByPoolTypeResponse.typeUrl || + InfoByPoolType.is(o.infoByPoolType)) + ); + }, + isSDK(o: any): o is QueryGetProtoRevInfoByPoolTypeResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevInfoByPoolTypeResponse.typeUrl || + InfoByPoolType.isSDK(o.info_by_pool_type)) + ); + }, + isAmino(o: any): o is QueryGetProtoRevInfoByPoolTypeResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevInfoByPoolTypeResponse.typeUrl || + InfoByPoolType.isAmino(o.info_by_pool_type)) + ); + }, + encode( + message: QueryGetProtoRevInfoByPoolTypeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode( + message.infoByPoolType, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevInfoByPoolTypeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infoByPoolType = InfoByPoolType.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevInfoByPoolTypeResponse { + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); + message.infoByPoolType = + object.infoByPoolType !== undefined && object.infoByPoolType !== null + ? InfoByPoolType.fromPartial(object.infoByPoolType) + : undefined; + return message; + }, + fromAmino( + object: QueryGetProtoRevInfoByPoolTypeResponseAmino + ): QueryGetProtoRevInfoByPoolTypeResponse { + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); + if ( + object.info_by_pool_type !== undefined && + object.info_by_pool_type !== null + ) { + message.infoByPoolType = InfoByPoolType.fromAmino( + object.info_by_pool_type + ); + } + return message; + }, + toAmino( + message: QueryGetProtoRevInfoByPoolTypeResponse + ): QueryGetProtoRevInfoByPoolTypeResponseAmino { + const obj: any = {}; + obj.info_by_pool_type = message.infoByPoolType + ? InfoByPoolType.toAmino(message.infoByPoolType) + : undefined; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevInfoByPoolTypeResponseAminoMsg + ): QueryGetProtoRevInfoByPoolTypeResponse { + return QueryGetProtoRevInfoByPoolTypeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevInfoByPoolTypeResponse + ): QueryGetProtoRevInfoByPoolTypeResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-info-by-pool-type-response', + value: QueryGetProtoRevInfoByPoolTypeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevInfoByPoolTypeResponseProtoMsg + ): QueryGetProtoRevInfoByPoolTypeResponse { + return QueryGetProtoRevInfoByPoolTypeResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevInfoByPoolTypeResponse): Uint8Array { + return QueryGetProtoRevInfoByPoolTypeResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevInfoByPoolTypeResponse + ): QueryGetProtoRevInfoByPoolTypeResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse', + value: QueryGetProtoRevInfoByPoolTypeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevInfoByPoolTypeResponse.typeUrl, + QueryGetProtoRevInfoByPoolTypeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevInfoByPoolTypeResponse.aminoType, + QueryGetProtoRevInfoByPoolTypeResponse.typeUrl +); +function createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(): QueryGetProtoRevMaxPoolPointsPerBlockRequest { + return {}; +} +export const QueryGetProtoRevMaxPoolPointsPerBlockRequest = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockRequest', + aminoType: + 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-request', + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockRequest { + return ( + o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl + ); + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockRequestSDKType { + return ( + o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl + ); + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino { + return ( + o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl + ); + }, + encode( + _: QueryGetProtoRevMaxPoolPointsPerBlockRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevMaxPoolPointsPerBlockRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevMaxPoolPointsPerBlockRequest { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino + ): QueryGetProtoRevMaxPoolPointsPerBlockRequest { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevMaxPoolPointsPerBlockRequest + ): QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevMaxPoolPointsPerBlockRequestAminoMsg + ): QueryGetProtoRevMaxPoolPointsPerBlockRequest { + return QueryGetProtoRevMaxPoolPointsPerBlockRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevMaxPoolPointsPerBlockRequest + ): QueryGetProtoRevMaxPoolPointsPerBlockRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-request', + value: QueryGetProtoRevMaxPoolPointsPerBlockRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerBlockRequestProtoMsg + ): QueryGetProtoRevMaxPoolPointsPerBlockRequest { + return QueryGetProtoRevMaxPoolPointsPerBlockRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevMaxPoolPointsPerBlockRequest): Uint8Array { + return QueryGetProtoRevMaxPoolPointsPerBlockRequest.encode( + message + ).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerBlockRequest + ): QueryGetProtoRevMaxPoolPointsPerBlockRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockRequest', + value: + QueryGetProtoRevMaxPoolPointsPerBlockRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl, + QueryGetProtoRevMaxPoolPointsPerBlockRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevMaxPoolPointsPerBlockRequest.aminoType, + QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl +); +function createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(): QueryGetProtoRevMaxPoolPointsPerBlockResponse { + return { + maxPoolPointsPerBlock: BigInt(0), + }; +} +export const QueryGetProtoRevMaxPoolPointsPerBlockResponse = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockResponse', + aminoType: + 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-response', + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl || + typeof o.maxPoolPointsPerBlock === 'bigint') + ); + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl || + typeof o.max_pool_points_per_block === 'bigint') + ); + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl || + typeof o.max_pool_points_per_block === 'bigint') + ); + }, + encode( + message: QueryGetProtoRevMaxPoolPointsPerBlockResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.maxPoolPointsPerBlock !== BigInt(0)) { + writer.uint32(8).uint64(message.maxPoolPointsPerBlock); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevMaxPoolPointsPerBlockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxPoolPointsPerBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevMaxPoolPointsPerBlockResponse { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(); + message.maxPoolPointsPerBlock = + object.maxPoolPointsPerBlock !== undefined && + object.maxPoolPointsPerBlock !== null + ? BigInt(object.maxPoolPointsPerBlock.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino + ): QueryGetProtoRevMaxPoolPointsPerBlockResponse { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(); + if ( + object.max_pool_points_per_block !== undefined && + object.max_pool_points_per_block !== null + ) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + return message; + }, + toAmino( + message: QueryGetProtoRevMaxPoolPointsPerBlockResponse + ): QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { + const obj: any = {}; + obj.max_pool_points_per_block = + message.maxPoolPointsPerBlock !== BigInt(0) + ? message.maxPoolPointsPerBlock.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevMaxPoolPointsPerBlockResponseAminoMsg + ): QueryGetProtoRevMaxPoolPointsPerBlockResponse { + return QueryGetProtoRevMaxPoolPointsPerBlockResponse.fromAmino( + object.value + ); + }, + toAminoMsg( + message: QueryGetProtoRevMaxPoolPointsPerBlockResponse + ): QueryGetProtoRevMaxPoolPointsPerBlockResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-response', + value: QueryGetProtoRevMaxPoolPointsPerBlockResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerBlockResponseProtoMsg + ): QueryGetProtoRevMaxPoolPointsPerBlockResponse { + return QueryGetProtoRevMaxPoolPointsPerBlockResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevMaxPoolPointsPerBlockResponse): Uint8Array { + return QueryGetProtoRevMaxPoolPointsPerBlockResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerBlockResponse + ): QueryGetProtoRevMaxPoolPointsPerBlockResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockResponse', + value: + QueryGetProtoRevMaxPoolPointsPerBlockResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl, + QueryGetProtoRevMaxPoolPointsPerBlockResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevMaxPoolPointsPerBlockResponse.aminoType, + QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl +); +function createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(): QueryGetProtoRevMaxPoolPointsPerTxRequest { + return {}; +} +export const QueryGetProtoRevMaxPoolPointsPerTxRequest = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxRequest', + aminoType: + 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-request', + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxRequest { + return ( + o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl + ); + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxRequestSDKType { + return ( + o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl + ); + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxRequestAmino { + return ( + o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl + ); + }, + encode( + _: QueryGetProtoRevMaxPoolPointsPerTxRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevMaxPoolPointsPerTxRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevMaxPoolPointsPerTxRequest { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevMaxPoolPointsPerTxRequestAmino + ): QueryGetProtoRevMaxPoolPointsPerTxRequest { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevMaxPoolPointsPerTxRequest + ): QueryGetProtoRevMaxPoolPointsPerTxRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevMaxPoolPointsPerTxRequestAminoMsg + ): QueryGetProtoRevMaxPoolPointsPerTxRequest { + return QueryGetProtoRevMaxPoolPointsPerTxRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevMaxPoolPointsPerTxRequest + ): QueryGetProtoRevMaxPoolPointsPerTxRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-request', + value: QueryGetProtoRevMaxPoolPointsPerTxRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerTxRequestProtoMsg + ): QueryGetProtoRevMaxPoolPointsPerTxRequest { + return QueryGetProtoRevMaxPoolPointsPerTxRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevMaxPoolPointsPerTxRequest): Uint8Array { + return QueryGetProtoRevMaxPoolPointsPerTxRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerTxRequest + ): QueryGetProtoRevMaxPoolPointsPerTxRequestProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxRequest', + value: QueryGetProtoRevMaxPoolPointsPerTxRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl, + QueryGetProtoRevMaxPoolPointsPerTxRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevMaxPoolPointsPerTxRequest.aminoType, + QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl +); +function createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(): QueryGetProtoRevMaxPoolPointsPerTxResponse { + return { + maxPoolPointsPerTx: BigInt(0), + }; +} +export const QueryGetProtoRevMaxPoolPointsPerTxResponse = { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxResponse', + aminoType: + 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-response', + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl || + typeof o.maxPoolPointsPerTx === 'bigint') + ); + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl || + typeof o.max_pool_points_per_tx === 'bigint') + ); + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl || + typeof o.max_pool_points_per_tx === 'bigint') + ); + }, + encode( + message: QueryGetProtoRevMaxPoolPointsPerTxResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.maxPoolPointsPerTx !== BigInt(0)) { + writer.uint32(8).uint64(message.maxPoolPointsPerTx); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevMaxPoolPointsPerTxResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxPoolPointsPerTx = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevMaxPoolPointsPerTxResponse { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(); + message.maxPoolPointsPerTx = + object.maxPoolPointsPerTx !== undefined && + object.maxPoolPointsPerTx !== null + ? BigInt(object.maxPoolPointsPerTx.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: QueryGetProtoRevMaxPoolPointsPerTxResponseAmino + ): QueryGetProtoRevMaxPoolPointsPerTxResponse { + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(); + if ( + object.max_pool_points_per_tx !== undefined && + object.max_pool_points_per_tx !== null + ) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + return message; + }, + toAmino( + message: QueryGetProtoRevMaxPoolPointsPerTxResponse + ): QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { + const obj: any = {}; + obj.max_pool_points_per_tx = + message.maxPoolPointsPerTx !== BigInt(0) + ? message.maxPoolPointsPerTx.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevMaxPoolPointsPerTxResponseAminoMsg + ): QueryGetProtoRevMaxPoolPointsPerTxResponse { + return QueryGetProtoRevMaxPoolPointsPerTxResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevMaxPoolPointsPerTxResponse + ): QueryGetProtoRevMaxPoolPointsPerTxResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-response', + value: QueryGetProtoRevMaxPoolPointsPerTxResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerTxResponseProtoMsg + ): QueryGetProtoRevMaxPoolPointsPerTxResponse { + return QueryGetProtoRevMaxPoolPointsPerTxResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevMaxPoolPointsPerTxResponse): Uint8Array { + return QueryGetProtoRevMaxPoolPointsPerTxResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevMaxPoolPointsPerTxResponse + ): QueryGetProtoRevMaxPoolPointsPerTxResponseProtoMsg { + return { + typeUrl: + '/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxResponse', + value: + QueryGetProtoRevMaxPoolPointsPerTxResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl, + QueryGetProtoRevMaxPoolPointsPerTxResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevMaxPoolPointsPerTxResponse.aminoType, + QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl +); +function createBaseQueryGetProtoRevBaseDenomsRequest(): QueryGetProtoRevBaseDenomsRequest { + return {}; +} +export const QueryGetProtoRevBaseDenomsRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-base-denoms-request', + is(o: any): o is QueryGetProtoRevBaseDenomsRequest { + return o && o.$typeUrl === QueryGetProtoRevBaseDenomsRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevBaseDenomsRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevBaseDenomsRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevBaseDenomsRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevBaseDenomsRequest.typeUrl; + }, + encode( + _: QueryGetProtoRevBaseDenomsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevBaseDenomsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevBaseDenomsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevBaseDenomsRequest { + const message = createBaseQueryGetProtoRevBaseDenomsRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevBaseDenomsRequestAmino + ): QueryGetProtoRevBaseDenomsRequest { + const message = createBaseQueryGetProtoRevBaseDenomsRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevBaseDenomsRequest + ): QueryGetProtoRevBaseDenomsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevBaseDenomsRequestAminoMsg + ): QueryGetProtoRevBaseDenomsRequest { + return QueryGetProtoRevBaseDenomsRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevBaseDenomsRequest + ): QueryGetProtoRevBaseDenomsRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-base-denoms-request', + value: QueryGetProtoRevBaseDenomsRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevBaseDenomsRequestProtoMsg + ): QueryGetProtoRevBaseDenomsRequest { + return QueryGetProtoRevBaseDenomsRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevBaseDenomsRequest): Uint8Array { + return QueryGetProtoRevBaseDenomsRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevBaseDenomsRequest + ): QueryGetProtoRevBaseDenomsRequestProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsRequest', + value: QueryGetProtoRevBaseDenomsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevBaseDenomsRequest.typeUrl, + QueryGetProtoRevBaseDenomsRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevBaseDenomsRequest.aminoType, + QueryGetProtoRevBaseDenomsRequest.typeUrl +); +function createBaseQueryGetProtoRevBaseDenomsResponse(): QueryGetProtoRevBaseDenomsResponse { + return { + baseDenoms: [], + }; +} +export const QueryGetProtoRevBaseDenomsResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-base-denoms-response', + is(o: any): o is QueryGetProtoRevBaseDenomsResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevBaseDenomsResponse.typeUrl || + (Array.isArray(o.baseDenoms) && + (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0])))) + ); + }, + isSDK(o: any): o is QueryGetProtoRevBaseDenomsResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevBaseDenomsResponse.typeUrl || + (Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0])))) + ); + }, + isAmino(o: any): o is QueryGetProtoRevBaseDenomsResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevBaseDenomsResponse.typeUrl || + (Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0])))) + ); + }, + encode( + message: QueryGetProtoRevBaseDenomsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.baseDenoms) { + BaseDenom.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevBaseDenomsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevBaseDenomsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseDenoms.push(BaseDenom.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevBaseDenomsResponse { + const message = createBaseQueryGetProtoRevBaseDenomsResponse(); + message.baseDenoms = + object.baseDenoms?.map((e) => BaseDenom.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: QueryGetProtoRevBaseDenomsResponseAmino + ): QueryGetProtoRevBaseDenomsResponse { + const message = createBaseQueryGetProtoRevBaseDenomsResponse(); + message.baseDenoms = + object.base_denoms?.map((e) => BaseDenom.fromAmino(e)) || []; + return message; + }, + toAmino( + message: QueryGetProtoRevBaseDenomsResponse + ): QueryGetProtoRevBaseDenomsResponseAmino { + const obj: any = {}; + if (message.baseDenoms) { + obj.base_denoms = message.baseDenoms.map((e) => + e ? BaseDenom.toAmino(e) : undefined + ); + } else { + obj.base_denoms = message.baseDenoms; + } + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevBaseDenomsResponseAminoMsg + ): QueryGetProtoRevBaseDenomsResponse { + return QueryGetProtoRevBaseDenomsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevBaseDenomsResponse + ): QueryGetProtoRevBaseDenomsResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-base-denoms-response', + value: QueryGetProtoRevBaseDenomsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevBaseDenomsResponseProtoMsg + ): QueryGetProtoRevBaseDenomsResponse { + return QueryGetProtoRevBaseDenomsResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevBaseDenomsResponse): Uint8Array { + return QueryGetProtoRevBaseDenomsResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevBaseDenomsResponse + ): QueryGetProtoRevBaseDenomsResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsResponse', + value: QueryGetProtoRevBaseDenomsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevBaseDenomsResponse.typeUrl, + QueryGetProtoRevBaseDenomsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevBaseDenomsResponse.aminoType, + QueryGetProtoRevBaseDenomsResponse.typeUrl +); +function createBaseQueryGetProtoRevEnabledRequest(): QueryGetProtoRevEnabledRequest { + return {}; +} +export const QueryGetProtoRevEnabledRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-enabled-request', + is(o: any): o is QueryGetProtoRevEnabledRequest { + return o && o.$typeUrl === QueryGetProtoRevEnabledRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevEnabledRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevEnabledRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevEnabledRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevEnabledRequest.typeUrl; + }, + encode( + _: QueryGetProtoRevEnabledRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevEnabledRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevEnabledRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetProtoRevEnabledRequest { + const message = createBaseQueryGetProtoRevEnabledRequest(); + return message; + }, + fromAmino( + _: QueryGetProtoRevEnabledRequestAmino + ): QueryGetProtoRevEnabledRequest { + const message = createBaseQueryGetProtoRevEnabledRequest(); + return message; + }, + toAmino( + _: QueryGetProtoRevEnabledRequest + ): QueryGetProtoRevEnabledRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevEnabledRequestAminoMsg + ): QueryGetProtoRevEnabledRequest { + return QueryGetProtoRevEnabledRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevEnabledRequest + ): QueryGetProtoRevEnabledRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-enabled-request', + value: QueryGetProtoRevEnabledRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevEnabledRequestProtoMsg + ): QueryGetProtoRevEnabledRequest { + return QueryGetProtoRevEnabledRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevEnabledRequest): Uint8Array { + return QueryGetProtoRevEnabledRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevEnabledRequest + ): QueryGetProtoRevEnabledRequestProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledRequest', + value: QueryGetProtoRevEnabledRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevEnabledRequest.typeUrl, + QueryGetProtoRevEnabledRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevEnabledRequest.aminoType, + QueryGetProtoRevEnabledRequest.typeUrl +); +function createBaseQueryGetProtoRevEnabledResponse(): QueryGetProtoRevEnabledResponse { + return { + enabled: false, + }; +} +export const QueryGetProtoRevEnabledResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-enabled-response', + is(o: any): o is QueryGetProtoRevEnabledResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevEnabledResponse.typeUrl || + typeof o.enabled === 'boolean') + ); + }, + isSDK(o: any): o is QueryGetProtoRevEnabledResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevEnabledResponse.typeUrl || + typeof o.enabled === 'boolean') + ); + }, + isAmino(o: any): o is QueryGetProtoRevEnabledResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevEnabledResponse.typeUrl || + typeof o.enabled === 'boolean') + ); + }, + encode( + message: QueryGetProtoRevEnabledResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevEnabledResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevEnabledResponse { + const message = createBaseQueryGetProtoRevEnabledResponse(); + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino( + object: QueryGetProtoRevEnabledResponseAmino + ): QueryGetProtoRevEnabledResponse { + const message = createBaseQueryGetProtoRevEnabledResponse(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino( + message: QueryGetProtoRevEnabledResponse + ): QueryGetProtoRevEnabledResponseAmino { + const obj: any = {}; + obj.enabled = message.enabled === false ? undefined : message.enabled; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevEnabledResponseAminoMsg + ): QueryGetProtoRevEnabledResponse { + return QueryGetProtoRevEnabledResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevEnabledResponse + ): QueryGetProtoRevEnabledResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-enabled-response', + value: QueryGetProtoRevEnabledResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevEnabledResponseProtoMsg + ): QueryGetProtoRevEnabledResponse { + return QueryGetProtoRevEnabledResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevEnabledResponse): Uint8Array { + return QueryGetProtoRevEnabledResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevEnabledResponse + ): QueryGetProtoRevEnabledResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledResponse', + value: QueryGetProtoRevEnabledResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevEnabledResponse.typeUrl, + QueryGetProtoRevEnabledResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevEnabledResponse.aminoType, + QueryGetProtoRevEnabledResponse.typeUrl +); +function createBaseQueryGetProtoRevPoolRequest(): QueryGetProtoRevPoolRequest { + return { + baseDenom: '', + otherDenom: '', + }; +} +export const QueryGetProtoRevPoolRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevPoolRequest', + aminoType: 'osmosis/protorev/query-get-proto-rev-pool-request', + is(o: any): o is QueryGetProtoRevPoolRequest { + return ( + o && + (o.$typeUrl === QueryGetProtoRevPoolRequest.typeUrl || + (typeof o.baseDenom === 'string' && typeof o.otherDenom === 'string')) + ); + }, + isSDK(o: any): o is QueryGetProtoRevPoolRequestSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevPoolRequest.typeUrl || + (typeof o.base_denom === 'string' && typeof o.other_denom === 'string')) + ); + }, + isAmino(o: any): o is QueryGetProtoRevPoolRequestAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevPoolRequest.typeUrl || + (typeof o.base_denom === 'string' && typeof o.other_denom === 'string')) + ); + }, + encode( + message: QueryGetProtoRevPoolRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.baseDenom !== '') { + writer.uint32(10).string(message.baseDenom); + } + if (message.otherDenom !== '') { + writer.uint32(18).string(message.otherDenom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevPoolRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseDenom = reader.string(); + break; + case 2: + message.otherDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevPoolRequest { + const message = createBaseQueryGetProtoRevPoolRequest(); + message.baseDenom = object.baseDenom ?? ''; + message.otherDenom = object.otherDenom ?? ''; + return message; + }, + fromAmino( + object: QueryGetProtoRevPoolRequestAmino + ): QueryGetProtoRevPoolRequest { + const message = createBaseQueryGetProtoRevPoolRequest(); + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.other_denom !== undefined && object.other_denom !== null) { + message.otherDenom = object.other_denom; + } + return message; + }, + toAmino( + message: QueryGetProtoRevPoolRequest + ): QueryGetProtoRevPoolRequestAmino { + const obj: any = {}; + obj.base_denom = message.baseDenom === '' ? undefined : message.baseDenom; + obj.other_denom = + message.otherDenom === '' ? undefined : message.otherDenom; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevPoolRequestAminoMsg + ): QueryGetProtoRevPoolRequest { + return QueryGetProtoRevPoolRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevPoolRequest + ): QueryGetProtoRevPoolRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-pool-request', + value: QueryGetProtoRevPoolRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevPoolRequestProtoMsg + ): QueryGetProtoRevPoolRequest { + return QueryGetProtoRevPoolRequest.decode(message.value); + }, + toProto(message: QueryGetProtoRevPoolRequest): Uint8Array { + return QueryGetProtoRevPoolRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevPoolRequest + ): QueryGetProtoRevPoolRequestProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevPoolRequest', + value: QueryGetProtoRevPoolRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevPoolRequest.typeUrl, + QueryGetProtoRevPoolRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevPoolRequest.aminoType, + QueryGetProtoRevPoolRequest.typeUrl +); +function createBaseQueryGetProtoRevPoolResponse(): QueryGetProtoRevPoolResponse { + return { + poolId: BigInt(0), + }; +} +export const QueryGetProtoRevPoolResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevPoolResponse', + aminoType: 'osmosis/protorev/query-get-proto-rev-pool-response', + is(o: any): o is QueryGetProtoRevPoolResponse { + return ( + o && + (o.$typeUrl === QueryGetProtoRevPoolResponse.typeUrl || + typeof o.poolId === 'bigint') + ); + }, + isSDK(o: any): o is QueryGetProtoRevPoolResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetProtoRevPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + isAmino(o: any): o is QueryGetProtoRevPoolResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetProtoRevPoolResponse.typeUrl || + typeof o.pool_id === 'bigint') + ); + }, + encode( + message: QueryGetProtoRevPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetProtoRevPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetProtoRevPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetProtoRevPoolResponse { + const message = createBaseQueryGetProtoRevPoolResponse(); + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: QueryGetProtoRevPoolResponseAmino + ): QueryGetProtoRevPoolResponse { + const message = createBaseQueryGetProtoRevPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino( + message: QueryGetProtoRevPoolResponse + ): QueryGetProtoRevPoolResponseAmino { + const obj: any = {}; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: QueryGetProtoRevPoolResponseAminoMsg + ): QueryGetProtoRevPoolResponse { + return QueryGetProtoRevPoolResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetProtoRevPoolResponse + ): QueryGetProtoRevPoolResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-proto-rev-pool-response', + value: QueryGetProtoRevPoolResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetProtoRevPoolResponseProtoMsg + ): QueryGetProtoRevPoolResponse { + return QueryGetProtoRevPoolResponse.decode(message.value); + }, + toProto(message: QueryGetProtoRevPoolResponse): Uint8Array { + return QueryGetProtoRevPoolResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetProtoRevPoolResponse + ): QueryGetProtoRevPoolResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetProtoRevPoolResponse', + value: QueryGetProtoRevPoolResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetProtoRevPoolResponse.typeUrl, + QueryGetProtoRevPoolResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetProtoRevPoolResponse.aminoType, + QueryGetProtoRevPoolResponse.typeUrl +); +function createBaseQueryGetAllProtocolRevenueRequest(): QueryGetAllProtocolRevenueRequest { + return {}; +} +export const QueryGetAllProtocolRevenueRequest = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest', + aminoType: 'osmosis/protorev/query-get-all-protocol-revenue-request', + is(o: any): o is QueryGetAllProtocolRevenueRequest { + return o && o.$typeUrl === QueryGetAllProtocolRevenueRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetAllProtocolRevenueRequestSDKType { + return o && o.$typeUrl === QueryGetAllProtocolRevenueRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetAllProtocolRevenueRequestAmino { + return o && o.$typeUrl === QueryGetAllProtocolRevenueRequest.typeUrl; + }, + encode( + _: QueryGetAllProtocolRevenueRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetAllProtocolRevenueRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetAllProtocolRevenueRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryGetAllProtocolRevenueRequest { + const message = createBaseQueryGetAllProtocolRevenueRequest(); + return message; + }, + fromAmino( + _: QueryGetAllProtocolRevenueRequestAmino + ): QueryGetAllProtocolRevenueRequest { + const message = createBaseQueryGetAllProtocolRevenueRequest(); + return message; + }, + toAmino( + _: QueryGetAllProtocolRevenueRequest + ): QueryGetAllProtocolRevenueRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryGetAllProtocolRevenueRequestAminoMsg + ): QueryGetAllProtocolRevenueRequest { + return QueryGetAllProtocolRevenueRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetAllProtocolRevenueRequest + ): QueryGetAllProtocolRevenueRequestAminoMsg { + return { + type: 'osmosis/protorev/query-get-all-protocol-revenue-request', + value: QueryGetAllProtocolRevenueRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetAllProtocolRevenueRequestProtoMsg + ): QueryGetAllProtocolRevenueRequest { + return QueryGetAllProtocolRevenueRequest.decode(message.value); + }, + toProto(message: QueryGetAllProtocolRevenueRequest): Uint8Array { + return QueryGetAllProtocolRevenueRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetAllProtocolRevenueRequest + ): QueryGetAllProtocolRevenueRequestProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest', + value: QueryGetAllProtocolRevenueRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetAllProtocolRevenueRequest.typeUrl, + QueryGetAllProtocolRevenueRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetAllProtocolRevenueRequest.aminoType, + QueryGetAllProtocolRevenueRequest.typeUrl +); +function createBaseQueryGetAllProtocolRevenueResponse(): QueryGetAllProtocolRevenueResponse { + return { + allProtocolRevenue: AllProtocolRevenue.fromPartial({}), + }; +} +export const QueryGetAllProtocolRevenueResponse = { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse', + aminoType: 'osmosis/protorev/query-get-all-protocol-revenue-response', + is(o: any): o is QueryGetAllProtocolRevenueResponse { + return ( + o && + (o.$typeUrl === QueryGetAllProtocolRevenueResponse.typeUrl || + AllProtocolRevenue.is(o.allProtocolRevenue)) + ); + }, + isSDK(o: any): o is QueryGetAllProtocolRevenueResponseSDKType { + return ( + o && + (o.$typeUrl === QueryGetAllProtocolRevenueResponse.typeUrl || + AllProtocolRevenue.isSDK(o.all_protocol_revenue)) + ); + }, + isAmino(o: any): o is QueryGetAllProtocolRevenueResponseAmino { + return ( + o && + (o.$typeUrl === QueryGetAllProtocolRevenueResponse.typeUrl || + AllProtocolRevenue.isAmino(o.all_protocol_revenue)) + ); + }, + encode( + message: QueryGetAllProtocolRevenueResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.allProtocolRevenue !== undefined) { + AllProtocolRevenue.encode( + message.allProtocolRevenue, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryGetAllProtocolRevenueResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetAllProtocolRevenueResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allProtocolRevenue = AllProtocolRevenue.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryGetAllProtocolRevenueResponse { + const message = createBaseQueryGetAllProtocolRevenueResponse(); + message.allProtocolRevenue = + object.allProtocolRevenue !== undefined && + object.allProtocolRevenue !== null + ? AllProtocolRevenue.fromPartial(object.allProtocolRevenue) + : undefined; + return message; + }, + fromAmino( + object: QueryGetAllProtocolRevenueResponseAmino + ): QueryGetAllProtocolRevenueResponse { + const message = createBaseQueryGetAllProtocolRevenueResponse(); + if ( + object.all_protocol_revenue !== undefined && + object.all_protocol_revenue !== null + ) { + message.allProtocolRevenue = AllProtocolRevenue.fromAmino( + object.all_protocol_revenue + ); + } + return message; + }, + toAmino( + message: QueryGetAllProtocolRevenueResponse + ): QueryGetAllProtocolRevenueResponseAmino { + const obj: any = {}; + obj.all_protocol_revenue = message.allProtocolRevenue + ? AllProtocolRevenue.toAmino(message.allProtocolRevenue) + : undefined; + return obj; + }, + fromAminoMsg( + object: QueryGetAllProtocolRevenueResponseAminoMsg + ): QueryGetAllProtocolRevenueResponse { + return QueryGetAllProtocolRevenueResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryGetAllProtocolRevenueResponse + ): QueryGetAllProtocolRevenueResponseAminoMsg { + return { + type: 'osmosis/protorev/query-get-all-protocol-revenue-response', + value: QueryGetAllProtocolRevenueResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryGetAllProtocolRevenueResponseProtoMsg + ): QueryGetAllProtocolRevenueResponse { + return QueryGetAllProtocolRevenueResponse.decode(message.value); + }, + toProto(message: QueryGetAllProtocolRevenueResponse): Uint8Array { + return QueryGetAllProtocolRevenueResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryGetAllProtocolRevenueResponse + ): QueryGetAllProtocolRevenueResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse', + value: QueryGetAllProtocolRevenueResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryGetAllProtocolRevenueResponse.typeUrl, + QueryGetAllProtocolRevenueResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryGetAllProtocolRevenueResponse.aminoType, + QueryGetAllProtocolRevenueResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.amino.ts new file mode 100644 index 00000000..d23ad699 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.amino.ts @@ -0,0 +1,41 @@ +//@ts-nocheck +import { + MsgSetHotRoutes, + MsgSetDeveloperAccount, + MsgSetMaxPoolPointsPerTx, + MsgSetMaxPoolPointsPerBlock, + MsgSetInfoByPoolType, + MsgSetBaseDenoms, +} from './tx'; +export const AminoConverter = { + '/osmosis.protorev.v1beta1.MsgSetHotRoutes': { + aminoType: 'osmosis/MsgSetHotRoutes', + toAmino: MsgSetHotRoutes.toAmino, + fromAmino: MsgSetHotRoutes.fromAmino, + }, + '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount': { + aminoType: 'osmosis/MsgSetDeveloperAccount', + toAmino: MsgSetDeveloperAccount.toAmino, + fromAmino: MsgSetDeveloperAccount.fromAmino, + }, + '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx': { + aminoType: 'osmosis/MsgSetMaxPoolPointsPerTx', + toAmino: MsgSetMaxPoolPointsPerTx.toAmino, + fromAmino: MsgSetMaxPoolPointsPerTx.fromAmino, + }, + '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock': { + aminoType: 'osmosis/MsgSetPoolWeights', + toAmino: MsgSetMaxPoolPointsPerBlock.toAmino, + fromAmino: MsgSetMaxPoolPointsPerBlock.fromAmino, + }, + '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType': { + aminoType: 'osmosis/MsgSetInfoByPoolType', + toAmino: MsgSetInfoByPoolType.toAmino, + fromAmino: MsgSetInfoByPoolType.fromAmino, + }, + '/osmosis.protorev.v1beta1.MsgSetBaseDenoms': { + aminoType: 'osmosis/MsgSetBaseDenoms', + toAmino: MsgSetBaseDenoms.toAmino, + fromAmino: MsgSetBaseDenoms.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.registry.ts new file mode 100644 index 00000000..a8081b5d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.registry.ts @@ -0,0 +1,146 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgSetHotRoutes, + MsgSetDeveloperAccount, + MsgSetMaxPoolPointsPerTx, + MsgSetMaxPoolPointsPerBlock, + MsgSetInfoByPoolType, + MsgSetBaseDenoms, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.protorev.v1beta1.MsgSetHotRoutes', MsgSetHotRoutes], + ['/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', MsgSetDeveloperAccount], + [ + '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + MsgSetMaxPoolPointsPerTx, + ], + [ + '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + MsgSetMaxPoolPointsPerBlock, + ], + ['/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', MsgSetInfoByPoolType], + ['/osmosis.protorev.v1beta1.MsgSetBaseDenoms', MsgSetBaseDenoms], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setHotRoutes(value: MsgSetHotRoutes) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value: MsgSetHotRoutes.encode(value).finish(), + }; + }, + setDeveloperAccount(value: MsgSetDeveloperAccount) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.encode(value).finish(), + }; + }, + setMaxPoolPointsPerTx(value: MsgSetMaxPoolPointsPerTx) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.encode(value).finish(), + }; + }, + setMaxPoolPointsPerBlock(value: MsgSetMaxPoolPointsPerBlock) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value: MsgSetMaxPoolPointsPerBlock.encode(value).finish(), + }; + }, + setInfoByPoolType(value: MsgSetInfoByPoolType) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.encode(value).finish(), + }; + }, + setBaseDenoms(value: MsgSetBaseDenoms) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value: MsgSetBaseDenoms.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + setHotRoutes(value: MsgSetHotRoutes) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value, + }; + }, + setDeveloperAccount(value: MsgSetDeveloperAccount) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value, + }; + }, + setMaxPoolPointsPerTx(value: MsgSetMaxPoolPointsPerTx) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value, + }; + }, + setMaxPoolPointsPerBlock(value: MsgSetMaxPoolPointsPerBlock) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value, + }; + }, + setInfoByPoolType(value: MsgSetInfoByPoolType) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value, + }; + }, + setBaseDenoms(value: MsgSetBaseDenoms) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value, + }; + }, + }, + fromPartial: { + setHotRoutes(value: MsgSetHotRoutes) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value: MsgSetHotRoutes.fromPartial(value), + }; + }, + setDeveloperAccount(value: MsgSetDeveloperAccount) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.fromPartial(value), + }; + }, + setMaxPoolPointsPerTx(value: MsgSetMaxPoolPointsPerTx) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.fromPartial(value), + }; + }, + setMaxPoolPointsPerBlock(value: MsgSetMaxPoolPointsPerBlock) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value: MsgSetMaxPoolPointsPerBlock.fromPartial(value), + }; + }, + setInfoByPoolType(value: MsgSetInfoByPoolType) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.fromPartial(value), + }; + }, + setBaseDenoms(value: MsgSetBaseDenoms) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value: MsgSetBaseDenoms.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..805c9ef5 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,147 @@ +//@ts-nocheck +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; + +import { + MsgSetHotRoutes, + MsgSetHotRoutesResponse, + MsgSetDeveloperAccount, + MsgSetDeveloperAccountResponse, + MsgSetMaxPoolPointsPerTx, + MsgSetMaxPoolPointsPerTxResponse, + MsgSetMaxPoolPointsPerBlock, + MsgSetMaxPoolPointsPerBlockResponse, + MsgSetInfoByPoolType, + MsgSetInfoByPoolTypeResponse, + MsgSetBaseDenoms, + MsgSetBaseDenomsResponse, +} from './tx'; +export interface Msg { + /** + * SetHotRoutes sets the hot routes that will be explored when creating + * cyclic arbitrage routes. Can only be called by the admin account. + */ + setHotRoutes(request: MsgSetHotRoutes): Promise; + /** + * SetDeveloperAccount sets the account that can withdraw a portion of the + * profits from the protorev module. This will be Skip's address. + */ + setDeveloperAccount( + request: MsgSetDeveloperAccount + ): Promise; + /** + * SetMaxPoolPointsPerTx sets the maximum number of pool points that can be + * consumed per transaction. Can only be called by the admin account. + */ + setMaxPoolPointsPerTx( + request: MsgSetMaxPoolPointsPerTx + ): Promise; + /** + * SetMaxPoolPointsPerBlock sets the maximum number of pool points that can be + * consumed per block. Can only be called by the admin account. + */ + setMaxPoolPointsPerBlock( + request: MsgSetMaxPoolPointsPerBlock + ): Promise; + /** + * SetInfoByPoolType sets the pool type information needed to make smart + * assumptions about swapping on different pool types + */ + setInfoByPoolType( + request: MsgSetInfoByPoolType + ): Promise; + /** + * SetBaseDenoms sets the base denoms that will be used to create cyclic + * arbitrage routes. Can only be called by the admin account. + */ + setBaseDenoms(request: MsgSetBaseDenoms): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setHotRoutes = this.setHotRoutes.bind(this); + this.setDeveloperAccount = this.setDeveloperAccount.bind(this); + this.setMaxPoolPointsPerTx = this.setMaxPoolPointsPerTx.bind(this); + this.setMaxPoolPointsPerBlock = this.setMaxPoolPointsPerBlock.bind(this); + this.setInfoByPoolType = this.setInfoByPoolType.bind(this); + this.setBaseDenoms = this.setBaseDenoms.bind(this); + } + setHotRoutes(request: MsgSetHotRoutes): Promise { + const data = MsgSetHotRoutes.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Msg', + 'SetHotRoutes', + data + ); + return promise.then((data) => + MsgSetHotRoutesResponse.decode(new BinaryReader(data)) + ); + } + setDeveloperAccount( + request: MsgSetDeveloperAccount + ): Promise { + const data = MsgSetDeveloperAccount.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Msg', + 'SetDeveloperAccount', + data + ); + return promise.then((data) => + MsgSetDeveloperAccountResponse.decode(new BinaryReader(data)) + ); + } + setMaxPoolPointsPerTx( + request: MsgSetMaxPoolPointsPerTx + ): Promise { + const data = MsgSetMaxPoolPointsPerTx.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Msg', + 'SetMaxPoolPointsPerTx', + data + ); + return promise.then((data) => + MsgSetMaxPoolPointsPerTxResponse.decode(new BinaryReader(data)) + ); + } + setMaxPoolPointsPerBlock( + request: MsgSetMaxPoolPointsPerBlock + ): Promise { + const data = MsgSetMaxPoolPointsPerBlock.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Msg', + 'SetMaxPoolPointsPerBlock', + data + ); + return promise.then((data) => + MsgSetMaxPoolPointsPerBlockResponse.decode(new BinaryReader(data)) + ); + } + setInfoByPoolType( + request: MsgSetInfoByPoolType + ): Promise { + const data = MsgSetInfoByPoolType.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Msg', + 'SetInfoByPoolType', + data + ); + return promise.then((data) => + MsgSetInfoByPoolTypeResponse.decode(new BinaryReader(data)) + ); + } + setBaseDenoms(request: MsgSetBaseDenoms): Promise { + const data = MsgSetBaseDenoms.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.protorev.v1beta1.Msg', + 'SetBaseDenoms', + data + ); + return promise.then((data) => + MsgSetBaseDenomsResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.ts new file mode 100644 index 00000000..745ad862 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/protorev/v1beta1/tx.ts @@ -0,0 +1,1676 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + TokenPairArbRoutes, + TokenPairArbRoutesAmino, + TokenPairArbRoutesSDKType, + InfoByPoolType, + InfoByPoolTypeAmino, + InfoByPoolTypeSDKType, + BaseDenom, + BaseDenomAmino, + BaseDenomSDKType, +} from './protorev'; +/** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ +export interface MsgSetHotRoutes { + /** admin is the account that is authorized to set the hot routes. */ + admin: string; + /** hot_routes is the list of hot routes to set. */ + hotRoutes: TokenPairArbRoutes[]; +} +export interface MsgSetHotRoutesProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes'; + value: Uint8Array; +} +/** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ +export interface MsgSetHotRoutesAmino { + /** admin is the account that is authorized to set the hot routes. */ + admin?: string; + /** hot_routes is the list of hot routes to set. */ + hot_routes?: TokenPairArbRoutesAmino[]; +} +export interface MsgSetHotRoutesAminoMsg { + type: 'osmosis/MsgSetHotRoutes'; + value: MsgSetHotRoutesAmino; +} +/** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ +export interface MsgSetHotRoutesSDKType { + admin: string; + hot_routes: TokenPairArbRoutesSDKType[]; +} +/** MsgSetHotRoutesResponse defines the Msg/SetHotRoutes response type. */ +export interface MsgSetHotRoutesResponse {} +export interface MsgSetHotRoutesResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutesResponse'; + value: Uint8Array; +} +/** MsgSetHotRoutesResponse defines the Msg/SetHotRoutes response type. */ +export interface MsgSetHotRoutesResponseAmino {} +export interface MsgSetHotRoutesResponseAminoMsg { + type: 'osmosis/protorev/set-hot-routes-response'; + value: MsgSetHotRoutesResponseAmino; +} +/** MsgSetHotRoutesResponse defines the Msg/SetHotRoutes response type. */ +export interface MsgSetHotRoutesResponseSDKType {} +/** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ +export interface MsgSetDeveloperAccount { + /** admin is the account that is authorized to set the developer account. */ + admin: string; + /** + * developer_account is the account that will receive a portion of the profits + * from the protorev module. + */ + developerAccount: string; +} +export interface MsgSetDeveloperAccountProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount'; + value: Uint8Array; +} +/** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ +export interface MsgSetDeveloperAccountAmino { + /** admin is the account that is authorized to set the developer account. */ + admin?: string; + /** + * developer_account is the account that will receive a portion of the profits + * from the protorev module. + */ + developer_account?: string; +} +export interface MsgSetDeveloperAccountAminoMsg { + type: 'osmosis/MsgSetDeveloperAccount'; + value: MsgSetDeveloperAccountAmino; +} +/** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ +export interface MsgSetDeveloperAccountSDKType { + admin: string; + developer_account: string; +} +/** + * MsgSetDeveloperAccountResponse defines the Msg/SetDeveloperAccount response + * type. + */ +export interface MsgSetDeveloperAccountResponse {} +export interface MsgSetDeveloperAccountResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccountResponse'; + value: Uint8Array; +} +/** + * MsgSetDeveloperAccountResponse defines the Msg/SetDeveloperAccount response + * type. + */ +export interface MsgSetDeveloperAccountResponseAmino {} +export interface MsgSetDeveloperAccountResponseAminoMsg { + type: 'osmosis/protorev/set-developer-account-response'; + value: MsgSetDeveloperAccountResponseAmino; +} +/** + * MsgSetDeveloperAccountResponse defines the Msg/SetDeveloperAccount response + * type. + */ +export interface MsgSetDeveloperAccountResponseSDKType {} +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolType { + /** admin is the account that is authorized to set the pool weights. */ + admin: string; + /** info_by_pool_type contains information about the pool types. */ + infoByPoolType: InfoByPoolType; +} +export interface MsgSetInfoByPoolTypeProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType'; + value: Uint8Array; +} +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeAmino { + /** admin is the account that is authorized to set the pool weights. */ + admin?: string; + /** info_by_pool_type contains information about the pool types. */ + info_by_pool_type?: InfoByPoolTypeAmino; +} +export interface MsgSetInfoByPoolTypeAminoMsg { + type: 'osmosis/MsgSetInfoByPoolType'; + value: MsgSetInfoByPoolTypeAmino; +} +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeSDKType { + admin: string; + info_by_pool_type: InfoByPoolTypeSDKType; +} +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponse {} +export interface MsgSetInfoByPoolTypeResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse'; + value: Uint8Array; +} +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponseAmino {} +export interface MsgSetInfoByPoolTypeResponseAminoMsg { + type: 'osmosis/protorev/set-info-by-pool-type-response'; + value: MsgSetInfoByPoolTypeResponseAmino; +} +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponseSDKType {} +/** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ +export interface MsgSetMaxPoolPointsPerTx { + /** admin is the account that is authorized to set the max pool points per tx. */ + admin: string; + /** + * max_pool_points_per_tx is the maximum number of pool points that can be + * consumed per transaction. + */ + maxPoolPointsPerTx: bigint; +} +export interface MsgSetMaxPoolPointsPerTxProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx'; + value: Uint8Array; +} +/** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ +export interface MsgSetMaxPoolPointsPerTxAmino { + /** admin is the account that is authorized to set the max pool points per tx. */ + admin?: string; + /** + * max_pool_points_per_tx is the maximum number of pool points that can be + * consumed per transaction. + */ + max_pool_points_per_tx?: string; +} +export interface MsgSetMaxPoolPointsPerTxAminoMsg { + type: 'osmosis/MsgSetMaxPoolPointsPerTx'; + value: MsgSetMaxPoolPointsPerTxAmino; +} +/** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ +export interface MsgSetMaxPoolPointsPerTxSDKType { + admin: string; + max_pool_points_per_tx: bigint; +} +/** + * MsgSetMaxPoolPointsPerTxResponse defines the Msg/SetMaxPoolPointsPerTx + * response type. + */ +export interface MsgSetMaxPoolPointsPerTxResponse {} +export interface MsgSetMaxPoolPointsPerTxResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTxResponse'; + value: Uint8Array; +} +/** + * MsgSetMaxPoolPointsPerTxResponse defines the Msg/SetMaxPoolPointsPerTx + * response type. + */ +export interface MsgSetMaxPoolPointsPerTxResponseAmino {} +export interface MsgSetMaxPoolPointsPerTxResponseAminoMsg { + type: 'osmosis/protorev/set-max-pool-points-per-tx-response'; + value: MsgSetMaxPoolPointsPerTxResponseAmino; +} +/** + * MsgSetMaxPoolPointsPerTxResponse defines the Msg/SetMaxPoolPointsPerTx + * response type. + */ +export interface MsgSetMaxPoolPointsPerTxResponseSDKType {} +/** + * MsgSetMaxPoolPointsPerBlock defines the Msg/SetMaxPoolPointsPerBlock request + * type. + */ +export interface MsgSetMaxPoolPointsPerBlock { + /** + * admin is the account that is authorized to set the max pool points per + * block. + */ + admin: string; + /** + * max_pool_points_per_block is the maximum number of pool points that can be + * consumed per block. + */ + maxPoolPointsPerBlock: bigint; +} +export interface MsgSetMaxPoolPointsPerBlockProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock'; + value: Uint8Array; +} +/** + * MsgSetMaxPoolPointsPerBlock defines the Msg/SetMaxPoolPointsPerBlock request + * type. + */ +export interface MsgSetMaxPoolPointsPerBlockAmino { + /** + * admin is the account that is authorized to set the max pool points per + * block. + */ + admin?: string; + /** + * max_pool_points_per_block is the maximum number of pool points that can be + * consumed per block. + */ + max_pool_points_per_block?: string; +} +export interface MsgSetMaxPoolPointsPerBlockAminoMsg { + type: 'osmosis/MsgSetPoolWeights'; + value: MsgSetMaxPoolPointsPerBlockAmino; +} +/** + * MsgSetMaxPoolPointsPerBlock defines the Msg/SetMaxPoolPointsPerBlock request + * type. + */ +export interface MsgSetMaxPoolPointsPerBlockSDKType { + admin: string; + max_pool_points_per_block: bigint; +} +/** + * MsgSetMaxPoolPointsPerBlockResponse defines the + * Msg/SetMaxPoolPointsPerBlock response type. + */ +export interface MsgSetMaxPoolPointsPerBlockResponse {} +export interface MsgSetMaxPoolPointsPerBlockResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlockResponse'; + value: Uint8Array; +} +/** + * MsgSetMaxPoolPointsPerBlockResponse defines the + * Msg/SetMaxPoolPointsPerBlock response type. + */ +export interface MsgSetMaxPoolPointsPerBlockResponseAmino {} +export interface MsgSetMaxPoolPointsPerBlockResponseAminoMsg { + type: 'osmosis/protorev/set-max-pool-points-per-block-response'; + value: MsgSetMaxPoolPointsPerBlockResponseAmino; +} +/** + * MsgSetMaxPoolPointsPerBlockResponse defines the + * Msg/SetMaxPoolPointsPerBlock response type. + */ +export interface MsgSetMaxPoolPointsPerBlockResponseSDKType {} +/** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ +export interface MsgSetBaseDenoms { + /** admin is the account that is authorized to set the base denoms. */ + admin: string; + /** base_denoms is the list of base denoms to set. */ + baseDenoms: BaseDenom[]; +} +export interface MsgSetBaseDenomsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms'; + value: Uint8Array; +} +/** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ +export interface MsgSetBaseDenomsAmino { + /** admin is the account that is authorized to set the base denoms. */ + admin?: string; + /** base_denoms is the list of base denoms to set. */ + base_denoms?: BaseDenomAmino[]; +} +export interface MsgSetBaseDenomsAminoMsg { + type: 'osmosis/MsgSetBaseDenoms'; + value: MsgSetBaseDenomsAmino; +} +/** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ +export interface MsgSetBaseDenomsSDKType { + admin: string; + base_denoms: BaseDenomSDKType[]; +} +/** MsgSetBaseDenomsResponse defines the Msg/SetBaseDenoms response type. */ +export interface MsgSetBaseDenomsResponse {} +export interface MsgSetBaseDenomsResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenomsResponse'; + value: Uint8Array; +} +/** MsgSetBaseDenomsResponse defines the Msg/SetBaseDenoms response type. */ +export interface MsgSetBaseDenomsResponseAmino {} +export interface MsgSetBaseDenomsResponseAminoMsg { + type: 'osmosis/protorev/set-base-denoms-response'; + value: MsgSetBaseDenomsResponseAmino; +} +/** MsgSetBaseDenomsResponse defines the Msg/SetBaseDenoms response type. */ +export interface MsgSetBaseDenomsResponseSDKType {} +function createBaseMsgSetHotRoutes(): MsgSetHotRoutes { + return { + admin: '', + hotRoutes: [], + }; +} +export const MsgSetHotRoutes = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + aminoType: 'osmosis/MsgSetHotRoutes', + is(o: any): o is MsgSetHotRoutes { + return ( + o && + (o.$typeUrl === MsgSetHotRoutes.typeUrl || + (typeof o.admin === 'string' && + Array.isArray(o.hotRoutes) && + (!o.hotRoutes.length || TokenPairArbRoutes.is(o.hotRoutes[0])))) + ); + }, + isSDK(o: any): o is MsgSetHotRoutesSDKType { + return ( + o && + (o.$typeUrl === MsgSetHotRoutes.typeUrl || + (typeof o.admin === 'string' && + Array.isArray(o.hot_routes) && + (!o.hot_routes.length || TokenPairArbRoutes.isSDK(o.hot_routes[0])))) + ); + }, + isAmino(o: any): o is MsgSetHotRoutesAmino { + return ( + o && + (o.$typeUrl === MsgSetHotRoutes.typeUrl || + (typeof o.admin === 'string' && + Array.isArray(o.hot_routes) && + (!o.hot_routes.length || + TokenPairArbRoutes.isAmino(o.hot_routes[0])))) + ); + }, + encode( + message: MsgSetHotRoutes, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.admin !== '') { + writer.uint32(10).string(message.admin); + } + for (const v of message.hotRoutes) { + TokenPairArbRoutes.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetHotRoutes { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetHotRoutes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.hotRoutes.push( + TokenPairArbRoutes.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetHotRoutes { + const message = createBaseMsgSetHotRoutes(); + message.admin = object.admin ?? ''; + message.hotRoutes = + object.hotRoutes?.map((e) => TokenPairArbRoutes.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSetHotRoutesAmino): MsgSetHotRoutes { + const message = createBaseMsgSetHotRoutes(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.hotRoutes = + object.hot_routes?.map((e) => TokenPairArbRoutes.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgSetHotRoutes): MsgSetHotRoutesAmino { + const obj: any = {}; + obj.admin = message.admin === '' ? undefined : message.admin; + if (message.hotRoutes) { + obj.hot_routes = message.hotRoutes.map((e) => + e ? TokenPairArbRoutes.toAmino(e) : undefined + ); + } else { + obj.hot_routes = message.hotRoutes; + } + return obj; + }, + fromAminoMsg(object: MsgSetHotRoutesAminoMsg): MsgSetHotRoutes { + return MsgSetHotRoutes.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetHotRoutes): MsgSetHotRoutesAminoMsg { + return { + type: 'osmosis/MsgSetHotRoutes', + value: MsgSetHotRoutes.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetHotRoutesProtoMsg): MsgSetHotRoutes { + return MsgSetHotRoutes.decode(message.value); + }, + toProto(message: MsgSetHotRoutes): Uint8Array { + return MsgSetHotRoutes.encode(message).finish(); + }, + toProtoMsg(message: MsgSetHotRoutes): MsgSetHotRoutesProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value: MsgSetHotRoutes.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSetHotRoutes.typeUrl, MsgSetHotRoutes); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetHotRoutes.aminoType, + MsgSetHotRoutes.typeUrl +); +function createBaseMsgSetHotRoutesResponse(): MsgSetHotRoutesResponse { + return {}; +} +export const MsgSetHotRoutesResponse = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutesResponse', + aminoType: 'osmosis/protorev/set-hot-routes-response', + is(o: any): o is MsgSetHotRoutesResponse { + return o && o.$typeUrl === MsgSetHotRoutesResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetHotRoutesResponseSDKType { + return o && o.$typeUrl === MsgSetHotRoutesResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetHotRoutesResponseAmino { + return o && o.$typeUrl === MsgSetHotRoutesResponse.typeUrl; + }, + encode( + _: MsgSetHotRoutesResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetHotRoutesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetHotRoutesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetHotRoutesResponse { + const message = createBaseMsgSetHotRoutesResponse(); + return message; + }, + fromAmino(_: MsgSetHotRoutesResponseAmino): MsgSetHotRoutesResponse { + const message = createBaseMsgSetHotRoutesResponse(); + return message; + }, + toAmino(_: MsgSetHotRoutesResponse): MsgSetHotRoutesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetHotRoutesResponseAminoMsg + ): MsgSetHotRoutesResponse { + return MsgSetHotRoutesResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetHotRoutesResponse + ): MsgSetHotRoutesResponseAminoMsg { + return { + type: 'osmosis/protorev/set-hot-routes-response', + value: MsgSetHotRoutesResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetHotRoutesResponseProtoMsg + ): MsgSetHotRoutesResponse { + return MsgSetHotRoutesResponse.decode(message.value); + }, + toProto(message: MsgSetHotRoutesResponse): Uint8Array { + return MsgSetHotRoutesResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetHotRoutesResponse + ): MsgSetHotRoutesResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutesResponse', + value: MsgSetHotRoutesResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetHotRoutesResponse.typeUrl, + MsgSetHotRoutesResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetHotRoutesResponse.aminoType, + MsgSetHotRoutesResponse.typeUrl +); +function createBaseMsgSetDeveloperAccount(): MsgSetDeveloperAccount { + return { + admin: '', + developerAccount: '', + }; +} +export const MsgSetDeveloperAccount = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + aminoType: 'osmosis/MsgSetDeveloperAccount', + is(o: any): o is MsgSetDeveloperAccount { + return ( + o && + (o.$typeUrl === MsgSetDeveloperAccount.typeUrl || + (typeof o.admin === 'string' && typeof o.developerAccount === 'string')) + ); + }, + isSDK(o: any): o is MsgSetDeveloperAccountSDKType { + return ( + o && + (o.$typeUrl === MsgSetDeveloperAccount.typeUrl || + (typeof o.admin === 'string' && + typeof o.developer_account === 'string')) + ); + }, + isAmino(o: any): o is MsgSetDeveloperAccountAmino { + return ( + o && + (o.$typeUrl === MsgSetDeveloperAccount.typeUrl || + (typeof o.admin === 'string' && + typeof o.developer_account === 'string')) + ); + }, + encode( + message: MsgSetDeveloperAccount, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.admin !== '') { + writer.uint32(10).string(message.admin); + } + if (message.developerAccount !== '') { + writer.uint32(18).string(message.developerAccount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDeveloperAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDeveloperAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.developerAccount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetDeveloperAccount { + const message = createBaseMsgSetDeveloperAccount(); + message.admin = object.admin ?? ''; + message.developerAccount = object.developerAccount ?? ''; + return message; + }, + fromAmino(object: MsgSetDeveloperAccountAmino): MsgSetDeveloperAccount { + const message = createBaseMsgSetDeveloperAccount(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if ( + object.developer_account !== undefined && + object.developer_account !== null + ) { + message.developerAccount = object.developer_account; + } + return message; + }, + toAmino(message: MsgSetDeveloperAccount): MsgSetDeveloperAccountAmino { + const obj: any = {}; + obj.admin = message.admin === '' ? undefined : message.admin; + obj.developer_account = + message.developerAccount === '' ? undefined : message.developerAccount; + return obj; + }, + fromAminoMsg(object: MsgSetDeveloperAccountAminoMsg): MsgSetDeveloperAccount { + return MsgSetDeveloperAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDeveloperAccount): MsgSetDeveloperAccountAminoMsg { + return { + type: 'osmosis/MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetDeveloperAccountProtoMsg + ): MsgSetDeveloperAccount { + return MsgSetDeveloperAccount.decode(message.value); + }, + toProto(message: MsgSetDeveloperAccount): Uint8Array { + return MsgSetDeveloperAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDeveloperAccount): MsgSetDeveloperAccountProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetDeveloperAccount.typeUrl, + MsgSetDeveloperAccount +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDeveloperAccount.aminoType, + MsgSetDeveloperAccount.typeUrl +); +function createBaseMsgSetDeveloperAccountResponse(): MsgSetDeveloperAccountResponse { + return {}; +} +export const MsgSetDeveloperAccountResponse = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccountResponse', + aminoType: 'osmosis/protorev/set-developer-account-response', + is(o: any): o is MsgSetDeveloperAccountResponse { + return o && o.$typeUrl === MsgSetDeveloperAccountResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetDeveloperAccountResponseSDKType { + return o && o.$typeUrl === MsgSetDeveloperAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetDeveloperAccountResponseAmino { + return o && o.$typeUrl === MsgSetDeveloperAccountResponse.typeUrl; + }, + encode( + _: MsgSetDeveloperAccountResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDeveloperAccountResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDeveloperAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetDeveloperAccountResponse { + const message = createBaseMsgSetDeveloperAccountResponse(); + return message; + }, + fromAmino( + _: MsgSetDeveloperAccountResponseAmino + ): MsgSetDeveloperAccountResponse { + const message = createBaseMsgSetDeveloperAccountResponse(); + return message; + }, + toAmino( + _: MsgSetDeveloperAccountResponse + ): MsgSetDeveloperAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetDeveloperAccountResponseAminoMsg + ): MsgSetDeveloperAccountResponse { + return MsgSetDeveloperAccountResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetDeveloperAccountResponse + ): MsgSetDeveloperAccountResponseAminoMsg { + return { + type: 'osmosis/protorev/set-developer-account-response', + value: MsgSetDeveloperAccountResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetDeveloperAccountResponseProtoMsg + ): MsgSetDeveloperAccountResponse { + return MsgSetDeveloperAccountResponse.decode(message.value); + }, + toProto(message: MsgSetDeveloperAccountResponse): Uint8Array { + return MsgSetDeveloperAccountResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetDeveloperAccountResponse + ): MsgSetDeveloperAccountResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccountResponse', + value: MsgSetDeveloperAccountResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetDeveloperAccountResponse.typeUrl, + MsgSetDeveloperAccountResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDeveloperAccountResponse.aminoType, + MsgSetDeveloperAccountResponse.typeUrl +); +function createBaseMsgSetInfoByPoolType(): MsgSetInfoByPoolType { + return { + admin: '', + infoByPoolType: InfoByPoolType.fromPartial({}), + }; +} +export const MsgSetInfoByPoolType = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + aminoType: 'osmosis/MsgSetInfoByPoolType', + is(o: any): o is MsgSetInfoByPoolType { + return ( + o && + (o.$typeUrl === MsgSetInfoByPoolType.typeUrl || + (typeof o.admin === 'string' && InfoByPoolType.is(o.infoByPoolType))) + ); + }, + isSDK(o: any): o is MsgSetInfoByPoolTypeSDKType { + return ( + o && + (o.$typeUrl === MsgSetInfoByPoolType.typeUrl || + (typeof o.admin === 'string' && + InfoByPoolType.isSDK(o.info_by_pool_type))) + ); + }, + isAmino(o: any): o is MsgSetInfoByPoolTypeAmino { + return ( + o && + (o.$typeUrl === MsgSetInfoByPoolType.typeUrl || + (typeof o.admin === 'string' && + InfoByPoolType.isAmino(o.info_by_pool_type))) + ); + }, + encode( + message: MsgSetInfoByPoolType, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.admin !== '') { + writer.uint32(10).string(message.admin); + } + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode( + message.infoByPoolType, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetInfoByPoolType { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetInfoByPoolType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.infoByPoolType = InfoByPoolType.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetInfoByPoolType { + const message = createBaseMsgSetInfoByPoolType(); + message.admin = object.admin ?? ''; + message.infoByPoolType = + object.infoByPoolType !== undefined && object.infoByPoolType !== null + ? InfoByPoolType.fromPartial(object.infoByPoolType) + : undefined; + return message; + }, + fromAmino(object: MsgSetInfoByPoolTypeAmino): MsgSetInfoByPoolType { + const message = createBaseMsgSetInfoByPoolType(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if ( + object.info_by_pool_type !== undefined && + object.info_by_pool_type !== null + ) { + message.infoByPoolType = InfoByPoolType.fromAmino( + object.info_by_pool_type + ); + } + return message; + }, + toAmino(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAmino { + const obj: any = {}; + obj.admin = message.admin === '' ? undefined : message.admin; + obj.info_by_pool_type = message.infoByPoolType + ? InfoByPoolType.toAmino(message.infoByPoolType) + : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetInfoByPoolTypeAminoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAminoMsg { + return { + type: 'osmosis/MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetInfoByPoolTypeProtoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.decode(message.value); + }, + toProto(message: MsgSetInfoByPoolType): Uint8Array { + return MsgSetInfoByPoolType.encode(message).finish(); + }, + toProtoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetInfoByPoolType.typeUrl, + MsgSetInfoByPoolType +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetInfoByPoolType.aminoType, + MsgSetInfoByPoolType.typeUrl +); +function createBaseMsgSetInfoByPoolTypeResponse(): MsgSetInfoByPoolTypeResponse { + return {}; +} +export const MsgSetInfoByPoolTypeResponse = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse', + aminoType: 'osmosis/protorev/set-info-by-pool-type-response', + is(o: any): o is MsgSetInfoByPoolTypeResponse { + return o && o.$typeUrl === MsgSetInfoByPoolTypeResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetInfoByPoolTypeResponseSDKType { + return o && o.$typeUrl === MsgSetInfoByPoolTypeResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetInfoByPoolTypeResponseAmino { + return o && o.$typeUrl === MsgSetInfoByPoolTypeResponse.typeUrl; + }, + encode( + _: MsgSetInfoByPoolTypeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetInfoByPoolTypeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetInfoByPoolTypeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse(); + return message; + }, + fromAmino( + _: MsgSetInfoByPoolTypeResponseAmino + ): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse(); + return message; + }, + toAmino(_: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetInfoByPoolTypeResponseAminoMsg + ): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetInfoByPoolTypeResponse + ): MsgSetInfoByPoolTypeResponseAminoMsg { + return { + type: 'osmosis/protorev/set-info-by-pool-type-response', + value: MsgSetInfoByPoolTypeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetInfoByPoolTypeResponseProtoMsg + ): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.decode(message.value); + }, + toProto(message: MsgSetInfoByPoolTypeResponse): Uint8Array { + return MsgSetInfoByPoolTypeResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetInfoByPoolTypeResponse + ): MsgSetInfoByPoolTypeResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse', + value: MsgSetInfoByPoolTypeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetInfoByPoolTypeResponse.typeUrl, + MsgSetInfoByPoolTypeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetInfoByPoolTypeResponse.aminoType, + MsgSetInfoByPoolTypeResponse.typeUrl +); +function createBaseMsgSetMaxPoolPointsPerTx(): MsgSetMaxPoolPointsPerTx { + return { + admin: '', + maxPoolPointsPerTx: BigInt(0), + }; +} +export const MsgSetMaxPoolPointsPerTx = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + aminoType: 'osmosis/MsgSetMaxPoolPointsPerTx', + is(o: any): o is MsgSetMaxPoolPointsPerTx { + return ( + o && + (o.$typeUrl === MsgSetMaxPoolPointsPerTx.typeUrl || + (typeof o.admin === 'string' && + typeof o.maxPoolPointsPerTx === 'bigint')) + ); + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerTxSDKType { + return ( + o && + (o.$typeUrl === MsgSetMaxPoolPointsPerTx.typeUrl || + (typeof o.admin === 'string' && + typeof o.max_pool_points_per_tx === 'bigint')) + ); + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerTxAmino { + return ( + o && + (o.$typeUrl === MsgSetMaxPoolPointsPerTx.typeUrl || + (typeof o.admin === 'string' && + typeof o.max_pool_points_per_tx === 'bigint')) + ); + }, + encode( + message: MsgSetMaxPoolPointsPerTx, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.admin !== '') { + writer.uint32(10).string(message.admin); + } + if (message.maxPoolPointsPerTx !== BigInt(0)) { + writer.uint32(16).uint64(message.maxPoolPointsPerTx); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerTx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMaxPoolPointsPerTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.maxPoolPointsPerTx = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetMaxPoolPointsPerTx { + const message = createBaseMsgSetMaxPoolPointsPerTx(); + message.admin = object.admin ?? ''; + message.maxPoolPointsPerTx = + object.maxPoolPointsPerTx !== undefined && + object.maxPoolPointsPerTx !== null + ? BigInt(object.maxPoolPointsPerTx.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgSetMaxPoolPointsPerTxAmino): MsgSetMaxPoolPointsPerTx { + const message = createBaseMsgSetMaxPoolPointsPerTx(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if ( + object.max_pool_points_per_tx !== undefined && + object.max_pool_points_per_tx !== null + ) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + return message; + }, + toAmino(message: MsgSetMaxPoolPointsPerTx): MsgSetMaxPoolPointsPerTxAmino { + const obj: any = {}; + obj.admin = message.admin === '' ? undefined : message.admin; + obj.max_pool_points_per_tx = + message.maxPoolPointsPerTx !== BigInt(0) + ? message.maxPoolPointsPerTx.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerTxAminoMsg + ): MsgSetMaxPoolPointsPerTx { + return MsgSetMaxPoolPointsPerTx.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerTx + ): MsgSetMaxPoolPointsPerTxAminoMsg { + return { + type: 'osmosis/MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerTxProtoMsg + ): MsgSetMaxPoolPointsPerTx { + return MsgSetMaxPoolPointsPerTx.decode(message.value); + }, + toProto(message: MsgSetMaxPoolPointsPerTx): Uint8Array { + return MsgSetMaxPoolPointsPerTx.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerTx + ): MsgSetMaxPoolPointsPerTxProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetMaxPoolPointsPerTx.typeUrl, + MsgSetMaxPoolPointsPerTx +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetMaxPoolPointsPerTx.aminoType, + MsgSetMaxPoolPointsPerTx.typeUrl +); +function createBaseMsgSetMaxPoolPointsPerTxResponse(): MsgSetMaxPoolPointsPerTxResponse { + return {}; +} +export const MsgSetMaxPoolPointsPerTxResponse = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTxResponse', + aminoType: 'osmosis/protorev/set-max-pool-points-per-tx-response', + is(o: any): o is MsgSetMaxPoolPointsPerTxResponse { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerTxResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerTxResponseSDKType { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerTxResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerTxResponseAmino { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerTxResponse.typeUrl; + }, + encode( + _: MsgSetMaxPoolPointsPerTxResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerTxResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMaxPoolPointsPerTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetMaxPoolPointsPerTxResponse { + const message = createBaseMsgSetMaxPoolPointsPerTxResponse(); + return message; + }, + fromAmino( + _: MsgSetMaxPoolPointsPerTxResponseAmino + ): MsgSetMaxPoolPointsPerTxResponse { + const message = createBaseMsgSetMaxPoolPointsPerTxResponse(); + return message; + }, + toAmino( + _: MsgSetMaxPoolPointsPerTxResponse + ): MsgSetMaxPoolPointsPerTxResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerTxResponseAminoMsg + ): MsgSetMaxPoolPointsPerTxResponse { + return MsgSetMaxPoolPointsPerTxResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerTxResponse + ): MsgSetMaxPoolPointsPerTxResponseAminoMsg { + return { + type: 'osmosis/protorev/set-max-pool-points-per-tx-response', + value: MsgSetMaxPoolPointsPerTxResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerTxResponseProtoMsg + ): MsgSetMaxPoolPointsPerTxResponse { + return MsgSetMaxPoolPointsPerTxResponse.decode(message.value); + }, + toProto(message: MsgSetMaxPoolPointsPerTxResponse): Uint8Array { + return MsgSetMaxPoolPointsPerTxResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerTxResponse + ): MsgSetMaxPoolPointsPerTxResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTxResponse', + value: MsgSetMaxPoolPointsPerTxResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetMaxPoolPointsPerTxResponse.typeUrl, + MsgSetMaxPoolPointsPerTxResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetMaxPoolPointsPerTxResponse.aminoType, + MsgSetMaxPoolPointsPerTxResponse.typeUrl +); +function createBaseMsgSetMaxPoolPointsPerBlock(): MsgSetMaxPoolPointsPerBlock { + return { + admin: '', + maxPoolPointsPerBlock: BigInt(0), + }; +} +export const MsgSetMaxPoolPointsPerBlock = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + aminoType: 'osmosis/MsgSetPoolWeights', + is(o: any): o is MsgSetMaxPoolPointsPerBlock { + return ( + o && + (o.$typeUrl === MsgSetMaxPoolPointsPerBlock.typeUrl || + (typeof o.admin === 'string' && + typeof o.maxPoolPointsPerBlock === 'bigint')) + ); + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerBlockSDKType { + return ( + o && + (o.$typeUrl === MsgSetMaxPoolPointsPerBlock.typeUrl || + (typeof o.admin === 'string' && + typeof o.max_pool_points_per_block === 'bigint')) + ); + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerBlockAmino { + return ( + o && + (o.$typeUrl === MsgSetMaxPoolPointsPerBlock.typeUrl || + (typeof o.admin === 'string' && + typeof o.max_pool_points_per_block === 'bigint')) + ); + }, + encode( + message: MsgSetMaxPoolPointsPerBlock, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.admin !== '') { + writer.uint32(10).string(message.admin); + } + if (message.maxPoolPointsPerBlock !== BigInt(0)) { + writer.uint32(16).uint64(message.maxPoolPointsPerBlock); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerBlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMaxPoolPointsPerBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.maxPoolPointsPerBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetMaxPoolPointsPerBlock { + const message = createBaseMsgSetMaxPoolPointsPerBlock(); + message.admin = object.admin ?? ''; + message.maxPoolPointsPerBlock = + object.maxPoolPointsPerBlock !== undefined && + object.maxPoolPointsPerBlock !== null + ? BigInt(object.maxPoolPointsPerBlock.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgSetMaxPoolPointsPerBlockAmino + ): MsgSetMaxPoolPointsPerBlock { + const message = createBaseMsgSetMaxPoolPointsPerBlock(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if ( + object.max_pool_points_per_block !== undefined && + object.max_pool_points_per_block !== null + ) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + return message; + }, + toAmino( + message: MsgSetMaxPoolPointsPerBlock + ): MsgSetMaxPoolPointsPerBlockAmino { + const obj: any = {}; + obj.admin = message.admin === '' ? undefined : message.admin; + obj.max_pool_points_per_block = + message.maxPoolPointsPerBlock !== BigInt(0) + ? message.maxPoolPointsPerBlock.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerBlockAminoMsg + ): MsgSetMaxPoolPointsPerBlock { + return MsgSetMaxPoolPointsPerBlock.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerBlock + ): MsgSetMaxPoolPointsPerBlockAminoMsg { + return { + type: 'osmosis/MsgSetPoolWeights', + value: MsgSetMaxPoolPointsPerBlock.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerBlockProtoMsg + ): MsgSetMaxPoolPointsPerBlock { + return MsgSetMaxPoolPointsPerBlock.decode(message.value); + }, + toProto(message: MsgSetMaxPoolPointsPerBlock): Uint8Array { + return MsgSetMaxPoolPointsPerBlock.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerBlock + ): MsgSetMaxPoolPointsPerBlockProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value: MsgSetMaxPoolPointsPerBlock.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetMaxPoolPointsPerBlock.typeUrl, + MsgSetMaxPoolPointsPerBlock +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetMaxPoolPointsPerBlock.aminoType, + MsgSetMaxPoolPointsPerBlock.typeUrl +); +function createBaseMsgSetMaxPoolPointsPerBlockResponse(): MsgSetMaxPoolPointsPerBlockResponse { + return {}; +} +export const MsgSetMaxPoolPointsPerBlockResponse = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlockResponse', + aminoType: 'osmosis/protorev/set-max-pool-points-per-block-response', + is(o: any): o is MsgSetMaxPoolPointsPerBlockResponse { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerBlockResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerBlockResponseSDKType { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerBlockResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerBlockResponseAmino { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerBlockResponse.typeUrl; + }, + encode( + _: MsgSetMaxPoolPointsPerBlockResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerBlockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetMaxPoolPointsPerBlockResponse { + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse(); + return message; + }, + fromAmino( + _: MsgSetMaxPoolPointsPerBlockResponseAmino + ): MsgSetMaxPoolPointsPerBlockResponse { + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse(); + return message; + }, + toAmino( + _: MsgSetMaxPoolPointsPerBlockResponse + ): MsgSetMaxPoolPointsPerBlockResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerBlockResponseAminoMsg + ): MsgSetMaxPoolPointsPerBlockResponse { + return MsgSetMaxPoolPointsPerBlockResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerBlockResponse + ): MsgSetMaxPoolPointsPerBlockResponseAminoMsg { + return { + type: 'osmosis/protorev/set-max-pool-points-per-block-response', + value: MsgSetMaxPoolPointsPerBlockResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerBlockResponseProtoMsg + ): MsgSetMaxPoolPointsPerBlockResponse { + return MsgSetMaxPoolPointsPerBlockResponse.decode(message.value); + }, + toProto(message: MsgSetMaxPoolPointsPerBlockResponse): Uint8Array { + return MsgSetMaxPoolPointsPerBlockResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerBlockResponse + ): MsgSetMaxPoolPointsPerBlockResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlockResponse', + value: MsgSetMaxPoolPointsPerBlockResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetMaxPoolPointsPerBlockResponse.typeUrl, + MsgSetMaxPoolPointsPerBlockResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetMaxPoolPointsPerBlockResponse.aminoType, + MsgSetMaxPoolPointsPerBlockResponse.typeUrl +); +function createBaseMsgSetBaseDenoms(): MsgSetBaseDenoms { + return { + admin: '', + baseDenoms: [], + }; +} +export const MsgSetBaseDenoms = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + aminoType: 'osmosis/MsgSetBaseDenoms', + is(o: any): o is MsgSetBaseDenoms { + return ( + o && + (o.$typeUrl === MsgSetBaseDenoms.typeUrl || + (typeof o.admin === 'string' && + Array.isArray(o.baseDenoms) && + (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0])))) + ); + }, + isSDK(o: any): o is MsgSetBaseDenomsSDKType { + return ( + o && + (o.$typeUrl === MsgSetBaseDenoms.typeUrl || + (typeof o.admin === 'string' && + Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0])))) + ); + }, + isAmino(o: any): o is MsgSetBaseDenomsAmino { + return ( + o && + (o.$typeUrl === MsgSetBaseDenoms.typeUrl || + (typeof o.admin === 'string' && + Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0])))) + ); + }, + encode( + message: MsgSetBaseDenoms, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.admin !== '') { + writer.uint32(10).string(message.admin); + } + for (const v of message.baseDenoms) { + BaseDenom.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBaseDenoms { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBaseDenoms(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.baseDenoms.push(BaseDenom.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetBaseDenoms { + const message = createBaseMsgSetBaseDenoms(); + message.admin = object.admin ?? ''; + message.baseDenoms = + object.baseDenoms?.map((e) => BaseDenom.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSetBaseDenomsAmino): MsgSetBaseDenoms { + const message = createBaseMsgSetBaseDenoms(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.baseDenoms = + object.base_denoms?.map((e) => BaseDenom.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgSetBaseDenoms): MsgSetBaseDenomsAmino { + const obj: any = {}; + obj.admin = message.admin === '' ? undefined : message.admin; + if (message.baseDenoms) { + obj.base_denoms = message.baseDenoms.map((e) => + e ? BaseDenom.toAmino(e) : undefined + ); + } else { + obj.base_denoms = message.baseDenoms; + } + return obj; + }, + fromAminoMsg(object: MsgSetBaseDenomsAminoMsg): MsgSetBaseDenoms { + return MsgSetBaseDenoms.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBaseDenoms): MsgSetBaseDenomsAminoMsg { + return { + type: 'osmosis/MsgSetBaseDenoms', + value: MsgSetBaseDenoms.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetBaseDenomsProtoMsg): MsgSetBaseDenoms { + return MsgSetBaseDenoms.decode(message.value); + }, + toProto(message: MsgSetBaseDenoms): Uint8Array { + return MsgSetBaseDenoms.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBaseDenoms): MsgSetBaseDenomsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value: MsgSetBaseDenoms.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSetBaseDenoms.typeUrl, MsgSetBaseDenoms); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetBaseDenoms.aminoType, + MsgSetBaseDenoms.typeUrl +); +function createBaseMsgSetBaseDenomsResponse(): MsgSetBaseDenomsResponse { + return {}; +} +export const MsgSetBaseDenomsResponse = { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenomsResponse', + aminoType: 'osmosis/protorev/set-base-denoms-response', + is(o: any): o is MsgSetBaseDenomsResponse { + return o && o.$typeUrl === MsgSetBaseDenomsResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetBaseDenomsResponseSDKType { + return o && o.$typeUrl === MsgSetBaseDenomsResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetBaseDenomsResponseAmino { + return o && o.$typeUrl === MsgSetBaseDenomsResponse.typeUrl; + }, + encode( + _: MsgSetBaseDenomsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetBaseDenomsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBaseDenomsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetBaseDenomsResponse { + const message = createBaseMsgSetBaseDenomsResponse(); + return message; + }, + fromAmino(_: MsgSetBaseDenomsResponseAmino): MsgSetBaseDenomsResponse { + const message = createBaseMsgSetBaseDenomsResponse(); + return message; + }, + toAmino(_: MsgSetBaseDenomsResponse): MsgSetBaseDenomsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetBaseDenomsResponseAminoMsg + ): MsgSetBaseDenomsResponse { + return MsgSetBaseDenomsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetBaseDenomsResponse + ): MsgSetBaseDenomsResponseAminoMsg { + return { + type: 'osmosis/protorev/set-base-denoms-response', + value: MsgSetBaseDenomsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetBaseDenomsResponseProtoMsg + ): MsgSetBaseDenomsResponse { + return MsgSetBaseDenomsResponse.decode(message.value); + }, + toProto(message: MsgSetBaseDenomsResponse): Uint8Array { + return MsgSetBaseDenomsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetBaseDenomsResponse + ): MsgSetBaseDenomsResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenomsResponse', + value: MsgSetBaseDenomsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetBaseDenomsResponse.typeUrl, + MsgSetBaseDenomsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetBaseDenomsResponse.aminoType, + MsgSetBaseDenomsResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/rpc.query.ts b/packages/cosmos/src/proto_export/osmosis/rpc.query.ts new file mode 100644 index 00000000..77be78a4 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/rpc.query.ts @@ -0,0 +1,43 @@ +//@ts-nocheck +import { connectComet, HttpEndpoint } from '@cosmjs/tendermint-rpc'; +import { QueryClient } from '@cosmjs/stargate'; +export const createRPCQueryClient = async ({ + rpcEndpoint, +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await connectComet(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + osmosis: { + lockup: ( + await import('./lockup/query.rpc.Query') + ).createRpcQueryExtension(client), + poolmanager: { + v2: ( + await import('./poolmanager/v2/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + protorev: { + v1beta1: ( + await import('./protorev/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + smartaccount: { + v1beta1: ( + await import('./smartaccount/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + txfees: { + v1beta1: ( + await import('./txfees/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + valsetpref: { + v1beta1: ( + await import('./valsetpref/v1beta1/query.rpc.Query') + ).createRpcQueryExtension(client), + }, + }, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/rpc.tx.ts b/packages/cosmos/src/proto_export/osmosis/rpc.tx.ts new file mode 100644 index 00000000..c31d26dc --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/rpc.tx.ts @@ -0,0 +1,72 @@ +//@ts-nocheck +import { Rpc } from '../helpers'; +export const createRPCMsgClient = async ({ rpc }: { rpc: Rpc }) => ({ + osmosis: { + concentratedliquidity: { + poolmodel: { + concentrated: { + v1beta1: new ( + await import( + './concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg' + ) + ).MsgClientImpl(rpc), + }, + }, + }, + gamm: { + poolmodels: { + balancer: { + v1beta1: new ( + await import('./gamm/poolmodels/balancer/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + stableswap: { + v1beta1: new ( + await import('./gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + }, + v1beta1: new (await import('./gamm/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + ibchooks: new (await import('./ibchooks/tx.rpc.msg')).MsgClientImpl(rpc), + incentives: new (await import('./incentives/tx.rpc.msg')).MsgClientImpl( + rpc + ), + lockup: new (await import('./lockup/tx.rpc.msg')).MsgClientImpl(rpc), + poolmanager: { + v1beta1: new ( + await import('./poolmanager/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + protorev: { + v1beta1: new ( + await import('./protorev/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + smartaccount: { + v1beta1: new ( + await import('./smartaccount/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + superfluid: new (await import('./superfluid/tx.rpc.msg')).MsgClientImpl( + rpc + ), + tokenfactory: { + v1beta1: new ( + await import('./tokenfactory/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + txfees: { + v1beta1: new (await import('./txfees/v1beta1/tx.rpc.msg')).MsgClientImpl( + rpc + ), + }, + valsetpref: { + v1beta1: new ( + await import('./valsetpref/v1beta1/tx.rpc.msg') + ).MsgClientImpl(rpc), + }, + }, +}); diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/genesis.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/genesis.ts new file mode 100644 index 00000000..d9cdee8f --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/genesis.ts @@ -0,0 +1,385 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + AccountAuthenticator, + AccountAuthenticatorAmino, + AccountAuthenticatorSDKType, +} from './models'; +import { Params, ParamsAmino, ParamsSDKType } from './params'; +/** + * AuthenticatorData represents a genesis exported account with Authenticators. + * The address is used as the key, and the account authenticators are stored in + * the authenticators field. + */ +export interface AuthenticatorData { + /** address is an account address, one address can have many authenticators */ + address: string; + /** + * authenticators are the account's authenticators, these can be multiple + * types including SignatureVerificationAuthenticator, AllOfAuthenticators and + * CosmWasmAuthenticators. + */ + authenticators: AccountAuthenticator[]; +} +export interface AuthenticatorDataProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.AuthenticatorData'; + value: Uint8Array; +} +/** + * AuthenticatorData represents a genesis exported account with Authenticators. + * The address is used as the key, and the account authenticators are stored in + * the authenticators field. + */ +export interface AuthenticatorDataAmino { + /** address is an account address, one address can have many authenticators */ + address?: string; + /** + * authenticators are the account's authenticators, these can be multiple + * types including SignatureVerificationAuthenticator, AllOfAuthenticators and + * CosmWasmAuthenticators. + */ + authenticators?: AccountAuthenticatorAmino[]; +} +export interface AuthenticatorDataAminoMsg { + type: 'osmosis/smartaccount/authenticator-data'; + value: AuthenticatorDataAmino; +} +/** + * AuthenticatorData represents a genesis exported account with Authenticators. + * The address is used as the key, and the account authenticators are stored in + * the authenticators field. + */ +export interface AuthenticatorDataSDKType { + address: string; + authenticators: AccountAuthenticatorSDKType[]; +} +/** GenesisState defines the authenticator module's genesis state. */ +export interface GenesisState { + /** params define the parameters for the authenticator module. */ + params: Params; + /** next_authenticator_id is the next available authenticator ID. */ + nextAuthenticatorId: bigint; + /** + * authenticator_data contains the data for multiple accounts, each with their + * authenticators. + */ + authenticatorData: AuthenticatorData[]; +} +export interface GenesisStateProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.GenesisState'; + value: Uint8Array; +} +/** GenesisState defines the authenticator module's genesis state. */ +export interface GenesisStateAmino { + /** params define the parameters for the authenticator module. */ + params?: ParamsAmino; + /** next_authenticator_id is the next available authenticator ID. */ + next_authenticator_id?: string; + /** + * authenticator_data contains the data for multiple accounts, each with their + * authenticators. + */ + authenticator_data?: AuthenticatorDataAmino[]; +} +export interface GenesisStateAminoMsg { + type: 'osmosis/smartaccount/genesis-state'; + value: GenesisStateAmino; +} +/** GenesisState defines the authenticator module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + next_authenticator_id: bigint; + authenticator_data: AuthenticatorDataSDKType[]; +} +function createBaseAuthenticatorData(): AuthenticatorData { + return { + address: '', + authenticators: [], + }; +} +export const AuthenticatorData = { + typeUrl: '/osmosis.smartaccount.v1beta1.AuthenticatorData', + aminoType: 'osmosis/smartaccount/authenticator-data', + is(o: any): o is AuthenticatorData { + return ( + o && + (o.$typeUrl === AuthenticatorData.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.authenticators) && + (!o.authenticators.length || + AccountAuthenticator.is(o.authenticators[0])))) + ); + }, + isSDK(o: any): o is AuthenticatorDataSDKType { + return ( + o && + (o.$typeUrl === AuthenticatorData.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.authenticators) && + (!o.authenticators.length || + AccountAuthenticator.isSDK(o.authenticators[0])))) + ); + }, + isAmino(o: any): o is AuthenticatorDataAmino { + return ( + o && + (o.$typeUrl === AuthenticatorData.typeUrl || + (typeof o.address === 'string' && + Array.isArray(o.authenticators) && + (!o.authenticators.length || + AccountAuthenticator.isAmino(o.authenticators[0])))) + ); + }, + encode( + message: AuthenticatorData, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + for (const v of message.authenticators) { + AccountAuthenticator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuthenticatorData { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthenticatorData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.authenticators.push( + AccountAuthenticator.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AuthenticatorData { + const message = createBaseAuthenticatorData(); + message.address = object.address ?? ''; + message.authenticators = + object.authenticators?.map((e) => AccountAuthenticator.fromPartial(e)) || + []; + return message; + }, + fromAmino(object: AuthenticatorDataAmino): AuthenticatorData { + const message = createBaseAuthenticatorData(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.authenticators = + object.authenticators?.map((e) => AccountAuthenticator.fromAmino(e)) || + []; + return message; + }, + toAmino(message: AuthenticatorData): AuthenticatorDataAmino { + const obj: any = {}; + obj.address = message.address === '' ? undefined : message.address; + if (message.authenticators) { + obj.authenticators = message.authenticators.map((e) => + e ? AccountAuthenticator.toAmino(e) : undefined + ); + } else { + obj.authenticators = message.authenticators; + } + return obj; + }, + fromAminoMsg(object: AuthenticatorDataAminoMsg): AuthenticatorData { + return AuthenticatorData.fromAmino(object.value); + }, + toAminoMsg(message: AuthenticatorData): AuthenticatorDataAminoMsg { + return { + type: 'osmosis/smartaccount/authenticator-data', + value: AuthenticatorData.toAmino(message), + }; + }, + fromProtoMsg(message: AuthenticatorDataProtoMsg): AuthenticatorData { + return AuthenticatorData.decode(message.value); + }, + toProto(message: AuthenticatorData): Uint8Array { + return AuthenticatorData.encode(message).finish(); + }, + toProtoMsg(message: AuthenticatorData): AuthenticatorDataProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.AuthenticatorData', + value: AuthenticatorData.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(AuthenticatorData.typeUrl, AuthenticatorData); +GlobalDecoderRegistry.registerAminoProtoMapping( + AuthenticatorData.aminoType, + AuthenticatorData.typeUrl +); +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + nextAuthenticatorId: BigInt(0), + authenticatorData: [], + }; +} +export const GenesisState = { + typeUrl: '/osmosis.smartaccount.v1beta1.GenesisState', + aminoType: 'osmosis/smartaccount/genesis-state', + is(o: any): o is GenesisState { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.is(o.params) && + typeof o.nextAuthenticatorId === 'bigint' && + Array.isArray(o.authenticatorData) && + (!o.authenticatorData.length || + AuthenticatorData.is(o.authenticatorData[0])))) + ); + }, + isSDK(o: any): o is GenesisStateSDKType { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.isSDK(o.params) && + typeof o.next_authenticator_id === 'bigint' && + Array.isArray(o.authenticator_data) && + (!o.authenticator_data.length || + AuthenticatorData.isSDK(o.authenticator_data[0])))) + ); + }, + isAmino(o: any): o is GenesisStateAmino { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.isAmino(o.params) && + typeof o.next_authenticator_id === 'bigint' && + Array.isArray(o.authenticator_data) && + (!o.authenticator_data.length || + AuthenticatorData.isAmino(o.authenticator_data[0])))) + ); + }, + encode( + message: GenesisState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.nextAuthenticatorId !== BigInt(0)) { + writer.uint32(16).uint64(message.nextAuthenticatorId); + } + for (const v of message.authenticatorData) { + AuthenticatorData.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.nextAuthenticatorId = reader.uint64(); + break; + case 3: + message.authenticatorData.push( + AuthenticatorData.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + message.nextAuthenticatorId = + object.nextAuthenticatorId !== undefined && + object.nextAuthenticatorId !== null + ? BigInt(object.nextAuthenticatorId.toString()) + : BigInt(0); + message.authenticatorData = + object.authenticatorData?.map((e) => AuthenticatorData.fromPartial(e)) || + []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if ( + object.next_authenticator_id !== undefined && + object.next_authenticator_id !== null + ) { + message.nextAuthenticatorId = BigInt(object.next_authenticator_id); + } + message.authenticatorData = + object.authenticator_data?.map((e) => AuthenticatorData.fromAmino(e)) || + []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.next_authenticator_id = + message.nextAuthenticatorId !== BigInt(0) + ? message.nextAuthenticatorId.toString() + : undefined; + if (message.authenticatorData) { + obj.authenticator_data = message.authenticatorData.map((e) => + e ? AuthenticatorData.toAmino(e) : undefined + ); + } else { + obj.authenticator_data = message.authenticatorData; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/smartaccount/genesis-state', + value: GenesisState.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.GenesisState', + value: GenesisState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisState.aminoType, + GenesisState.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/models.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/models.ts new file mode 100644 index 00000000..88b0faf4 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/models.ts @@ -0,0 +1,205 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { bytesFromBase64, base64FromBytes } from '../../../helpers'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * AccountAuthenticator represents a foundational model for all authenticators. + * It provides extensibility by allowing concrete types to interpret and + * validate transactions based on the encapsulated data. + */ +export interface AccountAuthenticator { + /** ID uniquely identifies the authenticator instance. */ + id: bigint; + /** + * Type specifies the category of the AccountAuthenticator. + * This type information is essential for differentiating authenticators + * and ensuring precise data retrieval from the storage layer. + */ + type: string; + /** + * Data is a versatile field used in conjunction with the specific type of + * account authenticator to facilitate complex authentication processes. + * The interpretation of this field is overloaded, enabling multiple + * authenticators to utilize it for their respective purposes. + */ + data: Uint8Array; +} +export interface AccountAuthenticatorProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.AccountAuthenticator'; + value: Uint8Array; +} +/** + * AccountAuthenticator represents a foundational model for all authenticators. + * It provides extensibility by allowing concrete types to interpret and + * validate transactions based on the encapsulated data. + */ +export interface AccountAuthenticatorAmino { + /** ID uniquely identifies the authenticator instance. */ + id?: string; + /** + * Type specifies the category of the AccountAuthenticator. + * This type information is essential for differentiating authenticators + * and ensuring precise data retrieval from the storage layer. + */ + type?: string; + /** + * Data is a versatile field used in conjunction with the specific type of + * account authenticator to facilitate complex authentication processes. + * The interpretation of this field is overloaded, enabling multiple + * authenticators to utilize it for their respective purposes. + */ + data?: string; +} +export interface AccountAuthenticatorAminoMsg { + type: 'osmosis/smartaccount/account-authenticator'; + value: AccountAuthenticatorAmino; +} +/** + * AccountAuthenticator represents a foundational model for all authenticators. + * It provides extensibility by allowing concrete types to interpret and + * validate transactions based on the encapsulated data. + */ +export interface AccountAuthenticatorSDKType { + id: bigint; + type: string; + data: Uint8Array; +} +function createBaseAccountAuthenticator(): AccountAuthenticator { + return { + id: BigInt(0), + type: '', + data: new Uint8Array(), + }; +} +export const AccountAuthenticator = { + typeUrl: '/osmosis.smartaccount.v1beta1.AccountAuthenticator', + aminoType: 'osmosis/smartaccount/account-authenticator', + is(o: any): o is AccountAuthenticator { + return ( + o && + (o.$typeUrl === AccountAuthenticator.typeUrl || + (typeof o.id === 'bigint' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ); + }, + isSDK(o: any): o is AccountAuthenticatorSDKType { + return ( + o && + (o.$typeUrl === AccountAuthenticator.typeUrl || + (typeof o.id === 'bigint' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ); + }, + isAmino(o: any): o is AccountAuthenticatorAmino { + return ( + o && + (o.$typeUrl === AccountAuthenticator.typeUrl || + (typeof o.id === 'bigint' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ); + }, + encode( + message: AccountAuthenticator, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.type !== '') { + writer.uint32(18).string(message.type); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccountAuthenticator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountAuthenticator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccountAuthenticator { + const message = createBaseAccountAuthenticator(); + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0); + message.type = object.type ?? ''; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: AccountAuthenticatorAmino): AccountAuthenticator { + const message = createBaseAccountAuthenticator(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: AccountAuthenticator): AccountAuthenticatorAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.type = message.type === '' ? undefined : message.type; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: AccountAuthenticatorAminoMsg): AccountAuthenticator { + return AccountAuthenticator.fromAmino(object.value); + }, + toAminoMsg(message: AccountAuthenticator): AccountAuthenticatorAminoMsg { + return { + type: 'osmosis/smartaccount/account-authenticator', + value: AccountAuthenticator.toAmino(message), + }; + }, + fromProtoMsg(message: AccountAuthenticatorProtoMsg): AccountAuthenticator { + return AccountAuthenticator.decode(message.value); + }, + toProto(message: AccountAuthenticator): Uint8Array { + return AccountAuthenticator.encode(message).finish(); + }, + toProtoMsg(message: AccountAuthenticator): AccountAuthenticatorProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.AccountAuthenticator', + value: AccountAuthenticator.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + AccountAuthenticator.typeUrl, + AccountAuthenticator +); +GlobalDecoderRegistry.registerAminoProtoMapping( + AccountAuthenticator.aminoType, + AccountAuthenticator.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/params.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/params.ts new file mode 100644 index 00000000..d365f586 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/params.ts @@ -0,0 +1,217 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** Params defines the parameters for the module. */ +export interface Params { + /** + * MaximumUnauthenticatedGas defines the maximum amount of gas that can be + * used to authenticate a transaction in ante handler without having fee payer + * authenticated. + */ + maximumUnauthenticatedGas: bigint; + /** + * IsSmartAccountActive defines the state of the authenticator. + * If set to false, the authenticator module will not be used + * and the classic cosmos sdk authentication will be used instead. + */ + isSmartAccountActive: boolean; + /** + * CircuitBreakerControllers defines list of addresses that are allowed to + * set is_smart_account_active without going through governance. + */ + circuitBreakerControllers: string[]; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.Params'; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + /** + * MaximumUnauthenticatedGas defines the maximum amount of gas that can be + * used to authenticate a transaction in ante handler without having fee payer + * authenticated. + */ + maximum_unauthenticated_gas?: string; + /** + * IsSmartAccountActive defines the state of the authenticator. + * If set to false, the authenticator module will not be used + * and the classic cosmos sdk authentication will be used instead. + */ + is_smart_account_active?: boolean; + /** + * CircuitBreakerControllers defines list of addresses that are allowed to + * set is_smart_account_active without going through governance. + */ + circuit_breaker_controllers?: string[]; +} +export interface ParamsAminoMsg { + type: 'osmosis/smartaccount/params'; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + maximum_unauthenticated_gas: bigint; + is_smart_account_active: boolean; + circuit_breaker_controllers: string[]; +} +function createBaseParams(): Params { + return { + maximumUnauthenticatedGas: BigInt(0), + isSmartAccountActive: false, + circuitBreakerControllers: [], + }; +} +export const Params = { + typeUrl: '/osmosis.smartaccount.v1beta1.Params', + aminoType: 'osmosis/smartaccount/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.maximumUnauthenticatedGas === 'bigint' && + typeof o.isSmartAccountActive === 'boolean' && + Array.isArray(o.circuitBreakerControllers) && + (!o.circuitBreakerControllers.length || + typeof o.circuitBreakerControllers[0] === 'string'))) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.maximum_unauthenticated_gas === 'bigint' && + typeof o.is_smart_account_active === 'boolean' && + Array.isArray(o.circuit_breaker_controllers) && + (!o.circuit_breaker_controllers.length || + typeof o.circuit_breaker_controllers[0] === 'string'))) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (typeof o.maximum_unauthenticated_gas === 'bigint' && + typeof o.is_smart_account_active === 'boolean' && + Array.isArray(o.circuit_breaker_controllers) && + (!o.circuit_breaker_controllers.length || + typeof o.circuit_breaker_controllers[0] === 'string'))) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.maximumUnauthenticatedGas !== BigInt(0)) { + writer.uint32(8).uint64(message.maximumUnauthenticatedGas); + } + if (message.isSmartAccountActive === true) { + writer.uint32(16).bool(message.isSmartAccountActive); + } + for (const v of message.circuitBreakerControllers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maximumUnauthenticatedGas = reader.uint64(); + break; + case 2: + message.isSmartAccountActive = reader.bool(); + break; + case 3: + message.circuitBreakerControllers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.maximumUnauthenticatedGas = + object.maximumUnauthenticatedGas !== undefined && + object.maximumUnauthenticatedGas !== null + ? BigInt(object.maximumUnauthenticatedGas.toString()) + : BigInt(0); + message.isSmartAccountActive = object.isSmartAccountActive ?? false; + message.circuitBreakerControllers = + object.circuitBreakerControllers?.map((e) => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if ( + object.maximum_unauthenticated_gas !== undefined && + object.maximum_unauthenticated_gas !== null + ) { + message.maximumUnauthenticatedGas = BigInt( + object.maximum_unauthenticated_gas + ); + } + if ( + object.is_smart_account_active !== undefined && + object.is_smart_account_active !== null + ) { + message.isSmartAccountActive = object.is_smart_account_active; + } + message.circuitBreakerControllers = + object.circuit_breaker_controllers?.map((e) => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.maximum_unauthenticated_gas = + message.maximumUnauthenticatedGas !== BigInt(0) + ? message.maximumUnauthenticatedGas.toString() + : undefined; + obj.is_smart_account_active = + message.isSmartAccountActive === false + ? undefined + : message.isSmartAccountActive; + if (message.circuitBreakerControllers) { + obj.circuit_breaker_controllers = message.circuitBreakerControllers.map( + (e) => e + ); + } else { + obj.circuit_breaker_controllers = message.circuitBreakerControllers; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/smartaccount/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.lcd.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.lcd.ts new file mode 100644 index 00000000..dfb221fa --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.lcd.ts @@ -0,0 +1,31 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; + +import { + QueryParamsRequest, + QueryParamsResponseSDKType, + GetAuthenticatorsRequest, + GetAuthenticatorsResponseSDKType, +} from './query'; +export class LCDQueryClient { + req: LCDClient; + constructor({ requestClient }: { requestClient: LCDClient }) { + this.req = requestClient; + this.params = this.params.bind(this); + this.getAuthenticators = this.getAuthenticators.bind(this); + } + /* Parameters queries the parameters of the module. */ + async params( + _params: QueryParamsRequest = {} + ): Promise { + const endpoint = `osmosis/smartaccount/params`; + return await this.req.get(endpoint); + } + /* GetAuthenticators */ + async getAuthenticators( + params: GetAuthenticatorsRequest + ): Promise { + const endpoint = `osmosis/smartaccount/authenticators/${params.account}`; + return await this.req.get(endpoint); + } +} diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.rpc.Query.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..e55fd59d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.rpc.Query.ts @@ -0,0 +1,126 @@ +//@ts-nocheck +import { + QueryClient, + createProtobufRpcClient, + ProtobufRpcClient, +} from '@cosmjs/stargate'; +import { useQuery } from '@tanstack/react-query'; + +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; +import { ReactQueryParams } from '../../../react-query'; + +import { + QueryParamsRequest, + QueryParamsResponse, + GetAuthenticatorsRequest, + GetAuthenticatorsResponse, +} from './query'; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + getAuthenticators( + request: GetAuthenticatorsRequest + ): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.getAuthenticators = this.getAuthenticators.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.smartaccount.v1beta1.Query', + 'Params', + data + ); + return promise.then((data) => + QueryParamsResponse.decode(new BinaryReader(data)) + ); + } + getAuthenticators( + request: GetAuthenticatorsRequest + ): Promise { + const data = GetAuthenticatorsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.smartaccount.v1beta1.Query', + 'GetAuthenticators', + data + ); + return promise.then((data) => + GetAuthenticatorsResponse.decode(new BinaryReader(data)) + ); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + getAuthenticators( + request: GetAuthenticatorsRequest + ): Promise { + return queryService.getAuthenticators(request); + }, + }; +}; +export interface UseParamsQuery + extends ReactQueryParams { + request?: QueryParamsRequest; +} +export interface UseGetAuthenticatorsQuery + extends ReactQueryParams { + request: GetAuthenticatorsRequest; +} +const _queryClients: WeakMap = + new WeakMap(); +const getQueryService = ( + rpc: ProtobufRpcClient | undefined +): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useParams = ({ + request, + options, + }: UseParamsQuery) => { + return useQuery( + ['paramsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.params(request); + }, + options + ); + }; + const useGetAuthenticators = ({ + request, + options, + }: UseGetAuthenticatorsQuery) => { + return useQuery( + ['getAuthenticatorsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getAuthenticators(request); + }, + options + ); + }; + return { + /** Parameters queries the parameters of the module. */ useParams, + useGetAuthenticators, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.ts new file mode 100644 index 00000000..6bf610fa --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/query.ts @@ -0,0 +1,521 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { Params, ParamsAmino, ParamsSDKType } from './params'; +import { + AccountAuthenticator, + AccountAuthenticatorAmino, + AccountAuthenticatorSDKType, +} from './models'; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.QueryParamsRequest'; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: 'osmosis/smartaccount/query-params-request'; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.QueryParamsResponse'; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: 'osmosis/smartaccount/query-params-response'; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ +export interface GetAuthenticatorsRequest { + /** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ + account: string; +} +export interface GetAuthenticatorsRequestProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.GetAuthenticatorsRequest'; + value: Uint8Array; +} +/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ +export interface GetAuthenticatorsRequestAmino { + /** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ + account?: string; +} +export interface GetAuthenticatorsRequestAminoMsg { + type: 'osmosis/smartaccount/get-authenticators-request'; + value: GetAuthenticatorsRequestAmino; +} +/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ +export interface GetAuthenticatorsRequestSDKType { + account: string; +} +/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */ +export interface GetAuthenticatorsResponse { + accountAuthenticators: AccountAuthenticator[]; +} +export interface GetAuthenticatorsResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.GetAuthenticatorsResponse'; + value: Uint8Array; +} +/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */ +export interface GetAuthenticatorsResponseAmino { + account_authenticators?: AccountAuthenticatorAmino[]; +} +export interface GetAuthenticatorsResponseAminoMsg { + type: 'osmosis/smartaccount/get-authenticators-response'; + value: GetAuthenticatorsResponseAmino; +} +/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */ +export interface GetAuthenticatorsResponseSDKType { + account_authenticators: AccountAuthenticatorSDKType[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: '/osmosis.smartaccount.v1beta1.QueryParamsRequest', + aminoType: 'osmosis/smartaccount/query-params-request', + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + encode( + _: QueryParamsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: 'osmosis/smartaccount/query-params-request', + value: QueryParamsRequest.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.QueryParamsRequest', + value: QueryParamsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsRequest.aminoType, + QueryParamsRequest.typeUrl +); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}), + }; +} +export const QueryParamsResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.QueryParamsResponse', + aminoType: 'osmosis/smartaccount/query-params-response', + is(o: any): o is QueryParamsResponse { + return ( + o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)) + ); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)) + ); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)) + ); + }, + encode( + message: QueryParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: 'osmosis/smartaccount/query-params-response', + value: QueryParamsResponse.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.QueryParamsResponse', + value: QueryParamsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryParamsResponse.typeUrl, + QueryParamsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsResponse.aminoType, + QueryParamsResponse.typeUrl +); +function createBaseGetAuthenticatorsRequest(): GetAuthenticatorsRequest { + return { + account: '', + }; +} +export const GetAuthenticatorsRequest = { + typeUrl: '/osmosis.smartaccount.v1beta1.GetAuthenticatorsRequest', + aminoType: 'osmosis/smartaccount/get-authenticators-request', + is(o: any): o is GetAuthenticatorsRequest { + return ( + o && + (o.$typeUrl === GetAuthenticatorsRequest.typeUrl || + typeof o.account === 'string') + ); + }, + isSDK(o: any): o is GetAuthenticatorsRequestSDKType { + return ( + o && + (o.$typeUrl === GetAuthenticatorsRequest.typeUrl || + typeof o.account === 'string') + ); + }, + isAmino(o: any): o is GetAuthenticatorsRequestAmino { + return ( + o && + (o.$typeUrl === GetAuthenticatorsRequest.typeUrl || + typeof o.account === 'string') + ); + }, + encode( + message: GetAuthenticatorsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.account !== '') { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): GetAuthenticatorsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthenticatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): GetAuthenticatorsRequest { + const message = createBaseGetAuthenticatorsRequest(); + message.account = object.account ?? ''; + return message; + }, + fromAmino(object: GetAuthenticatorsRequestAmino): GetAuthenticatorsRequest { + const message = createBaseGetAuthenticatorsRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: GetAuthenticatorsRequest): GetAuthenticatorsRequestAmino { + const obj: any = {}; + obj.account = message.account === '' ? undefined : message.account; + return obj; + }, + fromAminoMsg( + object: GetAuthenticatorsRequestAminoMsg + ): GetAuthenticatorsRequest { + return GetAuthenticatorsRequest.fromAmino(object.value); + }, + toAminoMsg( + message: GetAuthenticatorsRequest + ): GetAuthenticatorsRequestAminoMsg { + return { + type: 'osmosis/smartaccount/get-authenticators-request', + value: GetAuthenticatorsRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: GetAuthenticatorsRequestProtoMsg + ): GetAuthenticatorsRequest { + return GetAuthenticatorsRequest.decode(message.value); + }, + toProto(message: GetAuthenticatorsRequest): Uint8Array { + return GetAuthenticatorsRequest.encode(message).finish(); + }, + toProtoMsg( + message: GetAuthenticatorsRequest + ): GetAuthenticatorsRequestProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.GetAuthenticatorsRequest', + value: GetAuthenticatorsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + GetAuthenticatorsRequest.typeUrl, + GetAuthenticatorsRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + GetAuthenticatorsRequest.aminoType, + GetAuthenticatorsRequest.typeUrl +); +function createBaseGetAuthenticatorsResponse(): GetAuthenticatorsResponse { + return { + accountAuthenticators: [], + }; +} +export const GetAuthenticatorsResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.GetAuthenticatorsResponse', + aminoType: 'osmosis/smartaccount/get-authenticators-response', + is(o: any): o is GetAuthenticatorsResponse { + return ( + o && + (o.$typeUrl === GetAuthenticatorsResponse.typeUrl || + (Array.isArray(o.accountAuthenticators) && + (!o.accountAuthenticators.length || + AccountAuthenticator.is(o.accountAuthenticators[0])))) + ); + }, + isSDK(o: any): o is GetAuthenticatorsResponseSDKType { + return ( + o && + (o.$typeUrl === GetAuthenticatorsResponse.typeUrl || + (Array.isArray(o.account_authenticators) && + (!o.account_authenticators.length || + AccountAuthenticator.isSDK(o.account_authenticators[0])))) + ); + }, + isAmino(o: any): o is GetAuthenticatorsResponseAmino { + return ( + o && + (o.$typeUrl === GetAuthenticatorsResponse.typeUrl || + (Array.isArray(o.account_authenticators) && + (!o.account_authenticators.length || + AccountAuthenticator.isAmino(o.account_authenticators[0])))) + ); + }, + encode( + message: GetAuthenticatorsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.accountAuthenticators) { + AccountAuthenticator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): GetAuthenticatorsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthenticatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAuthenticators.push( + AccountAuthenticator.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): GetAuthenticatorsResponse { + const message = createBaseGetAuthenticatorsResponse(); + message.accountAuthenticators = + object.accountAuthenticators?.map((e) => + AccountAuthenticator.fromPartial(e) + ) || []; + return message; + }, + fromAmino(object: GetAuthenticatorsResponseAmino): GetAuthenticatorsResponse { + const message = createBaseGetAuthenticatorsResponse(); + message.accountAuthenticators = + object.account_authenticators?.map((e) => + AccountAuthenticator.fromAmino(e) + ) || []; + return message; + }, + toAmino(message: GetAuthenticatorsResponse): GetAuthenticatorsResponseAmino { + const obj: any = {}; + if (message.accountAuthenticators) { + obj.account_authenticators = message.accountAuthenticators.map((e) => + e ? AccountAuthenticator.toAmino(e) : undefined + ); + } else { + obj.account_authenticators = message.accountAuthenticators; + } + return obj; + }, + fromAminoMsg( + object: GetAuthenticatorsResponseAminoMsg + ): GetAuthenticatorsResponse { + return GetAuthenticatorsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: GetAuthenticatorsResponse + ): GetAuthenticatorsResponseAminoMsg { + return { + type: 'osmosis/smartaccount/get-authenticators-response', + value: GetAuthenticatorsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: GetAuthenticatorsResponseProtoMsg + ): GetAuthenticatorsResponse { + return GetAuthenticatorsResponse.decode(message.value); + }, + toProto(message: GetAuthenticatorsResponse): Uint8Array { + return GetAuthenticatorsResponse.encode(message).finish(); + }, + toProtoMsg( + message: GetAuthenticatorsResponse + ): GetAuthenticatorsResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.GetAuthenticatorsResponse', + value: GetAuthenticatorsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + GetAuthenticatorsResponse.typeUrl, + GetAuthenticatorsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + GetAuthenticatorsResponse.aminoType, + GetAuthenticatorsResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.amino.ts new file mode 100644 index 00000000..4bb80fbe --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.amino.ts @@ -0,0 +1,23 @@ +//@ts-nocheck +import { + MsgAddAuthenticator, + MsgRemoveAuthenticator, + MsgSetActiveState, +} from './tx'; +export const AminoConverter = { + '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator': { + aminoType: 'osmosis/smartaccount/add-authenticator', + toAmino: MsgAddAuthenticator.toAmino, + fromAmino: MsgAddAuthenticator.fromAmino, + }, + '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator': { + aminoType: 'osmosis/smartaccount/remove-authenticator', + toAmino: MsgRemoveAuthenticator.toAmino, + fromAmino: MsgRemoveAuthenticator.fromAmino, + }, + '/osmosis.smartaccount.v1beta1.MsgSetActiveState': { + aminoType: 'osmosis/smartaccount/set-active-state', + toAmino: MsgSetActiveState.toAmino, + fromAmino: MsgSetActiveState.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.registry.ts new file mode 100644 index 00000000..634dd587 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.registry.ts @@ -0,0 +1,83 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgAddAuthenticator, + MsgRemoveAuthenticator, + MsgSetActiveState, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', MsgAddAuthenticator], + [ + '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + MsgRemoveAuthenticator, + ], + ['/osmosis.smartaccount.v1beta1.MsgSetActiveState', MsgSetActiveState], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value: MsgAddAuthenticator.encode(value).finish(), + }; + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value: MsgRemoveAuthenticator.encode(value).finish(), + }; + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value: MsgSetActiveState.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value, + }; + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value, + }; + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value, + }; + }, + }, + fromPartial: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value: MsgAddAuthenticator.fromPartial(value), + }; + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value: MsgRemoveAuthenticator.fromPartial(value), + }; + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value: MsgSetActiveState.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..3c83e335 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,79 @@ +//@ts-nocheck +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; + +import { + MsgAddAuthenticator, + MsgAddAuthenticatorResponse, + MsgRemoveAuthenticator, + MsgRemoveAuthenticatorResponse, + MsgSetActiveState, + MsgSetActiveStateResponse, +} from './tx'; +/** Msg defines the Msg service. */ +export interface Msg { + addAuthenticator( + request: MsgAddAuthenticator + ): Promise; + removeAuthenticator( + request: MsgRemoveAuthenticator + ): Promise; + /** + * SetActiveState sets the active state of the authenticator. + * Primarily used for circuit breaking. + */ + setActiveState( + request: MsgSetActiveState + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.addAuthenticator = this.addAuthenticator.bind(this); + this.removeAuthenticator = this.removeAuthenticator.bind(this); + this.setActiveState = this.setActiveState.bind(this); + } + addAuthenticator( + request: MsgAddAuthenticator + ): Promise { + const data = MsgAddAuthenticator.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.smartaccount.v1beta1.Msg', + 'AddAuthenticator', + data + ); + return promise.then((data) => + MsgAddAuthenticatorResponse.decode(new BinaryReader(data)) + ); + } + removeAuthenticator( + request: MsgRemoveAuthenticator + ): Promise { + const data = MsgRemoveAuthenticator.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.smartaccount.v1beta1.Msg', + 'RemoveAuthenticator', + data + ); + return promise.then((data) => + MsgRemoveAuthenticatorResponse.decode(new BinaryReader(data)) + ); + } + setActiveState( + request: MsgSetActiveState + ): Promise { + const data = MsgSetActiveState.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.smartaccount.v1beta1.Msg', + 'SetActiveState', + data + ); + return promise.then((data) => + MsgSetActiveStateResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.ts new file mode 100644 index 00000000..3c47b26a --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/smartaccount/v1beta1/tx.ts @@ -0,0 +1,1012 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { bytesFromBase64, base64FromBytes } from '../../../helpers'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticator { + sender: string; + type: string; + data: Uint8Array; +} +export interface MsgAddAuthenticatorProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator'; + value: Uint8Array; +} +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticatorAmino { + sender?: string; + type?: string; + data?: string; +} +export interface MsgAddAuthenticatorAminoMsg { + type: 'osmosis/smartaccount/add-authenticator'; + value: MsgAddAuthenticatorAmino; +} +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticatorSDKType { + sender: string; + type: string; + data: Uint8Array; +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponse { + /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ + success: boolean; +} +export interface MsgAddAuthenticatorResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse'; + value: Uint8Array; +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponseAmino { + /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ + success?: boolean; +} +export interface MsgAddAuthenticatorResponseAminoMsg { + type: 'osmosis/smartaccount/add-authenticator-response'; + value: MsgAddAuthenticatorResponseAmino; +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponseSDKType { + success: boolean; +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticator { + sender: string; + id: bigint; +} +export interface MsgRemoveAuthenticatorProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator'; + value: Uint8Array; +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticatorAmino { + sender?: string; + id?: string; +} +export interface MsgRemoveAuthenticatorAminoMsg { + type: 'osmosis/smartaccount/remove-authenticator'; + value: MsgRemoveAuthenticatorAmino; +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticatorSDKType { + sender: string; + id: bigint; +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponse { + /** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ + success: boolean; +} +export interface MsgRemoveAuthenticatorResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse'; + value: Uint8Array; +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponseAmino { + /** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ + success?: boolean; +} +export interface MsgRemoveAuthenticatorResponseAminoMsg { + type: 'osmosis/smartaccount/remove-authenticator-response'; + value: MsgRemoveAuthenticatorResponseAmino; +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponseSDKType { + success: boolean; +} +export interface MsgSetActiveState { + sender: string; + active: boolean; +} +export interface MsgSetActiveStateProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState'; + value: Uint8Array; +} +export interface MsgSetActiveStateAmino { + sender?: string; + active?: boolean; +} +export interface MsgSetActiveStateAminoMsg { + type: 'osmosis/smartaccount/set-active-state'; + value: MsgSetActiveStateAmino; +} +export interface MsgSetActiveStateSDKType { + sender: string; + active: boolean; +} +export interface MsgSetActiveStateResponse {} +export interface MsgSetActiveStateResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse'; + value: Uint8Array; +} +export interface MsgSetActiveStateResponseAmino {} +export interface MsgSetActiveStateResponseAminoMsg { + type: 'osmosis/smartaccount/set-active-state-response'; + value: MsgSetActiveStateResponseAmino; +} +export interface MsgSetActiveStateResponseSDKType {} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtension { + /** + * selected_authenticators holds the authenticator_id for the chosen + * authenticator per message. + */ + selectedAuthenticators: bigint[]; +} +export interface TxExtensionProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.TxExtension'; + value: Uint8Array; +} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtensionAmino { + /** + * selected_authenticators holds the authenticator_id for the chosen + * authenticator per message. + */ + selected_authenticators?: string[]; +} +export interface TxExtensionAminoMsg { + type: 'osmosis/smartaccount/tx-extension'; + value: TxExtensionAmino; +} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtensionSDKType { + selected_authenticators: bigint[]; +} +function createBaseMsgAddAuthenticator(): MsgAddAuthenticator { + return { + sender: '', + type: '', + data: new Uint8Array(), + }; +} +export const MsgAddAuthenticator = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + aminoType: 'osmosis/smartaccount/add-authenticator', + is(o: any): o is MsgAddAuthenticator { + return ( + o && + (o.$typeUrl === MsgAddAuthenticator.typeUrl || + (typeof o.sender === 'string' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ); + }, + isSDK(o: any): o is MsgAddAuthenticatorSDKType { + return ( + o && + (o.$typeUrl === MsgAddAuthenticator.typeUrl || + (typeof o.sender === 'string' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ); + }, + isAmino(o: any): o is MsgAddAuthenticatorAmino { + return ( + o && + (o.$typeUrl === MsgAddAuthenticator.typeUrl || + (typeof o.sender === 'string' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ); + }, + encode( + message: MsgAddAuthenticator, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.type !== '') { + writer.uint32(18).string(message.type); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddAuthenticator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAuthenticator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddAuthenticator { + const message = createBaseMsgAddAuthenticator(); + message.sender = object.sender ?? ''; + message.type = object.type ?? ''; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgAddAuthenticatorAmino): MsgAddAuthenticator { + const message = createBaseMsgAddAuthenticator(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgAddAuthenticator): MsgAddAuthenticatorAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.type = message.type === '' ? undefined : message.type; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAddAuthenticatorAminoMsg): MsgAddAuthenticator { + return MsgAddAuthenticator.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddAuthenticator): MsgAddAuthenticatorAminoMsg { + return { + type: 'osmosis/smartaccount/add-authenticator', + value: MsgAddAuthenticator.toAmino(message), + }; + }, + fromProtoMsg(message: MsgAddAuthenticatorProtoMsg): MsgAddAuthenticator { + return MsgAddAuthenticator.decode(message.value); + }, + toProto(message: MsgAddAuthenticator): Uint8Array { + return MsgAddAuthenticator.encode(message).finish(); + }, + toProtoMsg(message: MsgAddAuthenticator): MsgAddAuthenticatorProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value: MsgAddAuthenticator.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgAddAuthenticator.typeUrl, + MsgAddAuthenticator +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddAuthenticator.aminoType, + MsgAddAuthenticator.typeUrl +); +function createBaseMsgAddAuthenticatorResponse(): MsgAddAuthenticatorResponse { + return { + success: false, + }; +} +export const MsgAddAuthenticatorResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse', + aminoType: 'osmosis/smartaccount/add-authenticator-response', + is(o: any): o is MsgAddAuthenticatorResponse { + return ( + o && + (o.$typeUrl === MsgAddAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isSDK(o: any): o is MsgAddAuthenticatorResponseSDKType { + return ( + o && + (o.$typeUrl === MsgAddAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isAmino(o: any): o is MsgAddAuthenticatorResponseAmino { + return ( + o && + (o.$typeUrl === MsgAddAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + encode( + message: MsgAddAuthenticatorResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddAuthenticatorResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAuthenticatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgAddAuthenticatorResponse { + const message = createBaseMsgAddAuthenticatorResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino( + object: MsgAddAuthenticatorResponseAmino + ): MsgAddAuthenticatorResponse { + const message = createBaseMsgAddAuthenticatorResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino( + message: MsgAddAuthenticatorResponse + ): MsgAddAuthenticatorResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg( + object: MsgAddAuthenticatorResponseAminoMsg + ): MsgAddAuthenticatorResponse { + return MsgAddAuthenticatorResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgAddAuthenticatorResponse + ): MsgAddAuthenticatorResponseAminoMsg { + return { + type: 'osmosis/smartaccount/add-authenticator-response', + value: MsgAddAuthenticatorResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgAddAuthenticatorResponseProtoMsg + ): MsgAddAuthenticatorResponse { + return MsgAddAuthenticatorResponse.decode(message.value); + }, + toProto(message: MsgAddAuthenticatorResponse): Uint8Array { + return MsgAddAuthenticatorResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgAddAuthenticatorResponse + ): MsgAddAuthenticatorResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse', + value: MsgAddAuthenticatorResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgAddAuthenticatorResponse.typeUrl, + MsgAddAuthenticatorResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddAuthenticatorResponse.aminoType, + MsgAddAuthenticatorResponse.typeUrl +); +function createBaseMsgRemoveAuthenticator(): MsgRemoveAuthenticator { + return { + sender: '', + id: BigInt(0), + }; +} +export const MsgRemoveAuthenticator = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + aminoType: 'osmosis/smartaccount/remove-authenticator', + is(o: any): o is MsgRemoveAuthenticator { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticator.typeUrl || + (typeof o.sender === 'string' && typeof o.id === 'bigint')) + ); + }, + isSDK(o: any): o is MsgRemoveAuthenticatorSDKType { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticator.typeUrl || + (typeof o.sender === 'string' && typeof o.id === 'bigint')) + ); + }, + isAmino(o: any): o is MsgRemoveAuthenticatorAmino { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticator.typeUrl || + (typeof o.sender === 'string' && typeof o.id === 'bigint')) + ); + }, + encode( + message: MsgRemoveAuthenticator, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.id !== BigInt(0)) { + writer.uint32(16).uint64(message.id); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRemoveAuthenticator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveAuthenticator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveAuthenticator { + const message = createBaseMsgRemoveAuthenticator(); + message.sender = object.sender ?? ''; + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgRemoveAuthenticatorAmino): MsgRemoveAuthenticator { + const message = createBaseMsgRemoveAuthenticator(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgRemoveAuthenticatorAminoMsg): MsgRemoveAuthenticator { + return MsgRemoveAuthenticator.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorAminoMsg { + return { + type: 'osmosis/smartaccount/remove-authenticator', + value: MsgRemoveAuthenticator.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgRemoveAuthenticatorProtoMsg + ): MsgRemoveAuthenticator { + return MsgRemoveAuthenticator.decode(message.value); + }, + toProto(message: MsgRemoveAuthenticator): Uint8Array { + return MsgRemoveAuthenticator.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value: MsgRemoveAuthenticator.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgRemoveAuthenticator.typeUrl, + MsgRemoveAuthenticator +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRemoveAuthenticator.aminoType, + MsgRemoveAuthenticator.typeUrl +); +function createBaseMsgRemoveAuthenticatorResponse(): MsgRemoveAuthenticatorResponse { + return { + success: false, + }; +} +export const MsgRemoveAuthenticatorResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse', + aminoType: 'osmosis/smartaccount/remove-authenticator-response', + is(o: any): o is MsgRemoveAuthenticatorResponse { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isSDK(o: any): o is MsgRemoveAuthenticatorResponseSDKType { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + isAmino(o: any): o is MsgRemoveAuthenticatorResponseAmino { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ); + }, + encode( + message: MsgRemoveAuthenticatorResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRemoveAuthenticatorResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveAuthenticatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgRemoveAuthenticatorResponse { + const message = createBaseMsgRemoveAuthenticatorResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino( + object: MsgRemoveAuthenticatorResponseAmino + ): MsgRemoveAuthenticatorResponse { + const message = createBaseMsgRemoveAuthenticatorResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino( + message: MsgRemoveAuthenticatorResponse + ): MsgRemoveAuthenticatorResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg( + object: MsgRemoveAuthenticatorResponseAminoMsg + ): MsgRemoveAuthenticatorResponse { + return MsgRemoveAuthenticatorResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgRemoveAuthenticatorResponse + ): MsgRemoveAuthenticatorResponseAminoMsg { + return { + type: 'osmosis/smartaccount/remove-authenticator-response', + value: MsgRemoveAuthenticatorResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgRemoveAuthenticatorResponseProtoMsg + ): MsgRemoveAuthenticatorResponse { + return MsgRemoveAuthenticatorResponse.decode(message.value); + }, + toProto(message: MsgRemoveAuthenticatorResponse): Uint8Array { + return MsgRemoveAuthenticatorResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgRemoveAuthenticatorResponse + ): MsgRemoveAuthenticatorResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse', + value: MsgRemoveAuthenticatorResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgRemoveAuthenticatorResponse.typeUrl, + MsgRemoveAuthenticatorResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRemoveAuthenticatorResponse.aminoType, + MsgRemoveAuthenticatorResponse.typeUrl +); +function createBaseMsgSetActiveState(): MsgSetActiveState { + return { + sender: '', + active: false, + }; +} +export const MsgSetActiveState = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + aminoType: 'osmosis/smartaccount/set-active-state', + is(o: any): o is MsgSetActiveState { + return ( + o && + (o.$typeUrl === MsgSetActiveState.typeUrl || + (typeof o.sender === 'string' && typeof o.active === 'boolean')) + ); + }, + isSDK(o: any): o is MsgSetActiveStateSDKType { + return ( + o && + (o.$typeUrl === MsgSetActiveState.typeUrl || + (typeof o.sender === 'string' && typeof o.active === 'boolean')) + ); + }, + isAmino(o: any): o is MsgSetActiveStateAmino { + return ( + o && + (o.$typeUrl === MsgSetActiveState.typeUrl || + (typeof o.sender === 'string' && typeof o.active === 'boolean')) + ); + }, + encode( + message: MsgSetActiveState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.active === true) { + writer.uint32(16).bool(message.active); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetActiveState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetActiveState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetActiveState { + const message = createBaseMsgSetActiveState(); + message.sender = object.sender ?? ''; + message.active = object.active ?? false; + return message; + }, + fromAmino(object: MsgSetActiveStateAmino): MsgSetActiveState { + const message = createBaseMsgSetActiveState(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } + return message; + }, + toAmino(message: MsgSetActiveState): MsgSetActiveStateAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.active = message.active === false ? undefined : message.active; + return obj; + }, + fromAminoMsg(object: MsgSetActiveStateAminoMsg): MsgSetActiveState { + return MsgSetActiveState.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetActiveState): MsgSetActiveStateAminoMsg { + return { + type: 'osmosis/smartaccount/set-active-state', + value: MsgSetActiveState.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetActiveStateProtoMsg): MsgSetActiveState { + return MsgSetActiveState.decode(message.value); + }, + toProto(message: MsgSetActiveState): Uint8Array { + return MsgSetActiveState.encode(message).finish(); + }, + toProtoMsg(message: MsgSetActiveState): MsgSetActiveStateProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value: MsgSetActiveState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSetActiveState.typeUrl, MsgSetActiveState); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetActiveState.aminoType, + MsgSetActiveState.typeUrl +); +function createBaseMsgSetActiveStateResponse(): MsgSetActiveStateResponse { + return {}; +} +export const MsgSetActiveStateResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse', + aminoType: 'osmosis/smartaccount/set-active-state-response', + is(o: any): o is MsgSetActiveStateResponse { + return o && o.$typeUrl === MsgSetActiveStateResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetActiveStateResponseSDKType { + return o && o.$typeUrl === MsgSetActiveStateResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetActiveStateResponseAmino { + return o && o.$typeUrl === MsgSetActiveStateResponse.typeUrl; + }, + encode( + _: MsgSetActiveStateResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetActiveStateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetActiveStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetActiveStateResponse { + const message = createBaseMsgSetActiveStateResponse(); + return message; + }, + fromAmino(_: MsgSetActiveStateResponseAmino): MsgSetActiveStateResponse { + const message = createBaseMsgSetActiveStateResponse(); + return message; + }, + toAmino(_: MsgSetActiveStateResponse): MsgSetActiveStateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetActiveStateResponseAminoMsg + ): MsgSetActiveStateResponse { + return MsgSetActiveStateResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetActiveStateResponse + ): MsgSetActiveStateResponseAminoMsg { + return { + type: 'osmosis/smartaccount/set-active-state-response', + value: MsgSetActiveStateResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetActiveStateResponseProtoMsg + ): MsgSetActiveStateResponse { + return MsgSetActiveStateResponse.decode(message.value); + }, + toProto(message: MsgSetActiveStateResponse): Uint8Array { + return MsgSetActiveStateResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetActiveStateResponse + ): MsgSetActiveStateResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse', + value: MsgSetActiveStateResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetActiveStateResponse.typeUrl, + MsgSetActiveStateResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetActiveStateResponse.aminoType, + MsgSetActiveStateResponse.typeUrl +); +function createBaseTxExtension(): TxExtension { + return { + selectedAuthenticators: [], + }; +} +export const TxExtension = { + typeUrl: '/osmosis.smartaccount.v1beta1.TxExtension', + aminoType: 'osmosis/smartaccount/tx-extension', + is(o: any): o is TxExtension { + return ( + o && + (o.$typeUrl === TxExtension.typeUrl || + (Array.isArray(o.selectedAuthenticators) && + (!o.selectedAuthenticators.length || + typeof o.selectedAuthenticators[0] === 'bigint'))) + ); + }, + isSDK(o: any): o is TxExtensionSDKType { + return ( + o && + (o.$typeUrl === TxExtension.typeUrl || + (Array.isArray(o.selected_authenticators) && + (!o.selected_authenticators.length || + typeof o.selected_authenticators[0] === 'bigint'))) + ); + }, + isAmino(o: any): o is TxExtensionAmino { + return ( + o && + (o.$typeUrl === TxExtension.typeUrl || + (Array.isArray(o.selected_authenticators) && + (!o.selected_authenticators.length || + typeof o.selected_authenticators[0] === 'bigint'))) + ); + }, + encode( + message: TxExtension, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.selectedAuthenticators) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxExtension { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxExtension(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.selectedAuthenticators.push(reader.uint64()); + } + } else { + message.selectedAuthenticators.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxExtension { + const message = createBaseTxExtension(); + message.selectedAuthenticators = + object.selectedAuthenticators?.map((e) => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: TxExtensionAmino): TxExtension { + const message = createBaseTxExtension(); + message.selectedAuthenticators = + object.selected_authenticators?.map((e) => BigInt(e)) || []; + return message; + }, + toAmino(message: TxExtension): TxExtensionAmino { + const obj: any = {}; + if (message.selectedAuthenticators) { + obj.selected_authenticators = message.selectedAuthenticators.map((e) => + e.toString() + ); + } else { + obj.selected_authenticators = message.selectedAuthenticators; + } + return obj; + }, + fromAminoMsg(object: TxExtensionAminoMsg): TxExtension { + return TxExtension.fromAmino(object.value); + }, + toAminoMsg(message: TxExtension): TxExtensionAminoMsg { + return { + type: 'osmosis/smartaccount/tx-extension', + value: TxExtension.toAmino(message), + }; + }, + fromProtoMsg(message: TxExtensionProtoMsg): TxExtension { + return TxExtension.decode(message.value); + }, + toProto(message: TxExtension): Uint8Array { + return TxExtension.encode(message).finish(); + }, + toProtoMsg(message: TxExtension): TxExtensionProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.TxExtension', + value: TxExtension.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(TxExtension.typeUrl, TxExtension); +GlobalDecoderRegistry.registerAminoProtoMapping( + TxExtension.aminoType, + TxExtension.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/superfluid/superfluid.ts b/packages/cosmos/src/proto_export/osmosis/superfluid/superfluid.ts new file mode 100644 index 00000000..5c6d3dfa --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/superfluid/superfluid.ts @@ -0,0 +1,1423 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin'; +import { + SyntheticLock, + SyntheticLockAmino, + SyntheticLockSDKType, +} from '../lockup/lock'; +import { isSet } from '../../helpers'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +/** + * SuperfluidAssetType indicates whether the superfluid asset is + * a native token, lp share of a pool, or concentrated share of a pool + */ +export enum SuperfluidAssetType { + SuperfluidAssetTypeNative = 0, + SuperfluidAssetTypeLPShare = 1, + SuperfluidAssetTypeConcentratedShare = 2, + UNRECOGNIZED = -1, +} +export const SuperfluidAssetTypeSDKType = SuperfluidAssetType; +export const SuperfluidAssetTypeAmino = SuperfluidAssetType; +export function superfluidAssetTypeFromJSON(object: any): SuperfluidAssetType { + switch (object) { + case 0: + case 'SuperfluidAssetTypeNative': + return SuperfluidAssetType.SuperfluidAssetTypeNative; + case 1: + case 'SuperfluidAssetTypeLPShare': + return SuperfluidAssetType.SuperfluidAssetTypeLPShare; + case 2: + case 'SuperfluidAssetTypeConcentratedShare': + return SuperfluidAssetType.SuperfluidAssetTypeConcentratedShare; + case -1: + case 'UNRECOGNIZED': + default: + return SuperfluidAssetType.UNRECOGNIZED; + } +} +export function superfluidAssetTypeToJSON(object: SuperfluidAssetType): string { + switch (object) { + case SuperfluidAssetType.SuperfluidAssetTypeNative: + return 'SuperfluidAssetTypeNative'; + case SuperfluidAssetType.SuperfluidAssetTypeLPShare: + return 'SuperfluidAssetTypeLPShare'; + case SuperfluidAssetType.SuperfluidAssetTypeConcentratedShare: + return 'SuperfluidAssetTypeConcentratedShare'; + case SuperfluidAssetType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED'; + } +} +/** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ +export interface SuperfluidAsset { + denom: string; + /** + * AssetType indicates whether the superfluid asset is a native token or an lp + * share + */ + assetType: SuperfluidAssetType; +} +export interface SuperfluidAssetProtoMsg { + typeUrl: '/osmosis.superfluid.SuperfluidAsset'; + value: Uint8Array; +} +/** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ +export interface SuperfluidAssetAmino { + denom?: string; + /** + * AssetType indicates whether the superfluid asset is a native token or an lp + * share + */ + asset_type?: SuperfluidAssetType; +} +export interface SuperfluidAssetAminoMsg { + type: 'osmosis/superfluid-asset'; + value: SuperfluidAssetAmino; +} +/** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ +export interface SuperfluidAssetSDKType { + denom: string; + asset_type: SuperfluidAssetType; +} +/** + * SuperfluidIntermediaryAccount takes the role of intermediary between LP token + * and OSMO tokens for superfluid staking. The intermediary account is the + * actual account responsible for delegation, not the validator account itself. + */ +export interface SuperfluidIntermediaryAccount { + /** Denom indicates the denom of the superfluid asset. */ + denom: string; + valAddr: string; + /** perpetual gauge for rewards distribution */ + gaugeId: bigint; +} +export interface SuperfluidIntermediaryAccountProtoMsg { + typeUrl: '/osmosis.superfluid.SuperfluidIntermediaryAccount'; + value: Uint8Array; +} +/** + * SuperfluidIntermediaryAccount takes the role of intermediary between LP token + * and OSMO tokens for superfluid staking. The intermediary account is the + * actual account responsible for delegation, not the validator account itself. + */ +export interface SuperfluidIntermediaryAccountAmino { + /** Denom indicates the denom of the superfluid asset. */ + denom?: string; + val_addr?: string; + /** perpetual gauge for rewards distribution */ + gauge_id?: string; +} +export interface SuperfluidIntermediaryAccountAminoMsg { + type: 'osmosis/superfluid-intermediary-account'; + value: SuperfluidIntermediaryAccountAmino; +} +/** + * SuperfluidIntermediaryAccount takes the role of intermediary between LP token + * and OSMO tokens for superfluid staking. The intermediary account is the + * actual account responsible for delegation, not the validator account itself. + */ +export interface SuperfluidIntermediaryAccountSDKType { + denom: string; + val_addr: string; + gauge_id: bigint; +} +/** + * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we + * treat an LP share as having, for all of epoch N. Eventually this is intended + * to be set as the Time-weighted-average-osmo-backing for the entire duration + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. + */ +export interface OsmoEquivalentMultiplierRecord { + epochNumber: bigint; + /** superfluid asset denom, can be LP token or native token */ + denom: string; + multiplier: string; +} +export interface OsmoEquivalentMultiplierRecordProtoMsg { + typeUrl: '/osmosis.superfluid.OsmoEquivalentMultiplierRecord'; + value: Uint8Array; +} +/** + * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we + * treat an LP share as having, for all of epoch N. Eventually this is intended + * to be set as the Time-weighted-average-osmo-backing for the entire duration + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. + */ +export interface OsmoEquivalentMultiplierRecordAmino { + epoch_number?: string; + /** superfluid asset denom, can be LP token or native token */ + denom?: string; + multiplier?: string; +} +export interface OsmoEquivalentMultiplierRecordAminoMsg { + type: 'osmosis/osmo-equivalent-multiplier-record'; + value: OsmoEquivalentMultiplierRecordAmino; +} +/** + * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we + * treat an LP share as having, for all of epoch N. Eventually this is intended + * to be set as the Time-weighted-average-osmo-backing for the entire duration + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. + */ +export interface OsmoEquivalentMultiplierRecordSDKType { + epoch_number: bigint; + denom: string; + multiplier: string; +} +/** + * SuperfluidDelegationRecord is a struct used to indicate superfluid + * delegations of an account in the state machine in a user friendly form. + */ +export interface SuperfluidDelegationRecord { + delegatorAddress: string; + validatorAddress: string; + delegationAmount: Coin; + equivalentStakedAmount?: Coin; +} +export interface SuperfluidDelegationRecordProtoMsg { + typeUrl: '/osmosis.superfluid.SuperfluidDelegationRecord'; + value: Uint8Array; +} +/** + * SuperfluidDelegationRecord is a struct used to indicate superfluid + * delegations of an account in the state machine in a user friendly form. + */ +export interface SuperfluidDelegationRecordAmino { + delegator_address?: string; + validator_address?: string; + delegation_amount?: CoinAmino; + equivalent_staked_amount?: CoinAmino; +} +export interface SuperfluidDelegationRecordAminoMsg { + type: 'osmosis/superfluid-delegation-record'; + value: SuperfluidDelegationRecordAmino; +} +/** + * SuperfluidDelegationRecord is a struct used to indicate superfluid + * delegations of an account in the state machine in a user friendly form. + */ +export interface SuperfluidDelegationRecordSDKType { + delegator_address: string; + validator_address: string; + delegation_amount: CoinSDKType; + equivalent_staked_amount?: CoinSDKType; +} +/** + * LockIdIntermediaryAccountConnection is a struct used to indicate the + * relationship between the underlying lock id and superfluid delegation done + * via lp shares. + */ +export interface LockIdIntermediaryAccountConnection { + lockId: bigint; + intermediaryAccount: string; +} +export interface LockIdIntermediaryAccountConnectionProtoMsg { + typeUrl: '/osmosis.superfluid.LockIdIntermediaryAccountConnection'; + value: Uint8Array; +} +/** + * LockIdIntermediaryAccountConnection is a struct used to indicate the + * relationship between the underlying lock id and superfluid delegation done + * via lp shares. + */ +export interface LockIdIntermediaryAccountConnectionAmino { + lock_id?: string; + intermediary_account?: string; +} +export interface LockIdIntermediaryAccountConnectionAminoMsg { + type: 'osmosis/lock-id-intermediary-account-connection'; + value: LockIdIntermediaryAccountConnectionAmino; +} +/** + * LockIdIntermediaryAccountConnection is a struct used to indicate the + * relationship between the underlying lock id and superfluid delegation done + * via lp shares. + */ +export interface LockIdIntermediaryAccountConnectionSDKType { + lock_id: bigint; + intermediary_account: string; +} +export interface UnpoolWhitelistedPools { + ids: bigint[]; +} +export interface UnpoolWhitelistedPoolsProtoMsg { + typeUrl: '/osmosis.superfluid.UnpoolWhitelistedPools'; + value: Uint8Array; +} +export interface UnpoolWhitelistedPoolsAmino { + ids?: string[]; +} +export interface UnpoolWhitelistedPoolsAminoMsg { + type: 'osmosis/unpool-whitelisted-pools'; + value: UnpoolWhitelistedPoolsAmino; +} +export interface UnpoolWhitelistedPoolsSDKType { + ids: bigint[]; +} +export interface ConcentratedPoolUserPositionRecord { + validatorAddress: string; + positionId: bigint; + lockId: bigint; + syntheticLock: SyntheticLock; + delegationAmount: Coin; + equivalentStakedAmount?: Coin; +} +export interface ConcentratedPoolUserPositionRecordProtoMsg { + typeUrl: '/osmosis.superfluid.ConcentratedPoolUserPositionRecord'; + value: Uint8Array; +} +export interface ConcentratedPoolUserPositionRecordAmino { + validator_address?: string; + position_id?: string; + lock_id?: string; + synthetic_lock?: SyntheticLockAmino; + delegation_amount?: CoinAmino; + equivalent_staked_amount?: CoinAmino; +} +export interface ConcentratedPoolUserPositionRecordAminoMsg { + type: 'osmosis/concentrated-pool-user-position-record'; + value: ConcentratedPoolUserPositionRecordAmino; +} +export interface ConcentratedPoolUserPositionRecordSDKType { + validator_address: string; + position_id: bigint; + lock_id: bigint; + synthetic_lock: SyntheticLockSDKType; + delegation_amount: CoinSDKType; + equivalent_staked_amount?: CoinSDKType; +} +function createBaseSuperfluidAsset(): SuperfluidAsset { + return { + denom: '', + assetType: 0, + }; +} +export const SuperfluidAsset = { + typeUrl: '/osmosis.superfluid.SuperfluidAsset', + aminoType: 'osmosis/superfluid-asset', + is(o: any): o is SuperfluidAsset { + return ( + o && + (o.$typeUrl === SuperfluidAsset.typeUrl || + (typeof o.denom === 'string' && isSet(o.assetType))) + ); + }, + isSDK(o: any): o is SuperfluidAssetSDKType { + return ( + o && + (o.$typeUrl === SuperfluidAsset.typeUrl || + (typeof o.denom === 'string' && isSet(o.asset_type))) + ); + }, + isAmino(o: any): o is SuperfluidAssetAmino { + return ( + o && + (o.$typeUrl === SuperfluidAsset.typeUrl || + (typeof o.denom === 'string' && isSet(o.asset_type))) + ); + }, + encode( + message: SuperfluidAsset, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.assetType !== 0) { + writer.uint32(16).int32(message.assetType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SuperfluidAsset { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSuperfluidAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.assetType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SuperfluidAsset { + const message = createBaseSuperfluidAsset(); + message.denom = object.denom ?? ''; + message.assetType = object.assetType ?? 0; + return message; + }, + fromAmino(object: SuperfluidAssetAmino): SuperfluidAsset { + const message = createBaseSuperfluidAsset(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.asset_type !== undefined && object.asset_type !== null) { + message.assetType = object.asset_type; + } + return message; + }, + toAmino(message: SuperfluidAsset): SuperfluidAssetAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.asset_type = message.assetType === 0 ? undefined : message.assetType; + return obj; + }, + fromAminoMsg(object: SuperfluidAssetAminoMsg): SuperfluidAsset { + return SuperfluidAsset.fromAmino(object.value); + }, + toAminoMsg(message: SuperfluidAsset): SuperfluidAssetAminoMsg { + return { + type: 'osmosis/superfluid-asset', + value: SuperfluidAsset.toAmino(message), + }; + }, + fromProtoMsg(message: SuperfluidAssetProtoMsg): SuperfluidAsset { + return SuperfluidAsset.decode(message.value); + }, + toProto(message: SuperfluidAsset): Uint8Array { + return SuperfluidAsset.encode(message).finish(); + }, + toProtoMsg(message: SuperfluidAsset): SuperfluidAssetProtoMsg { + return { + typeUrl: '/osmosis.superfluid.SuperfluidAsset', + value: SuperfluidAsset.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(SuperfluidAsset.typeUrl, SuperfluidAsset); +GlobalDecoderRegistry.registerAminoProtoMapping( + SuperfluidAsset.aminoType, + SuperfluidAsset.typeUrl +); +function createBaseSuperfluidIntermediaryAccount(): SuperfluidIntermediaryAccount { + return { + denom: '', + valAddr: '', + gaugeId: BigInt(0), + }; +} +export const SuperfluidIntermediaryAccount = { + typeUrl: '/osmosis.superfluid.SuperfluidIntermediaryAccount', + aminoType: 'osmosis/superfluid-intermediary-account', + is(o: any): o is SuperfluidIntermediaryAccount { + return ( + o && + (o.$typeUrl === SuperfluidIntermediaryAccount.typeUrl || + (typeof o.denom === 'string' && + typeof o.valAddr === 'string' && + typeof o.gaugeId === 'bigint')) + ); + }, + isSDK(o: any): o is SuperfluidIntermediaryAccountSDKType { + return ( + o && + (o.$typeUrl === SuperfluidIntermediaryAccount.typeUrl || + (typeof o.denom === 'string' && + typeof o.val_addr === 'string' && + typeof o.gauge_id === 'bigint')) + ); + }, + isAmino(o: any): o is SuperfluidIntermediaryAccountAmino { + return ( + o && + (o.$typeUrl === SuperfluidIntermediaryAccount.typeUrl || + (typeof o.denom === 'string' && + typeof o.val_addr === 'string' && + typeof o.gauge_id === 'bigint')) + ); + }, + encode( + message: SuperfluidIntermediaryAccount, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.valAddr !== '') { + writer.uint32(18).string(message.valAddr); + } + if (message.gaugeId !== BigInt(0)) { + writer.uint32(24).uint64(message.gaugeId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SuperfluidIntermediaryAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSuperfluidIntermediaryAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.valAddr = reader.string(); + break; + case 3: + message.gaugeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SuperfluidIntermediaryAccount { + const message = createBaseSuperfluidIntermediaryAccount(); + message.denom = object.denom ?? ''; + message.valAddr = object.valAddr ?? ''; + message.gaugeId = + object.gaugeId !== undefined && object.gaugeId !== null + ? BigInt(object.gaugeId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: SuperfluidIntermediaryAccountAmino + ): SuperfluidIntermediaryAccount { + const message = createBaseSuperfluidIntermediaryAccount(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + return message; + }, + toAmino( + message: SuperfluidIntermediaryAccount + ): SuperfluidIntermediaryAccountAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr; + obj.gauge_id = + message.gaugeId !== BigInt(0) ? message.gaugeId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: SuperfluidIntermediaryAccountAminoMsg + ): SuperfluidIntermediaryAccount { + return SuperfluidIntermediaryAccount.fromAmino(object.value); + }, + toAminoMsg( + message: SuperfluidIntermediaryAccount + ): SuperfluidIntermediaryAccountAminoMsg { + return { + type: 'osmosis/superfluid-intermediary-account', + value: SuperfluidIntermediaryAccount.toAmino(message), + }; + }, + fromProtoMsg( + message: SuperfluidIntermediaryAccountProtoMsg + ): SuperfluidIntermediaryAccount { + return SuperfluidIntermediaryAccount.decode(message.value); + }, + toProto(message: SuperfluidIntermediaryAccount): Uint8Array { + return SuperfluidIntermediaryAccount.encode(message).finish(); + }, + toProtoMsg( + message: SuperfluidIntermediaryAccount + ): SuperfluidIntermediaryAccountProtoMsg { + return { + typeUrl: '/osmosis.superfluid.SuperfluidIntermediaryAccount', + value: SuperfluidIntermediaryAccount.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SuperfluidIntermediaryAccount.typeUrl, + SuperfluidIntermediaryAccount +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SuperfluidIntermediaryAccount.aminoType, + SuperfluidIntermediaryAccount.typeUrl +); +function createBaseOsmoEquivalentMultiplierRecord(): OsmoEquivalentMultiplierRecord { + return { + epochNumber: BigInt(0), + denom: '', + multiplier: '', + }; +} +export const OsmoEquivalentMultiplierRecord = { + typeUrl: '/osmosis.superfluid.OsmoEquivalentMultiplierRecord', + aminoType: 'osmosis/osmo-equivalent-multiplier-record', + is(o: any): o is OsmoEquivalentMultiplierRecord { + return ( + o && + (o.$typeUrl === OsmoEquivalentMultiplierRecord.typeUrl || + (typeof o.epochNumber === 'bigint' && + typeof o.denom === 'string' && + typeof o.multiplier === 'string')) + ); + }, + isSDK(o: any): o is OsmoEquivalentMultiplierRecordSDKType { + return ( + o && + (o.$typeUrl === OsmoEquivalentMultiplierRecord.typeUrl || + (typeof o.epoch_number === 'bigint' && + typeof o.denom === 'string' && + typeof o.multiplier === 'string')) + ); + }, + isAmino(o: any): o is OsmoEquivalentMultiplierRecordAmino { + return ( + o && + (o.$typeUrl === OsmoEquivalentMultiplierRecord.typeUrl || + (typeof o.epoch_number === 'bigint' && + typeof o.denom === 'string' && + typeof o.multiplier === 'string')) + ); + }, + encode( + message: OsmoEquivalentMultiplierRecord, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { + writer.uint32(8).int64(message.epochNumber); + } + if (message.denom !== '') { + writer.uint32(18).string(message.denom); + } + if (message.multiplier !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.multiplier, 18).atomics); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): OsmoEquivalentMultiplierRecord { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOsmoEquivalentMultiplierRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochNumber = reader.int64(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.multiplier = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): OsmoEquivalentMultiplierRecord { + const message = createBaseOsmoEquivalentMultiplierRecord(); + message.epochNumber = + object.epochNumber !== undefined && object.epochNumber !== null + ? BigInt(object.epochNumber.toString()) + : BigInt(0); + message.denom = object.denom ?? ''; + message.multiplier = object.multiplier ?? ''; + return message; + }, + fromAmino( + object: OsmoEquivalentMultiplierRecordAmino + ): OsmoEquivalentMultiplierRecord { + const message = createBaseOsmoEquivalentMultiplierRecord(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.multiplier !== undefined && object.multiplier !== null) { + message.multiplier = object.multiplier; + } + return message; + }, + toAmino( + message: OsmoEquivalentMultiplierRecord + ): OsmoEquivalentMultiplierRecordAmino { + const obj: any = {}; + obj.epoch_number = + message.epochNumber !== BigInt(0) + ? message.epochNumber.toString() + : undefined; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.multiplier = message.multiplier === '' ? undefined : message.multiplier; + return obj; + }, + fromAminoMsg( + object: OsmoEquivalentMultiplierRecordAminoMsg + ): OsmoEquivalentMultiplierRecord { + return OsmoEquivalentMultiplierRecord.fromAmino(object.value); + }, + toAminoMsg( + message: OsmoEquivalentMultiplierRecord + ): OsmoEquivalentMultiplierRecordAminoMsg { + return { + type: 'osmosis/osmo-equivalent-multiplier-record', + value: OsmoEquivalentMultiplierRecord.toAmino(message), + }; + }, + fromProtoMsg( + message: OsmoEquivalentMultiplierRecordProtoMsg + ): OsmoEquivalentMultiplierRecord { + return OsmoEquivalentMultiplierRecord.decode(message.value); + }, + toProto(message: OsmoEquivalentMultiplierRecord): Uint8Array { + return OsmoEquivalentMultiplierRecord.encode(message).finish(); + }, + toProtoMsg( + message: OsmoEquivalentMultiplierRecord + ): OsmoEquivalentMultiplierRecordProtoMsg { + return { + typeUrl: '/osmosis.superfluid.OsmoEquivalentMultiplierRecord', + value: OsmoEquivalentMultiplierRecord.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + OsmoEquivalentMultiplierRecord.typeUrl, + OsmoEquivalentMultiplierRecord +); +GlobalDecoderRegistry.registerAminoProtoMapping( + OsmoEquivalentMultiplierRecord.aminoType, + OsmoEquivalentMultiplierRecord.typeUrl +); +function createBaseSuperfluidDelegationRecord(): SuperfluidDelegationRecord { + return { + delegatorAddress: '', + validatorAddress: '', + delegationAmount: Coin.fromPartial({}), + equivalentStakedAmount: undefined, + }; +} +export const SuperfluidDelegationRecord = { + typeUrl: '/osmosis.superfluid.SuperfluidDelegationRecord', + aminoType: 'osmosis/superfluid-delegation-record', + is(o: any): o is SuperfluidDelegationRecord { + return ( + o && + (o.$typeUrl === SuperfluidDelegationRecord.typeUrl || + (typeof o.delegatorAddress === 'string' && + typeof o.validatorAddress === 'string' && + Coin.is(o.delegationAmount))) + ); + }, + isSDK(o: any): o is SuperfluidDelegationRecordSDKType { + return ( + o && + (o.$typeUrl === SuperfluidDelegationRecord.typeUrl || + (typeof o.delegator_address === 'string' && + typeof o.validator_address === 'string' && + Coin.isSDK(o.delegation_amount))) + ); + }, + isAmino(o: any): o is SuperfluidDelegationRecordAmino { + return ( + o && + (o.$typeUrl === SuperfluidDelegationRecord.typeUrl || + (typeof o.delegator_address === 'string' && + typeof o.validator_address === 'string' && + Coin.isAmino(o.delegation_amount))) + ); + }, + encode( + message: SuperfluidDelegationRecord, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegatorAddress !== '') { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress); + } + if (message.delegationAmount !== undefined) { + Coin.encode(message.delegationAmount, writer.uint32(26).fork()).ldelim(); + } + if (message.equivalentStakedAmount !== undefined) { + Coin.encode( + message.equivalentStakedAmount, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SuperfluidDelegationRecord { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSuperfluidDelegationRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.delegationAmount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.equivalentStakedAmount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SuperfluidDelegationRecord { + const message = createBaseSuperfluidDelegationRecord(); + message.delegatorAddress = object.delegatorAddress ?? ''; + message.validatorAddress = object.validatorAddress ?? ''; + message.delegationAmount = + object.delegationAmount !== undefined && object.delegationAmount !== null + ? Coin.fromPartial(object.delegationAmount) + : undefined; + message.equivalentStakedAmount = + object.equivalentStakedAmount !== undefined && + object.equivalentStakedAmount !== null + ? Coin.fromPartial(object.equivalentStakedAmount) + : undefined; + return message; + }, + fromAmino( + object: SuperfluidDelegationRecordAmino + ): SuperfluidDelegationRecord { + const message = createBaseSuperfluidDelegationRecord(); + if ( + object.delegator_address !== undefined && + object.delegator_address !== null + ) { + message.delegatorAddress = object.delegator_address; + } + if ( + object.validator_address !== undefined && + object.validator_address !== null + ) { + message.validatorAddress = object.validator_address; + } + if ( + object.delegation_amount !== undefined && + object.delegation_amount !== null + ) { + message.delegationAmount = Coin.fromAmino(object.delegation_amount); + } + if ( + object.equivalent_staked_amount !== undefined && + object.equivalent_staked_amount !== null + ) { + message.equivalentStakedAmount = Coin.fromAmino( + object.equivalent_staked_amount + ); + } + return message; + }, + toAmino( + message: SuperfluidDelegationRecord + ): SuperfluidDelegationRecordAmino { + const obj: any = {}; + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress; + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress; + obj.delegation_amount = message.delegationAmount + ? Coin.toAmino(message.delegationAmount) + : undefined; + obj.equivalent_staked_amount = message.equivalentStakedAmount + ? Coin.toAmino(message.equivalentStakedAmount) + : undefined; + return obj; + }, + fromAminoMsg( + object: SuperfluidDelegationRecordAminoMsg + ): SuperfluidDelegationRecord { + return SuperfluidDelegationRecord.fromAmino(object.value); + }, + toAminoMsg( + message: SuperfluidDelegationRecord + ): SuperfluidDelegationRecordAminoMsg { + return { + type: 'osmosis/superfluid-delegation-record', + value: SuperfluidDelegationRecord.toAmino(message), + }; + }, + fromProtoMsg( + message: SuperfluidDelegationRecordProtoMsg + ): SuperfluidDelegationRecord { + return SuperfluidDelegationRecord.decode(message.value); + }, + toProto(message: SuperfluidDelegationRecord): Uint8Array { + return SuperfluidDelegationRecord.encode(message).finish(); + }, + toProtoMsg( + message: SuperfluidDelegationRecord + ): SuperfluidDelegationRecordProtoMsg { + return { + typeUrl: '/osmosis.superfluid.SuperfluidDelegationRecord', + value: SuperfluidDelegationRecord.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SuperfluidDelegationRecord.typeUrl, + SuperfluidDelegationRecord +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SuperfluidDelegationRecord.aminoType, + SuperfluidDelegationRecord.typeUrl +); +function createBaseLockIdIntermediaryAccountConnection(): LockIdIntermediaryAccountConnection { + return { + lockId: BigInt(0), + intermediaryAccount: '', + }; +} +export const LockIdIntermediaryAccountConnection = { + typeUrl: '/osmosis.superfluid.LockIdIntermediaryAccountConnection', + aminoType: 'osmosis/lock-id-intermediary-account-connection', + is(o: any): o is LockIdIntermediaryAccountConnection { + return ( + o && + (o.$typeUrl === LockIdIntermediaryAccountConnection.typeUrl || + (typeof o.lockId === 'bigint' && + typeof o.intermediaryAccount === 'string')) + ); + }, + isSDK(o: any): o is LockIdIntermediaryAccountConnectionSDKType { + return ( + o && + (o.$typeUrl === LockIdIntermediaryAccountConnection.typeUrl || + (typeof o.lock_id === 'bigint' && + typeof o.intermediary_account === 'string')) + ); + }, + isAmino(o: any): o is LockIdIntermediaryAccountConnectionAmino { + return ( + o && + (o.$typeUrl === LockIdIntermediaryAccountConnection.typeUrl || + (typeof o.lock_id === 'bigint' && + typeof o.intermediary_account === 'string')) + ); + }, + encode( + message: LockIdIntermediaryAccountConnection, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + if (message.intermediaryAccount !== '') { + writer.uint32(18).string(message.intermediaryAccount); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): LockIdIntermediaryAccountConnection { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockIdIntermediaryAccountConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + case 2: + message.intermediaryAccount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): LockIdIntermediaryAccountConnection { + const message = createBaseLockIdIntermediaryAccountConnection(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + message.intermediaryAccount = object.intermediaryAccount ?? ''; + return message; + }, + fromAmino( + object: LockIdIntermediaryAccountConnectionAmino + ): LockIdIntermediaryAccountConnection { + const message = createBaseLockIdIntermediaryAccountConnection(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if ( + object.intermediary_account !== undefined && + object.intermediary_account !== null + ) { + message.intermediaryAccount = object.intermediary_account; + } + return message; + }, + toAmino( + message: LockIdIntermediaryAccountConnection + ): LockIdIntermediaryAccountConnectionAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + obj.intermediary_account = + message.intermediaryAccount === '' + ? undefined + : message.intermediaryAccount; + return obj; + }, + fromAminoMsg( + object: LockIdIntermediaryAccountConnectionAminoMsg + ): LockIdIntermediaryAccountConnection { + return LockIdIntermediaryAccountConnection.fromAmino(object.value); + }, + toAminoMsg( + message: LockIdIntermediaryAccountConnection + ): LockIdIntermediaryAccountConnectionAminoMsg { + return { + type: 'osmosis/lock-id-intermediary-account-connection', + value: LockIdIntermediaryAccountConnection.toAmino(message), + }; + }, + fromProtoMsg( + message: LockIdIntermediaryAccountConnectionProtoMsg + ): LockIdIntermediaryAccountConnection { + return LockIdIntermediaryAccountConnection.decode(message.value); + }, + toProto(message: LockIdIntermediaryAccountConnection): Uint8Array { + return LockIdIntermediaryAccountConnection.encode(message).finish(); + }, + toProtoMsg( + message: LockIdIntermediaryAccountConnection + ): LockIdIntermediaryAccountConnectionProtoMsg { + return { + typeUrl: '/osmosis.superfluid.LockIdIntermediaryAccountConnection', + value: LockIdIntermediaryAccountConnection.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + LockIdIntermediaryAccountConnection.typeUrl, + LockIdIntermediaryAccountConnection +); +GlobalDecoderRegistry.registerAminoProtoMapping( + LockIdIntermediaryAccountConnection.aminoType, + LockIdIntermediaryAccountConnection.typeUrl +); +function createBaseUnpoolWhitelistedPools(): UnpoolWhitelistedPools { + return { + ids: [], + }; +} +export const UnpoolWhitelistedPools = { + typeUrl: '/osmosis.superfluid.UnpoolWhitelistedPools', + aminoType: 'osmosis/unpool-whitelisted-pools', + is(o: any): o is UnpoolWhitelistedPools { + return ( + o && + (o.$typeUrl === UnpoolWhitelistedPools.typeUrl || + (Array.isArray(o.ids) && + (!o.ids.length || typeof o.ids[0] === 'bigint'))) + ); + }, + isSDK(o: any): o is UnpoolWhitelistedPoolsSDKType { + return ( + o && + (o.$typeUrl === UnpoolWhitelistedPools.typeUrl || + (Array.isArray(o.ids) && + (!o.ids.length || typeof o.ids[0] === 'bigint'))) + ); + }, + isAmino(o: any): o is UnpoolWhitelistedPoolsAmino { + return ( + o && + (o.$typeUrl === UnpoolWhitelistedPools.typeUrl || + (Array.isArray(o.ids) && + (!o.ids.length || typeof o.ids[0] === 'bigint'))) + ); + }, + encode( + message: UnpoolWhitelistedPools, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.ids) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UnpoolWhitelistedPools { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnpoolWhitelistedPools(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.ids.push(reader.uint64()); + } + } else { + message.ids.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnpoolWhitelistedPools { + const message = createBaseUnpoolWhitelistedPools(); + message.ids = object.ids?.map((e) => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: UnpoolWhitelistedPoolsAmino): UnpoolWhitelistedPools { + const message = createBaseUnpoolWhitelistedPools(); + message.ids = object.ids?.map((e) => BigInt(e)) || []; + return message; + }, + toAmino(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsAmino { + const obj: any = {}; + if (message.ids) { + obj.ids = message.ids.map((e) => e.toString()); + } else { + obj.ids = message.ids; + } + return obj; + }, + fromAminoMsg(object: UnpoolWhitelistedPoolsAminoMsg): UnpoolWhitelistedPools { + return UnpoolWhitelistedPools.fromAmino(object.value); + }, + toAminoMsg(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsAminoMsg { + return { + type: 'osmosis/unpool-whitelisted-pools', + value: UnpoolWhitelistedPools.toAmino(message), + }; + }, + fromProtoMsg( + message: UnpoolWhitelistedPoolsProtoMsg + ): UnpoolWhitelistedPools { + return UnpoolWhitelistedPools.decode(message.value); + }, + toProto(message: UnpoolWhitelistedPools): Uint8Array { + return UnpoolWhitelistedPools.encode(message).finish(); + }, + toProtoMsg(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsProtoMsg { + return { + typeUrl: '/osmosis.superfluid.UnpoolWhitelistedPools', + value: UnpoolWhitelistedPools.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + UnpoolWhitelistedPools.typeUrl, + UnpoolWhitelistedPools +); +GlobalDecoderRegistry.registerAminoProtoMapping( + UnpoolWhitelistedPools.aminoType, + UnpoolWhitelistedPools.typeUrl +); +function createBaseConcentratedPoolUserPositionRecord(): ConcentratedPoolUserPositionRecord { + return { + validatorAddress: '', + positionId: BigInt(0), + lockId: BigInt(0), + syntheticLock: SyntheticLock.fromPartial({}), + delegationAmount: Coin.fromPartial({}), + equivalentStakedAmount: undefined, + }; +} +export const ConcentratedPoolUserPositionRecord = { + typeUrl: '/osmosis.superfluid.ConcentratedPoolUserPositionRecord', + aminoType: 'osmosis/concentrated-pool-user-position-record', + is(o: any): o is ConcentratedPoolUserPositionRecord { + return ( + o && + (o.$typeUrl === ConcentratedPoolUserPositionRecord.typeUrl || + (typeof o.validatorAddress === 'string' && + typeof o.positionId === 'bigint' && + typeof o.lockId === 'bigint' && + SyntheticLock.is(o.syntheticLock) && + Coin.is(o.delegationAmount))) + ); + }, + isSDK(o: any): o is ConcentratedPoolUserPositionRecordSDKType { + return ( + o && + (o.$typeUrl === ConcentratedPoolUserPositionRecord.typeUrl || + (typeof o.validator_address === 'string' && + typeof o.position_id === 'bigint' && + typeof o.lock_id === 'bigint' && + SyntheticLock.isSDK(o.synthetic_lock) && + Coin.isSDK(o.delegation_amount))) + ); + }, + isAmino(o: any): o is ConcentratedPoolUserPositionRecordAmino { + return ( + o && + (o.$typeUrl === ConcentratedPoolUserPositionRecord.typeUrl || + (typeof o.validator_address === 'string' && + typeof o.position_id === 'bigint' && + typeof o.lock_id === 'bigint' && + SyntheticLock.isAmino(o.synthetic_lock) && + Coin.isAmino(o.delegation_amount))) + ); + }, + encode( + message: ConcentratedPoolUserPositionRecord, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.validatorAddress !== '') { + writer.uint32(10).string(message.validatorAddress); + } + if (message.positionId !== BigInt(0)) { + writer.uint32(16).uint64(message.positionId); + } + if (message.lockId !== BigInt(0)) { + writer.uint32(24).uint64(message.lockId); + } + if (message.syntheticLock !== undefined) { + SyntheticLock.encode( + message.syntheticLock, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.delegationAmount !== undefined) { + Coin.encode(message.delegationAmount, writer.uint32(42).fork()).ldelim(); + } + if (message.equivalentStakedAmount !== undefined) { + Coin.encode( + message.equivalentStakedAmount, + writer.uint32(50).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ConcentratedPoolUserPositionRecord { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConcentratedPoolUserPositionRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.positionId = reader.uint64(); + break; + case 3: + message.lockId = reader.uint64(); + break; + case 4: + message.syntheticLock = SyntheticLock.decode(reader, reader.uint32()); + break; + case 5: + message.delegationAmount = Coin.decode(reader, reader.uint32()); + break; + case 6: + message.equivalentStakedAmount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): ConcentratedPoolUserPositionRecord { + const message = createBaseConcentratedPoolUserPositionRecord(); + message.validatorAddress = object.validatorAddress ?? ''; + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + message.syntheticLock = + object.syntheticLock !== undefined && object.syntheticLock !== null + ? SyntheticLock.fromPartial(object.syntheticLock) + : undefined; + message.delegationAmount = + object.delegationAmount !== undefined && object.delegationAmount !== null + ? Coin.fromPartial(object.delegationAmount) + : undefined; + message.equivalentStakedAmount = + object.equivalentStakedAmount !== undefined && + object.equivalentStakedAmount !== null + ? Coin.fromPartial(object.equivalentStakedAmount) + : undefined; + return message; + }, + fromAmino( + object: ConcentratedPoolUserPositionRecordAmino + ): ConcentratedPoolUserPositionRecord { + const message = createBaseConcentratedPoolUserPositionRecord(); + if ( + object.validator_address !== undefined && + object.validator_address !== null + ) { + message.validatorAddress = object.validator_address; + } + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.synthetic_lock !== undefined && object.synthetic_lock !== null) { + message.syntheticLock = SyntheticLock.fromAmino(object.synthetic_lock); + } + if ( + object.delegation_amount !== undefined && + object.delegation_amount !== null + ) { + message.delegationAmount = Coin.fromAmino(object.delegation_amount); + } + if ( + object.equivalent_staked_amount !== undefined && + object.equivalent_staked_amount !== null + ) { + message.equivalentStakedAmount = Coin.fromAmino( + object.equivalent_staked_amount + ); + } + return message; + }, + toAmino( + message: ConcentratedPoolUserPositionRecord + ): ConcentratedPoolUserPositionRecordAmino { + const obj: any = {}; + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress; + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + obj.synthetic_lock = message.syntheticLock + ? SyntheticLock.toAmino(message.syntheticLock) + : undefined; + obj.delegation_amount = message.delegationAmount + ? Coin.toAmino(message.delegationAmount) + : undefined; + obj.equivalent_staked_amount = message.equivalentStakedAmount + ? Coin.toAmino(message.equivalentStakedAmount) + : undefined; + return obj; + }, + fromAminoMsg( + object: ConcentratedPoolUserPositionRecordAminoMsg + ): ConcentratedPoolUserPositionRecord { + return ConcentratedPoolUserPositionRecord.fromAmino(object.value); + }, + toAminoMsg( + message: ConcentratedPoolUserPositionRecord + ): ConcentratedPoolUserPositionRecordAminoMsg { + return { + type: 'osmosis/concentrated-pool-user-position-record', + value: ConcentratedPoolUserPositionRecord.toAmino(message), + }; + }, + fromProtoMsg( + message: ConcentratedPoolUserPositionRecordProtoMsg + ): ConcentratedPoolUserPositionRecord { + return ConcentratedPoolUserPositionRecord.decode(message.value); + }, + toProto(message: ConcentratedPoolUserPositionRecord): Uint8Array { + return ConcentratedPoolUserPositionRecord.encode(message).finish(); + }, + toProtoMsg( + message: ConcentratedPoolUserPositionRecord + ): ConcentratedPoolUserPositionRecordProtoMsg { + return { + typeUrl: '/osmosis.superfluid.ConcentratedPoolUserPositionRecord', + value: ConcentratedPoolUserPositionRecord.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ConcentratedPoolUserPositionRecord.typeUrl, + ConcentratedPoolUserPositionRecord +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ConcentratedPoolUserPositionRecord.aminoType, + ConcentratedPoolUserPositionRecord.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/superfluid/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.amino.ts new file mode 100644 index 00000000..6842b771 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.amino.ts @@ -0,0 +1,67 @@ +//@ts-nocheck +import { + MsgSuperfluidDelegate, + MsgSuperfluidUndelegate, + MsgSuperfluidUnbondLock, + MsgSuperfluidUndelegateAndUnbondLock, + MsgLockAndSuperfluidDelegate, + MsgCreateFullRangePositionAndSuperfluidDelegate, + MsgUnPoolWhitelistedPool, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, + MsgAddToConcentratedLiquiditySuperfluidPosition, + MsgUnbondConvertAndStake, +} from './tx'; +export const AminoConverter = { + '/osmosis.superfluid.MsgSuperfluidDelegate': { + aminoType: 'osmosis/superfluid-delegate', + toAmino: MsgSuperfluidDelegate.toAmino, + fromAmino: MsgSuperfluidDelegate.fromAmino, + }, + '/osmosis.superfluid.MsgSuperfluidUndelegate': { + aminoType: 'osmosis/superfluid-undelegate', + toAmino: MsgSuperfluidUndelegate.toAmino, + fromAmino: MsgSuperfluidUndelegate.fromAmino, + }, + '/osmosis.superfluid.MsgSuperfluidUnbondLock': { + aminoType: 'osmosis/superfluid-unbond-lock', + toAmino: MsgSuperfluidUnbondLock.toAmino, + fromAmino: MsgSuperfluidUnbondLock.fromAmino, + }, + '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock': { + aminoType: 'osmosis/superfluid-undelegate-and-unbond-lock', + toAmino: MsgSuperfluidUndelegateAndUnbondLock.toAmino, + fromAmino: MsgSuperfluidUndelegateAndUnbondLock.fromAmino, + }, + '/osmosis.superfluid.MsgLockAndSuperfluidDelegate': { + aminoType: 'osmosis/lock-and-superfluid-delegate', + toAmino: MsgLockAndSuperfluidDelegate.toAmino, + fromAmino: MsgLockAndSuperfluidDelegate.fromAmino, + }, + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate': { + aminoType: 'osmosis/full-range-and-sf-delegate', + toAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino, + fromAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino, + }, + '/osmosis.superfluid.MsgUnPoolWhitelistedPool': { + aminoType: 'osmosis/unpool-whitelisted-pool', + toAmino: MsgUnPoolWhitelistedPool.toAmino, + fromAmino: MsgUnPoolWhitelistedPool.fromAmino, + }, + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition': + { + aminoType: 'osmosis/unlock-and-migrate', + toAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino, + fromAmino: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromAmino, + }, + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition': { + aminoType: 'osmosis/add-to-cl-superfluid-position', + toAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino, + fromAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.fromAmino, + }, + '/osmosis.superfluid.MsgUnbondConvertAndStake': { + aminoType: 'osmosis/unbond-convert-and-stake', + toAmino: MsgUnbondConvertAndStake.toAmino, + fromAmino: MsgUnbondConvertAndStake.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/superfluid/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.registry.ts new file mode 100644 index 00000000..90c84ea4 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.registry.ts @@ -0,0 +1,282 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgSuperfluidDelegate, + MsgSuperfluidUndelegate, + MsgSuperfluidUnbondLock, + MsgSuperfluidUndelegateAndUnbondLock, + MsgLockAndSuperfluidDelegate, + MsgCreateFullRangePositionAndSuperfluidDelegate, + MsgUnPoolWhitelistedPool, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, + MsgAddToConcentratedLiquiditySuperfluidPosition, + MsgUnbondConvertAndStake, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.superfluid.MsgSuperfluidDelegate', MsgSuperfluidDelegate], + ['/osmosis.superfluid.MsgSuperfluidUndelegate', MsgSuperfluidUndelegate], + ['/osmosis.superfluid.MsgSuperfluidUnbondLock', MsgSuperfluidUnbondLock], + [ + '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + MsgSuperfluidUndelegateAndUnbondLock, + ], + [ + '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + MsgLockAndSuperfluidDelegate, + ], + [ + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + MsgCreateFullRangePositionAndSuperfluidDelegate, + ], + ['/osmosis.superfluid.MsgUnPoolWhitelistedPool', MsgUnPoolWhitelistedPool], + [ + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, + ], + [ + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + MsgAddToConcentratedLiquiditySuperfluidPosition, + ], + ['/osmosis.superfluid.MsgUnbondConvertAndStake', MsgUnbondConvertAndStake], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + superfluidDelegate(value: MsgSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value: MsgSuperfluidDelegate.encode(value).finish(), + }; + }, + superfluidUndelegate(value: MsgSuperfluidUndelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value: MsgSuperfluidUndelegate.encode(value).finish(), + }; + }, + superfluidUnbondLock(value: MsgSuperfluidUnbondLock) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value: MsgSuperfluidUnbondLock.encode(value).finish(), + }; + }, + superfluidUndelegateAndUnbondLock( + value: MsgSuperfluidUndelegateAndUnbondLock + ) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value: MsgSuperfluidUndelegateAndUnbondLock.encode(value).finish(), + }; + }, + lockAndSuperfluidDelegate(value: MsgLockAndSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value: MsgLockAndSuperfluidDelegate.encode(value).finish(), + }; + }, + createFullRangePositionAndSuperfluidDelegate( + value: MsgCreateFullRangePositionAndSuperfluidDelegate + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value: + MsgCreateFullRangePositionAndSuperfluidDelegate.encode( + value + ).finish(), + }; + }, + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value: MsgUnPoolWhitelistedPool.encode(value).finish(), + }; + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition( + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode( + value + ).finish(), + }; + }, + addToConcentratedLiquiditySuperfluidPosition( + value: MsgAddToConcentratedLiquiditySuperfluidPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value: + MsgAddToConcentratedLiquiditySuperfluidPosition.encode( + value + ).finish(), + }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + value: MsgUnbondConvertAndStake.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + superfluidDelegate(value: MsgSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value, + }; + }, + superfluidUndelegate(value: MsgSuperfluidUndelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value, + }; + }, + superfluidUnbondLock(value: MsgSuperfluidUnbondLock) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value, + }; + }, + superfluidUndelegateAndUnbondLock( + value: MsgSuperfluidUndelegateAndUnbondLock + ) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value, + }; + }, + lockAndSuperfluidDelegate(value: MsgLockAndSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value, + }; + }, + createFullRangePositionAndSuperfluidDelegate( + value: MsgCreateFullRangePositionAndSuperfluidDelegate + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value, + }; + }, + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value, + }; + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition( + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value, + }; + }, + addToConcentratedLiquiditySuperfluidPosition( + value: MsgAddToConcentratedLiquiditySuperfluidPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value, + }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + value, + }; + }, + }, + fromPartial: { + superfluidDelegate(value: MsgSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value: MsgSuperfluidDelegate.fromPartial(value), + }; + }, + superfluidUndelegate(value: MsgSuperfluidUndelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value: MsgSuperfluidUndelegate.fromPartial(value), + }; + }, + superfluidUnbondLock(value: MsgSuperfluidUnbondLock) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value: MsgSuperfluidUnbondLock.fromPartial(value), + }; + }, + superfluidUndelegateAndUnbondLock( + value: MsgSuperfluidUndelegateAndUnbondLock + ) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value: MsgSuperfluidUndelegateAndUnbondLock.fromPartial(value), + }; + }, + lockAndSuperfluidDelegate(value: MsgLockAndSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value: MsgLockAndSuperfluidDelegate.fromPartial(value), + }; + }, + createFullRangePositionAndSuperfluidDelegate( + value: MsgCreateFullRangePositionAndSuperfluidDelegate + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value: + MsgCreateFullRangePositionAndSuperfluidDelegate.fromPartial(value), + }; + }, + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value: MsgUnPoolWhitelistedPool.fromPartial(value), + }; + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition( + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromPartial( + value + ), + }; + }, + addToConcentratedLiquiditySuperfluidPosition( + value: MsgAddToConcentratedLiquiditySuperfluidPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value: + MsgAddToConcentratedLiquiditySuperfluidPosition.fromPartial(value), + }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + value: MsgUnbondConvertAndStake.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/superfluid/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.rpc.msg.ts new file mode 100644 index 00000000..e22a0858 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.rpc.msg.ts @@ -0,0 +1,237 @@ +//@ts-nocheck +import { Rpc } from '../../helpers'; +import { BinaryReader } from '../../binary'; + +import { + MsgSuperfluidDelegate, + MsgSuperfluidDelegateResponse, + MsgSuperfluidUndelegate, + MsgSuperfluidUndelegateResponse, + MsgSuperfluidUnbondLock, + MsgSuperfluidUnbondLockResponse, + MsgSuperfluidUndelegateAndUnbondLock, + MsgSuperfluidUndelegateAndUnbondLockResponse, + MsgLockAndSuperfluidDelegate, + MsgLockAndSuperfluidDelegateResponse, + MsgCreateFullRangePositionAndSuperfluidDelegate, + MsgCreateFullRangePositionAndSuperfluidDelegateResponse, + MsgUnPoolWhitelistedPool, + MsgUnPoolWhitelistedPoolResponse, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, + MsgAddToConcentratedLiquiditySuperfluidPosition, + MsgAddToConcentratedLiquiditySuperfluidPositionResponse, + MsgUnbondConvertAndStake, + MsgUnbondConvertAndStakeResponse, +} from './tx'; +/** Msg defines the Msg service. */ +export interface Msg { + /** Execute superfluid delegation for a lockup */ + superfluidDelegate( + request: MsgSuperfluidDelegate + ): Promise; + /** Execute superfluid undelegation for a lockup */ + superfluidUndelegate( + request: MsgSuperfluidUndelegate + ): Promise; + /** + * For a given lock that is being superfluidly undelegated, + * also unbond the underlying lock. + */ + superfluidUnbondLock( + request: MsgSuperfluidUnbondLock + ): Promise; + /** Superfluid undelegate and unbond partial amount of the underlying lock. */ + superfluidUndelegateAndUnbondLock( + request: MsgSuperfluidUndelegateAndUnbondLock + ): Promise; + /** Execute lockup lock and superfluid delegation in a single msg */ + lockAndSuperfluidDelegate( + request: MsgLockAndSuperfluidDelegate + ): Promise; + createFullRangePositionAndSuperfluidDelegate( + request: MsgCreateFullRangePositionAndSuperfluidDelegate + ): Promise; + unPoolWhitelistedPool( + request: MsgUnPoolWhitelistedPool + ): Promise; + unlockAndMigrateSharesToFullRangeConcentratedPosition( + request: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): Promise; + addToConcentratedLiquiditySuperfluidPosition( + request: MsgAddToConcentratedLiquiditySuperfluidPosition + ): Promise; + /** + * UnbondConvertAndStake breaks all locks / superfluid staked assets, + * converts them to osmo then stakes the osmo to the designated validator. + */ + unbondConvertAndStake( + request: MsgUnbondConvertAndStake + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.superfluidDelegate = this.superfluidDelegate.bind(this); + this.superfluidUndelegate = this.superfluidUndelegate.bind(this); + this.superfluidUnbondLock = this.superfluidUnbondLock.bind(this); + this.superfluidUndelegateAndUnbondLock = + this.superfluidUndelegateAndUnbondLock.bind(this); + this.lockAndSuperfluidDelegate = this.lockAndSuperfluidDelegate.bind(this); + this.createFullRangePositionAndSuperfluidDelegate = + this.createFullRangePositionAndSuperfluidDelegate.bind(this); + this.unPoolWhitelistedPool = this.unPoolWhitelistedPool.bind(this); + this.unlockAndMigrateSharesToFullRangeConcentratedPosition = + this.unlockAndMigrateSharesToFullRangeConcentratedPosition.bind(this); + this.addToConcentratedLiquiditySuperfluidPosition = + this.addToConcentratedLiquiditySuperfluidPosition.bind(this); + this.unbondConvertAndStake = this.unbondConvertAndStake.bind(this); + } + superfluidDelegate( + request: MsgSuperfluidDelegate + ): Promise { + const data = MsgSuperfluidDelegate.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'SuperfluidDelegate', + data + ); + return promise.then((data) => + MsgSuperfluidDelegateResponse.decode(new BinaryReader(data)) + ); + } + superfluidUndelegate( + request: MsgSuperfluidUndelegate + ): Promise { + const data = MsgSuperfluidUndelegate.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'SuperfluidUndelegate', + data + ); + return promise.then((data) => + MsgSuperfluidUndelegateResponse.decode(new BinaryReader(data)) + ); + } + superfluidUnbondLock( + request: MsgSuperfluidUnbondLock + ): Promise { + const data = MsgSuperfluidUnbondLock.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'SuperfluidUnbondLock', + data + ); + return promise.then((data) => + MsgSuperfluidUnbondLockResponse.decode(new BinaryReader(data)) + ); + } + superfluidUndelegateAndUnbondLock( + request: MsgSuperfluidUndelegateAndUnbondLock + ): Promise { + const data = MsgSuperfluidUndelegateAndUnbondLock.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'SuperfluidUndelegateAndUnbondLock', + data + ); + return promise.then((data) => + MsgSuperfluidUndelegateAndUnbondLockResponse.decode( + new BinaryReader(data) + ) + ); + } + lockAndSuperfluidDelegate( + request: MsgLockAndSuperfluidDelegate + ): Promise { + const data = MsgLockAndSuperfluidDelegate.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'LockAndSuperfluidDelegate', + data + ); + return promise.then((data) => + MsgLockAndSuperfluidDelegateResponse.decode(new BinaryReader(data)) + ); + } + createFullRangePositionAndSuperfluidDelegate( + request: MsgCreateFullRangePositionAndSuperfluidDelegate + ): Promise { + const data = + MsgCreateFullRangePositionAndSuperfluidDelegate.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'CreateFullRangePositionAndSuperfluidDelegate', + data + ); + return promise.then((data) => + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.decode( + new BinaryReader(data) + ) + ); + } + unPoolWhitelistedPool( + request: MsgUnPoolWhitelistedPool + ): Promise { + const data = MsgUnPoolWhitelistedPool.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'UnPoolWhitelistedPool', + data + ); + return promise.then((data) => + MsgUnPoolWhitelistedPoolResponse.decode(new BinaryReader(data)) + ); + } + unlockAndMigrateSharesToFullRangeConcentratedPosition( + request: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): Promise { + const data = + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode( + request + ).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'UnlockAndMigrateSharesToFullRangeConcentratedPosition', + data + ); + return promise.then((data) => + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.decode( + new BinaryReader(data) + ) + ); + } + addToConcentratedLiquiditySuperfluidPosition( + request: MsgAddToConcentratedLiquiditySuperfluidPosition + ): Promise { + const data = + MsgAddToConcentratedLiquiditySuperfluidPosition.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'AddToConcentratedLiquiditySuperfluidPosition', + data + ); + return promise.then((data) => + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.decode( + new BinaryReader(data) + ) + ); + } + unbondConvertAndStake( + request: MsgUnbondConvertAndStake + ): Promise { + const data = MsgUnbondConvertAndStake.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.superfluid.Msg', + 'UnbondConvertAndStake', + data + ); + return promise.then((data) => + MsgUnbondConvertAndStakeResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/superfluid/tx.ts b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.ts new file mode 100644 index 00000000..f610d922 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/superfluid/tx.ts @@ -0,0 +1,3582 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin'; +import { Timestamp } from '../../google/protobuf/timestamp'; +import { BinaryReader, BinaryWriter } from '../../binary'; +import { GlobalDecoderRegistry } from '../../registry'; +import { toTimestamp, fromTimestamp } from '../../helpers'; +export interface MsgSuperfluidDelegate { + sender: string; + lockId: bigint; + valAddr: string; +} +export interface MsgSuperfluidDelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate'; + value: Uint8Array; +} +export interface MsgSuperfluidDelegateAmino { + sender?: string; + lock_id?: string; + val_addr?: string; +} +export interface MsgSuperfluidDelegateAminoMsg { + type: 'osmosis/superfluid-delegate'; + value: MsgSuperfluidDelegateAmino; +} +export interface MsgSuperfluidDelegateSDKType { + sender: string; + lock_id: bigint; + val_addr: string; +} +export interface MsgSuperfluidDelegateResponse {} +export interface MsgSuperfluidDelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegateResponse'; + value: Uint8Array; +} +export interface MsgSuperfluidDelegateResponseAmino {} +export interface MsgSuperfluidDelegateResponseAminoMsg { + type: 'osmosis/superfluid-delegate-response'; + value: MsgSuperfluidDelegateResponseAmino; +} +export interface MsgSuperfluidDelegateResponseSDKType {} +export interface MsgSuperfluidUndelegate { + sender: string; + lockId: bigint; +} +export interface MsgSuperfluidUndelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate'; + value: Uint8Array; +} +export interface MsgSuperfluidUndelegateAmino { + sender?: string; + lock_id?: string; +} +export interface MsgSuperfluidUndelegateAminoMsg { + type: 'osmosis/superfluid-undelegate'; + value: MsgSuperfluidUndelegateAmino; +} +export interface MsgSuperfluidUndelegateSDKType { + sender: string; + lock_id: bigint; +} +export interface MsgSuperfluidUndelegateResponse {} +export interface MsgSuperfluidUndelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateResponse'; + value: Uint8Array; +} +export interface MsgSuperfluidUndelegateResponseAmino {} +export interface MsgSuperfluidUndelegateResponseAminoMsg { + type: 'osmosis/superfluid-undelegate-response'; + value: MsgSuperfluidUndelegateResponseAmino; +} +export interface MsgSuperfluidUndelegateResponseSDKType {} +export interface MsgSuperfluidUnbondLock { + sender: string; + lockId: bigint; +} +export interface MsgSuperfluidUnbondLockProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock'; + value: Uint8Array; +} +export interface MsgSuperfluidUnbondLockAmino { + sender?: string; + lock_id?: string; +} +export interface MsgSuperfluidUnbondLockAminoMsg { + type: 'osmosis/superfluid-unbond-lock'; + value: MsgSuperfluidUnbondLockAmino; +} +export interface MsgSuperfluidUnbondLockSDKType { + sender: string; + lock_id: bigint; +} +export interface MsgSuperfluidUnbondLockResponse {} +export interface MsgSuperfluidUnbondLockResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLockResponse'; + value: Uint8Array; +} +export interface MsgSuperfluidUnbondLockResponseAmino {} +export interface MsgSuperfluidUnbondLockResponseAminoMsg { + type: 'osmosis/superfluid-unbond-lock-response'; + value: MsgSuperfluidUnbondLockResponseAmino; +} +export interface MsgSuperfluidUnbondLockResponseSDKType {} +export interface MsgSuperfluidUndelegateAndUnbondLock { + sender: string; + lockId: bigint; + /** Amount of unlocking coin. */ + coin: Coin; +} +export interface MsgSuperfluidUndelegateAndUnbondLockProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock'; + value: Uint8Array; +} +export interface MsgSuperfluidUndelegateAndUnbondLockAmino { + sender?: string; + lock_id?: string; + /** Amount of unlocking coin. */ + coin?: CoinAmino; +} +export interface MsgSuperfluidUndelegateAndUnbondLockAminoMsg { + type: 'osmosis/superfluid-undelegate-and-unbond-lock'; + value: MsgSuperfluidUndelegateAndUnbondLockAmino; +} +export interface MsgSuperfluidUndelegateAndUnbondLockSDKType { + sender: string; + lock_id: bigint; + coin: CoinSDKType; +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponse { + /** + * lock id of the new lock created for the remaining amount. + * returns the original lockid if the unlocked amount is equal to the + * original lock's amount. + */ + lockId: bigint; +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLockResponse'; + value: Uint8Array; +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseAmino { + /** + * lock id of the new lock created for the remaining amount. + * returns the original lockid if the unlocked amount is equal to the + * original lock's amount. + */ + lock_id?: string; +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg { + type: 'osmosis/superfluid-undelegate-and-unbond-lock-response'; + value: MsgSuperfluidUndelegateAndUnbondLockResponseAmino; +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseSDKType { + lock_id: bigint; +} +/** + * MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, + * and then does a superfluid lock from the newly created lockup, to the + * specified validator addr. + */ +export interface MsgLockAndSuperfluidDelegate { + sender: string; + coins: Coin[]; + valAddr: string; +} +export interface MsgLockAndSuperfluidDelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate'; + value: Uint8Array; +} +/** + * MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, + * and then does a superfluid lock from the newly created lockup, to the + * specified validator addr. + */ +export interface MsgLockAndSuperfluidDelegateAmino { + sender?: string; + coins?: CoinAmino[]; + val_addr?: string; +} +export interface MsgLockAndSuperfluidDelegateAminoMsg { + type: 'osmosis/lock-and-superfluid-delegate'; + value: MsgLockAndSuperfluidDelegateAmino; +} +/** + * MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, + * and then does a superfluid lock from the newly created lockup, to the + * specified validator addr. + */ +export interface MsgLockAndSuperfluidDelegateSDKType { + sender: string; + coins: CoinSDKType[]; + val_addr: string; +} +export interface MsgLockAndSuperfluidDelegateResponse { + ID: bigint; +} +export interface MsgLockAndSuperfluidDelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegateResponse'; + value: Uint8Array; +} +export interface MsgLockAndSuperfluidDelegateResponseAmino { + ID?: string; +} +export interface MsgLockAndSuperfluidDelegateResponseAminoMsg { + type: 'osmosis/lock-and-superfluid-delegate-response'; + value: MsgLockAndSuperfluidDelegateResponseAmino; +} +export interface MsgLockAndSuperfluidDelegateResponseSDKType { + ID: bigint; +} +/** + * MsgCreateFullRangePositionAndSuperfluidDelegate creates a full range position + * in a concentrated liquidity pool, then superfluid delegates. + */ +export interface MsgCreateFullRangePositionAndSuperfluidDelegate { + sender: string; + coins: Coin[]; + valAddr: string; + poolId: bigint; +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate'; + value: Uint8Array; +} +/** + * MsgCreateFullRangePositionAndSuperfluidDelegate creates a full range position + * in a concentrated liquidity pool, then superfluid delegates. + */ +export interface MsgCreateFullRangePositionAndSuperfluidDelegateAmino { + sender?: string; + coins?: CoinAmino[]; + val_addr?: string; + pool_id?: string; +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { + type: 'osmosis/full-range-and-sf-delegate'; + value: MsgCreateFullRangePositionAndSuperfluidDelegateAmino; +} +/** + * MsgCreateFullRangePositionAndSuperfluidDelegate creates a full range position + * in a concentrated liquidity pool, then superfluid delegates. + */ +export interface MsgCreateFullRangePositionAndSuperfluidDelegateSDKType { + sender: string; + coins: CoinSDKType[]; + val_addr: string; + pool_id: bigint; +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + lockID: bigint; + positionID: bigint; +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegateResponse'; + value: Uint8Array; +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { + lockID?: string; + positionID?: string; +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg { + type: 'osmosis/create-full-range-position-and-superfluid-delegate-response'; + value: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino; +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseSDKType { + lockID: bigint; + positionID: bigint; +} +/** + * MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is + * associated with pool pool_id. If pool_id is not approved for unpooling by + * governance, this is a no-op. Unpooling takes the locked gamm shares, and runs + * "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens + * ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new + * lock for every constituent token, with the duration associated with the lock. + * If the lock was unbonding, the new lockup durations should be the time left + * until unbond completion. + */ +export interface MsgUnPoolWhitelistedPool { + sender: string; + poolId: bigint; +} +export interface MsgUnPoolWhitelistedPoolProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool'; + value: Uint8Array; +} +/** + * MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is + * associated with pool pool_id. If pool_id is not approved for unpooling by + * governance, this is a no-op. Unpooling takes the locked gamm shares, and runs + * "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens + * ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new + * lock for every constituent token, with the duration associated with the lock. + * If the lock was unbonding, the new lockup durations should be the time left + * until unbond completion. + */ +export interface MsgUnPoolWhitelistedPoolAmino { + sender?: string; + pool_id?: string; +} +export interface MsgUnPoolWhitelistedPoolAminoMsg { + type: 'osmosis/unpool-whitelisted-pool'; + value: MsgUnPoolWhitelistedPoolAmino; +} +/** + * MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is + * associated with pool pool_id. If pool_id is not approved for unpooling by + * governance, this is a no-op. Unpooling takes the locked gamm shares, and runs + * "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens + * ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new + * lock for every constituent token, with the duration associated with the lock. + * If the lock was unbonding, the new lockup durations should be the time left + * until unbond completion. + */ +export interface MsgUnPoolWhitelistedPoolSDKType { + sender: string; + pool_id: bigint; +} +export interface MsgUnPoolWhitelistedPoolResponse { + exitedLockIds: bigint[]; +} +export interface MsgUnPoolWhitelistedPoolResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPoolResponse'; + value: Uint8Array; +} +export interface MsgUnPoolWhitelistedPoolResponseAmino { + exited_lock_ids?: string[]; +} +export interface MsgUnPoolWhitelistedPoolResponseAminoMsg { + type: 'osmosis/un-pool-whitelisted-pool-response'; + value: MsgUnPoolWhitelistedPoolResponseAmino; +} +export interface MsgUnPoolWhitelistedPoolResponseSDKType { + exited_lock_ids: bigint[]; +} +/** + * ===================== + * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + */ +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + sender: string; + lockId: bigint; + sharesToMigrate: Coin; + /** token_out_mins indicates minimum token to exit Balancer pool with. */ + tokenOutMins: Coin[]; +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition'; + value: Uint8Array; +} +/** + * ===================== + * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + */ +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { + sender?: string; + lock_id?: string; + shares_to_migrate?: CoinAmino; + /** token_out_mins indicates minimum token to exit Balancer pool with. */ + token_out_mins?: CoinAmino[]; +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { + type: 'osmosis/unlock-and-migrate'; + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino; +} +/** + * ===================== + * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + */ +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionSDKType { + sender: string; + lock_id: bigint; + shares_to_migrate: CoinSDKType; + token_out_mins: CoinSDKType[]; +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + amount0: string; + amount1: string; + liquidityCreated: string; + joinTime: Date; +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse'; + value: Uint8Array; +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { + amount0?: string; + amount1?: string; + liquidity_created?: string; + join_time?: string; +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg { + type: 'osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position-response'; + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino; +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseSDKType { + amount0: string; + amount1: string; + liquidity_created: string; + join_time: Date; +} +/** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ +export interface MsgAddToConcentratedLiquiditySuperfluidPosition { + positionId: bigint; + sender: string; + tokenDesired0: Coin; + tokenDesired1: Coin; +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg { + typeUrl: '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition'; + value: Uint8Array; +} +/** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ +export interface MsgAddToConcentratedLiquiditySuperfluidPositionAmino { + position_id?: string; + sender?: string; + token_desired0?: CoinAmino; + token_desired1?: CoinAmino; +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { + type: 'osmosis/add-to-cl-superfluid-position'; + value: MsgAddToConcentratedLiquiditySuperfluidPositionAmino; +} +/** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ +export interface MsgAddToConcentratedLiquiditySuperfluidPositionSDKType { + position_id: bigint; + sender: string; + token_desired0: CoinSDKType; + token_desired1: CoinSDKType; +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + positionId: bigint; + amount0: string; + amount1: string; + /** + * new_liquidity is the final liquidity after the add. + * It includes the liquidity that existed before in the position + * and the new liquidity that was added to the position. + */ + newLiquidity: string; + lockId: bigint; +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPositionResponse'; + value: Uint8Array; +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { + position_id?: string; + amount0?: string; + amount1?: string; + /** + * new_liquidity is the final liquidity after the add. + * It includes the liquidity that existed before in the position + * and the new liquidity that was added to the position. + */ + new_liquidity?: string; + lock_id?: string; +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg { + type: 'osmosis/add-to-concentrated-liquidity-superfluid-position-response'; + value: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino; +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseSDKType { + position_id: bigint; + amount0: string; + amount1: string; + new_liquidity: string; + lock_id: bigint; +} +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStake { + /** + * lock ID to convert and stake. + * lock id with 0 should be provided if converting liquid gamm shares to stake + */ + lockId: bigint; + sender: string; + /** + * validator address to delegate to. + * If provided empty string, we use the validators returned from + * valset-preference module. + */ + valAddr: string; + /** min_amt_to_stake indicates the minimum amount to stake after conversion */ + minAmtToStake: string; + /** + * shares_to_convert indicates shares wanted to stake. + * Note that this field is only used for liquid(unlocked) gamm shares. + * For all other cases, this field would be disregarded. + */ + sharesToConvert: Coin; +} +export interface MsgUnbondConvertAndStakeProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake'; + value: Uint8Array; +} +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStakeAmino { + /** + * lock ID to convert and stake. + * lock id with 0 should be provided if converting liquid gamm shares to stake + */ + lock_id?: string; + sender?: string; + /** + * validator address to delegate to. + * If provided empty string, we use the validators returned from + * valset-preference module. + */ + val_addr?: string; + /** min_amt_to_stake indicates the minimum amount to stake after conversion */ + min_amt_to_stake?: string; + /** + * shares_to_convert indicates shares wanted to stake. + * Note that this field is only used for liquid(unlocked) gamm shares. + * For all other cases, this field would be disregarded. + */ + shares_to_convert?: CoinAmino; +} +export interface MsgUnbondConvertAndStakeAminoMsg { + type: 'osmosis/unbond-convert-and-stake'; + value: MsgUnbondConvertAndStakeAmino; +} +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStakeSDKType { + lock_id: bigint; + sender: string; + val_addr: string; + min_amt_to_stake: string; + shares_to_convert: CoinSDKType; +} +export interface MsgUnbondConvertAndStakeResponse { + totalAmtStaked: string; +} +export interface MsgUnbondConvertAndStakeResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStakeResponse'; + value: Uint8Array; +} +export interface MsgUnbondConvertAndStakeResponseAmino { + total_amt_staked?: string; +} +export interface MsgUnbondConvertAndStakeResponseAminoMsg { + type: 'osmosis/unbond-convert-and-stake-response'; + value: MsgUnbondConvertAndStakeResponseAmino; +} +export interface MsgUnbondConvertAndStakeResponseSDKType { + total_amt_staked: string; +} +function createBaseMsgSuperfluidDelegate(): MsgSuperfluidDelegate { + return { + sender: '', + lockId: BigInt(0), + valAddr: '', + }; +} +export const MsgSuperfluidDelegate = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + aminoType: 'osmosis/superfluid-delegate', + is(o: any): o is MsgSuperfluidDelegate { + return ( + o && + (o.$typeUrl === MsgSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + typeof o.lockId === 'bigint' && + typeof o.valAddr === 'string')) + ); + }, + isSDK(o: any): o is MsgSuperfluidDelegateSDKType { + return ( + o && + (o.$typeUrl === MsgSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + typeof o.lock_id === 'bigint' && + typeof o.val_addr === 'string')) + ); + }, + isAmino(o: any): o is MsgSuperfluidDelegateAmino { + return ( + o && + (o.$typeUrl === MsgSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + typeof o.lock_id === 'bigint' && + typeof o.val_addr === 'string')) + ); + }, + encode( + message: MsgSuperfluidDelegate, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId); + } + if (message.valAddr !== '') { + writer.uint32(26).string(message.valAddr); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidDelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidDelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.lockId = reader.uint64(); + break; + case 3: + message.valAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSuperfluidDelegate { + const message = createBaseMsgSuperfluidDelegate(); + message.sender = object.sender ?? ''; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + message.valAddr = object.valAddr ?? ''; + return message; + }, + fromAmino(object: MsgSuperfluidDelegateAmino): MsgSuperfluidDelegate { + const message = createBaseMsgSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + return message; + }, + toAmino(message: MsgSuperfluidDelegate): MsgSuperfluidDelegateAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr; + return obj; + }, + fromAminoMsg(object: MsgSuperfluidDelegateAminoMsg): MsgSuperfluidDelegate { + return MsgSuperfluidDelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgSuperfluidDelegate): MsgSuperfluidDelegateAminoMsg { + return { + type: 'osmosis/superfluid-delegate', + value: MsgSuperfluidDelegate.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSuperfluidDelegateProtoMsg): MsgSuperfluidDelegate { + return MsgSuperfluidDelegate.decode(message.value); + }, + toProto(message: MsgSuperfluidDelegate): Uint8Array { + return MsgSuperfluidDelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgSuperfluidDelegate): MsgSuperfluidDelegateProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value: MsgSuperfluidDelegate.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidDelegate.typeUrl, + MsgSuperfluidDelegate +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidDelegate.aminoType, + MsgSuperfluidDelegate.typeUrl +); +function createBaseMsgSuperfluidDelegateResponse(): MsgSuperfluidDelegateResponse { + return {}; +} +export const MsgSuperfluidDelegateResponse = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegateResponse', + aminoType: 'osmosis/superfluid-delegate-response', + is(o: any): o is MsgSuperfluidDelegateResponse { + return o && o.$typeUrl === MsgSuperfluidDelegateResponse.typeUrl; + }, + isSDK(o: any): o is MsgSuperfluidDelegateResponseSDKType { + return o && o.$typeUrl === MsgSuperfluidDelegateResponse.typeUrl; + }, + isAmino(o: any): o is MsgSuperfluidDelegateResponseAmino { + return o && o.$typeUrl === MsgSuperfluidDelegateResponse.typeUrl; + }, + encode( + _: MsgSuperfluidDelegateResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidDelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidDelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSuperfluidDelegateResponse { + const message = createBaseMsgSuperfluidDelegateResponse(); + return message; + }, + fromAmino( + _: MsgSuperfluidDelegateResponseAmino + ): MsgSuperfluidDelegateResponse { + const message = createBaseMsgSuperfluidDelegateResponse(); + return message; + }, + toAmino( + _: MsgSuperfluidDelegateResponse + ): MsgSuperfluidDelegateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSuperfluidDelegateResponseAminoMsg + ): MsgSuperfluidDelegateResponse { + return MsgSuperfluidDelegateResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSuperfluidDelegateResponse + ): MsgSuperfluidDelegateResponseAminoMsg { + return { + type: 'osmosis/superfluid-delegate-response', + value: MsgSuperfluidDelegateResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSuperfluidDelegateResponseProtoMsg + ): MsgSuperfluidDelegateResponse { + return MsgSuperfluidDelegateResponse.decode(message.value); + }, + toProto(message: MsgSuperfluidDelegateResponse): Uint8Array { + return MsgSuperfluidDelegateResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSuperfluidDelegateResponse + ): MsgSuperfluidDelegateResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegateResponse', + value: MsgSuperfluidDelegateResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidDelegateResponse.typeUrl, + MsgSuperfluidDelegateResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidDelegateResponse.aminoType, + MsgSuperfluidDelegateResponse.typeUrl +); +function createBaseMsgSuperfluidUndelegate(): MsgSuperfluidUndelegate { + return { + sender: '', + lockId: BigInt(0), + }; +} +export const MsgSuperfluidUndelegate = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + aminoType: 'osmosis/superfluid-undelegate', + is(o: any): o is MsgSuperfluidUndelegate { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegate.typeUrl || + (typeof o.sender === 'string' && typeof o.lockId === 'bigint')) + ); + }, + isSDK(o: any): o is MsgSuperfluidUndelegateSDKType { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegate.typeUrl || + (typeof o.sender === 'string' && typeof o.lock_id === 'bigint')) + ); + }, + isAmino(o: any): o is MsgSuperfluidUndelegateAmino { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegate.typeUrl || + (typeof o.sender === 'string' && typeof o.lock_id === 'bigint')) + ); + }, + encode( + message: MsgSuperfluidUndelegate, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidUndelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSuperfluidUndelegate { + const message = createBaseMsgSuperfluidUndelegate(); + message.sender = object.sender ?? ''; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgSuperfluidUndelegateAmino): MsgSuperfluidUndelegate { + const message = createBaseMsgSuperfluidUndelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino(message: MsgSuperfluidUndelegate): MsgSuperfluidUndelegateAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateAminoMsg + ): MsgSuperfluidUndelegate { + return MsgSuperfluidUndelegate.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSuperfluidUndelegate + ): MsgSuperfluidUndelegateAminoMsg { + return { + type: 'osmosis/superfluid-undelegate', + value: MsgSuperfluidUndelegate.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateProtoMsg + ): MsgSuperfluidUndelegate { + return MsgSuperfluidUndelegate.decode(message.value); + }, + toProto(message: MsgSuperfluidUndelegate): Uint8Array { + return MsgSuperfluidUndelegate.encode(message).finish(); + }, + toProtoMsg( + message: MsgSuperfluidUndelegate + ): MsgSuperfluidUndelegateProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value: MsgSuperfluidUndelegate.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidUndelegate.typeUrl, + MsgSuperfluidUndelegate +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUndelegate.aminoType, + MsgSuperfluidUndelegate.typeUrl +); +function createBaseMsgSuperfluidUndelegateResponse(): MsgSuperfluidUndelegateResponse { + return {}; +} +export const MsgSuperfluidUndelegateResponse = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateResponse', + aminoType: 'osmosis/superfluid-undelegate-response', + is(o: any): o is MsgSuperfluidUndelegateResponse { + return o && o.$typeUrl === MsgSuperfluidUndelegateResponse.typeUrl; + }, + isSDK(o: any): o is MsgSuperfluidUndelegateResponseSDKType { + return o && o.$typeUrl === MsgSuperfluidUndelegateResponse.typeUrl; + }, + isAmino(o: any): o is MsgSuperfluidUndelegateResponseAmino { + return o && o.$typeUrl === MsgSuperfluidUndelegateResponse.typeUrl; + }, + encode( + _: MsgSuperfluidUndelegateResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidUndelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSuperfluidUndelegateResponse { + const message = createBaseMsgSuperfluidUndelegateResponse(); + return message; + }, + fromAmino( + _: MsgSuperfluidUndelegateResponseAmino + ): MsgSuperfluidUndelegateResponse { + const message = createBaseMsgSuperfluidUndelegateResponse(); + return message; + }, + toAmino( + _: MsgSuperfluidUndelegateResponse + ): MsgSuperfluidUndelegateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateResponseAminoMsg + ): MsgSuperfluidUndelegateResponse { + return MsgSuperfluidUndelegateResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSuperfluidUndelegateResponse + ): MsgSuperfluidUndelegateResponseAminoMsg { + return { + type: 'osmosis/superfluid-undelegate-response', + value: MsgSuperfluidUndelegateResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateResponseProtoMsg + ): MsgSuperfluidUndelegateResponse { + return MsgSuperfluidUndelegateResponse.decode(message.value); + }, + toProto(message: MsgSuperfluidUndelegateResponse): Uint8Array { + return MsgSuperfluidUndelegateResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSuperfluidUndelegateResponse + ): MsgSuperfluidUndelegateResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateResponse', + value: MsgSuperfluidUndelegateResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidUndelegateResponse.typeUrl, + MsgSuperfluidUndelegateResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUndelegateResponse.aminoType, + MsgSuperfluidUndelegateResponse.typeUrl +); +function createBaseMsgSuperfluidUnbondLock(): MsgSuperfluidUnbondLock { + return { + sender: '', + lockId: BigInt(0), + }; +} +export const MsgSuperfluidUnbondLock = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + aminoType: 'osmosis/superfluid-unbond-lock', + is(o: any): o is MsgSuperfluidUnbondLock { + return ( + o && + (o.$typeUrl === MsgSuperfluidUnbondLock.typeUrl || + (typeof o.sender === 'string' && typeof o.lockId === 'bigint')) + ); + }, + isSDK(o: any): o is MsgSuperfluidUnbondLockSDKType { + return ( + o && + (o.$typeUrl === MsgSuperfluidUnbondLock.typeUrl || + (typeof o.sender === 'string' && typeof o.lock_id === 'bigint')) + ); + }, + isAmino(o: any): o is MsgSuperfluidUnbondLockAmino { + return ( + o && + (o.$typeUrl === MsgSuperfluidUnbondLock.typeUrl || + (typeof o.sender === 'string' && typeof o.lock_id === 'bigint')) + ); + }, + encode( + message: MsgSuperfluidUnbondLock, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUnbondLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidUnbondLock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSuperfluidUnbondLock { + const message = createBaseMsgSuperfluidUnbondLock(); + message.sender = object.sender ?? ''; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgSuperfluidUnbondLockAmino): MsgSuperfluidUnbondLock { + const message = createBaseMsgSuperfluidUnbondLock(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino(message: MsgSuperfluidUnbondLock): MsgSuperfluidUnbondLockAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgSuperfluidUnbondLockAminoMsg + ): MsgSuperfluidUnbondLock { + return MsgSuperfluidUnbondLock.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSuperfluidUnbondLock + ): MsgSuperfluidUnbondLockAminoMsg { + return { + type: 'osmosis/superfluid-unbond-lock', + value: MsgSuperfluidUnbondLock.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSuperfluidUnbondLockProtoMsg + ): MsgSuperfluidUnbondLock { + return MsgSuperfluidUnbondLock.decode(message.value); + }, + toProto(message: MsgSuperfluidUnbondLock): Uint8Array { + return MsgSuperfluidUnbondLock.encode(message).finish(); + }, + toProtoMsg( + message: MsgSuperfluidUnbondLock + ): MsgSuperfluidUnbondLockProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value: MsgSuperfluidUnbondLock.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidUnbondLock.typeUrl, + MsgSuperfluidUnbondLock +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUnbondLock.aminoType, + MsgSuperfluidUnbondLock.typeUrl +); +function createBaseMsgSuperfluidUnbondLockResponse(): MsgSuperfluidUnbondLockResponse { + return {}; +} +export const MsgSuperfluidUnbondLockResponse = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLockResponse', + aminoType: 'osmosis/superfluid-unbond-lock-response', + is(o: any): o is MsgSuperfluidUnbondLockResponse { + return o && o.$typeUrl === MsgSuperfluidUnbondLockResponse.typeUrl; + }, + isSDK(o: any): o is MsgSuperfluidUnbondLockResponseSDKType { + return o && o.$typeUrl === MsgSuperfluidUnbondLockResponse.typeUrl; + }, + isAmino(o: any): o is MsgSuperfluidUnbondLockResponseAmino { + return o && o.$typeUrl === MsgSuperfluidUnbondLockResponse.typeUrl; + }, + encode( + _: MsgSuperfluidUnbondLockResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUnbondLockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidUnbondLockResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSuperfluidUnbondLockResponse { + const message = createBaseMsgSuperfluidUnbondLockResponse(); + return message; + }, + fromAmino( + _: MsgSuperfluidUnbondLockResponseAmino + ): MsgSuperfluidUnbondLockResponse { + const message = createBaseMsgSuperfluidUnbondLockResponse(); + return message; + }, + toAmino( + _: MsgSuperfluidUnbondLockResponse + ): MsgSuperfluidUnbondLockResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSuperfluidUnbondLockResponseAminoMsg + ): MsgSuperfluidUnbondLockResponse { + return MsgSuperfluidUnbondLockResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSuperfluidUnbondLockResponse + ): MsgSuperfluidUnbondLockResponseAminoMsg { + return { + type: 'osmosis/superfluid-unbond-lock-response', + value: MsgSuperfluidUnbondLockResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSuperfluidUnbondLockResponseProtoMsg + ): MsgSuperfluidUnbondLockResponse { + return MsgSuperfluidUnbondLockResponse.decode(message.value); + }, + toProto(message: MsgSuperfluidUnbondLockResponse): Uint8Array { + return MsgSuperfluidUnbondLockResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSuperfluidUnbondLockResponse + ): MsgSuperfluidUnbondLockResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLockResponse', + value: MsgSuperfluidUnbondLockResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidUnbondLockResponse.typeUrl, + MsgSuperfluidUnbondLockResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUnbondLockResponse.aminoType, + MsgSuperfluidUnbondLockResponse.typeUrl +); +function createBaseMsgSuperfluidUndelegateAndUnbondLock(): MsgSuperfluidUndelegateAndUnbondLock { + return { + sender: '', + lockId: BigInt(0), + coin: Coin.fromPartial({}), + }; +} +export const MsgSuperfluidUndelegateAndUnbondLock = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + aminoType: 'osmosis/superfluid-undelegate-and-unbond-lock', + is(o: any): o is MsgSuperfluidUndelegateAndUnbondLock { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLock.typeUrl || + (typeof o.sender === 'string' && + typeof o.lockId === 'bigint' && + Coin.is(o.coin))) + ); + }, + isSDK(o: any): o is MsgSuperfluidUndelegateAndUnbondLockSDKType { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLock.typeUrl || + (typeof o.sender === 'string' && + typeof o.lock_id === 'bigint' && + Coin.isSDK(o.coin))) + ); + }, + isAmino(o: any): o is MsgSuperfluidUndelegateAndUnbondLockAmino { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLock.typeUrl || + (typeof o.sender === 'string' && + typeof o.lock_id === 'bigint' && + Coin.isAmino(o.coin))) + ); + }, + encode( + message: MsgSuperfluidUndelegateAndUnbondLock, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegateAndUnbondLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidUndelegateAndUnbondLock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.lockId = reader.uint64(); + break; + case 3: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSuperfluidUndelegateAndUnbondLock { + const message = createBaseMsgSuperfluidUndelegateAndUnbondLock(); + message.sender = object.sender ?? ''; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined; + return message; + }, + fromAmino( + object: MsgSuperfluidUndelegateAndUnbondLockAmino + ): MsgSuperfluidUndelegateAndUnbondLock { + const message = createBaseMsgSuperfluidUndelegateAndUnbondLock(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino( + message: MsgSuperfluidUndelegateAndUnbondLock + ): MsgSuperfluidUndelegateAndUnbondLockAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + return obj; + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateAndUnbondLockAminoMsg + ): MsgSuperfluidUndelegateAndUnbondLock { + return MsgSuperfluidUndelegateAndUnbondLock.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSuperfluidUndelegateAndUnbondLock + ): MsgSuperfluidUndelegateAndUnbondLockAminoMsg { + return { + type: 'osmosis/superfluid-undelegate-and-unbond-lock', + value: MsgSuperfluidUndelegateAndUnbondLock.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockProtoMsg + ): MsgSuperfluidUndelegateAndUnbondLock { + return MsgSuperfluidUndelegateAndUnbondLock.decode(message.value); + }, + toProto(message: MsgSuperfluidUndelegateAndUnbondLock): Uint8Array { + return MsgSuperfluidUndelegateAndUnbondLock.encode(message).finish(); + }, + toProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLock + ): MsgSuperfluidUndelegateAndUnbondLockProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value: MsgSuperfluidUndelegateAndUnbondLock.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidUndelegateAndUnbondLock.typeUrl, + MsgSuperfluidUndelegateAndUnbondLock +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUndelegateAndUnbondLock.aminoType, + MsgSuperfluidUndelegateAndUnbondLock.typeUrl +); +function createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(): MsgSuperfluidUndelegateAndUnbondLockResponse { + return { + lockId: BigInt(0), + }; +} +export const MsgSuperfluidUndelegateAndUnbondLockResponse = { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLockResponse', + aminoType: 'osmosis/superfluid-undelegate-and-unbond-lock-response', + is(o: any): o is MsgSuperfluidUndelegateAndUnbondLockResponse { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl || + typeof o.lockId === 'bigint') + ); + }, + isSDK(o: any): o is MsgSuperfluidUndelegateAndUnbondLockResponseSDKType { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + isAmino(o: any): o is MsgSuperfluidUndelegateAndUnbondLockResponseAmino { + return ( + o && + (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl || + typeof o.lock_id === 'bigint') + ); + }, + encode( + message: MsgSuperfluidUndelegateAndUnbondLockResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgSuperfluidUndelegateAndUnbondLockResponseAmino + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino( + message: MsgSuperfluidUndelegateAndUnbondLockResponse + ): MsgSuperfluidUndelegateAndUnbondLockResponseAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + return MsgSuperfluidUndelegateAndUnbondLockResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockResponse + ): MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg { + return { + type: 'osmosis/superfluid-undelegate-and-unbond-lock-response', + value: MsgSuperfluidUndelegateAndUnbondLockResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockResponseProtoMsg + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + return MsgSuperfluidUndelegateAndUnbondLockResponse.decode(message.value); + }, + toProto(message: MsgSuperfluidUndelegateAndUnbondLockResponse): Uint8Array { + return MsgSuperfluidUndelegateAndUnbondLockResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockResponse + ): MsgSuperfluidUndelegateAndUnbondLockResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLockResponse', + value: + MsgSuperfluidUndelegateAndUnbondLockResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl, + MsgSuperfluidUndelegateAndUnbondLockResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUndelegateAndUnbondLockResponse.aminoType, + MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl +); +function createBaseMsgLockAndSuperfluidDelegate(): MsgLockAndSuperfluidDelegate { + return { + sender: '', + coins: [], + valAddr: '', + }; +} +export const MsgLockAndSuperfluidDelegate = { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + aminoType: 'osmosis/lock-and-superfluid-delegate', + is(o: any): o is MsgLockAndSuperfluidDelegate { + return ( + o && + (o.$typeUrl === MsgLockAndSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])) && + typeof o.valAddr === 'string')) + ); + }, + isSDK(o: any): o is MsgLockAndSuperfluidDelegateSDKType { + return ( + o && + (o.$typeUrl === MsgLockAndSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])) && + typeof o.val_addr === 'string')) + ); + }, + isAmino(o: any): o is MsgLockAndSuperfluidDelegateAmino { + return ( + o && + (o.$typeUrl === MsgLockAndSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])) && + typeof o.val_addr === 'string')) + ); + }, + encode( + message: MsgLockAndSuperfluidDelegate, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.valAddr !== '') { + writer.uint32(26).string(message.valAddr); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgLockAndSuperfluidDelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLockAndSuperfluidDelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.valAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgLockAndSuperfluidDelegate { + const message = createBaseMsgLockAndSuperfluidDelegate(); + message.sender = object.sender ?? ''; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + message.valAddr = object.valAddr ?? ''; + return message; + }, + fromAmino( + object: MsgLockAndSuperfluidDelegateAmino + ): MsgLockAndSuperfluidDelegate { + const message = createBaseMsgLockAndSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + return message; + }, + toAmino( + message: MsgLockAndSuperfluidDelegate + ): MsgLockAndSuperfluidDelegateAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr; + return obj; + }, + fromAminoMsg( + object: MsgLockAndSuperfluidDelegateAminoMsg + ): MsgLockAndSuperfluidDelegate { + return MsgLockAndSuperfluidDelegate.fromAmino(object.value); + }, + toAminoMsg( + message: MsgLockAndSuperfluidDelegate + ): MsgLockAndSuperfluidDelegateAminoMsg { + return { + type: 'osmosis/lock-and-superfluid-delegate', + value: MsgLockAndSuperfluidDelegate.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgLockAndSuperfluidDelegateProtoMsg + ): MsgLockAndSuperfluidDelegate { + return MsgLockAndSuperfluidDelegate.decode(message.value); + }, + toProto(message: MsgLockAndSuperfluidDelegate): Uint8Array { + return MsgLockAndSuperfluidDelegate.encode(message).finish(); + }, + toProtoMsg( + message: MsgLockAndSuperfluidDelegate + ): MsgLockAndSuperfluidDelegateProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value: MsgLockAndSuperfluidDelegate.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgLockAndSuperfluidDelegate.typeUrl, + MsgLockAndSuperfluidDelegate +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockAndSuperfluidDelegate.aminoType, + MsgLockAndSuperfluidDelegate.typeUrl +); +function createBaseMsgLockAndSuperfluidDelegateResponse(): MsgLockAndSuperfluidDelegateResponse { + return { + ID: BigInt(0), + }; +} +export const MsgLockAndSuperfluidDelegateResponse = { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegateResponse', + aminoType: 'osmosis/lock-and-superfluid-delegate-response', + is(o: any): o is MsgLockAndSuperfluidDelegateResponse { + return ( + o && + (o.$typeUrl === MsgLockAndSuperfluidDelegateResponse.typeUrl || + typeof o.ID === 'bigint') + ); + }, + isSDK(o: any): o is MsgLockAndSuperfluidDelegateResponseSDKType { + return ( + o && + (o.$typeUrl === MsgLockAndSuperfluidDelegateResponse.typeUrl || + typeof o.ID === 'bigint') + ); + }, + isAmino(o: any): o is MsgLockAndSuperfluidDelegateResponseAmino { + return ( + o && + (o.$typeUrl === MsgLockAndSuperfluidDelegateResponse.typeUrl || + typeof o.ID === 'bigint') + ); + }, + encode( + message: MsgLockAndSuperfluidDelegateResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.ID !== BigInt(0)) { + writer.uint32(8).uint64(message.ID); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgLockAndSuperfluidDelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLockAndSuperfluidDelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgLockAndSuperfluidDelegateResponse { + const message = createBaseMsgLockAndSuperfluidDelegateResponse(); + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgLockAndSuperfluidDelegateResponseAmino + ): MsgLockAndSuperfluidDelegateResponse { + const message = createBaseMsgLockAndSuperfluidDelegateResponse(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + return message; + }, + toAmino( + message: MsgLockAndSuperfluidDelegateResponse + ): MsgLockAndSuperfluidDelegateResponseAmino { + const obj: any = {}; + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgLockAndSuperfluidDelegateResponseAminoMsg + ): MsgLockAndSuperfluidDelegateResponse { + return MsgLockAndSuperfluidDelegateResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgLockAndSuperfluidDelegateResponse + ): MsgLockAndSuperfluidDelegateResponseAminoMsg { + return { + type: 'osmosis/lock-and-superfluid-delegate-response', + value: MsgLockAndSuperfluidDelegateResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgLockAndSuperfluidDelegateResponseProtoMsg + ): MsgLockAndSuperfluidDelegateResponse { + return MsgLockAndSuperfluidDelegateResponse.decode(message.value); + }, + toProto(message: MsgLockAndSuperfluidDelegateResponse): Uint8Array { + return MsgLockAndSuperfluidDelegateResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgLockAndSuperfluidDelegateResponse + ): MsgLockAndSuperfluidDelegateResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegateResponse', + value: MsgLockAndSuperfluidDelegateResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgLockAndSuperfluidDelegateResponse.typeUrl, + MsgLockAndSuperfluidDelegateResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockAndSuperfluidDelegateResponse.aminoType, + MsgLockAndSuperfluidDelegateResponse.typeUrl +); +function createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(): MsgCreateFullRangePositionAndSuperfluidDelegate { + return { + sender: '', + coins: [], + valAddr: '', + poolId: BigInt(0), + }; +} +export const MsgCreateFullRangePositionAndSuperfluidDelegate = { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + aminoType: 'osmosis/full-range-and-sf-delegate', + is(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegate { + return ( + o && + (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.is(o.coins[0])) && + typeof o.valAddr === 'string' && + typeof o.poolId === 'bigint')) + ); + }, + isSDK(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateSDKType { + return ( + o && + (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isSDK(o.coins[0])) && + typeof o.val_addr === 'string' && + typeof o.pool_id === 'bigint')) + ); + }, + isAmino(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateAmino { + return ( + o && + (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl || + (typeof o.sender === 'string' && + Array.isArray(o.coins) && + (!o.coins.length || Coin.isAmino(o.coins[0])) && + typeof o.val_addr === 'string' && + typeof o.pool_id === 'bigint')) + ); + }, + encode( + message: MsgCreateFullRangePositionAndSuperfluidDelegate, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.valAddr !== '') { + writer.uint32(26).string(message.valAddr); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(32).uint64(message.poolId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.valAddr = reader.string(); + break; + case 4: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(); + message.sender = object.sender ?? ''; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; + message.valAddr = object.valAddr ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgCreateFullRangePositionAndSuperfluidDelegateAmino + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino( + message: MsgCreateFullRangePositionAndSuperfluidDelegate + ): MsgCreateFullRangePositionAndSuperfluidDelegateAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); + } else { + obj.coins = message.coins; + } + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + return MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino( + object.value + ); + }, + toAminoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegate + ): MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { + return { + type: 'osmosis/full-range-and-sf-delegate', + value: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + return MsgCreateFullRangePositionAndSuperfluidDelegate.decode( + message.value + ); + }, + toProto( + message: MsgCreateFullRangePositionAndSuperfluidDelegate + ): Uint8Array { + return MsgCreateFullRangePositionAndSuperfluidDelegate.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegate + ): MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value: + MsgCreateFullRangePositionAndSuperfluidDelegate.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl, + MsgCreateFullRangePositionAndSuperfluidDelegate +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateFullRangePositionAndSuperfluidDelegate.aminoType, + MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl +); +function createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return { + lockID: BigInt(0), + positionID: BigInt(0), + }; +} +export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegateResponse', + aminoType: + 'osmosis/create-full-range-position-and-superfluid-delegate-response', + is(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return ( + o && + (o.$typeUrl === + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl || + (typeof o.lockID === 'bigint' && typeof o.positionID === 'bigint')) + ); + }, + isSDK( + o: any + ): o is MsgCreateFullRangePositionAndSuperfluidDelegateResponseSDKType { + return ( + o && + (o.$typeUrl === + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl || + (typeof o.lockID === 'bigint' && typeof o.positionID === 'bigint')) + ); + }, + isAmino( + o: any + ): o is MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { + return ( + o && + (o.$typeUrl === + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl || + (typeof o.lockID === 'bigint' && typeof o.positionID === 'bigint')) + ); + }, + encode( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockID !== BigInt(0)) { + writer.uint32(8).uint64(message.lockID); + } + if (message.positionID !== BigInt(0)) { + writer.uint32(16).uint64(message.positionID); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = + createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockID = reader.uint64(); + break; + case 2: + message.positionID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + const message = + createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(); + message.lockID = + object.lockID !== undefined && object.lockID !== null + ? BigInt(object.lockID.toString()) + : BigInt(0); + message.positionID = + object.positionID !== undefined && object.positionID !== null + ? BigInt(object.positionID.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + const message = + createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(); + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + if (object.positionID !== undefined && object.positionID !== null) { + message.positionID = BigInt(object.positionID); + } + return message; + }, + toAmino( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { + const obj: any = {}; + obj.lockID = + message.lockID !== BigInt(0) ? message.lockID.toString() : undefined; + obj.positionID = + message.positionID !== BigInt(0) + ? message.positionID.toString() + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return MsgCreateFullRangePositionAndSuperfluidDelegateResponse.fromAmino( + object.value + ); + }, + toAminoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg { + return { + type: 'osmosis/create-full-range-position-and-superfluid-delegate-response', + value: + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.toAmino( + message + ), + }; + }, + fromProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return MsgCreateFullRangePositionAndSuperfluidDelegateResponse.decode( + message.value + ); + }, + toProto( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse + ): Uint8Array { + return MsgCreateFullRangePositionAndSuperfluidDelegateResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegateResponse', + value: + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl, + MsgCreateFullRangePositionAndSuperfluidDelegateResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.aminoType, + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl +); +function createBaseMsgUnPoolWhitelistedPool(): MsgUnPoolWhitelistedPool { + return { + sender: '', + poolId: BigInt(0), + }; +} +export const MsgUnPoolWhitelistedPool = { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + aminoType: 'osmosis/unpool-whitelisted-pool', + is(o: any): o is MsgUnPoolWhitelistedPool { + return ( + o && + (o.$typeUrl === MsgUnPoolWhitelistedPool.typeUrl || + (typeof o.sender === 'string' && typeof o.poolId === 'bigint')) + ); + }, + isSDK(o: any): o is MsgUnPoolWhitelistedPoolSDKType { + return ( + o && + (o.$typeUrl === MsgUnPoolWhitelistedPool.typeUrl || + (typeof o.sender === 'string' && typeof o.pool_id === 'bigint')) + ); + }, + isAmino(o: any): o is MsgUnPoolWhitelistedPoolAmino { + return ( + o && + (o.$typeUrl === MsgUnPoolWhitelistedPool.typeUrl || + (typeof o.sender === 'string' && typeof o.pool_id === 'bigint')) + ); + }, + encode( + message: MsgUnPoolWhitelistedPool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnPoolWhitelistedPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnPoolWhitelistedPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUnPoolWhitelistedPool { + const message = createBaseMsgUnPoolWhitelistedPool(); + message.sender = object.sender ?? ''; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgUnPoolWhitelistedPoolAmino): MsgUnPoolWhitelistedPool { + const message = createBaseMsgUnPoolWhitelistedPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino(message: MsgUnPoolWhitelistedPool): MsgUnPoolWhitelistedPoolAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgUnPoolWhitelistedPoolAminoMsg + ): MsgUnPoolWhitelistedPool { + return MsgUnPoolWhitelistedPool.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUnPoolWhitelistedPool + ): MsgUnPoolWhitelistedPoolAminoMsg { + return { + type: 'osmosis/unpool-whitelisted-pool', + value: MsgUnPoolWhitelistedPool.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUnPoolWhitelistedPoolProtoMsg + ): MsgUnPoolWhitelistedPool { + return MsgUnPoolWhitelistedPool.decode(message.value); + }, + toProto(message: MsgUnPoolWhitelistedPool): Uint8Array { + return MsgUnPoolWhitelistedPool.encode(message).finish(); + }, + toProtoMsg( + message: MsgUnPoolWhitelistedPool + ): MsgUnPoolWhitelistedPoolProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value: MsgUnPoolWhitelistedPool.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUnPoolWhitelistedPool.typeUrl, + MsgUnPoolWhitelistedPool +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnPoolWhitelistedPool.aminoType, + MsgUnPoolWhitelistedPool.typeUrl +); +function createBaseMsgUnPoolWhitelistedPoolResponse(): MsgUnPoolWhitelistedPoolResponse { + return { + exitedLockIds: [], + }; +} +export const MsgUnPoolWhitelistedPoolResponse = { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPoolResponse', + aminoType: 'osmosis/un-pool-whitelisted-pool-response', + is(o: any): o is MsgUnPoolWhitelistedPoolResponse { + return ( + o && + (o.$typeUrl === MsgUnPoolWhitelistedPoolResponse.typeUrl || + (Array.isArray(o.exitedLockIds) && + (!o.exitedLockIds.length || typeof o.exitedLockIds[0] === 'bigint'))) + ); + }, + isSDK(o: any): o is MsgUnPoolWhitelistedPoolResponseSDKType { + return ( + o && + (o.$typeUrl === MsgUnPoolWhitelistedPoolResponse.typeUrl || + (Array.isArray(o.exited_lock_ids) && + (!o.exited_lock_ids.length || + typeof o.exited_lock_ids[0] === 'bigint'))) + ); + }, + isAmino(o: any): o is MsgUnPoolWhitelistedPoolResponseAmino { + return ( + o && + (o.$typeUrl === MsgUnPoolWhitelistedPoolResponse.typeUrl || + (Array.isArray(o.exited_lock_ids) && + (!o.exited_lock_ids.length || + typeof o.exited_lock_ids[0] === 'bigint'))) + ); + }, + encode( + message: MsgUnPoolWhitelistedPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.exitedLockIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnPoolWhitelistedPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnPoolWhitelistedPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.exitedLockIds.push(reader.uint64()); + } + } else { + message.exitedLockIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUnPoolWhitelistedPoolResponse { + const message = createBaseMsgUnPoolWhitelistedPoolResponse(); + message.exitedLockIds = + object.exitedLockIds?.map((e) => BigInt(e.toString())) || []; + return message; + }, + fromAmino( + object: MsgUnPoolWhitelistedPoolResponseAmino + ): MsgUnPoolWhitelistedPoolResponse { + const message = createBaseMsgUnPoolWhitelistedPoolResponse(); + message.exitedLockIds = object.exited_lock_ids?.map((e) => BigInt(e)) || []; + return message; + }, + toAmino( + message: MsgUnPoolWhitelistedPoolResponse + ): MsgUnPoolWhitelistedPoolResponseAmino { + const obj: any = {}; + if (message.exitedLockIds) { + obj.exited_lock_ids = message.exitedLockIds.map((e) => e.toString()); + } else { + obj.exited_lock_ids = message.exitedLockIds; + } + return obj; + }, + fromAminoMsg( + object: MsgUnPoolWhitelistedPoolResponseAminoMsg + ): MsgUnPoolWhitelistedPoolResponse { + return MsgUnPoolWhitelistedPoolResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUnPoolWhitelistedPoolResponse + ): MsgUnPoolWhitelistedPoolResponseAminoMsg { + return { + type: 'osmosis/un-pool-whitelisted-pool-response', + value: MsgUnPoolWhitelistedPoolResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUnPoolWhitelistedPoolResponseProtoMsg + ): MsgUnPoolWhitelistedPoolResponse { + return MsgUnPoolWhitelistedPoolResponse.decode(message.value); + }, + toProto(message: MsgUnPoolWhitelistedPoolResponse): Uint8Array { + return MsgUnPoolWhitelistedPoolResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgUnPoolWhitelistedPoolResponse + ): MsgUnPoolWhitelistedPoolResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPoolResponse', + value: MsgUnPoolWhitelistedPoolResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUnPoolWhitelistedPoolResponse.typeUrl, + MsgUnPoolWhitelistedPoolResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnPoolWhitelistedPoolResponse.aminoType, + MsgUnPoolWhitelistedPoolResponse.typeUrl +); +function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return { + sender: '', + lockId: BigInt(0), + sharesToMigrate: Coin.fromPartial({}), + tokenOutMins: [], + }; +} +export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + aminoType: 'osmosis/unlock-and-migrate', + is(o: any): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return ( + o && + (o.$typeUrl === + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl || + (typeof o.sender === 'string' && + typeof o.lockId === 'bigint' && + Coin.is(o.sharesToMigrate) && + Array.isArray(o.tokenOutMins) && + (!o.tokenOutMins.length || Coin.is(o.tokenOutMins[0])))) + ); + }, + isSDK( + o: any + ): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionSDKType { + return ( + o && + (o.$typeUrl === + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl || + (typeof o.sender === 'string' && + typeof o.lock_id === 'bigint' && + Coin.isSDK(o.shares_to_migrate) && + Array.isArray(o.token_out_mins) && + (!o.token_out_mins.length || Coin.isSDK(o.token_out_mins[0])))) + ); + }, + isAmino( + o: any + ): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { + return ( + o && + (o.$typeUrl === + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl || + (typeof o.sender === 'string' && + typeof o.lock_id === 'bigint' && + Coin.isAmino(o.shares_to_migrate) && + Array.isArray(o.token_out_mins) && + (!o.token_out_mins.length || Coin.isAmino(o.token_out_mins[0])))) + ); + }, + encode( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).int64(message.lockId); + } + if (message.sharesToMigrate !== undefined) { + Coin.encode(message.sharesToMigrate, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.tokenOutMins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.lockId = reader.int64(); + break; + case 3: + message.sharesToMigrate = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.tokenOutMins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(); + message.sender = object.sender ?? ''; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + message.sharesToMigrate = + object.sharesToMigrate !== undefined && object.sharesToMigrate !== null + ? Coin.fromPartial(object.sharesToMigrate) + : undefined; + message.tokenOutMins = + object.tokenOutMins?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if ( + object.shares_to_migrate !== undefined && + object.shares_to_migrate !== null + ) { + message.sharesToMigrate = Coin.fromAmino(object.shares_to_migrate); + } + message.tokenOutMins = + object.token_out_mins?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + obj.shares_to_migrate = message.sharesToMigrate + ? Coin.toAmino(message.sharesToMigrate) + : undefined; + if (message.tokenOutMins) { + obj.token_out_mins = message.tokenOutMins.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.token_out_mins = message.tokenOutMins; + } + return obj; + }, + fromAminoMsg( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromAmino( + object.value + ); + }, + toAminoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { + return { + type: 'osmosis/unlock-and-migrate', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino( + message + ), + }; + }, + fromProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.decode( + message.value + ); + }, + toProto( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): Uint8Array { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.aminoType, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl +); +function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return { + amount0: '', + amount1: '', + liquidityCreated: '', + joinTime: new Date(), + }; +} +export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = + { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse', + aminoType: + 'osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position-response', + is( + o: any + ): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return ( + o && + (o.$typeUrl === + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl || + (typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.liquidityCreated === 'string' && + Timestamp.is(o.joinTime))) + ); + }, + isSDK( + o: any + ): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseSDKType { + return ( + o && + (o.$typeUrl === + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl || + (typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.liquidity_created === 'string' && + Timestamp.isSDK(o.join_time))) + ); + }, + isAmino( + o: any + ): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { + return ( + o && + (o.$typeUrl === + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl || + (typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.liquidity_created === 'string' && + Timestamp.isAmino(o.join_time))) + ); + }, + encode( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.amount0 !== '') { + writer.uint32(10).string(message.amount0); + } + if (message.amount1 !== '') { + writer.uint32(18).string(message.amount1); + } + if (message.liquidityCreated !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.liquidityCreated, 18).atomics); + } + if (message.joinTime !== undefined) { + Timestamp.encode( + toTimestamp(message.joinTime), + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount0 = reader.string(); + break; + case 2: + message.amount1 = reader.string(); + break; + case 3: + message.liquidityCreated = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 4: + message.joinTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(); + message.amount0 = object.amount0 ?? ''; + message.amount1 = object.amount1 ?? ''; + message.liquidityCreated = object.liquidityCreated ?? ''; + message.joinTime = object.joinTime ?? undefined; + return message; + }, + fromAmino( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(); + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if ( + object.liquidity_created !== undefined && + object.liquidity_created !== null + ) { + message.liquidityCreated = object.liquidity_created; + } + if (object.join_time !== undefined && object.join_time !== null) { + message.joinTime = fromTimestamp(Timestamp.fromAmino(object.join_time)); + } + return message; + }, + toAmino( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { + const obj: any = {}; + obj.amount0 = message.amount0 === '' ? undefined : message.amount0; + obj.amount1 = message.amount1 === '' ? undefined : message.amount1; + obj.liquidity_created = + message.liquidityCreated === '' ? undefined : message.liquidityCreated; + obj.join_time = message.joinTime + ? Timestamp.toAmino(toTimestamp(message.joinTime)) + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.fromAmino( + object.value + ); + }, + toAminoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg { + return { + type: 'osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position-response', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.toAmino( + message + ), + }; + }, + fromProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.decode( + message.value + ); + }, + toProto( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse + ): Uint8Array { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.encode( + message + ).finish(), + }; + }, + }; +GlobalDecoderRegistry.register( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.aminoType, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl +); +function createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(): MsgAddToConcentratedLiquiditySuperfluidPosition { + return { + positionId: BigInt(0), + sender: '', + tokenDesired0: Coin.fromPartial({}), + tokenDesired1: Coin.fromPartial({}), + }; +} +export const MsgAddToConcentratedLiquiditySuperfluidPosition = { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + aminoType: 'osmosis/add-to-cl-superfluid-position', + is(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPosition { + return ( + o && + (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl || + (typeof o.positionId === 'bigint' && + typeof o.sender === 'string' && + Coin.is(o.tokenDesired0) && + Coin.is(o.tokenDesired1))) + ); + }, + isSDK(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionSDKType { + return ( + o && + (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.sender === 'string' && + Coin.isSDK(o.token_desired0) && + Coin.isSDK(o.token_desired1))) + ); + }, + isAmino(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionAmino { + return ( + o && + (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.sender === 'string' && + Coin.isAmino(o.token_desired0) && + Coin.isAmino(o.token_desired1))) + ); + }, + encode( + message: MsgAddToConcentratedLiquiditySuperfluidPosition, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + if (message.tokenDesired0 !== undefined) { + Coin.encode(message.tokenDesired0, writer.uint32(26).fork()).ldelim(); + } + if (message.tokenDesired1 !== undefined) { + Coin.encode(message.tokenDesired1, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.tokenDesired0 = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.tokenDesired1 = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(); + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0); + message.sender = object.sender ?? ''; + message.tokenDesired0 = + object.tokenDesired0 !== undefined && object.tokenDesired0 !== null + ? Coin.fromPartial(object.tokenDesired0) + : undefined; + message.tokenDesired1 = + object.tokenDesired1 !== undefined && object.tokenDesired1 !== null + ? Coin.fromPartial(object.tokenDesired1) + : undefined; + return message; + }, + fromAmino( + object: MsgAddToConcentratedLiquiditySuperfluidPositionAmino + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.token_desired0 !== undefined && object.token_desired0 !== null) { + message.tokenDesired0 = Coin.fromAmino(object.token_desired0); + } + if (object.token_desired1 !== undefined && object.token_desired1 !== null) { + message.tokenDesired1 = Coin.fromAmino(object.token_desired1); + } + return message; + }, + toAmino( + message: MsgAddToConcentratedLiquiditySuperfluidPosition + ): MsgAddToConcentratedLiquiditySuperfluidPositionAmino { + const obj: any = {}; + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.token_desired0 = message.tokenDesired0 + ? Coin.toAmino(message.tokenDesired0) + : undefined; + obj.token_desired1 = message.tokenDesired1 + ? Coin.toAmino(message.tokenDesired1) + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + return MsgAddToConcentratedLiquiditySuperfluidPosition.fromAmino( + object.value + ); + }, + toAminoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPosition + ): MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { + return { + type: 'osmosis/add-to-cl-superfluid-position', + value: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + return MsgAddToConcentratedLiquiditySuperfluidPosition.decode( + message.value + ); + }, + toProto( + message: MsgAddToConcentratedLiquiditySuperfluidPosition + ): Uint8Array { + return MsgAddToConcentratedLiquiditySuperfluidPosition.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPosition + ): MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value: + MsgAddToConcentratedLiquiditySuperfluidPosition.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl, + MsgAddToConcentratedLiquiditySuperfluidPosition +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToConcentratedLiquiditySuperfluidPosition.aminoType, + MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl +); +function createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return { + positionId: BigInt(0), + amount0: '', + amount1: '', + newLiquidity: '', + lockId: BigInt(0), + }; +} +export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPositionResponse', + aminoType: + 'osmosis/add-to-concentrated-liquidity-superfluid-position-response', + is(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return ( + o && + (o.$typeUrl === + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl || + (typeof o.positionId === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.newLiquidity === 'string' && + typeof o.lockId === 'bigint')) + ); + }, + isSDK( + o: any + ): o is MsgAddToConcentratedLiquiditySuperfluidPositionResponseSDKType { + return ( + o && + (o.$typeUrl === + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.new_liquidity === 'string' && + typeof o.lock_id === 'bigint')) + ); + }, + isAmino( + o: any + ): o is MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { + return ( + o && + (o.$typeUrl === + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl || + (typeof o.position_id === 'bigint' && + typeof o.amount0 === 'string' && + typeof o.amount1 === 'string' && + typeof o.new_liquidity === 'string' && + typeof o.lock_id === 'bigint')) + ); + }, + encode( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + if (message.amount0 !== '') { + writer.uint32(18).string(message.amount0); + } + if (message.amount1 !== '') { + writer.uint32(26).string(message.amount1); + } + if (message.newLiquidity !== '') { + writer + .uint32(42) + .string(Decimal.fromUserInput(message.newLiquidity, 18).atomics); + } + if (message.lockId !== BigInt(0)) { + writer.uint32(32).uint64(message.lockId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = + createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + case 2: + message.amount0 = reader.string(); + break; + case 3: + message.amount1 = reader.string(); + break; + case 5: + message.newLiquidity = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 4: + message.lockId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + const message = + createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(); + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0); + message.amount0 = object.amount0 ?? ''; + message.amount1 = object.amount1 ?? ''; + message.newLiquidity = object.newLiquidity ?? ''; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + const message = + createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.new_liquidity !== undefined && object.new_liquidity !== null) { + message.newLiquidity = object.new_liquidity; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; + }, + toAmino( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { + const obj: any = {}; + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined; + obj.amount0 = message.amount0 === '' ? undefined : message.amount0; + obj.amount1 = message.amount1 === '' ? undefined : message.amount1; + obj.new_liquidity = + message.newLiquidity === '' ? undefined : message.newLiquidity; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return MsgAddToConcentratedLiquiditySuperfluidPositionResponse.fromAmino( + object.value + ); + }, + toAminoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg { + return { + type: 'osmosis/add-to-concentrated-liquidity-superfluid-position-response', + value: + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.toAmino( + message + ), + }; + }, + fromProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return MsgAddToConcentratedLiquiditySuperfluidPositionResponse.decode( + message.value + ); + }, + toProto( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse + ): Uint8Array { + return MsgAddToConcentratedLiquiditySuperfluidPositionResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPositionResponse', + value: + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl, + MsgAddToConcentratedLiquiditySuperfluidPositionResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.aminoType, + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl +); +function createBaseMsgUnbondConvertAndStake(): MsgUnbondConvertAndStake { + return { + lockId: BigInt(0), + sender: '', + valAddr: '', + minAmtToStake: '', + sharesToConvert: Coin.fromPartial({}), + }; +} +export const MsgUnbondConvertAndStake = { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + aminoType: 'osmosis/unbond-convert-and-stake', + is(o: any): o is MsgUnbondConvertAndStake { + return ( + o && + (o.$typeUrl === MsgUnbondConvertAndStake.typeUrl || + (typeof o.lockId === 'bigint' && + typeof o.sender === 'string' && + typeof o.valAddr === 'string' && + typeof o.minAmtToStake === 'string' && + Coin.is(o.sharesToConvert))) + ); + }, + isSDK(o: any): o is MsgUnbondConvertAndStakeSDKType { + return ( + o && + (o.$typeUrl === MsgUnbondConvertAndStake.typeUrl || + (typeof o.lock_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.val_addr === 'string' && + typeof o.min_amt_to_stake === 'string' && + Coin.isSDK(o.shares_to_convert))) + ); + }, + isAmino(o: any): o is MsgUnbondConvertAndStakeAmino { + return ( + o && + (o.$typeUrl === MsgUnbondConvertAndStake.typeUrl || + (typeof o.lock_id === 'bigint' && + typeof o.sender === 'string' && + typeof o.val_addr === 'string' && + typeof o.min_amt_to_stake === 'string' && + Coin.isAmino(o.shares_to_convert))) + ); + }, + encode( + message: MsgUnbondConvertAndStake, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + if (message.valAddr !== '') { + writer.uint32(26).string(message.valAddr); + } + if (message.minAmtToStake !== '') { + writer.uint32(34).string(message.minAmtToStake); + } + if (message.sharesToConvert !== undefined) { + Coin.encode(message.sharesToConvert, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnbondConvertAndStake { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnbondConvertAndStake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.valAddr = reader.string(); + break; + case 4: + message.minAmtToStake = reader.string(); + break; + case 5: + message.sharesToConvert = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUnbondConvertAndStake { + const message = createBaseMsgUnbondConvertAndStake(); + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0); + message.sender = object.sender ?? ''; + message.valAddr = object.valAddr ?? ''; + message.minAmtToStake = object.minAmtToStake ?? ''; + message.sharesToConvert = + object.sharesToConvert !== undefined && object.sharesToConvert !== null + ? Coin.fromPartial(object.sharesToConvert) + : undefined; + return message; + }, + fromAmino(object: MsgUnbondConvertAndStakeAmino): MsgUnbondConvertAndStake { + const message = createBaseMsgUnbondConvertAndStake(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if ( + object.min_amt_to_stake !== undefined && + object.min_amt_to_stake !== null + ) { + message.minAmtToStake = object.min_amt_to_stake; + } + if ( + object.shares_to_convert !== undefined && + object.shares_to_convert !== null + ) { + message.sharesToConvert = Coin.fromAmino(object.shares_to_convert); + } + return message; + }, + toAmino(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeAmino { + const obj: any = {}; + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr; + obj.min_amt_to_stake = + message.minAmtToStake === '' ? undefined : message.minAmtToStake; + obj.shares_to_convert = message.sharesToConvert + ? Coin.toAmino(message.sharesToConvert) + : undefined; + return obj; + }, + fromAminoMsg( + object: MsgUnbondConvertAndStakeAminoMsg + ): MsgUnbondConvertAndStake { + return MsgUnbondConvertAndStake.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUnbondConvertAndStake + ): MsgUnbondConvertAndStakeAminoMsg { + return { + type: 'osmosis/unbond-convert-and-stake', + value: MsgUnbondConvertAndStake.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUnbondConvertAndStakeProtoMsg + ): MsgUnbondConvertAndStake { + return MsgUnbondConvertAndStake.decode(message.value); + }, + toProto(message: MsgUnbondConvertAndStake): Uint8Array { + return MsgUnbondConvertAndStake.encode(message).finish(); + }, + toProtoMsg( + message: MsgUnbondConvertAndStake + ): MsgUnbondConvertAndStakeProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + value: MsgUnbondConvertAndStake.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUnbondConvertAndStake.typeUrl, + MsgUnbondConvertAndStake +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnbondConvertAndStake.aminoType, + MsgUnbondConvertAndStake.typeUrl +); +function createBaseMsgUnbondConvertAndStakeResponse(): MsgUnbondConvertAndStakeResponse { + return { + totalAmtStaked: '', + }; +} +export const MsgUnbondConvertAndStakeResponse = { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStakeResponse', + aminoType: 'osmosis/unbond-convert-and-stake-response', + is(o: any): o is MsgUnbondConvertAndStakeResponse { + return ( + o && + (o.$typeUrl === MsgUnbondConvertAndStakeResponse.typeUrl || + typeof o.totalAmtStaked === 'string') + ); + }, + isSDK(o: any): o is MsgUnbondConvertAndStakeResponseSDKType { + return ( + o && + (o.$typeUrl === MsgUnbondConvertAndStakeResponse.typeUrl || + typeof o.total_amt_staked === 'string') + ); + }, + isAmino(o: any): o is MsgUnbondConvertAndStakeResponseAmino { + return ( + o && + (o.$typeUrl === MsgUnbondConvertAndStakeResponse.typeUrl || + typeof o.total_amt_staked === 'string') + ); + }, + encode( + message: MsgUnbondConvertAndStakeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.totalAmtStaked !== '') { + writer.uint32(10).string(message.totalAmtStaked); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnbondConvertAndStakeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnbondConvertAndStakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalAmtStaked = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUnbondConvertAndStakeResponse { + const message = createBaseMsgUnbondConvertAndStakeResponse(); + message.totalAmtStaked = object.totalAmtStaked ?? ''; + return message; + }, + fromAmino( + object: MsgUnbondConvertAndStakeResponseAmino + ): MsgUnbondConvertAndStakeResponse { + const message = createBaseMsgUnbondConvertAndStakeResponse(); + if ( + object.total_amt_staked !== undefined && + object.total_amt_staked !== null + ) { + message.totalAmtStaked = object.total_amt_staked; + } + return message; + }, + toAmino( + message: MsgUnbondConvertAndStakeResponse + ): MsgUnbondConvertAndStakeResponseAmino { + const obj: any = {}; + obj.total_amt_staked = + message.totalAmtStaked === '' ? undefined : message.totalAmtStaked; + return obj; + }, + fromAminoMsg( + object: MsgUnbondConvertAndStakeResponseAminoMsg + ): MsgUnbondConvertAndStakeResponse { + return MsgUnbondConvertAndStakeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUnbondConvertAndStakeResponse + ): MsgUnbondConvertAndStakeResponseAminoMsg { + return { + type: 'osmosis/unbond-convert-and-stake-response', + value: MsgUnbondConvertAndStakeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUnbondConvertAndStakeResponseProtoMsg + ): MsgUnbondConvertAndStakeResponse { + return MsgUnbondConvertAndStakeResponse.decode(message.value); + }, + toProto(message: MsgUnbondConvertAndStakeResponse): Uint8Array { + return MsgUnbondConvertAndStakeResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgUnbondConvertAndStakeResponse + ): MsgUnbondConvertAndStakeResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStakeResponse', + value: MsgUnbondConvertAndStakeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUnbondConvertAndStakeResponse.typeUrl, + MsgUnbondConvertAndStakeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnbondConvertAndStakeResponse.aminoType, + MsgUnbondConvertAndStakeResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/superfluid/v1beta1/gov.ts b/packages/cosmos/src/proto_export/osmosis/superfluid/v1beta1/gov.ts new file mode 100644 index 00000000..21cb29ba --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/superfluid/v1beta1/gov.ts @@ -0,0 +1,627 @@ +//@ts-nocheck +import { + SuperfluidAsset, + SuperfluidAssetAmino, + SuperfluidAssetSDKType, +} from '../superfluid'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * SetSuperfluidAssetsProposal is a gov Content type to update the superfluid + * assets + */ +export interface SetSuperfluidAssetsProposal { + $typeUrl?: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal'; + title: string; + description: string; + assets: SuperfluidAsset[]; +} +export interface SetSuperfluidAssetsProposalProtoMsg { + typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal'; + value: Uint8Array; +} +/** + * SetSuperfluidAssetsProposal is a gov Content type to update the superfluid + * assets + */ +export interface SetSuperfluidAssetsProposalAmino { + title?: string; + description?: string; + assets?: SuperfluidAssetAmino[]; +} +export interface SetSuperfluidAssetsProposalAminoMsg { + type: 'osmosis/set-superfluid-assets-proposal'; + value: SetSuperfluidAssetsProposalAmino; +} +/** + * SetSuperfluidAssetsProposal is a gov Content type to update the superfluid + * assets + */ +export interface SetSuperfluidAssetsProposalSDKType { + $typeUrl?: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal'; + title: string; + description: string; + assets: SuperfluidAssetSDKType[]; +} +/** + * RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid + * assets by denom + */ +export interface RemoveSuperfluidAssetsProposal { + $typeUrl?: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal'; + title: string; + description: string; + superfluidAssetDenoms: string[]; +} +export interface RemoveSuperfluidAssetsProposalProtoMsg { + typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal'; + value: Uint8Array; +} +/** + * RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid + * assets by denom + */ +export interface RemoveSuperfluidAssetsProposalAmino { + title?: string; + description?: string; + superfluid_asset_denoms?: string[]; +} +export interface RemoveSuperfluidAssetsProposalAminoMsg { + type: 'osmosis/del-superfluid-assets-proposal'; + value: RemoveSuperfluidAssetsProposalAmino; +} +/** + * RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid + * assets by denom + */ +export interface RemoveSuperfluidAssetsProposalSDKType { + $typeUrl?: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal'; + title: string; + description: string; + superfluid_asset_denoms: string[]; +} +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposal { + $typeUrl?: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal'; + title: string; + description: string; + ids: bigint[]; + isOverwrite: boolean; +} +export interface UpdateUnpoolWhiteListProposalProtoMsg { + typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal'; + value: Uint8Array; +} +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposalAmino { + title?: string; + description?: string; + ids?: string[]; + is_overwrite?: boolean; +} +export interface UpdateUnpoolWhiteListProposalAminoMsg { + type: 'osmosis/update-unpool-whitelist'; + value: UpdateUnpoolWhiteListProposalAmino; +} +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposalSDKType { + $typeUrl?: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal'; + title: string; + description: string; + ids: bigint[]; + is_overwrite: boolean; +} +function createBaseSetSuperfluidAssetsProposal(): SetSuperfluidAssetsProposal { + return { + $typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal', + title: '', + description: '', + assets: [], + }; +} +export const SetSuperfluidAssetsProposal = { + typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal', + aminoType: 'osmosis/set-superfluid-assets-proposal', + is(o: any): o is SetSuperfluidAssetsProposal { + return ( + o && + (o.$typeUrl === SetSuperfluidAssetsProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.assets) && + (!o.assets.length || SuperfluidAsset.is(o.assets[0])))) + ); + }, + isSDK(o: any): o is SetSuperfluidAssetsProposalSDKType { + return ( + o && + (o.$typeUrl === SetSuperfluidAssetsProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.assets) && + (!o.assets.length || SuperfluidAsset.isSDK(o.assets[0])))) + ); + }, + isAmino(o: any): o is SetSuperfluidAssetsProposalAmino { + return ( + o && + (o.$typeUrl === SetSuperfluidAssetsProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.assets) && + (!o.assets.length || SuperfluidAsset.isAmino(o.assets[0])))) + ); + }, + encode( + message: SetSuperfluidAssetsProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + for (const v of message.assets) { + SuperfluidAsset.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SetSuperfluidAssetsProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetSuperfluidAssetsProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.assets.push(SuperfluidAsset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): SetSuperfluidAssetsProposal { + const message = createBaseSetSuperfluidAssetsProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.assets = + object.assets?.map((e) => SuperfluidAsset.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: SetSuperfluidAssetsProposalAmino + ): SetSuperfluidAssetsProposal { + const message = createBaseSetSuperfluidAssetsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.assets = + object.assets?.map((e) => SuperfluidAsset.fromAmino(e)) || []; + return message; + }, + toAmino( + message: SetSuperfluidAssetsProposal + ): SetSuperfluidAssetsProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + if (message.assets) { + obj.assets = message.assets.map((e) => + e ? SuperfluidAsset.toAmino(e) : undefined + ); + } else { + obj.assets = message.assets; + } + return obj; + }, + fromAminoMsg( + object: SetSuperfluidAssetsProposalAminoMsg + ): SetSuperfluidAssetsProposal { + return SetSuperfluidAssetsProposal.fromAmino(object.value); + }, + toAminoMsg( + message: SetSuperfluidAssetsProposal + ): SetSuperfluidAssetsProposalAminoMsg { + return { + type: 'osmosis/set-superfluid-assets-proposal', + value: SetSuperfluidAssetsProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: SetSuperfluidAssetsProposalProtoMsg + ): SetSuperfluidAssetsProposal { + return SetSuperfluidAssetsProposal.decode(message.value); + }, + toProto(message: SetSuperfluidAssetsProposal): Uint8Array { + return SetSuperfluidAssetsProposal.encode(message).finish(); + }, + toProtoMsg( + message: SetSuperfluidAssetsProposal + ): SetSuperfluidAssetsProposalProtoMsg { + return { + typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal', + value: SetSuperfluidAssetsProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + SetSuperfluidAssetsProposal.typeUrl, + SetSuperfluidAssetsProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + SetSuperfluidAssetsProposal.aminoType, + SetSuperfluidAssetsProposal.typeUrl +); +function createBaseRemoveSuperfluidAssetsProposal(): RemoveSuperfluidAssetsProposal { + return { + $typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal', + title: '', + description: '', + superfluidAssetDenoms: [], + }; +} +export const RemoveSuperfluidAssetsProposal = { + typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal', + aminoType: 'osmosis/del-superfluid-assets-proposal', + is(o: any): o is RemoveSuperfluidAssetsProposal { + return ( + o && + (o.$typeUrl === RemoveSuperfluidAssetsProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.superfluidAssetDenoms) && + (!o.superfluidAssetDenoms.length || + typeof o.superfluidAssetDenoms[0] === 'string'))) + ); + }, + isSDK(o: any): o is RemoveSuperfluidAssetsProposalSDKType { + return ( + o && + (o.$typeUrl === RemoveSuperfluidAssetsProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.superfluid_asset_denoms) && + (!o.superfluid_asset_denoms.length || + typeof o.superfluid_asset_denoms[0] === 'string'))) + ); + }, + isAmino(o: any): o is RemoveSuperfluidAssetsProposalAmino { + return ( + o && + (o.$typeUrl === RemoveSuperfluidAssetsProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.superfluid_asset_denoms) && + (!o.superfluid_asset_denoms.length || + typeof o.superfluid_asset_denoms[0] === 'string'))) + ); + }, + encode( + message: RemoveSuperfluidAssetsProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + for (const v of message.superfluidAssetDenoms) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RemoveSuperfluidAssetsProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRemoveSuperfluidAssetsProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.superfluidAssetDenoms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): RemoveSuperfluidAssetsProposal { + const message = createBaseRemoveSuperfluidAssetsProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.superfluidAssetDenoms = + object.superfluidAssetDenoms?.map((e) => e) || []; + return message; + }, + fromAmino( + object: RemoveSuperfluidAssetsProposalAmino + ): RemoveSuperfluidAssetsProposal { + const message = createBaseRemoveSuperfluidAssetsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.superfluidAssetDenoms = + object.superfluid_asset_denoms?.map((e) => e) || []; + return message; + }, + toAmino( + message: RemoveSuperfluidAssetsProposal + ): RemoveSuperfluidAssetsProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + if (message.superfluidAssetDenoms) { + obj.superfluid_asset_denoms = message.superfluidAssetDenoms.map((e) => e); + } else { + obj.superfluid_asset_denoms = message.superfluidAssetDenoms; + } + return obj; + }, + fromAminoMsg( + object: RemoveSuperfluidAssetsProposalAminoMsg + ): RemoveSuperfluidAssetsProposal { + return RemoveSuperfluidAssetsProposal.fromAmino(object.value); + }, + toAminoMsg( + message: RemoveSuperfluidAssetsProposal + ): RemoveSuperfluidAssetsProposalAminoMsg { + return { + type: 'osmosis/del-superfluid-assets-proposal', + value: RemoveSuperfluidAssetsProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: RemoveSuperfluidAssetsProposalProtoMsg + ): RemoveSuperfluidAssetsProposal { + return RemoveSuperfluidAssetsProposal.decode(message.value); + }, + toProto(message: RemoveSuperfluidAssetsProposal): Uint8Array { + return RemoveSuperfluidAssetsProposal.encode(message).finish(); + }, + toProtoMsg( + message: RemoveSuperfluidAssetsProposal + ): RemoveSuperfluidAssetsProposalProtoMsg { + return { + typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal', + value: RemoveSuperfluidAssetsProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + RemoveSuperfluidAssetsProposal.typeUrl, + RemoveSuperfluidAssetsProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + RemoveSuperfluidAssetsProposal.aminoType, + RemoveSuperfluidAssetsProposal.typeUrl +); +function createBaseUpdateUnpoolWhiteListProposal(): UpdateUnpoolWhiteListProposal { + return { + $typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal', + title: '', + description: '', + ids: [], + isOverwrite: false, + }; +} +export const UpdateUnpoolWhiteListProposal = { + typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal', + aminoType: 'osmosis/update-unpool-whitelist', + is(o: any): o is UpdateUnpoolWhiteListProposal { + return ( + o && + (o.$typeUrl === UpdateUnpoolWhiteListProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.ids) && + (!o.ids.length || typeof o.ids[0] === 'bigint') && + typeof o.isOverwrite === 'boolean')) + ); + }, + isSDK(o: any): o is UpdateUnpoolWhiteListProposalSDKType { + return ( + o && + (o.$typeUrl === UpdateUnpoolWhiteListProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.ids) && + (!o.ids.length || typeof o.ids[0] === 'bigint') && + typeof o.is_overwrite === 'boolean')) + ); + }, + isAmino(o: any): o is UpdateUnpoolWhiteListProposalAmino { + return ( + o && + (o.$typeUrl === UpdateUnpoolWhiteListProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.ids) && + (!o.ids.length || typeof o.ids[0] === 'bigint') && + typeof o.is_overwrite === 'boolean')) + ); + }, + encode( + message: UpdateUnpoolWhiteListProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.ids) { + writer.uint64(v); + } + writer.ldelim(); + if (message.isOverwrite === true) { + writer.uint32(32).bool(message.isOverwrite); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdateUnpoolWhiteListProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUnpoolWhiteListProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.ids.push(reader.uint64()); + } + } else { + message.ids.push(reader.uint64()); + } + break; + case 4: + message.isOverwrite = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): UpdateUnpoolWhiteListProposal { + const message = createBaseUpdateUnpoolWhiteListProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.ids = object.ids?.map((e) => BigInt(e.toString())) || []; + message.isOverwrite = object.isOverwrite ?? false; + return message; + }, + fromAmino( + object: UpdateUnpoolWhiteListProposalAmino + ): UpdateUnpoolWhiteListProposal { + const message = createBaseUpdateUnpoolWhiteListProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.ids = object.ids?.map((e) => BigInt(e)) || []; + if (object.is_overwrite !== undefined && object.is_overwrite !== null) { + message.isOverwrite = object.is_overwrite; + } + return message; + }, + toAmino( + message: UpdateUnpoolWhiteListProposal + ): UpdateUnpoolWhiteListProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + if (message.ids) { + obj.ids = message.ids.map((e) => e.toString()); + } else { + obj.ids = message.ids; + } + obj.is_overwrite = + message.isOverwrite === false ? undefined : message.isOverwrite; + return obj; + }, + fromAminoMsg( + object: UpdateUnpoolWhiteListProposalAminoMsg + ): UpdateUnpoolWhiteListProposal { + return UpdateUnpoolWhiteListProposal.fromAmino(object.value); + }, + toAminoMsg( + message: UpdateUnpoolWhiteListProposal + ): UpdateUnpoolWhiteListProposalAminoMsg { + return { + type: 'osmosis/update-unpool-whitelist', + value: UpdateUnpoolWhiteListProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: UpdateUnpoolWhiteListProposalProtoMsg + ): UpdateUnpoolWhiteListProposal { + return UpdateUnpoolWhiteListProposal.decode(message.value); + }, + toProto(message: UpdateUnpoolWhiteListProposal): Uint8Array { + return UpdateUnpoolWhiteListProposal.encode(message).finish(); + }, + toProtoMsg( + message: UpdateUnpoolWhiteListProposal + ): UpdateUnpoolWhiteListProposalProtoMsg { + return { + typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal', + value: UpdateUnpoolWhiteListProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + UpdateUnpoolWhiteListProposal.typeUrl, + UpdateUnpoolWhiteListProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + UpdateUnpoolWhiteListProposal.aminoType, + UpdateUnpoolWhiteListProposal.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/authorityMetadata.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/authorityMetadata.ts new file mode 100644 index 00000000..eead3b3d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/authorityMetadata.ts @@ -0,0 +1,145 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadata { + /** Can be empty for no admin, or a valid osmosis address */ + admin: string; +} +export interface DenomAuthorityMetadataProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata'; + value: Uint8Array; +} +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadataAmino { + /** Can be empty for no admin, or a valid osmosis address */ + admin?: string; +} +export interface DenomAuthorityMetadataAminoMsg { + type: 'osmosis/tokenfactory/denom-authority-metadata'; + value: DenomAuthorityMetadataAmino; +} +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadataSDKType { + admin: string; +} +function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { + return { + admin: '', + }; +} +export const DenomAuthorityMetadata = { + typeUrl: '/osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata', + aminoType: 'osmosis/tokenfactory/denom-authority-metadata', + is(o: any): o is DenomAuthorityMetadata { + return ( + o && + (o.$typeUrl === DenomAuthorityMetadata.typeUrl || + typeof o.admin === 'string') + ); + }, + isSDK(o: any): o is DenomAuthorityMetadataSDKType { + return ( + o && + (o.$typeUrl === DenomAuthorityMetadata.typeUrl || + typeof o.admin === 'string') + ); + }, + isAmino(o: any): o is DenomAuthorityMetadataAmino { + return ( + o && + (o.$typeUrl === DenomAuthorityMetadata.typeUrl || + typeof o.admin === 'string') + ); + }, + encode( + message: DenomAuthorityMetadata, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.admin !== '') { + writer.uint32(10).string(message.admin); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): DenomAuthorityMetadata { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomAuthorityMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + message.admin = object.admin ?? ''; + return message; + }, + fromAmino(object: DenomAuthorityMetadataAmino): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: DenomAuthorityMetadata): DenomAuthorityMetadataAmino { + const obj: any = {}; + obj.admin = message.admin === '' ? undefined : message.admin; + return obj; + }, + fromAminoMsg(object: DenomAuthorityMetadataAminoMsg): DenomAuthorityMetadata { + return DenomAuthorityMetadata.fromAmino(object.value); + }, + toAminoMsg(message: DenomAuthorityMetadata): DenomAuthorityMetadataAminoMsg { + return { + type: 'osmosis/tokenfactory/denom-authority-metadata', + value: DenomAuthorityMetadata.toAmino(message), + }; + }, + fromProtoMsg( + message: DenomAuthorityMetadataProtoMsg + ): DenomAuthorityMetadata { + return DenomAuthorityMetadata.decode(message.value); + }, + toProto(message: DenomAuthorityMetadata): Uint8Array { + return DenomAuthorityMetadata.encode(message).finish(); + }, + toProtoMsg(message: DenomAuthorityMetadata): DenomAuthorityMetadataProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata', + value: DenomAuthorityMetadata.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + DenomAuthorityMetadata.typeUrl, + DenomAuthorityMetadata +); +GlobalDecoderRegistry.registerAminoProtoMapping( + DenomAuthorityMetadata.aminoType, + DenomAuthorityMetadata.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/genesis.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/genesis.ts new file mode 100644 index 00000000..93b0f176 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/genesis.ts @@ -0,0 +1,333 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { Params, ParamsAmino, ParamsSDKType } from './params'; +import { + DenomAuthorityMetadata, + DenomAuthorityMetadataAmino, + DenomAuthorityMetadataSDKType, +} from './authorityMetadata'; +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisState { + /** params defines the parameters of the module. */ + params: Params; + factoryDenoms: GenesisDenom[]; +} +export interface GenesisStateProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.GenesisState'; + value: Uint8Array; +} +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisStateAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; + factory_denoms?: GenesisDenomAmino[]; +} +export interface GenesisStateAminoMsg { + type: 'osmosis/tokenfactory/genesis-state'; + value: GenesisStateAmino; +} +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + factory_denoms: GenesisDenomSDKType[]; +} +/** + * GenesisDenom defines a tokenfactory denom that is defined within genesis + * state. The structure contains DenomAuthorityMetadata which defines the + * denom's admin. + */ +export interface GenesisDenom { + denom: string; + authorityMetadata: DenomAuthorityMetadata; +} +export interface GenesisDenomProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.GenesisDenom'; + value: Uint8Array; +} +/** + * GenesisDenom defines a tokenfactory denom that is defined within genesis + * state. The structure contains DenomAuthorityMetadata which defines the + * denom's admin. + */ +export interface GenesisDenomAmino { + denom?: string; + authority_metadata?: DenomAuthorityMetadataAmino; +} +export interface GenesisDenomAminoMsg { + type: 'osmosis/tokenfactory/genesis-denom'; + value: GenesisDenomAmino; +} +/** + * GenesisDenom defines a tokenfactory denom that is defined within genesis + * state. The structure contains DenomAuthorityMetadata which defines the + * denom's admin. + */ +export interface GenesisDenomSDKType { + denom: string; + authority_metadata: DenomAuthorityMetadataSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + factoryDenoms: [], + }; +} +export const GenesisState = { + typeUrl: '/osmosis.tokenfactory.v1beta1.GenesisState', + aminoType: 'osmosis/tokenfactory/genesis-state', + is(o: any): o is GenesisState { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.is(o.params) && + Array.isArray(o.factoryDenoms) && + (!o.factoryDenoms.length || GenesisDenom.is(o.factoryDenoms[0])))) + ); + }, + isSDK(o: any): o is GenesisStateSDKType { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.isSDK(o.params) && + Array.isArray(o.factory_denoms) && + (!o.factory_denoms.length || + GenesisDenom.isSDK(o.factory_denoms[0])))) + ); + }, + isAmino(o: any): o is GenesisStateAmino { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (Params.isAmino(o.params) && + Array.isArray(o.factory_denoms) && + (!o.factory_denoms.length || + GenesisDenom.isAmino(o.factory_denoms[0])))) + ); + }, + encode( + message: GenesisState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.factoryDenoms) { + GenesisDenom.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.factoryDenoms.push( + GenesisDenom.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + message.factoryDenoms = + object.factoryDenoms?.map((e) => GenesisDenom.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.factoryDenoms = + object.factory_denoms?.map((e) => GenesisDenom.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.factoryDenoms) { + obj.factory_denoms = message.factoryDenoms.map((e) => + e ? GenesisDenom.toAmino(e) : undefined + ); + } else { + obj.factory_denoms = message.factoryDenoms; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/tokenfactory/genesis-state', + value: GenesisState.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.GenesisState', + value: GenesisState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisState.aminoType, + GenesisState.typeUrl +); +function createBaseGenesisDenom(): GenesisDenom { + return { + denom: '', + authorityMetadata: DenomAuthorityMetadata.fromPartial({}), + }; +} +export const GenesisDenom = { + typeUrl: '/osmosis.tokenfactory.v1beta1.GenesisDenom', + aminoType: 'osmosis/tokenfactory/genesis-denom', + is(o: any): o is GenesisDenom { + return ( + o && + (o.$typeUrl === GenesisDenom.typeUrl || + (typeof o.denom === 'string' && + DenomAuthorityMetadata.is(o.authorityMetadata))) + ); + }, + isSDK(o: any): o is GenesisDenomSDKType { + return ( + o && + (o.$typeUrl === GenesisDenom.typeUrl || + (typeof o.denom === 'string' && + DenomAuthorityMetadata.isSDK(o.authority_metadata))) + ); + }, + isAmino(o: any): o is GenesisDenomAmino { + return ( + o && + (o.$typeUrl === GenesisDenom.typeUrl || + (typeof o.denom === 'string' && + DenomAuthorityMetadata.isAmino(o.authority_metadata))) + ); + }, + encode( + message: GenesisDenom, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode( + message.authorityMetadata, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisDenom { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.authorityMetadata = DenomAuthorityMetadata.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisDenom { + const message = createBaseGenesisDenom(); + message.denom = object.denom ?? ''; + message.authorityMetadata = + object.authorityMetadata !== undefined && + object.authorityMetadata !== null + ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) + : undefined; + return message; + }, + fromAmino(object: GenesisDenomAmino): GenesisDenom { + const message = createBaseGenesisDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if ( + object.authority_metadata !== undefined && + object.authority_metadata !== null + ) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino( + object.authority_metadata + ); + } + return message; + }, + toAmino(message: GenesisDenom): GenesisDenomAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.authority_metadata = message.authorityMetadata + ? DenomAuthorityMetadata.toAmino(message.authorityMetadata) + : undefined; + return obj; + }, + fromAminoMsg(object: GenesisDenomAminoMsg): GenesisDenom { + return GenesisDenom.fromAmino(object.value); + }, + toAminoMsg(message: GenesisDenom): GenesisDenomAminoMsg { + return { + type: 'osmosis/tokenfactory/genesis-denom', + value: GenesisDenom.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisDenomProtoMsg): GenesisDenom { + return GenesisDenom.decode(message.value); + }, + toProto(message: GenesisDenom): Uint8Array { + return GenesisDenom.encode(message).finish(); + }, + toProtoMsg(message: GenesisDenom): GenesisDenomProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.GenesisDenom', + value: GenesisDenom.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisDenom.typeUrl, GenesisDenom); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisDenom.aminoType, + GenesisDenom.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/params.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/params.ts new file mode 100644 index 00000000..90d06f12 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/params.ts @@ -0,0 +1,188 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** Params defines the parameters for the tokenfactory module. */ +export interface Params { + /** + * DenomCreationFee defines the fee to be charged on the creation of a new + * denom. The fee is drawn from the MsgCreateDenom's sender account, and + * transferred to the community pool. + */ + denomCreationFee: Coin[]; + /** + * DenomCreationGasConsume defines the gas cost for creating a new denom. + * This is intended as a spam deterrence mechanism. + * + * See: https://github.com/CosmWasm/token-factory/issues/11 + */ + denomCreationGasConsume?: bigint; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.Params'; + value: Uint8Array; +} +/** Params defines the parameters for the tokenfactory module. */ +export interface ParamsAmino { + /** + * DenomCreationFee defines the fee to be charged on the creation of a new + * denom. The fee is drawn from the MsgCreateDenom's sender account, and + * transferred to the community pool. + */ + denom_creation_fee?: CoinAmino[]; + /** + * DenomCreationGasConsume defines the gas cost for creating a new denom. + * This is intended as a spam deterrence mechanism. + * + * See: https://github.com/CosmWasm/token-factory/issues/11 + */ + denom_creation_gas_consume?: string; +} +export interface ParamsAminoMsg { + type: 'osmosis/tokenfactory/params'; + value: ParamsAmino; +} +/** Params defines the parameters for the tokenfactory module. */ +export interface ParamsSDKType { + denom_creation_fee: CoinSDKType[]; + denom_creation_gas_consume?: bigint; +} +function createBaseParams(): Params { + return { + denomCreationFee: [], + denomCreationGasConsume: undefined, + }; +} +export const Params = { + typeUrl: '/osmosis.tokenfactory.v1beta1.Params', + aminoType: 'osmosis/tokenfactory/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.denomCreationFee) && + (!o.denomCreationFee.length || Coin.is(o.denomCreationFee[0])))) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.denom_creation_fee) && + (!o.denom_creation_fee.length || + Coin.isSDK(o.denom_creation_fee[0])))) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.denom_creation_fee) && + (!o.denom_creation_fee.length || + Coin.isAmino(o.denom_creation_fee[0])))) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.denomCreationFee) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.denomCreationGasConsume !== undefined) { + writer.uint32(16).uint64(message.denomCreationGasConsume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.denomCreationGasConsume = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.denomCreationFee = + object.denomCreationFee?.map((e) => Coin.fromPartial(e)) || []; + message.denomCreationGasConsume = + object.denomCreationGasConsume !== undefined && + object.denomCreationGasConsume !== null + ? BigInt(object.denomCreationGasConsume.toString()) + : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.denomCreationFee = + object.denom_creation_fee?.map((e) => Coin.fromAmino(e)) || []; + if ( + object.denom_creation_gas_consume !== undefined && + object.denom_creation_gas_consume !== null + ) { + message.denomCreationGasConsume = BigInt( + object.denom_creation_gas_consume + ); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.denomCreationFee) { + obj.denom_creation_fee = message.denomCreationFee.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.denom_creation_fee = message.denomCreationFee; + } + obj.denom_creation_gas_consume = + message.denomCreationGasConsume !== BigInt(0) + ? message.denomCreationGasConsume.toString() + : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/tokenfactory/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.lcd.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.lcd.ts new file mode 100644 index 00000000..b9a04901 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.lcd.ts @@ -0,0 +1,76 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; + +import { + QueryParamsRequest, + QueryParamsResponseSDKType, + QueryDenomAuthorityMetadataRequest, + QueryDenomAuthorityMetadataResponseSDKType, + QueryDenomsFromCreatorRequest, + QueryDenomsFromCreatorResponseSDKType, + QueryBeforeSendHookAddressRequest, + QueryBeforeSendHookAddressResponseSDKType, + QueryAllBeforeSendHooksAddressesRequest, + QueryAllBeforeSendHooksAddressesResponseSDKType, +} from './query'; +export class LCDQueryClient { + req: LCDClient; + constructor({ requestClient }: { requestClient: LCDClient }) { + this.req = requestClient; + this.params = this.params.bind(this); + this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); + this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); + this.allBeforeSendHooksAddresses = + this.allBeforeSendHooksAddresses.bind(this); + } + /* Params defines a gRPC query method that returns the tokenfactory module's + parameters. */ + async params( + _params: QueryParamsRequest = {} + ): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/params`; + return await this.req.get(endpoint); + } + /* DenomAuthorityMetadata defines a gRPC query method for fetching + DenomAuthorityMetadata for a particular denom. */ + async denomAuthorityMetadata( + params: QueryDenomAuthorityMetadataRequest + ): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms/${params.denom}/authority_metadata`; + return await this.req.get( + endpoint + ); + } + /* DenomsFromCreator defines a gRPC query method for fetching all + denominations created by a specific admin/creator. */ + async denomsFromCreator( + params: QueryDenomsFromCreatorRequest + ): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms_from_creator/${params.creator}`; + return await this.req.get(endpoint); + } + /* BeforeSendHookAddress defines a gRPC query method for + getting the address registered for the before send hook. */ + async beforeSendHookAddress( + params: QueryBeforeSendHookAddressRequest + ): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms/${params.denom}/before_send_hook`; + return await this.req.get( + endpoint + ); + } + /* AllBeforeSendHooksAddresses defines a gRPC query method for + getting all addresses with before send hook registered. + The response returns two arrays, an array with a list of denom and an array + of before send hook addresses. The idx of denom corresponds to before send + hook addresse's idx. */ + async allBeforeSendHooksAddresses( + _params: QueryAllBeforeSendHooksAddressesRequest = {} + ): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/all_before_send_hooks`; + return await this.req.get( + endpoint + ); + } +} diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..997c6be4 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts @@ -0,0 +1,305 @@ +//@ts-nocheck +import { + QueryClient, + createProtobufRpcClient, + ProtobufRpcClient, +} from '@cosmjs/stargate'; +import { useQuery } from '@tanstack/react-query'; + +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; +import { ReactQueryParams } from '../../../react-query'; + +import { + QueryParamsRequest, + QueryParamsResponse, + QueryDenomAuthorityMetadataRequest, + QueryDenomAuthorityMetadataResponse, + QueryDenomsFromCreatorRequest, + QueryDenomsFromCreatorResponse, + QueryBeforeSendHookAddressRequest, + QueryBeforeSendHookAddressResponse, + QueryAllBeforeSendHooksAddressesRequest, + QueryAllBeforeSendHooksAddressesResponse, +} from './query'; +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params defines a gRPC query method that returns the tokenfactory module's + * parameters. + */ + params(request?: QueryParamsRequest): Promise; + /** + * DenomAuthorityMetadata defines a gRPC query method for fetching + * DenomAuthorityMetadata for a particular denom. + */ + denomAuthorityMetadata( + request: QueryDenomAuthorityMetadataRequest + ): Promise; + /** + * DenomsFromCreator defines a gRPC query method for fetching all + * denominations created by a specific admin/creator. + */ + denomsFromCreator( + request: QueryDenomsFromCreatorRequest + ): Promise; + /** + * BeforeSendHookAddress defines a gRPC query method for + * getting the address registered for the before send hook. + */ + beforeSendHookAddress( + request: QueryBeforeSendHookAddressRequest + ): Promise; + /** + * AllBeforeSendHooksAddresses defines a gRPC query method for + * getting all addresses with before send hook registered. + * The response returns two arrays, an array with a list of denom and an array + * of before send hook addresses. The idx of denom corresponds to before send + * hook addresse's idx. + */ + allBeforeSendHooksAddresses( + request?: QueryAllBeforeSendHooksAddressesRequest + ): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); + this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); + this.allBeforeSendHooksAddresses = + this.allBeforeSendHooksAddresses.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Query', + 'Params', + data + ); + return promise.then((data) => + QueryParamsResponse.decode(new BinaryReader(data)) + ); + } + denomAuthorityMetadata( + request: QueryDenomAuthorityMetadataRequest + ): Promise { + const data = QueryDenomAuthorityMetadataRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Query', + 'DenomAuthorityMetadata', + data + ); + return promise.then((data) => + QueryDenomAuthorityMetadataResponse.decode(new BinaryReader(data)) + ); + } + denomsFromCreator( + request: QueryDenomsFromCreatorRequest + ): Promise { + const data = QueryDenomsFromCreatorRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Query', + 'DenomsFromCreator', + data + ); + return promise.then((data) => + QueryDenomsFromCreatorResponse.decode(new BinaryReader(data)) + ); + } + beforeSendHookAddress( + request: QueryBeforeSendHookAddressRequest + ): Promise { + const data = QueryBeforeSendHookAddressRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Query', + 'BeforeSendHookAddress', + data + ); + return promise.then((data) => + QueryBeforeSendHookAddressResponse.decode(new BinaryReader(data)) + ); + } + allBeforeSendHooksAddresses( + request: QueryAllBeforeSendHooksAddressesRequest = {} + ): Promise { + const data = + QueryAllBeforeSendHooksAddressesRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Query', + 'AllBeforeSendHooksAddresses', + data + ); + return promise.then((data) => + QueryAllBeforeSendHooksAddressesResponse.decode(new BinaryReader(data)) + ); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + denomAuthorityMetadata( + request: QueryDenomAuthorityMetadataRequest + ): Promise { + return queryService.denomAuthorityMetadata(request); + }, + denomsFromCreator( + request: QueryDenomsFromCreatorRequest + ): Promise { + return queryService.denomsFromCreator(request); + }, + beforeSendHookAddress( + request: QueryBeforeSendHookAddressRequest + ): Promise { + return queryService.beforeSendHookAddress(request); + }, + allBeforeSendHooksAddresses( + request?: QueryAllBeforeSendHooksAddressesRequest + ): Promise { + return queryService.allBeforeSendHooksAddresses(request); + }, + }; +}; +export interface UseParamsQuery + extends ReactQueryParams { + request?: QueryParamsRequest; +} +export interface UseDenomAuthorityMetadataQuery + extends ReactQueryParams { + request: QueryDenomAuthorityMetadataRequest; +} +export interface UseDenomsFromCreatorQuery + extends ReactQueryParams { + request: QueryDenomsFromCreatorRequest; +} +export interface UseBeforeSendHookAddressQuery + extends ReactQueryParams { + request: QueryBeforeSendHookAddressRequest; +} +export interface UseAllBeforeSendHooksAddressesQuery + extends ReactQueryParams { + request?: QueryAllBeforeSendHooksAddressesRequest; +} +const _queryClients: WeakMap = + new WeakMap(); +const getQueryService = ( + rpc: ProtobufRpcClient | undefined +): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useParams = ({ + request, + options, + }: UseParamsQuery) => { + return useQuery( + ['paramsQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.params(request); + }, + options + ); + }; + const useDenomAuthorityMetadata = < + TData = QueryDenomAuthorityMetadataResponse + >({ + request, + options, + }: UseDenomAuthorityMetadataQuery) => { + return useQuery( + ['denomAuthorityMetadataQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.denomAuthorityMetadata(request); + }, + options + ); + }; + const useDenomsFromCreator = ({ + request, + options, + }: UseDenomsFromCreatorQuery) => { + return useQuery( + ['denomsFromCreatorQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.denomsFromCreator(request); + }, + options + ); + }; + const useBeforeSendHookAddress = < + TData = QueryBeforeSendHookAddressResponse + >({ + request, + options, + }: UseBeforeSendHookAddressQuery) => { + return useQuery( + ['beforeSendHookAddressQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.beforeSendHookAddress(request); + }, + options + ); + }; + const useAllBeforeSendHooksAddresses = < + TData = QueryAllBeforeSendHooksAddressesResponse + >({ + request, + options, + }: UseAllBeforeSendHooksAddressesQuery) => { + return useQuery( + ['allBeforeSendHooksAddressesQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.allBeforeSendHooksAddresses(request); + }, + options + ); + }; + return { + /** + * Params defines a gRPC query method that returns the tokenfactory module's + * parameters. + */ + useParams, + /** + * DenomAuthorityMetadata defines a gRPC query method for fetching + * DenomAuthorityMetadata for a particular denom. + */ + useDenomAuthorityMetadata, + /** + * DenomsFromCreator defines a gRPC query method for fetching all + * denominations created by a specific admin/creator. + */ + useDenomsFromCreator, + /** + * BeforeSendHookAddress defines a gRPC query method for + * getting the address registered for the before send hook. + */ + useBeforeSendHookAddress, + /** + * AllBeforeSendHooksAddresses defines a gRPC query method for + * getting all addresses with before send hook registered. + * The response returns two arrays, an array with a list of denom and an array + * of before send hook addresses. The idx of denom corresponds to before send + * hook addresse's idx. + */ + useAllBeforeSendHooksAddresses, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.ts new file mode 100644 index 00000000..4185dc10 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/query.ts @@ -0,0 +1,1437 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { Params, ParamsAmino, ParamsSDKType } from './params'; +import { + DenomAuthorityMetadata, + DenomAuthorityMetadataAmino, + DenomAuthorityMetadataSDKType, +} from './authorityMetadata'; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryParamsRequest'; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: 'osmosis/tokenfactory/query-params-request'; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryParamsResponse'; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: 'osmosis/tokenfactory/query-params-response'; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequest { + denom: string; +} +export interface QueryDenomAuthorityMetadataRequestProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest'; + value: Uint8Array; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequestAmino { + denom?: string; +} +export interface QueryDenomAuthorityMetadataRequestAminoMsg { + type: 'osmosis/tokenfactory/query-denom-authority-metadata-request'; + value: QueryDenomAuthorityMetadataRequestAmino; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequestSDKType { + denom: string; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponse { + authorityMetadata: DenomAuthorityMetadata; +} +export interface QueryDenomAuthorityMetadataResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse'; + value: Uint8Array; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponseAmino { + authority_metadata?: DenomAuthorityMetadataAmino; +} +export interface QueryDenomAuthorityMetadataResponseAminoMsg { + type: 'osmosis/tokenfactory/query-denom-authority-metadata-response'; + value: QueryDenomAuthorityMetadataResponseAmino; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponseSDKType { + authority_metadata: DenomAuthorityMetadataSDKType; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequest { + creator: string; +} +export interface QueryDenomsFromCreatorRequestProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest'; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequestAmino { + creator?: string; +} +export interface QueryDenomsFromCreatorRequestAminoMsg { + type: 'osmosis/tokenfactory/query-denoms-from-creator-request'; + value: QueryDenomsFromCreatorRequestAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequestSDKType { + creator: string; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponse { + denoms: string[]; +} +export interface QueryDenomsFromCreatorResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse'; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponseAmino { + denoms?: string[]; +} +export interface QueryDenomsFromCreatorResponseAminoMsg { + type: 'osmosis/tokenfactory/query-denoms-from-creator-response'; + value: QueryDenomsFromCreatorResponseAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponseSDKType { + denoms: string[]; +} +export interface QueryBeforeSendHookAddressRequest { + denom: string; +} +export interface QueryBeforeSendHookAddressRequestProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest'; + value: Uint8Array; +} +export interface QueryBeforeSendHookAddressRequestAmino { + denom?: string; +} +export interface QueryBeforeSendHookAddressRequestAminoMsg { + type: 'osmosis/tokenfactory/query-before-send-hook-address-request'; + value: QueryBeforeSendHookAddressRequestAmino; +} +export interface QueryBeforeSendHookAddressRequestSDKType { + denom: string; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponse { + cosmwasmAddress: string; +} +export interface QueryBeforeSendHookAddressResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse'; + value: Uint8Array; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseAmino { + cosmwasm_address?: string; +} +export interface QueryBeforeSendHookAddressResponseAminoMsg { + type: 'osmosis/tokenfactory/query-before-send-hook-address-response'; + value: QueryBeforeSendHookAddressResponseAmino; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseSDKType { + cosmwasm_address: string; +} +export interface QueryAllBeforeSendHooksAddressesRequest {} +export interface QueryAllBeforeSendHooksAddressesRequestProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesRequest'; + value: Uint8Array; +} +export interface QueryAllBeforeSendHooksAddressesRequestAmino {} +export interface QueryAllBeforeSendHooksAddressesRequestAminoMsg { + type: 'osmosis/tokenfactory/query-all-before-send-hooks-addresses-request'; + value: QueryAllBeforeSendHooksAddressesRequestAmino; +} +export interface QueryAllBeforeSendHooksAddressesRequestSDKType {} +/** + * QueryAllBeforeSendHooksAddressesResponse defines the response structure for + * the AllBeforeSendHooksAddresses gRPC query. + */ +export interface QueryAllBeforeSendHooksAddressesResponse { + denoms: string[]; + beforeSendHookAddresses: string[]; +} +export interface QueryAllBeforeSendHooksAddressesResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesResponse'; + value: Uint8Array; +} +/** + * QueryAllBeforeSendHooksAddressesResponse defines the response structure for + * the AllBeforeSendHooksAddresses gRPC query. + */ +export interface QueryAllBeforeSendHooksAddressesResponseAmino { + denoms?: string[]; + before_send_hook_addresses?: string[]; +} +export interface QueryAllBeforeSendHooksAddressesResponseAminoMsg { + type: 'osmosis/tokenfactory/query-all-before-send-hooks-addresses-response'; + value: QueryAllBeforeSendHooksAddressesResponseAmino; +} +/** + * QueryAllBeforeSendHooksAddressesResponse defines the response structure for + * the AllBeforeSendHooksAddresses gRPC query. + */ +export interface QueryAllBeforeSendHooksAddressesResponseSDKType { + denoms: string[]; + before_send_hook_addresses: string[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryParamsRequest', + aminoType: 'osmosis/tokenfactory/query-params-request', + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + encode( + _: QueryParamsRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: 'osmosis/tokenfactory/query-params-request', + value: QueryParamsRequest.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryParamsRequest', + value: QueryParamsRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsRequest.aminoType, + QueryParamsRequest.typeUrl +); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}), + }; +} +export const QueryParamsResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryParamsResponse', + aminoType: 'osmosis/tokenfactory/query-params-response', + is(o: any): o is QueryParamsResponse { + return ( + o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)) + ); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)) + ); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return ( + o && + (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)) + ); + }, + encode( + message: QueryParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/query-params-response', + value: QueryParamsResponse.toAmino(message), + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryParamsResponse', + value: QueryParamsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryParamsResponse.typeUrl, + QueryParamsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryParamsResponse.aminoType, + QueryParamsResponse.typeUrl +); +function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { + return { + denom: '', + }; +} +export const QueryDenomAuthorityMetadataRequest = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest', + aminoType: 'osmosis/tokenfactory/query-denom-authority-metadata-request', + is(o: any): o is QueryDenomAuthorityMetadataRequest { + return ( + o && + (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isSDK(o: any): o is QueryDenomAuthorityMetadataRequestSDKType { + return ( + o && + (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataRequestAmino { + return ( + o && + (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + encode( + message: QueryDenomAuthorityMetadataRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomAuthorityMetadataRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + message.denom = object.denom ?? ''; + return message; + }, + fromAmino( + object: QueryDenomAuthorityMetadataRequestAmino + ): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino( + message: QueryDenomAuthorityMetadataRequest + ): QueryDenomAuthorityMetadataRequestAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + return obj; + }, + fromAminoMsg( + object: QueryDenomAuthorityMetadataRequestAminoMsg + ): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomAuthorityMetadataRequest + ): QueryDenomAuthorityMetadataRequestAminoMsg { + return { + type: 'osmosis/tokenfactory/query-denom-authority-metadata-request', + value: QueryDenomAuthorityMetadataRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomAuthorityMetadataRequestProtoMsg + ): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataRequest): Uint8Array { + return QueryDenomAuthorityMetadataRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomAuthorityMetadataRequest + ): QueryDenomAuthorityMetadataRequestProtoMsg { + return { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest', + value: QueryDenomAuthorityMetadataRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomAuthorityMetadataRequest.typeUrl, + QueryDenomAuthorityMetadataRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomAuthorityMetadataRequest.aminoType, + QueryDenomAuthorityMetadataRequest.typeUrl +); +function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: DenomAuthorityMetadata.fromPartial({}), + }; +} +export const QueryDenomAuthorityMetadataResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse', + aminoType: 'osmosis/tokenfactory/query-denom-authority-metadata-response', + is(o: any): o is QueryDenomAuthorityMetadataResponse { + return ( + o && + (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || + DenomAuthorityMetadata.is(o.authorityMetadata)) + ); + }, + isSDK(o: any): o is QueryDenomAuthorityMetadataResponseSDKType { + return ( + o && + (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || + DenomAuthorityMetadata.isSDK(o.authority_metadata)) + ); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataResponseAmino { + return ( + o && + (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || + DenomAuthorityMetadata.isAmino(o.authority_metadata)) + ); + }, + encode( + message: QueryDenomAuthorityMetadataResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode( + message.authorityMetadata, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomAuthorityMetadataResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorityMetadata = DenomAuthorityMetadata.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomAuthorityMetadataResponse { + const message = createBaseQueryDenomAuthorityMetadataResponse(); + message.authorityMetadata = + object.authorityMetadata !== undefined && + object.authorityMetadata !== null + ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) + : undefined; + return message; + }, + fromAmino( + object: QueryDenomAuthorityMetadataResponseAmino + ): QueryDenomAuthorityMetadataResponse { + const message = createBaseQueryDenomAuthorityMetadataResponse(); + if ( + object.authority_metadata !== undefined && + object.authority_metadata !== null + ) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino( + object.authority_metadata + ); + } + return message; + }, + toAmino( + message: QueryDenomAuthorityMetadataResponse + ): QueryDenomAuthorityMetadataResponseAmino { + const obj: any = {}; + obj.authority_metadata = message.authorityMetadata + ? DenomAuthorityMetadata.toAmino(message.authorityMetadata) + : undefined; + return obj; + }, + fromAminoMsg( + object: QueryDenomAuthorityMetadataResponseAminoMsg + ): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomAuthorityMetadataResponse + ): QueryDenomAuthorityMetadataResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/query-denom-authority-metadata-response', + value: QueryDenomAuthorityMetadataResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomAuthorityMetadataResponseProtoMsg + ): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataResponse): Uint8Array { + return QueryDenomAuthorityMetadataResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomAuthorityMetadataResponse + ): QueryDenomAuthorityMetadataResponseProtoMsg { + return { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse', + value: QueryDenomAuthorityMetadataResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomAuthorityMetadataResponse.typeUrl, + QueryDenomAuthorityMetadataResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomAuthorityMetadataResponse.aminoType, + QueryDenomAuthorityMetadataResponse.typeUrl +); +function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { + return { + creator: '', + }; +} +export const QueryDenomsFromCreatorRequest = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest', + aminoType: 'osmosis/tokenfactory/query-denoms-from-creator-request', + is(o: any): o is QueryDenomsFromCreatorRequest { + return ( + o && + (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || + typeof o.creator === 'string') + ); + }, + isSDK(o: any): o is QueryDenomsFromCreatorRequestSDKType { + return ( + o && + (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || + typeof o.creator === 'string') + ); + }, + isAmino(o: any): o is QueryDenomsFromCreatorRequestAmino { + return ( + o && + (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || + typeof o.creator === 'string') + ); + }, + encode( + message: QueryDenomsFromCreatorRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.creator !== '') { + writer.uint32(10).string(message.creator); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomsFromCreatorRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomsFromCreatorRequest { + const message = createBaseQueryDenomsFromCreatorRequest(); + message.creator = object.creator ?? ''; + return message; + }, + fromAmino( + object: QueryDenomsFromCreatorRequestAmino + ): QueryDenomsFromCreatorRequest { + const message = createBaseQueryDenomsFromCreatorRequest(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; + }, + toAmino( + message: QueryDenomsFromCreatorRequest + ): QueryDenomsFromCreatorRequestAmino { + const obj: any = {}; + obj.creator = message.creator === '' ? undefined : message.creator; + return obj; + }, + fromAminoMsg( + object: QueryDenomsFromCreatorRequestAminoMsg + ): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomsFromCreatorRequest + ): QueryDenomsFromCreatorRequestAminoMsg { + return { + type: 'osmosis/tokenfactory/query-denoms-from-creator-request', + value: QueryDenomsFromCreatorRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomsFromCreatorRequestProtoMsg + ): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorRequest): Uint8Array { + return QueryDenomsFromCreatorRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomsFromCreatorRequest + ): QueryDenomsFromCreatorRequestProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest', + value: QueryDenomsFromCreatorRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomsFromCreatorRequest.typeUrl, + QueryDenomsFromCreatorRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomsFromCreatorRequest.aminoType, + QueryDenomsFromCreatorRequest.typeUrl +); +function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { + return { + denoms: [], + }; +} +export const QueryDenomsFromCreatorResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse', + aminoType: 'osmosis/tokenfactory/query-denoms-from-creator-response', + is(o: any): o is QueryDenomsFromCreatorResponse { + return ( + o && + (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || + (Array.isArray(o.denoms) && + (!o.denoms.length || typeof o.denoms[0] === 'string'))) + ); + }, + isSDK(o: any): o is QueryDenomsFromCreatorResponseSDKType { + return ( + o && + (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || + (Array.isArray(o.denoms) && + (!o.denoms.length || typeof o.denoms[0] === 'string'))) + ); + }, + isAmino(o: any): o is QueryDenomsFromCreatorResponseAmino { + return ( + o && + (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || + (Array.isArray(o.denoms) && + (!o.denoms.length || typeof o.denoms[0] === 'string'))) + ); + }, + encode( + message: QueryDenomsFromCreatorResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomsFromCreatorResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomsFromCreatorResponse { + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map((e) => e) || []; + return message; + }, + fromAmino( + object: QueryDenomsFromCreatorResponseAmino + ): QueryDenomsFromCreatorResponse { + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map((e) => e) || []; + return message; + }, + toAmino( + message: QueryDenomsFromCreatorResponse + ): QueryDenomsFromCreatorResponseAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map((e) => e); + } else { + obj.denoms = message.denoms; + } + return obj; + }, + fromAminoMsg( + object: QueryDenomsFromCreatorResponseAminoMsg + ): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomsFromCreatorResponse + ): QueryDenomsFromCreatorResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/query-denoms-from-creator-response', + value: QueryDenomsFromCreatorResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomsFromCreatorResponseProtoMsg + ): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorResponse): Uint8Array { + return QueryDenomsFromCreatorResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomsFromCreatorResponse + ): QueryDenomsFromCreatorResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse', + value: QueryDenomsFromCreatorResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomsFromCreatorResponse.typeUrl, + QueryDenomsFromCreatorResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomsFromCreatorResponse.aminoType, + QueryDenomsFromCreatorResponse.typeUrl +); +function createBaseQueryBeforeSendHookAddressRequest(): QueryBeforeSendHookAddressRequest { + return { + denom: '', + }; +} +export const QueryBeforeSendHookAddressRequest = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest', + aminoType: 'osmosis/tokenfactory/query-before-send-hook-address-request', + is(o: any): o is QueryBeforeSendHookAddressRequest { + return ( + o && + (o.$typeUrl === QueryBeforeSendHookAddressRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isSDK(o: any): o is QueryBeforeSendHookAddressRequestSDKType { + return ( + o && + (o.$typeUrl === QueryBeforeSendHookAddressRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isAmino(o: any): o is QueryBeforeSendHookAddressRequestAmino { + return ( + o && + (o.$typeUrl === QueryBeforeSendHookAddressRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + encode( + message: QueryBeforeSendHookAddressRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryBeforeSendHookAddressRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryBeforeSendHookAddressRequest { + const message = createBaseQueryBeforeSendHookAddressRequest(); + message.denom = object.denom ?? ''; + return message; + }, + fromAmino( + object: QueryBeforeSendHookAddressRequestAmino + ): QueryBeforeSendHookAddressRequest { + const message = createBaseQueryBeforeSendHookAddressRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino( + message: QueryBeforeSendHookAddressRequest + ): QueryBeforeSendHookAddressRequestAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + return obj; + }, + fromAminoMsg( + object: QueryBeforeSendHookAddressRequestAminoMsg + ): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryBeforeSendHookAddressRequest + ): QueryBeforeSendHookAddressRequestAminoMsg { + return { + type: 'osmosis/tokenfactory/query-before-send-hook-address-request', + value: QueryBeforeSendHookAddressRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryBeforeSendHookAddressRequestProtoMsg + ): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressRequest): Uint8Array { + return QueryBeforeSendHookAddressRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryBeforeSendHookAddressRequest + ): QueryBeforeSendHookAddressRequestProtoMsg { + return { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest', + value: QueryBeforeSendHookAddressRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryBeforeSendHookAddressRequest.typeUrl, + QueryBeforeSendHookAddressRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryBeforeSendHookAddressRequest.aminoType, + QueryBeforeSendHookAddressRequest.typeUrl +); +function createBaseQueryBeforeSendHookAddressResponse(): QueryBeforeSendHookAddressResponse { + return { + cosmwasmAddress: '', + }; +} +export const QueryBeforeSendHookAddressResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse', + aminoType: 'osmosis/tokenfactory/query-before-send-hook-address-response', + is(o: any): o is QueryBeforeSendHookAddressResponse { + return ( + o && + (o.$typeUrl === QueryBeforeSendHookAddressResponse.typeUrl || + typeof o.cosmwasmAddress === 'string') + ); + }, + isSDK(o: any): o is QueryBeforeSendHookAddressResponseSDKType { + return ( + o && + (o.$typeUrl === QueryBeforeSendHookAddressResponse.typeUrl || + typeof o.cosmwasm_address === 'string') + ); + }, + isAmino(o: any): o is QueryBeforeSendHookAddressResponseAmino { + return ( + o && + (o.$typeUrl === QueryBeforeSendHookAddressResponse.typeUrl || + typeof o.cosmwasm_address === 'string') + ); + }, + encode( + message: QueryBeforeSendHookAddressResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.cosmwasmAddress !== '') { + writer.uint32(10).string(message.cosmwasmAddress); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryBeforeSendHookAddressResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryBeforeSendHookAddressResponse { + const message = createBaseQueryBeforeSendHookAddressResponse(); + message.cosmwasmAddress = object.cosmwasmAddress ?? ''; + return message; + }, + fromAmino( + object: QueryBeforeSendHookAddressResponseAmino + ): QueryBeforeSendHookAddressResponse { + const message = createBaseQueryBeforeSendHookAddressResponse(); + if ( + object.cosmwasm_address !== undefined && + object.cosmwasm_address !== null + ) { + message.cosmwasmAddress = object.cosmwasm_address; + } + return message; + }, + toAmino( + message: QueryBeforeSendHookAddressResponse + ): QueryBeforeSendHookAddressResponseAmino { + const obj: any = {}; + obj.cosmwasm_address = + message.cosmwasmAddress === '' ? undefined : message.cosmwasmAddress; + return obj; + }, + fromAminoMsg( + object: QueryBeforeSendHookAddressResponseAminoMsg + ): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryBeforeSendHookAddressResponse + ): QueryBeforeSendHookAddressResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/query-before-send-hook-address-response', + value: QueryBeforeSendHookAddressResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryBeforeSendHookAddressResponseProtoMsg + ): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressResponse): Uint8Array { + return QueryBeforeSendHookAddressResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryBeforeSendHookAddressResponse + ): QueryBeforeSendHookAddressResponseProtoMsg { + return { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse', + value: QueryBeforeSendHookAddressResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryBeforeSendHookAddressResponse.typeUrl, + QueryBeforeSendHookAddressResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryBeforeSendHookAddressResponse.aminoType, + QueryBeforeSendHookAddressResponse.typeUrl +); +function createBaseQueryAllBeforeSendHooksAddressesRequest(): QueryAllBeforeSendHooksAddressesRequest { + return {}; +} +export const QueryAllBeforeSendHooksAddressesRequest = { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesRequest', + aminoType: + 'osmosis/tokenfactory/query-all-before-send-hooks-addresses-request', + is(o: any): o is QueryAllBeforeSendHooksAddressesRequest { + return o && o.$typeUrl === QueryAllBeforeSendHooksAddressesRequest.typeUrl; + }, + isSDK(o: any): o is QueryAllBeforeSendHooksAddressesRequestSDKType { + return o && o.$typeUrl === QueryAllBeforeSendHooksAddressesRequest.typeUrl; + }, + isAmino(o: any): o is QueryAllBeforeSendHooksAddressesRequestAmino { + return o && o.$typeUrl === QueryAllBeforeSendHooksAddressesRequest.typeUrl; + }, + encode( + _: QueryAllBeforeSendHooksAddressesRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryAllBeforeSendHooksAddressesRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBeforeSendHooksAddressesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): QueryAllBeforeSendHooksAddressesRequest { + const message = createBaseQueryAllBeforeSendHooksAddressesRequest(); + return message; + }, + fromAmino( + _: QueryAllBeforeSendHooksAddressesRequestAmino + ): QueryAllBeforeSendHooksAddressesRequest { + const message = createBaseQueryAllBeforeSendHooksAddressesRequest(); + return message; + }, + toAmino( + _: QueryAllBeforeSendHooksAddressesRequest + ): QueryAllBeforeSendHooksAddressesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: QueryAllBeforeSendHooksAddressesRequestAminoMsg + ): QueryAllBeforeSendHooksAddressesRequest { + return QueryAllBeforeSendHooksAddressesRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryAllBeforeSendHooksAddressesRequest + ): QueryAllBeforeSendHooksAddressesRequestAminoMsg { + return { + type: 'osmosis/tokenfactory/query-all-before-send-hooks-addresses-request', + value: QueryAllBeforeSendHooksAddressesRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryAllBeforeSendHooksAddressesRequestProtoMsg + ): QueryAllBeforeSendHooksAddressesRequest { + return QueryAllBeforeSendHooksAddressesRequest.decode(message.value); + }, + toProto(message: QueryAllBeforeSendHooksAddressesRequest): Uint8Array { + return QueryAllBeforeSendHooksAddressesRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryAllBeforeSendHooksAddressesRequest + ): QueryAllBeforeSendHooksAddressesRequestProtoMsg { + return { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesRequest', + value: QueryAllBeforeSendHooksAddressesRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryAllBeforeSendHooksAddressesRequest.typeUrl, + QueryAllBeforeSendHooksAddressesRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryAllBeforeSendHooksAddressesRequest.aminoType, + QueryAllBeforeSendHooksAddressesRequest.typeUrl +); +function createBaseQueryAllBeforeSendHooksAddressesResponse(): QueryAllBeforeSendHooksAddressesResponse { + return { + denoms: [], + beforeSendHookAddresses: [], + }; +} +export const QueryAllBeforeSendHooksAddressesResponse = { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesResponse', + aminoType: + 'osmosis/tokenfactory/query-all-before-send-hooks-addresses-response', + is(o: any): o is QueryAllBeforeSendHooksAddressesResponse { + return ( + o && + (o.$typeUrl === QueryAllBeforeSendHooksAddressesResponse.typeUrl || + (Array.isArray(o.denoms) && + (!o.denoms.length || typeof o.denoms[0] === 'string') && + Array.isArray(o.beforeSendHookAddresses) && + (!o.beforeSendHookAddresses.length || + typeof o.beforeSendHookAddresses[0] === 'string'))) + ); + }, + isSDK(o: any): o is QueryAllBeforeSendHooksAddressesResponseSDKType { + return ( + o && + (o.$typeUrl === QueryAllBeforeSendHooksAddressesResponse.typeUrl || + (Array.isArray(o.denoms) && + (!o.denoms.length || typeof o.denoms[0] === 'string') && + Array.isArray(o.before_send_hook_addresses) && + (!o.before_send_hook_addresses.length || + typeof o.before_send_hook_addresses[0] === 'string'))) + ); + }, + isAmino(o: any): o is QueryAllBeforeSendHooksAddressesResponseAmino { + return ( + o && + (o.$typeUrl === QueryAllBeforeSendHooksAddressesResponse.typeUrl || + (Array.isArray(o.denoms) && + (!o.denoms.length || typeof o.denoms[0] === 'string') && + Array.isArray(o.before_send_hook_addresses) && + (!o.before_send_hook_addresses.length || + typeof o.before_send_hook_addresses[0] === 'string'))) + ); + }, + encode( + message: QueryAllBeforeSendHooksAddressesResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + for (const v of message.beforeSendHookAddresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryAllBeforeSendHooksAddressesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBeforeSendHooksAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(reader.string()); + break; + case 2: + message.beforeSendHookAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryAllBeforeSendHooksAddressesResponse { + const message = createBaseQueryAllBeforeSendHooksAddressesResponse(); + message.denoms = object.denoms?.map((e) => e) || []; + message.beforeSendHookAddresses = + object.beforeSendHookAddresses?.map((e) => e) || []; + return message; + }, + fromAmino( + object: QueryAllBeforeSendHooksAddressesResponseAmino + ): QueryAllBeforeSendHooksAddressesResponse { + const message = createBaseQueryAllBeforeSendHooksAddressesResponse(); + message.denoms = object.denoms?.map((e) => e) || []; + message.beforeSendHookAddresses = + object.before_send_hook_addresses?.map((e) => e) || []; + return message; + }, + toAmino( + message: QueryAllBeforeSendHooksAddressesResponse + ): QueryAllBeforeSendHooksAddressesResponseAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map((e) => e); + } else { + obj.denoms = message.denoms; + } + if (message.beforeSendHookAddresses) { + obj.before_send_hook_addresses = message.beforeSendHookAddresses.map( + (e) => e + ); + } else { + obj.before_send_hook_addresses = message.beforeSendHookAddresses; + } + return obj; + }, + fromAminoMsg( + object: QueryAllBeforeSendHooksAddressesResponseAminoMsg + ): QueryAllBeforeSendHooksAddressesResponse { + return QueryAllBeforeSendHooksAddressesResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryAllBeforeSendHooksAddressesResponse + ): QueryAllBeforeSendHooksAddressesResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/query-all-before-send-hooks-addresses-response', + value: QueryAllBeforeSendHooksAddressesResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryAllBeforeSendHooksAddressesResponseProtoMsg + ): QueryAllBeforeSendHooksAddressesResponse { + return QueryAllBeforeSendHooksAddressesResponse.decode(message.value); + }, + toProto(message: QueryAllBeforeSendHooksAddressesResponse): Uint8Array { + return QueryAllBeforeSendHooksAddressesResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryAllBeforeSendHooksAddressesResponse + ): QueryAllBeforeSendHooksAddressesResponseProtoMsg { + return { + typeUrl: + '/osmosis.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesResponse', + value: QueryAllBeforeSendHooksAddressesResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryAllBeforeSendHooksAddressesResponse.typeUrl, + QueryAllBeforeSendHooksAddressesResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryAllBeforeSendHooksAddressesResponse.aminoType, + QueryAllBeforeSendHooksAddressesResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.amino.ts new file mode 100644 index 00000000..69f88dae --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.amino.ts @@ -0,0 +1,47 @@ +//@ts-nocheck +import { + MsgCreateDenom, + MsgMint, + MsgBurn, + MsgChangeAdmin, + MsgSetDenomMetadata, + MsgSetBeforeSendHook, + MsgForceTransfer, +} from './tx'; +export const AminoConverter = { + '/osmosis.tokenfactory.v1beta1.MsgCreateDenom': { + aminoType: 'osmosis/tokenfactory/create-denom', + toAmino: MsgCreateDenom.toAmino, + fromAmino: MsgCreateDenom.fromAmino, + }, + '/osmosis.tokenfactory.v1beta1.MsgMint': { + aminoType: 'osmosis/tokenfactory/mint', + toAmino: MsgMint.toAmino, + fromAmino: MsgMint.fromAmino, + }, + '/osmosis.tokenfactory.v1beta1.MsgBurn': { + aminoType: 'osmosis/tokenfactory/burn', + toAmino: MsgBurn.toAmino, + fromAmino: MsgBurn.fromAmino, + }, + '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin': { + aminoType: 'osmosis/tokenfactory/change-admin', + toAmino: MsgChangeAdmin.toAmino, + fromAmino: MsgChangeAdmin.fromAmino, + }, + '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata': { + aminoType: 'osmosis/tokenfactory/set-denom-metadata', + toAmino: MsgSetDenomMetadata.toAmino, + fromAmino: MsgSetDenomMetadata.fromAmino, + }, + '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook': { + aminoType: 'osmosis/tokenfactory/set-bef-send-hook', + toAmino: MsgSetBeforeSendHook.toAmino, + fromAmino: MsgSetBeforeSendHook.fromAmino, + }, + '/osmosis.tokenfactory.v1beta1.MsgForceTransfer': { + aminoType: 'osmosis/tokenfactory/force-transfer', + toAmino: MsgForceTransfer.toAmino, + fromAmino: MsgForceTransfer.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.registry.ts new file mode 100644 index 00000000..9c024760 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.registry.ts @@ -0,0 +1,160 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgCreateDenom, + MsgMint, + MsgBurn, + MsgChangeAdmin, + MsgSetDenomMetadata, + MsgSetBeforeSendHook, + MsgForceTransfer, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.tokenfactory.v1beta1.MsgCreateDenom', MsgCreateDenom], + ['/osmosis.tokenfactory.v1beta1.MsgMint', MsgMint], + ['/osmosis.tokenfactory.v1beta1.MsgBurn', MsgBurn], + ['/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', MsgChangeAdmin], + ['/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', MsgSetDenomMetadata], + ['/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook', MsgSetBeforeSendHook], + ['/osmosis.tokenfactory.v1beta1.MsgForceTransfer', MsgForceTransfer], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value: MsgCreateDenom.encode(value).finish(), + }; + }, + mint(value: MsgMint) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value: MsgMint.encode(value).finish(), + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value: MsgBurn.encode(value).finish(), + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value: MsgChangeAdmin.encode(value).finish(), + }; + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + value: MsgSetDenomMetadata.encode(value).finish(), + }; + }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook', + value: MsgSetBeforeSendHook.encode(value).finish(), + }; + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer', + value: MsgForceTransfer.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value, + }; + }, + mint(value: MsgMint) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value, + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value, + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value, + }; + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + value, + }; + }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook', + value, + }; + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer', + value, + }; + }, + }, + fromPartial: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value: MsgCreateDenom.fromPartial(value), + }; + }, + mint(value: MsgMint) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value: MsgMint.fromPartial(value), + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value: MsgBurn.fromPartial(value), + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value: MsgChangeAdmin.fromPartial(value), + }; + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + value: MsgSetDenomMetadata.fromPartial(value), + }; + }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook', + value: MsgSetBeforeSendHook.fromPartial(value), + }; + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer', + value: MsgForceTransfer.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..2e7bed69 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,131 @@ +//@ts-nocheck +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; + +import { + MsgCreateDenom, + MsgCreateDenomResponse, + MsgMint, + MsgMintResponse, + MsgBurn, + MsgBurnResponse, + MsgChangeAdmin, + MsgChangeAdminResponse, + MsgSetDenomMetadata, + MsgSetDenomMetadataResponse, + MsgSetBeforeSendHook, + MsgSetBeforeSendHookResponse, + MsgForceTransfer, + MsgForceTransferResponse, +} from './tx'; +/** Msg defines the tokefactory module's gRPC message service. */ +export interface Msg { + createDenom(request: MsgCreateDenom): Promise; + mint(request: MsgMint): Promise; + burn(request: MsgBurn): Promise; + changeAdmin(request: MsgChangeAdmin): Promise; + setDenomMetadata( + request: MsgSetDenomMetadata + ): Promise; + setBeforeSendHook( + request: MsgSetBeforeSendHook + ): Promise; + forceTransfer(request: MsgForceTransfer): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createDenom = this.createDenom.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + this.changeAdmin = this.changeAdmin.bind(this); + this.setDenomMetadata = this.setDenomMetadata.bind(this); + this.setBeforeSendHook = this.setBeforeSendHook.bind(this); + this.forceTransfer = this.forceTransfer.bind(this); + } + createDenom(request: MsgCreateDenom): Promise { + const data = MsgCreateDenom.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Msg', + 'CreateDenom', + data + ); + return promise.then((data) => + MsgCreateDenomResponse.decode(new BinaryReader(data)) + ); + } + mint(request: MsgMint): Promise { + const data = MsgMint.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Msg', + 'Mint', + data + ); + return promise.then((data) => + MsgMintResponse.decode(new BinaryReader(data)) + ); + } + burn(request: MsgBurn): Promise { + const data = MsgBurn.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Msg', + 'Burn', + data + ); + return promise.then((data) => + MsgBurnResponse.decode(new BinaryReader(data)) + ); + } + changeAdmin(request: MsgChangeAdmin): Promise { + const data = MsgChangeAdmin.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Msg', + 'ChangeAdmin', + data + ); + return promise.then((data) => + MsgChangeAdminResponse.decode(new BinaryReader(data)) + ); + } + setDenomMetadata( + request: MsgSetDenomMetadata + ): Promise { + const data = MsgSetDenomMetadata.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Msg', + 'SetDenomMetadata', + data + ); + return promise.then((data) => + MsgSetDenomMetadataResponse.decode(new BinaryReader(data)) + ); + } + setBeforeSendHook( + request: MsgSetBeforeSendHook + ): Promise { + const data = MsgSetBeforeSendHook.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Msg', + 'SetBeforeSendHook', + data + ); + return promise.then((data) => + MsgSetBeforeSendHookResponse.decode(new BinaryReader(data)) + ); + } + forceTransfer(request: MsgForceTransfer): Promise { + const data = MsgForceTransfer.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.tokenfactory.v1beta1.Msg', + 'ForceTransfer', + data + ); + return promise.then((data) => + MsgForceTransferResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.ts new file mode 100644 index 00000000..11952287 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/tokenfactory/v1beta1/tx.ts @@ -0,0 +1,1958 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { + Metadata, + MetadataAmino, + MetadataSDKType, +} from '../../../cosmos/bank/v1beta1/bank'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenom { + sender: string; + /** subdenom can be up to 44 "alphanumeric" characters long. */ + subdenom: string; +} +export interface MsgCreateDenomProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom'; + value: Uint8Array; +} +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenomAmino { + sender?: string; + /** subdenom can be up to 44 "alphanumeric" characters long. */ + subdenom?: string; +} +export interface MsgCreateDenomAminoMsg { + type: 'osmosis/tokenfactory/create-denom'; + value: MsgCreateDenomAmino; +} +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenomSDKType { + sender: string; + subdenom: string; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponse { + newTokenDenom: string; +} +export interface MsgCreateDenomResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse'; + value: Uint8Array; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseAmino { + new_token_denom?: string; +} +export interface MsgCreateDenomResponseAminoMsg { + type: 'osmosis/tokenfactory/create-denom-response'; + value: MsgCreateDenomResponseAmino; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseSDKType { + new_token_denom: string; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. + */ +export interface MsgMint { + sender: string; + amount: Coin; + mintToAddress: string; +} +export interface MsgMintProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint'; + value: Uint8Array; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. + */ +export interface MsgMintAmino { + sender?: string; + amount?: CoinAmino; + mintToAddress: string; +} +export interface MsgMintAminoMsg { + type: 'osmosis/tokenfactory/mint'; + value: MsgMintAmino; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. + */ +export interface MsgMintSDKType { + sender: string; + amount: CoinSDKType; + mintToAddress: string; +} +export interface MsgMintResponse {} +export interface MsgMintResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMintResponse'; + value: Uint8Array; +} +export interface MsgMintResponseAmino {} +export interface MsgMintResponseAminoMsg { + type: 'osmosis/tokenfactory/mint-response'; + value: MsgMintResponseAmino; +} +export interface MsgMintResponseSDKType {} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. + */ +export interface MsgBurn { + sender: string; + amount: Coin; + burnFromAddress: string; +} +export interface MsgBurnProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn'; + value: Uint8Array; +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. + */ +export interface MsgBurnAmino { + sender?: string; + amount?: CoinAmino; + burnFromAddress: string; +} +export interface MsgBurnAminoMsg { + type: 'osmosis/tokenfactory/burn'; + value: MsgBurnAmino; +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. + */ +export interface MsgBurnSDKType { + sender: string; + amount: CoinSDKType; + burnFromAddress: string; +} +export interface MsgBurnResponse {} +export interface MsgBurnResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurnResponse'; + value: Uint8Array; +} +export interface MsgBurnResponseAmino {} +export interface MsgBurnResponseAminoMsg { + type: 'osmosis/tokenfactory/burn-response'; + value: MsgBurnResponseAmino; +} +export interface MsgBurnResponseSDKType {} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdmin { + sender: string; + denom: string; + newAdmin: string; +} +export interface MsgChangeAdminProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin'; + value: Uint8Array; +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminAmino { + sender?: string; + denom?: string; + new_admin?: string; +} +export interface MsgChangeAdminAminoMsg { + type: 'osmosis/tokenfactory/change-admin'; + value: MsgChangeAdminAmino; +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminSDKType { + sender: string; + denom: string; + new_admin: string; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponse {} +export interface MsgChangeAdminResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse'; + value: Uint8Array; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponseAmino {} +export interface MsgChangeAdminResponseAminoMsg { + type: 'osmosis/tokenfactory/change-admin-response'; + value: MsgChangeAdminResponseAmino; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponseSDKType {} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHook { + sender: string; + denom: string; + cosmwasmAddress: string; +} +export interface MsgSetBeforeSendHookProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook'; + value: Uint8Array; +} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHookAmino { + sender?: string; + denom?: string; + cosmwasm_address: string; +} +export interface MsgSetBeforeSendHookAminoMsg { + type: 'osmosis/tokenfactory/set-bef-send-hook'; + value: MsgSetBeforeSendHookAmino; +} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHookSDKType { + sender: string; + denom: string; + cosmwasm_address: string; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponse {} +export interface MsgSetBeforeSendHookResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse'; + value: Uint8Array; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponseAmino {} +export interface MsgSetBeforeSendHookResponseAminoMsg { + type: 'osmosis/tokenfactory/set-before-send-hook-response'; + value: MsgSetBeforeSendHookResponseAmino; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponseSDKType {} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadata { + sender: string; + metadata: Metadata; +} +export interface MsgSetDenomMetadataProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata'; + value: Uint8Array; +} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadataAmino { + sender?: string; + metadata?: MetadataAmino; +} +export interface MsgSetDenomMetadataAminoMsg { + type: 'osmosis/tokenfactory/set-denom-metadata'; + value: MsgSetDenomMetadataAmino; +} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadataSDKType { + sender: string; + metadata: MetadataSDKType; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponse {} +export interface MsgSetDenomMetadataResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse'; + value: Uint8Array; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseAmino {} +export interface MsgSetDenomMetadataResponseAminoMsg { + type: 'osmosis/tokenfactory/set-denom-metadata-response'; + value: MsgSetDenomMetadataResponseAmino; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseSDKType {} +export interface MsgForceTransfer { + sender: string; + amount: Coin; + transferFromAddress: string; + transferToAddress: string; +} +export interface MsgForceTransferProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer'; + value: Uint8Array; +} +export interface MsgForceTransferAmino { + sender?: string; + amount?: CoinAmino; + transferFromAddress?: string; + transferToAddress?: string; +} +export interface MsgForceTransferAminoMsg { + type: 'osmosis/tokenfactory/force-transfer'; + value: MsgForceTransferAmino; +} +export interface MsgForceTransferSDKType { + sender: string; + amount: CoinSDKType; + transferFromAddress: string; + transferToAddress: string; +} +export interface MsgForceTransferResponse {} +export interface MsgForceTransferResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransferResponse'; + value: Uint8Array; +} +export interface MsgForceTransferResponseAmino {} +export interface MsgForceTransferResponseAminoMsg { + type: 'osmosis/tokenfactory/force-transfer-response'; + value: MsgForceTransferResponseAmino; +} +export interface MsgForceTransferResponseSDKType {} +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + sender: '', + subdenom: '', + }; +} +export const MsgCreateDenom = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + aminoType: 'osmosis/tokenfactory/create-denom', + is(o: any): o is MsgCreateDenom { + return ( + o && + (o.$typeUrl === MsgCreateDenom.typeUrl || + (typeof o.sender === 'string' && typeof o.subdenom === 'string')) + ); + }, + isSDK(o: any): o is MsgCreateDenomSDKType { + return ( + o && + (o.$typeUrl === MsgCreateDenom.typeUrl || + (typeof o.sender === 'string' && typeof o.subdenom === 'string')) + ); + }, + isAmino(o: any): o is MsgCreateDenomAmino { + return ( + o && + (o.$typeUrl === MsgCreateDenom.typeUrl || + (typeof o.sender === 'string' && typeof o.subdenom === 'string')) + ); + }, + encode( + message: MsgCreateDenom, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.subdenom !== '') { + writer.uint32(18).string(message.subdenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDenom { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subdenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.sender = object.sender ?? ''; + message.subdenom = object.subdenom ?? ''; + return message; + }, + fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subdenom !== undefined && object.subdenom !== null) { + message.subdenom = object.subdenom; + } + return message; + }, + toAmino(message: MsgCreateDenom): MsgCreateDenomAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.subdenom = message.subdenom === '' ? undefined : message.subdenom; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom { + return MsgCreateDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDenom): MsgCreateDenomAminoMsg { + return { + type: 'osmosis/tokenfactory/create-denom', + value: MsgCreateDenom.toAmino(message), + }; + }, + fromProtoMsg(message: MsgCreateDenomProtoMsg): MsgCreateDenom { + return MsgCreateDenom.decode(message.value); + }, + toProto(message: MsgCreateDenom): Uint8Array { + return MsgCreateDenom.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenom): MsgCreateDenomProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value: MsgCreateDenom.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgCreateDenom.typeUrl, MsgCreateDenom); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateDenom.aminoType, + MsgCreateDenom.typeUrl +); +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { + newTokenDenom: '', + }; +} +export const MsgCreateDenomResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse', + aminoType: 'osmosis/tokenfactory/create-denom-response', + is(o: any): o is MsgCreateDenomResponse { + return ( + o && + (o.$typeUrl === MsgCreateDenomResponse.typeUrl || + typeof o.newTokenDenom === 'string') + ); + }, + isSDK(o: any): o is MsgCreateDenomResponseSDKType { + return ( + o && + (o.$typeUrl === MsgCreateDenomResponse.typeUrl || + typeof o.new_token_denom === 'string') + ); + }, + isAmino(o: any): o is MsgCreateDenomResponseAmino { + return ( + o && + (o.$typeUrl === MsgCreateDenomResponse.typeUrl || + typeof o.new_token_denom === 'string') + ); + }, + encode( + message: MsgCreateDenomResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.newTokenDenom !== '') { + writer.uint32(10).string(message.newTokenDenom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newTokenDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + message.newTokenDenom = object.newTokenDenom ?? ''; + return message; + }, + fromAmino(object: MsgCreateDenomResponseAmino): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + if ( + object.new_token_denom !== undefined && + object.new_token_denom !== null + ) { + message.newTokenDenom = object.new_token_denom; + } + return message; + }, + toAmino(message: MsgCreateDenomResponse): MsgCreateDenomResponseAmino { + const obj: any = {}; + obj.new_token_denom = + message.newTokenDenom === '' ? undefined : message.newTokenDenom; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomResponseAminoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/create-denom-response', + value: MsgCreateDenomResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgCreateDenomResponseProtoMsg + ): MsgCreateDenomResponse { + return MsgCreateDenomResponse.decode(message.value); + }, + toProto(message: MsgCreateDenomResponse): Uint8Array { + return MsgCreateDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse', + value: MsgCreateDenomResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgCreateDenomResponse.typeUrl, + MsgCreateDenomResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateDenomResponse.aminoType, + MsgCreateDenomResponse.typeUrl +); +function createBaseMsgMint(): MsgMint { + return { + sender: '', + amount: Coin.fromPartial({}), + mintToAddress: '', + }; +} +export const MsgMint = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + aminoType: 'osmosis/tokenfactory/mint', + is(o: any): o is MsgMint { + return ( + o && + (o.$typeUrl === MsgMint.typeUrl || + (typeof o.sender === 'string' && + Coin.is(o.amount) && + typeof o.mintToAddress === 'string')) + ); + }, + isSDK(o: any): o is MsgMintSDKType { + return ( + o && + (o.$typeUrl === MsgMint.typeUrl || + (typeof o.sender === 'string' && + Coin.isSDK(o.amount) && + typeof o.mintToAddress === 'string')) + ); + }, + isAmino(o: any): o is MsgMintAmino { + return ( + o && + (o.$typeUrl === MsgMint.typeUrl || + (typeof o.sender === 'string' && + Coin.isAmino(o.amount) && + typeof o.mintToAddress === 'string')) + ); + }, + encode( + message: MsgMint, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.mintToAddress !== '') { + writer.uint32(26).string(message.mintToAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMint { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.mintToAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMint { + const message = createBaseMsgMint(); + message.sender = object.sender ?? ''; + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined; + message.mintToAddress = object.mintToAddress ?? ''; + return message; + }, + fromAmino(object: MsgMintAmino): MsgMint { + const message = createBaseMsgMint(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.mintToAddress !== undefined && object.mintToAddress !== null) { + message.mintToAddress = object.mintToAddress; + } + return message; + }, + toAmino(message: MsgMint): MsgMintAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.mintToAddress = message.mintToAddress ?? ''; + return obj; + }, + fromAminoMsg(object: MsgMintAminoMsg): MsgMint { + return MsgMint.fromAmino(object.value); + }, + toAminoMsg(message: MsgMint): MsgMintAminoMsg { + return { + type: 'osmosis/tokenfactory/mint', + value: MsgMint.toAmino(message), + }; + }, + fromProtoMsg(message: MsgMintProtoMsg): MsgMint { + return MsgMint.decode(message.value); + }, + toProto(message: MsgMint): Uint8Array { + return MsgMint.encode(message).finish(); + }, + toProtoMsg(message: MsgMint): MsgMintProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value: MsgMint.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgMint.typeUrl, MsgMint); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgMint.aminoType, + MsgMint.typeUrl +); +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} +export const MsgMintResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMintResponse', + aminoType: 'osmosis/tokenfactory/mint-response', + is(o: any): o is MsgMintResponse { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + isSDK(o: any): o is MsgMintResponseSDKType { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + isAmino(o: any): o is MsgMintResponseAmino { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + encode( + _: MsgMintResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMintResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + fromAmino(_: MsgMintResponseAmino): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + toAmino(_: MsgMintResponse): MsgMintResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMintResponseAminoMsg): MsgMintResponse { + return MsgMintResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMintResponse): MsgMintResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/mint-response', + value: MsgMintResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgMintResponseProtoMsg): MsgMintResponse { + return MsgMintResponse.decode(message.value); + }, + toProto(message: MsgMintResponse): Uint8Array { + return MsgMintResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintResponse): MsgMintResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMintResponse', + value: MsgMintResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgMintResponse.typeUrl, MsgMintResponse); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgMintResponse.aminoType, + MsgMintResponse.typeUrl +); +function createBaseMsgBurn(): MsgBurn { + return { + sender: '', + amount: Coin.fromPartial({}), + burnFromAddress: '', + }; +} +export const MsgBurn = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + aminoType: 'osmosis/tokenfactory/burn', + is(o: any): o is MsgBurn { + return ( + o && + (o.$typeUrl === MsgBurn.typeUrl || + (typeof o.sender === 'string' && + Coin.is(o.amount) && + typeof o.burnFromAddress === 'string')) + ); + }, + isSDK(o: any): o is MsgBurnSDKType { + return ( + o && + (o.$typeUrl === MsgBurn.typeUrl || + (typeof o.sender === 'string' && + Coin.isSDK(o.amount) && + typeof o.burnFromAddress === 'string')) + ); + }, + isAmino(o: any): o is MsgBurnAmino { + return ( + o && + (o.$typeUrl === MsgBurn.typeUrl || + (typeof o.sender === 'string' && + Coin.isAmino(o.amount) && + typeof o.burnFromAddress === 'string')) + ); + }, + encode( + message: MsgBurn, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.burnFromAddress !== '') { + writer.uint32(26).string(message.burnFromAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.burnFromAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBurn { + const message = createBaseMsgBurn(); + message.sender = object.sender ?? ''; + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined; + message.burnFromAddress = object.burnFromAddress ?? ''; + return message; + }, + fromAmino(object: MsgBurnAmino): MsgBurn { + const message = createBaseMsgBurn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if ( + object.burnFromAddress !== undefined && + object.burnFromAddress !== null + ) { + message.burnFromAddress = object.burnFromAddress; + } + return message; + }, + toAmino(message: MsgBurn): MsgBurnAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.burnFromAddress = message.burnFromAddress ?? ''; + return obj; + }, + fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { + return MsgBurn.fromAmino(object.value); + }, + toAminoMsg(message: MsgBurn): MsgBurnAminoMsg { + return { + type: 'osmosis/tokenfactory/burn', + value: MsgBurn.toAmino(message), + }; + }, + fromProtoMsg(message: MsgBurnProtoMsg): MsgBurn { + return MsgBurn.decode(message.value); + }, + toProto(message: MsgBurn): Uint8Array { + return MsgBurn.encode(message).finish(); + }, + toProtoMsg(message: MsgBurn): MsgBurnProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value: MsgBurn.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgBurn.typeUrl, MsgBurn); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBurn.aminoType, + MsgBurn.typeUrl +); +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} +export const MsgBurnResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurnResponse', + aminoType: 'osmosis/tokenfactory/burn-response', + is(o: any): o is MsgBurnResponse { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + isSDK(o: any): o is MsgBurnResponseSDKType { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + isAmino(o: any): o is MsgBurnResponseAmino { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + encode( + _: MsgBurnResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurnResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + fromAmino(_: MsgBurnResponseAmino): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + toAmino(_: MsgBurnResponse): MsgBurnResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBurnResponseAminoMsg): MsgBurnResponse { + return MsgBurnResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgBurnResponse): MsgBurnResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/burn-response', + value: MsgBurnResponse.toAmino(message), + }; + }, + fromProtoMsg(message: MsgBurnResponseProtoMsg): MsgBurnResponse { + return MsgBurnResponse.decode(message.value); + }, + toProto(message: MsgBurnResponse): Uint8Array { + return MsgBurnResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnResponse): MsgBurnResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurnResponse', + value: MsgBurnResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgBurnResponse.typeUrl, MsgBurnResponse); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBurnResponse.aminoType, + MsgBurnResponse.typeUrl +); +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { + sender: '', + denom: '', + newAdmin: '', + }; +} +export const MsgChangeAdmin = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + aminoType: 'osmosis/tokenfactory/change-admin', + is(o: any): o is MsgChangeAdmin { + return ( + o && + (o.$typeUrl === MsgChangeAdmin.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom === 'string' && + typeof o.newAdmin === 'string')) + ); + }, + isSDK(o: any): o is MsgChangeAdminSDKType { + return ( + o && + (o.$typeUrl === MsgChangeAdmin.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom === 'string' && + typeof o.new_admin === 'string')) + ); + }, + isAmino(o: any): o is MsgChangeAdminAmino { + return ( + o && + (o.$typeUrl === MsgChangeAdmin.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom === 'string' && + typeof o.new_admin === 'string')) + ); + }, + encode( + message: MsgChangeAdmin, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.denom !== '') { + writer.uint32(18).string(message.denom); + } + if (message.newAdmin !== '') { + writer.uint32(26).string(message.newAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChangeAdmin { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + message.sender = object.sender ?? ''; + message.denom = object.denom ?? ''; + message.newAdmin = object.newAdmin ?? ''; + return message; + }, + fromAmino(object: MsgChangeAdminAmino): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; + }, + toAmino(message: MsgChangeAdmin): MsgChangeAdminAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.new_admin = message.newAdmin === '' ? undefined : message.newAdmin; + return obj; + }, + fromAminoMsg(object: MsgChangeAdminAminoMsg): MsgChangeAdmin { + return MsgChangeAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgChangeAdmin): MsgChangeAdminAminoMsg { + return { + type: 'osmosis/tokenfactory/change-admin', + value: MsgChangeAdmin.toAmino(message), + }; + }, + fromProtoMsg(message: MsgChangeAdminProtoMsg): MsgChangeAdmin { + return MsgChangeAdmin.decode(message.value); + }, + toProto(message: MsgChangeAdmin): Uint8Array { + return MsgChangeAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdmin): MsgChangeAdminProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value: MsgChangeAdmin.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgChangeAdmin.typeUrl, MsgChangeAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChangeAdmin.aminoType, + MsgChangeAdmin.typeUrl +); +function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { + return {}; +} +export const MsgChangeAdminResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse', + aminoType: 'osmosis/tokenfactory/change-admin-response', + is(o: any): o is MsgChangeAdminResponse { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + isSDK(o: any): o is MsgChangeAdminResponseSDKType { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgChangeAdminResponseAmino { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + encode( + _: MsgChangeAdminResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChangeAdminResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); + return message; + }, + fromAmino(_: MsgChangeAdminResponseAmino): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); + return message; + }, + toAmino(_: MsgChangeAdminResponse): MsgChangeAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChangeAdminResponseAminoMsg): MsgChangeAdminResponse { + return MsgChangeAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/change-admin-response', + value: MsgChangeAdminResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgChangeAdminResponseProtoMsg + ): MsgChangeAdminResponse { + return MsgChangeAdminResponse.decode(message.value); + }, + toProto(message: MsgChangeAdminResponse): Uint8Array { + return MsgChangeAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse', + value: MsgChangeAdminResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgChangeAdminResponse.typeUrl, + MsgChangeAdminResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChangeAdminResponse.aminoType, + MsgChangeAdminResponse.typeUrl +); +function createBaseMsgSetBeforeSendHook(): MsgSetBeforeSendHook { + return { + sender: '', + denom: '', + cosmwasmAddress: '', + }; +} +export const MsgSetBeforeSendHook = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook', + aminoType: 'osmosis/tokenfactory/set-bef-send-hook', + is(o: any): o is MsgSetBeforeSendHook { + return ( + o && + (o.$typeUrl === MsgSetBeforeSendHook.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom === 'string' && + typeof o.cosmwasmAddress === 'string')) + ); + }, + isSDK(o: any): o is MsgSetBeforeSendHookSDKType { + return ( + o && + (o.$typeUrl === MsgSetBeforeSendHook.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom === 'string' && + typeof o.cosmwasm_address === 'string')) + ); + }, + isAmino(o: any): o is MsgSetBeforeSendHookAmino { + return ( + o && + (o.$typeUrl === MsgSetBeforeSendHook.typeUrl || + (typeof o.sender === 'string' && + typeof o.denom === 'string' && + typeof o.cosmwasm_address === 'string')) + ); + }, + encode( + message: MsgSetBeforeSendHook, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.denom !== '') { + writer.uint32(18).string(message.denom); + } + if (message.cosmwasmAddress !== '') { + writer.uint32(26).string(message.cosmwasmAddress); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetBeforeSendHook { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetBeforeSendHook { + const message = createBaseMsgSetBeforeSendHook(); + message.sender = object.sender ?? ''; + message.denom = object.denom ?? ''; + message.cosmwasmAddress = object.cosmwasmAddress ?? ''; + return message; + }, + fromAmino(object: MsgSetBeforeSendHookAmino): MsgSetBeforeSendHook { + const message = createBaseMsgSetBeforeSendHook(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if ( + object.cosmwasm_address !== undefined && + object.cosmwasm_address !== null + ) { + message.cosmwasmAddress = object.cosmwasm_address; + } + return message; + }, + toAmino(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.cosmwasm_address = message.cosmwasmAddress ?? ''; + return obj; + }, + fromAminoMsg(object: MsgSetBeforeSendHookAminoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAminoMsg { + return { + type: 'osmosis/tokenfactory/set-bef-send-hook', + value: MsgSetBeforeSendHook.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetBeforeSendHookProtoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHook): Uint8Array { + return MsgSetBeforeSendHook.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook', + value: MsgSetBeforeSendHook.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetBeforeSendHook.typeUrl, + MsgSetBeforeSendHook +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetBeforeSendHook.aminoType, + MsgSetBeforeSendHook.typeUrl +); +function createBaseMsgSetBeforeSendHookResponse(): MsgSetBeforeSendHookResponse { + return {}; +} +export const MsgSetBeforeSendHookResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse', + aminoType: 'osmosis/tokenfactory/set-before-send-hook-response', + is(o: any): o is MsgSetBeforeSendHookResponse { + return o && o.$typeUrl === MsgSetBeforeSendHookResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetBeforeSendHookResponseSDKType { + return o && o.$typeUrl === MsgSetBeforeSendHookResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetBeforeSendHookResponseAmino { + return o && o.$typeUrl === MsgSetBeforeSendHookResponse.typeUrl; + }, + encode( + _: MsgSetBeforeSendHookResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetBeforeSendHookResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetBeforeSendHookResponse { + const message = createBaseMsgSetBeforeSendHookResponse(); + return message; + }, + fromAmino( + _: MsgSetBeforeSendHookResponseAmino + ): MsgSetBeforeSendHookResponse { + const message = createBaseMsgSetBeforeSendHookResponse(); + return message; + }, + toAmino(_: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetBeforeSendHookResponseAminoMsg + ): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetBeforeSendHookResponse + ): MsgSetBeforeSendHookResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/set-before-send-hook-response', + value: MsgSetBeforeSendHookResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetBeforeSendHookResponseProtoMsg + ): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHookResponse): Uint8Array { + return MsgSetBeforeSendHookResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetBeforeSendHookResponse + ): MsgSetBeforeSendHookResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse', + value: MsgSetBeforeSendHookResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetBeforeSendHookResponse.typeUrl, + MsgSetBeforeSendHookResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetBeforeSendHookResponse.aminoType, + MsgSetBeforeSendHookResponse.typeUrl +); +function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { + return { + sender: '', + metadata: Metadata.fromPartial({}), + }; +} +export const MsgSetDenomMetadata = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + aminoType: 'osmosis/tokenfactory/set-denom-metadata', + is(o: any): o is MsgSetDenomMetadata { + return ( + o && + (o.$typeUrl === MsgSetDenomMetadata.typeUrl || + (typeof o.sender === 'string' && Metadata.is(o.metadata))) + ); + }, + isSDK(o: any): o is MsgSetDenomMetadataSDKType { + return ( + o && + (o.$typeUrl === MsgSetDenomMetadata.typeUrl || + (typeof o.sender === 'string' && Metadata.isSDK(o.metadata))) + ); + }, + isAmino(o: any): o is MsgSetDenomMetadataAmino { + return ( + o && + (o.$typeUrl === MsgSetDenomMetadata.typeUrl || + (typeof o.sender === 'string' && Metadata.isAmino(o.metadata))) + ); + }, + encode( + message: MsgSetDenomMetadata, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDenomMetadata { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetDenomMetadata { + const message = createBaseMsgSetDenomMetadata(); + message.sender = object.sender ?? ''; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? Metadata.fromPartial(object.metadata) + : undefined; + return message; + }, + fromAmino(object: MsgSetDenomMetadataAmino): MsgSetDenomMetadata { + const message = createBaseMsgSetDenomMetadata(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: MsgSetDenomMetadata): MsgSetDenomMetadataAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.metadata = message.metadata + ? Metadata.toAmino(message.metadata) + : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetDenomMetadataAminoMsg): MsgSetDenomMetadata { + return MsgSetDenomMetadata.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDenomMetadata): MsgSetDenomMetadataAminoMsg { + return { + type: 'osmosis/tokenfactory/set-denom-metadata', + value: MsgSetDenomMetadata.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetDenomMetadataProtoMsg): MsgSetDenomMetadata { + return MsgSetDenomMetadata.decode(message.value); + }, + toProto(message: MsgSetDenomMetadata): Uint8Array { + return MsgSetDenomMetadata.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomMetadata): MsgSetDenomMetadataProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + value: MsgSetDenomMetadata.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetDenomMetadata.typeUrl, + MsgSetDenomMetadata +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDenomMetadata.aminoType, + MsgSetDenomMetadata.typeUrl +); +function createBaseMsgSetDenomMetadataResponse(): MsgSetDenomMetadataResponse { + return {}; +} +export const MsgSetDenomMetadataResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse', + aminoType: 'osmosis/tokenfactory/set-denom-metadata-response', + is(o: any): o is MsgSetDenomMetadataResponse { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetDenomMetadataResponseSDKType { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetDenomMetadataResponseAmino { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + encode( + _: MsgSetDenomMetadataResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDenomMetadataResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetDenomMetadataResponse { + const message = createBaseMsgSetDenomMetadataResponse(); + return message; + }, + fromAmino(_: MsgSetDenomMetadataResponseAmino): MsgSetDenomMetadataResponse { + const message = createBaseMsgSetDenomMetadataResponse(); + return message; + }, + toAmino(_: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetDenomMetadataResponseAminoMsg + ): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetDenomMetadataResponse + ): MsgSetDenomMetadataResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/set-denom-metadata-response', + value: MsgSetDenomMetadataResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetDenomMetadataResponseProtoMsg + ): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.decode(message.value); + }, + toProto(message: MsgSetDenomMetadataResponse): Uint8Array { + return MsgSetDenomMetadataResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetDenomMetadataResponse + ): MsgSetDenomMetadataResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse', + value: MsgSetDenomMetadataResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetDenomMetadataResponse.typeUrl, + MsgSetDenomMetadataResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDenomMetadataResponse.aminoType, + MsgSetDenomMetadataResponse.typeUrl +); +function createBaseMsgForceTransfer(): MsgForceTransfer { + return { + sender: '', + amount: Coin.fromPartial({}), + transferFromAddress: '', + transferToAddress: '', + }; +} +export const MsgForceTransfer = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer', + aminoType: 'osmosis/tokenfactory/force-transfer', + is(o: any): o is MsgForceTransfer { + return ( + o && + (o.$typeUrl === MsgForceTransfer.typeUrl || + (typeof o.sender === 'string' && + Coin.is(o.amount) && + typeof o.transferFromAddress === 'string' && + typeof o.transferToAddress === 'string')) + ); + }, + isSDK(o: any): o is MsgForceTransferSDKType { + return ( + o && + (o.$typeUrl === MsgForceTransfer.typeUrl || + (typeof o.sender === 'string' && + Coin.isSDK(o.amount) && + typeof o.transferFromAddress === 'string' && + typeof o.transferToAddress === 'string')) + ); + }, + isAmino(o: any): o is MsgForceTransferAmino { + return ( + o && + (o.$typeUrl === MsgForceTransfer.typeUrl || + (typeof o.sender === 'string' && + Coin.isAmino(o.amount) && + typeof o.transferFromAddress === 'string' && + typeof o.transferToAddress === 'string')) + ); + }, + encode( + message: MsgForceTransfer, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.transferFromAddress !== '') { + writer.uint32(26).string(message.transferFromAddress); + } + if (message.transferToAddress !== '') { + writer.uint32(34).string(message.transferToAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgForceTransfer { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.transferFromAddress = reader.string(); + break; + case 4: + message.transferToAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgForceTransfer { + const message = createBaseMsgForceTransfer(); + message.sender = object.sender ?? ''; + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined; + message.transferFromAddress = object.transferFromAddress ?? ''; + message.transferToAddress = object.transferToAddress ?? ''; + return message; + }, + fromAmino(object: MsgForceTransferAmino): MsgForceTransfer { + const message = createBaseMsgForceTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if ( + object.transferFromAddress !== undefined && + object.transferFromAddress !== null + ) { + message.transferFromAddress = object.transferFromAddress; + } + if ( + object.transferToAddress !== undefined && + object.transferToAddress !== null + ) { + message.transferToAddress = object.transferToAddress; + } + return message; + }, + toAmino(message: MsgForceTransfer): MsgForceTransferAmino { + const obj: any = {}; + obj.sender = message.sender === '' ? undefined : message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.transferFromAddress = + message.transferFromAddress === '' + ? undefined + : message.transferFromAddress; + obj.transferToAddress = + message.transferToAddress === '' ? undefined : message.transferToAddress; + return obj; + }, + fromAminoMsg(object: MsgForceTransferAminoMsg): MsgForceTransfer { + return MsgForceTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgForceTransfer): MsgForceTransferAminoMsg { + return { + type: 'osmosis/tokenfactory/force-transfer', + value: MsgForceTransfer.toAmino(message), + }; + }, + fromProtoMsg(message: MsgForceTransferProtoMsg): MsgForceTransfer { + return MsgForceTransfer.decode(message.value); + }, + toProto(message: MsgForceTransfer): Uint8Array { + return MsgForceTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgForceTransfer): MsgForceTransferProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer', + value: MsgForceTransfer.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgForceTransfer.typeUrl, MsgForceTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgForceTransfer.aminoType, + MsgForceTransfer.typeUrl +); +function createBaseMsgForceTransferResponse(): MsgForceTransferResponse { + return {}; +} +export const MsgForceTransferResponse = { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransferResponse', + aminoType: 'osmosis/tokenfactory/force-transfer-response', + is(o: any): o is MsgForceTransferResponse { + return o && o.$typeUrl === MsgForceTransferResponse.typeUrl; + }, + isSDK(o: any): o is MsgForceTransferResponseSDKType { + return o && o.$typeUrl === MsgForceTransferResponse.typeUrl; + }, + isAmino(o: any): o is MsgForceTransferResponseAmino { + return o && o.$typeUrl === MsgForceTransferResponse.typeUrl; + }, + encode( + _: MsgForceTransferResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgForceTransferResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgForceTransferResponse { + const message = createBaseMsgForceTransferResponse(); + return message; + }, + fromAmino(_: MsgForceTransferResponseAmino): MsgForceTransferResponse { + const message = createBaseMsgForceTransferResponse(); + return message; + }, + toAmino(_: MsgForceTransferResponse): MsgForceTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgForceTransferResponseAminoMsg + ): MsgForceTransferResponse { + return MsgForceTransferResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgForceTransferResponse + ): MsgForceTransferResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/force-transfer-response', + value: MsgForceTransferResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgForceTransferResponseProtoMsg + ): MsgForceTransferResponse { + return MsgForceTransferResponse.decode(message.value); + }, + toProto(message: MsgForceTransferResponse): Uint8Array { + return MsgForceTransferResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgForceTransferResponse + ): MsgForceTransferResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransferResponse', + value: MsgForceTransferResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgForceTransferResponse.typeUrl, + MsgForceTransferResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgForceTransferResponse.aminoType, + MsgForceTransferResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/feetoken.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/feetoken.ts new file mode 100644 index 00000000..1d22b3d0 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/feetoken.ts @@ -0,0 +1,157 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * FeeToken is a struct that specifies a coin denom, and pool ID pair. + * This marks the token as eligible for use as a tx fee asset in Osmosis. + * Its price in osmo is derived through looking at the provided pool ID. + * The pool ID must have osmo as one of its assets. + */ +export interface FeeToken { + denom: string; + poolID: bigint; +} +export interface FeeTokenProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.FeeToken'; + value: Uint8Array; +} +/** + * FeeToken is a struct that specifies a coin denom, and pool ID pair. + * This marks the token as eligible for use as a tx fee asset in Osmosis. + * Its price in osmo is derived through looking at the provided pool ID. + * The pool ID must have osmo as one of its assets. + */ +export interface FeeTokenAmino { + denom?: string; + poolID?: string; +} +export interface FeeTokenAminoMsg { + type: 'osmosis/txfees/fee-token'; + value: FeeTokenAmino; +} +/** + * FeeToken is a struct that specifies a coin denom, and pool ID pair. + * This marks the token as eligible for use as a tx fee asset in Osmosis. + * Its price in osmo is derived through looking at the provided pool ID. + * The pool ID must have osmo as one of its assets. + */ +export interface FeeTokenSDKType { + denom: string; + poolID: bigint; +} +function createBaseFeeToken(): FeeToken { + return { + denom: '', + poolID: BigInt(0), + }; +} +export const FeeToken = { + typeUrl: '/osmosis.txfees.v1beta1.FeeToken', + aminoType: 'osmosis/txfees/fee-token', + is(o: any): o is FeeToken { + return ( + o && + (o.$typeUrl === FeeToken.typeUrl || + (typeof o.denom === 'string' && typeof o.poolID === 'bigint')) + ); + }, + isSDK(o: any): o is FeeTokenSDKType { + return ( + o && + (o.$typeUrl === FeeToken.typeUrl || + (typeof o.denom === 'string' && typeof o.poolID === 'bigint')) + ); + }, + isAmino(o: any): o is FeeTokenAmino { + return ( + o && + (o.$typeUrl === FeeToken.typeUrl || + (typeof o.denom === 'string' && typeof o.poolID === 'bigint')) + ); + }, + encode( + message: FeeToken, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + if (message.poolID !== BigInt(0)) { + writer.uint32(16).uint64(message.poolID); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeToken { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeToken(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.poolID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FeeToken { + const message = createBaseFeeToken(); + message.denom = object.denom ?? ''; + message.poolID = + object.poolID !== undefined && object.poolID !== null + ? BigInt(object.poolID.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: FeeTokenAmino): FeeToken { + const message = createBaseFeeToken(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + return message; + }, + toAmino(message: FeeToken): FeeTokenAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + obj.poolID = + message.poolID !== BigInt(0) ? message.poolID.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FeeTokenAminoMsg): FeeToken { + return FeeToken.fromAmino(object.value); + }, + toAminoMsg(message: FeeToken): FeeTokenAminoMsg { + return { + type: 'osmosis/txfees/fee-token', + value: FeeToken.toAmino(message), + }; + }, + fromProtoMsg(message: FeeTokenProtoMsg): FeeToken { + return FeeToken.decode(message.value); + }, + toProto(message: FeeToken): Uint8Array { + return FeeToken.encode(message).finish(); + }, + toProtoMsg(message: FeeToken): FeeTokenProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.FeeToken', + value: FeeToken.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(FeeToken.typeUrl, FeeToken); +GlobalDecoderRegistry.registerAminoProtoMapping( + FeeToken.aminoType, + FeeToken.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/genesis.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/genesis.ts new file mode 100644 index 00000000..4f7f58a1 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/genesis.ts @@ -0,0 +1,176 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from './feetoken'; +import { Params, ParamsAmino, ParamsSDKType } from './params'; +/** GenesisState defines the txfees module's genesis state. */ +export interface GenesisState { + basedenom: string; + feetokens: FeeToken[]; + /** params is the container of txfees parameters. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.GenesisState'; + value: Uint8Array; +} +/** GenesisState defines the txfees module's genesis state. */ +export interface GenesisStateAmino { + basedenom?: string; + feetokens?: FeeTokenAmino[]; + /** params is the container of txfees parameters. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: 'osmosis/txfees/genesis-state'; + value: GenesisStateAmino; +} +/** GenesisState defines the txfees module's genesis state. */ +export interface GenesisStateSDKType { + basedenom: string; + feetokens: FeeTokenSDKType[]; + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + basedenom: '', + feetokens: [], + params: Params.fromPartial({}), + }; +} +export const GenesisState = { + typeUrl: '/osmosis.txfees.v1beta1.GenesisState', + aminoType: 'osmosis/txfees/genesis-state', + is(o: any): o is GenesisState { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.basedenom === 'string' && + Array.isArray(o.feetokens) && + (!o.feetokens.length || FeeToken.is(o.feetokens[0])) && + Params.is(o.params))) + ); + }, + isSDK(o: any): o is GenesisStateSDKType { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.basedenom === 'string' && + Array.isArray(o.feetokens) && + (!o.feetokens.length || FeeToken.isSDK(o.feetokens[0])) && + Params.isSDK(o.params))) + ); + }, + isAmino(o: any): o is GenesisStateAmino { + return ( + o && + (o.$typeUrl === GenesisState.typeUrl || + (typeof o.basedenom === 'string' && + Array.isArray(o.feetokens) && + (!o.feetokens.length || FeeToken.isAmino(o.feetokens[0])) && + Params.isAmino(o.params))) + ); + }, + encode( + message: GenesisState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.basedenom !== '') { + writer.uint32(10).string(message.basedenom); + } + for (const v of message.feetokens) { + FeeToken.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.basedenom = reader.string(); + break; + case 2: + message.feetokens.push(FeeToken.decode(reader, reader.uint32())); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.basedenom = object.basedenom ?? ''; + message.feetokens = + object.feetokens?.map((e) => FeeToken.fromPartial(e)) || []; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.basedenom !== undefined && object.basedenom !== null) { + message.basedenom = object.basedenom; + } + message.feetokens = + object.feetokens?.map((e) => FeeToken.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.basedenom = message.basedenom === '' ? undefined : message.basedenom; + if (message.feetokens) { + obj.feetokens = message.feetokens.map((e) => + e ? FeeToken.toAmino(e) : undefined + ); + } else { + obj.feetokens = message.feetokens; + } + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/txfees/genesis-state', + value: GenesisState.toAmino(message), + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.GenesisState', + value: GenesisState.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping( + GenesisState.aminoType, + GenesisState.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/gov.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/gov.ts new file mode 100644 index 00000000..1666392d --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/gov.ts @@ -0,0 +1,200 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from './feetoken'; +/** + * UpdateFeeTokenProposal is a gov Content type for adding new whitelisted fee + * token(s). It must specify a denom along with gamm pool ID to use as a spot + * price calculator. It can be used to add new denoms to the whitelist. It can + * also be used to update the Pool to associate with the denom. If Pool ID is + * set to 0, it will remove the denom from the whitelisted set. + */ +export interface UpdateFeeTokenProposal { + $typeUrl?: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal'; + title: string; + description: string; + feetokens: FeeToken[]; +} +export interface UpdateFeeTokenProposalProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal'; + value: Uint8Array; +} +/** + * UpdateFeeTokenProposal is a gov Content type for adding new whitelisted fee + * token(s). It must specify a denom along with gamm pool ID to use as a spot + * price calculator. It can be used to add new denoms to the whitelist. It can + * also be used to update the Pool to associate with the denom. If Pool ID is + * set to 0, it will remove the denom from the whitelisted set. + */ +export interface UpdateFeeTokenProposalAmino { + title?: string; + description?: string; + feetokens?: FeeTokenAmino[]; +} +export interface UpdateFeeTokenProposalAminoMsg { + type: 'osmosis/UpdateFeeTokenProposal'; + value: UpdateFeeTokenProposalAmino; +} +/** + * UpdateFeeTokenProposal is a gov Content type for adding new whitelisted fee + * token(s). It must specify a denom along with gamm pool ID to use as a spot + * price calculator. It can be used to add new denoms to the whitelist. It can + * also be used to update the Pool to associate with the denom. If Pool ID is + * set to 0, it will remove the denom from the whitelisted set. + */ +export interface UpdateFeeTokenProposalSDKType { + $typeUrl?: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal'; + title: string; + description: string; + feetokens: FeeTokenSDKType[]; +} +function createBaseUpdateFeeTokenProposal(): UpdateFeeTokenProposal { + return { + $typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal', + title: '', + description: '', + feetokens: [], + }; +} +export const UpdateFeeTokenProposal = { + typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal', + aminoType: 'osmosis/UpdateFeeTokenProposal', + is(o: any): o is UpdateFeeTokenProposal { + return ( + o && + (o.$typeUrl === UpdateFeeTokenProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.feetokens) && + (!o.feetokens.length || FeeToken.is(o.feetokens[0])))) + ); + }, + isSDK(o: any): o is UpdateFeeTokenProposalSDKType { + return ( + o && + (o.$typeUrl === UpdateFeeTokenProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.feetokens) && + (!o.feetokens.length || FeeToken.isSDK(o.feetokens[0])))) + ); + }, + isAmino(o: any): o is UpdateFeeTokenProposalAmino { + return ( + o && + (o.$typeUrl === UpdateFeeTokenProposal.typeUrl || + (typeof o.title === 'string' && + typeof o.description === 'string' && + Array.isArray(o.feetokens) && + (!o.feetokens.length || FeeToken.isAmino(o.feetokens[0])))) + ); + }, + encode( + message: UpdateFeeTokenProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== '') { + writer.uint32(10).string(message.title); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + for (const v of message.feetokens) { + FeeToken.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdateFeeTokenProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFeeTokenProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.feetokens.push(FeeToken.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateFeeTokenProposal { + const message = createBaseUpdateFeeTokenProposal(); + message.title = object.title ?? ''; + message.description = object.description ?? ''; + message.feetokens = + object.feetokens?.map((e) => FeeToken.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateFeeTokenProposalAmino): UpdateFeeTokenProposal { + const message = createBaseUpdateFeeTokenProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.feetokens = + object.feetokens?.map((e) => FeeToken.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalAmino { + const obj: any = {}; + obj.title = message.title === '' ? undefined : message.title; + obj.description = + message.description === '' ? undefined : message.description; + if (message.feetokens) { + obj.feetokens = message.feetokens.map((e) => + e ? FeeToken.toAmino(e) : undefined + ); + } else { + obj.feetokens = message.feetokens; + } + return obj; + }, + fromAminoMsg(object: UpdateFeeTokenProposalAminoMsg): UpdateFeeTokenProposal { + return UpdateFeeTokenProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalAminoMsg { + return { + type: 'osmosis/UpdateFeeTokenProposal', + value: UpdateFeeTokenProposal.toAmino(message), + }; + }, + fromProtoMsg( + message: UpdateFeeTokenProposalProtoMsg + ): UpdateFeeTokenProposal { + return UpdateFeeTokenProposal.decode(message.value); + }, + toProto(message: UpdateFeeTokenProposal): Uint8Array { + return UpdateFeeTokenProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal', + value: UpdateFeeTokenProposal.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + UpdateFeeTokenProposal.typeUrl, + UpdateFeeTokenProposal +); +GlobalDecoderRegistry.registerAminoProtoMapping( + UpdateFeeTokenProposal.aminoType, + UpdateFeeTokenProposal.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/params.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/params.ts new file mode 100644 index 00000000..9d680097 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/params.ts @@ -0,0 +1,134 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** Params holds parameters for the txfees module */ +export interface Params { + whitelistedFeeTokenSetters: string[]; +} +export interface ParamsProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.Params'; + value: Uint8Array; +} +/** Params holds parameters for the txfees module */ +export interface ParamsAmino { + whitelisted_fee_token_setters?: string[]; +} +export interface ParamsAminoMsg { + type: 'osmosis/txfees/params'; + value: ParamsAmino; +} +/** Params holds parameters for the txfees module */ +export interface ParamsSDKType { + whitelisted_fee_token_setters: string[]; +} +function createBaseParams(): Params { + return { + whitelistedFeeTokenSetters: [], + }; +} +export const Params = { + typeUrl: '/osmosis.txfees.v1beta1.Params', + aminoType: 'osmosis/txfees/params', + is(o: any): o is Params { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.whitelistedFeeTokenSetters) && + (!o.whitelistedFeeTokenSetters.length || + typeof o.whitelistedFeeTokenSetters[0] === 'string'))) + ); + }, + isSDK(o: any): o is ParamsSDKType { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.whitelisted_fee_token_setters) && + (!o.whitelisted_fee_token_setters.length || + typeof o.whitelisted_fee_token_setters[0] === 'string'))) + ); + }, + isAmino(o: any): o is ParamsAmino { + return ( + o && + (o.$typeUrl === Params.typeUrl || + (Array.isArray(o.whitelisted_fee_token_setters) && + (!o.whitelisted_fee_token_setters.length || + typeof o.whitelisted_fee_token_setters[0] === 'string'))) + ); + }, + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.whitelistedFeeTokenSetters) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.whitelistedFeeTokenSetters.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.whitelistedFeeTokenSetters = + object.whitelistedFeeTokenSetters?.map((e) => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.whitelistedFeeTokenSetters = + object.whitelisted_fee_token_setters?.map((e) => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.whitelistedFeeTokenSetters) { + obj.whitelisted_fee_token_setters = + message.whitelistedFeeTokenSetters.map((e) => e); + } else { + obj.whitelisted_fee_token_setters = message.whitelistedFeeTokenSetters; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/txfees/params', + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.Params', + value: Params.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.lcd.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.lcd.ts new file mode 100644 index 00000000..91a980f2 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.lcd.ts @@ -0,0 +1,72 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; + +import { + QueryFeeTokensRequest, + QueryFeeTokensResponseSDKType, + QueryDenomSpotPriceRequest, + QueryDenomSpotPriceResponseSDKType, + QueryDenomPoolIdRequest, + QueryDenomPoolIdResponseSDKType, + QueryBaseDenomRequest, + QueryBaseDenomResponseSDKType, + QueryEipBaseFeeRequest, + QueryEipBaseFeeResponseSDKType, +} from './query'; +export class LCDQueryClient { + req: LCDClient; + constructor({ requestClient }: { requestClient: LCDClient }) { + this.req = requestClient; + this.feeTokens = this.feeTokens.bind(this); + this.denomSpotPrice = this.denomSpotPrice.bind(this); + this.denomPoolId = this.denomPoolId.bind(this); + this.baseDenom = this.baseDenom.bind(this); + this.getEipBaseFee = this.getEipBaseFee.bind(this); + } + /* FeeTokens returns a list of all the whitelisted fee tokens and their + corresponding pools. It does not include the BaseDenom, which has its own + query endpoint */ + async feeTokens( + _params: QueryFeeTokensRequest = {} + ): Promise { + const endpoint = `osmosis/txfees/v1beta1/fee_tokens`; + return await this.req.get(endpoint); + } + /* DenomSpotPrice returns all spot prices by each registered token denom. */ + async denomSpotPrice( + params: QueryDenomSpotPriceRequest + ): Promise { + const options: any = { + params: {}, + }; + if (typeof params?.denom !== 'undefined') { + options.params.denom = params.denom; + } + const endpoint = `osmosis/txfees/v1beta1/spot_price_by_denom`; + return await this.req.get( + endpoint, + options + ); + } + /* Returns the poolID for a specified denom input. */ + async denomPoolId( + params: QueryDenomPoolIdRequest + ): Promise { + const endpoint = `osmosis/txfees/v1beta1/denom_pool_id/${params.denom}`; + return await this.req.get(endpoint); + } + /* Returns a list of all base denom tokens and their corresponding pools. */ + async baseDenom( + _params: QueryBaseDenomRequest = {} + ): Promise { + const endpoint = `osmosis/txfees/v1beta1/base_denom`; + return await this.req.get(endpoint); + } + /* Returns a list of all base denom tokens and their corresponding pools. */ + async getEipBaseFee( + _params: QueryEipBaseFeeRequest = {} + ): Promise { + const endpoint = `osmosis/txfees/v1beta1/cur_eip_base_fee`; + return await this.req.get(endpoint); + } +} diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.rpc.Query.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..2b130b65 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.rpc.Query.ts @@ -0,0 +1,266 @@ +//@ts-nocheck +import { + QueryClient, + createProtobufRpcClient, + ProtobufRpcClient, +} from '@cosmjs/stargate'; +import { useQuery } from '@tanstack/react-query'; + +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; +import { ReactQueryParams } from '../../../react-query'; + +import { + QueryFeeTokensRequest, + QueryFeeTokensResponse, + QueryDenomSpotPriceRequest, + QueryDenomSpotPriceResponse, + QueryDenomPoolIdRequest, + QueryDenomPoolIdResponse, + QueryBaseDenomRequest, + QueryBaseDenomResponse, + QueryEipBaseFeeRequest, + QueryEipBaseFeeResponse, +} from './query'; +export interface Query { + /** + * FeeTokens returns a list of all the whitelisted fee tokens and their + * corresponding pools. It does not include the BaseDenom, which has its own + * query endpoint + */ + feeTokens(request?: QueryFeeTokensRequest): Promise; + /** DenomSpotPrice returns all spot prices by each registered token denom. */ + denomSpotPrice( + request: QueryDenomSpotPriceRequest + ): Promise; + /** Returns the poolID for a specified denom input. */ + denomPoolId( + request: QueryDenomPoolIdRequest + ): Promise; + /** Returns a list of all base denom tokens and their corresponding pools. */ + baseDenom(request?: QueryBaseDenomRequest): Promise; + /** Returns a list of all base denom tokens and their corresponding pools. */ + getEipBaseFee( + request?: QueryEipBaseFeeRequest + ): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.feeTokens = this.feeTokens.bind(this); + this.denomSpotPrice = this.denomSpotPrice.bind(this); + this.denomPoolId = this.denomPoolId.bind(this); + this.baseDenom = this.baseDenom.bind(this); + this.getEipBaseFee = this.getEipBaseFee.bind(this); + } + feeTokens( + request: QueryFeeTokensRequest = {} + ): Promise { + const data = QueryFeeTokensRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.txfees.v1beta1.Query', + 'FeeTokens', + data + ); + return promise.then((data) => + QueryFeeTokensResponse.decode(new BinaryReader(data)) + ); + } + denomSpotPrice( + request: QueryDenomSpotPriceRequest + ): Promise { + const data = QueryDenomSpotPriceRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.txfees.v1beta1.Query', + 'DenomSpotPrice', + data + ); + return promise.then((data) => + QueryDenomSpotPriceResponse.decode(new BinaryReader(data)) + ); + } + denomPoolId( + request: QueryDenomPoolIdRequest + ): Promise { + const data = QueryDenomPoolIdRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.txfees.v1beta1.Query', + 'DenomPoolId', + data + ); + return promise.then((data) => + QueryDenomPoolIdResponse.decode(new BinaryReader(data)) + ); + } + baseDenom( + request: QueryBaseDenomRequest = {} + ): Promise { + const data = QueryBaseDenomRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.txfees.v1beta1.Query', + 'BaseDenom', + data + ); + return promise.then((data) => + QueryBaseDenomResponse.decode(new BinaryReader(data)) + ); + } + getEipBaseFee( + request: QueryEipBaseFeeRequest = {} + ): Promise { + const data = QueryEipBaseFeeRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.txfees.v1beta1.Query', + 'GetEipBaseFee', + data + ); + return promise.then((data) => + QueryEipBaseFeeResponse.decode(new BinaryReader(data)) + ); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + feeTokens( + request?: QueryFeeTokensRequest + ): Promise { + return queryService.feeTokens(request); + }, + denomSpotPrice( + request: QueryDenomSpotPriceRequest + ): Promise { + return queryService.denomSpotPrice(request); + }, + denomPoolId( + request: QueryDenomPoolIdRequest + ): Promise { + return queryService.denomPoolId(request); + }, + baseDenom( + request?: QueryBaseDenomRequest + ): Promise { + return queryService.baseDenom(request); + }, + getEipBaseFee( + request?: QueryEipBaseFeeRequest + ): Promise { + return queryService.getEipBaseFee(request); + }, + }; +}; +export interface UseFeeTokensQuery + extends ReactQueryParams { + request?: QueryFeeTokensRequest; +} +export interface UseDenomSpotPriceQuery + extends ReactQueryParams { + request: QueryDenomSpotPriceRequest; +} +export interface UseDenomPoolIdQuery + extends ReactQueryParams { + request: QueryDenomPoolIdRequest; +} +export interface UseBaseDenomQuery + extends ReactQueryParams { + request?: QueryBaseDenomRequest; +} +export interface UseGetEipBaseFeeQuery + extends ReactQueryParams { + request?: QueryEipBaseFeeRequest; +} +const _queryClients: WeakMap = + new WeakMap(); +const getQueryService = ( + rpc: ProtobufRpcClient | undefined +): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useFeeTokens = ({ + request, + options, + }: UseFeeTokensQuery) => { + return useQuery( + ['feeTokensQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.feeTokens(request); + }, + options + ); + }; + const useDenomSpotPrice = ({ + request, + options, + }: UseDenomSpotPriceQuery) => { + return useQuery( + ['denomSpotPriceQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.denomSpotPrice(request); + }, + options + ); + }; + const useDenomPoolId = ({ + request, + options, + }: UseDenomPoolIdQuery) => { + return useQuery( + ['denomPoolIdQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.denomPoolId(request); + }, + options + ); + }; + const useBaseDenom = ({ + request, + options, + }: UseBaseDenomQuery) => { + return useQuery( + ['baseDenomQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.baseDenom(request); + }, + options + ); + }; + const useGetEipBaseFee = ({ + request, + options, + }: UseGetEipBaseFeeQuery) => { + return useQuery( + ['getEipBaseFeeQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.getEipBaseFee(request); + }, + options + ); + }; + return { + /** + * FeeTokens returns a list of all the whitelisted fee tokens and their + * corresponding pools. It does not include the BaseDenom, which has its own + * query endpoint + */ + useFeeTokens, + /** DenomSpotPrice returns all spot prices by each registered token denom. */ useDenomSpotPrice, + /** Returns the poolID for a specified denom input. */ useDenomPoolId, + /** Returns a list of all base denom tokens and their corresponding pools. */ useBaseDenom, + /** Returns a list of all base denom tokens and their corresponding pools. */ useGetEipBaseFee, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.ts new file mode 100644 index 00000000..fb305662 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/query.ts @@ -0,0 +1,1272 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from './feetoken'; + +export interface QueryFeeTokensRequest {} +export interface QueryFeeTokensRequestProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryFeeTokensRequest'; + value: Uint8Array; +} +export interface QueryFeeTokensRequestAmino {} +export interface QueryFeeTokensRequestAminoMsg { + type: 'osmosis/txfees/query-fee-tokens-request'; + value: QueryFeeTokensRequestAmino; +} +export interface QueryFeeTokensRequestSDKType {} +export interface QueryFeeTokensResponse { + feeTokens: FeeToken[]; +} +export interface QueryFeeTokensResponseProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryFeeTokensResponse'; + value: Uint8Array; +} +export interface QueryFeeTokensResponseAmino { + fee_tokens?: FeeTokenAmino[]; +} +export interface QueryFeeTokensResponseAminoMsg { + type: 'osmosis/txfees/query-fee-tokens-response'; + value: QueryFeeTokensResponseAmino; +} +export interface QueryFeeTokensResponseSDKType { + fee_tokens: FeeTokenSDKType[]; +} +/** + * QueryDenomSpotPriceRequest defines grpc request structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceRequest { + denom: string; +} +export interface QueryDenomSpotPriceRequestProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomSpotPriceRequest'; + value: Uint8Array; +} +/** + * QueryDenomSpotPriceRequest defines grpc request structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceRequestAmino { + denom?: string; +} +export interface QueryDenomSpotPriceRequestAminoMsg { + type: 'osmosis/txfees/query-denom-spot-price-request'; + value: QueryDenomSpotPriceRequestAmino; +} +/** + * QueryDenomSpotPriceRequest defines grpc request structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceRequestSDKType { + denom: string; +} +/** + * QueryDenomSpotPriceRequest defines grpc response structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceResponse { + poolID: bigint; + spotPrice: string; +} +export interface QueryDenomSpotPriceResponseProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomSpotPriceResponse'; + value: Uint8Array; +} +/** + * QueryDenomSpotPriceRequest defines grpc response structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceResponseAmino { + poolID?: string; + spot_price?: string; +} +export interface QueryDenomSpotPriceResponseAminoMsg { + type: 'osmosis/txfees/query-denom-spot-price-response'; + value: QueryDenomSpotPriceResponseAmino; +} +/** + * QueryDenomSpotPriceRequest defines grpc response structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceResponseSDKType { + poolID: bigint; + spot_price: string; +} +export interface QueryDenomPoolIdRequest { + denom: string; +} +export interface QueryDenomPoolIdRequestProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomPoolIdRequest'; + value: Uint8Array; +} +export interface QueryDenomPoolIdRequestAmino { + denom?: string; +} +export interface QueryDenomPoolIdRequestAminoMsg { + type: 'osmosis/txfees/query-denom-pool-id-request'; + value: QueryDenomPoolIdRequestAmino; +} +export interface QueryDenomPoolIdRequestSDKType { + denom: string; +} +export interface QueryDenomPoolIdResponse { + poolID: bigint; +} +export interface QueryDenomPoolIdResponseProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomPoolIdResponse'; + value: Uint8Array; +} +export interface QueryDenomPoolIdResponseAmino { + poolID?: string; +} +export interface QueryDenomPoolIdResponseAminoMsg { + type: 'osmosis/txfees/query-denom-pool-id-response'; + value: QueryDenomPoolIdResponseAmino; +} +export interface QueryDenomPoolIdResponseSDKType { + poolID: bigint; +} +export interface QueryBaseDenomRequest {} +export interface QueryBaseDenomRequestProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryBaseDenomRequest'; + value: Uint8Array; +} +export interface QueryBaseDenomRequestAmino {} +export interface QueryBaseDenomRequestAminoMsg { + type: 'osmosis/txfees/query-base-denom-request'; + value: QueryBaseDenomRequestAmino; +} +export interface QueryBaseDenomRequestSDKType {} +export interface QueryBaseDenomResponse { + baseDenom: string; +} +export interface QueryBaseDenomResponseProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryBaseDenomResponse'; + value: Uint8Array; +} +export interface QueryBaseDenomResponseAmino { + base_denom?: string; +} +export interface QueryBaseDenomResponseAminoMsg { + type: 'osmosis/txfees/query-base-denom-response'; + value: QueryBaseDenomResponseAmino; +} +export interface QueryBaseDenomResponseSDKType { + base_denom: string; +} +export interface QueryEipBaseFeeRequest {} +export interface QueryEipBaseFeeRequestProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest'; + value: Uint8Array; +} +export interface QueryEipBaseFeeRequestAmino {} +export interface QueryEipBaseFeeRequestAminoMsg { + type: 'osmosis/txfees/query-eip-base-fee-request'; + value: QueryEipBaseFeeRequestAmino; +} +export interface QueryEipBaseFeeRequestSDKType {} +export interface QueryEipBaseFeeResponse { + baseFee: string; +} +export interface QueryEipBaseFeeResponseProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse'; + value: Uint8Array; +} +export interface QueryEipBaseFeeResponseAmino { + base_fee?: string; +} +export interface QueryEipBaseFeeResponseAminoMsg { + type: 'osmosis/txfees/query-eip-base-fee-response'; + value: QueryEipBaseFeeResponseAmino; +} +export interface QueryEipBaseFeeResponseSDKType { + base_fee: string; +} +function createBaseQueryFeeTokensRequest(): QueryFeeTokensRequest { + return {}; +} +export const QueryFeeTokensRequest = { + typeUrl: '/osmosis.txfees.v1beta1.QueryFeeTokensRequest', + aminoType: 'osmosis/txfees/query-fee-tokens-request', + is(o: any): o is QueryFeeTokensRequest { + return o && o.$typeUrl === QueryFeeTokensRequest.typeUrl; + }, + isSDK(o: any): o is QueryFeeTokensRequestSDKType { + return o && o.$typeUrl === QueryFeeTokensRequest.typeUrl; + }, + isAmino(o: any): o is QueryFeeTokensRequestAmino { + return o && o.$typeUrl === QueryFeeTokensRequest.typeUrl; + }, + encode( + _: QueryFeeTokensRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryFeeTokensRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeTokensRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryFeeTokensRequest { + const message = createBaseQueryFeeTokensRequest(); + return message; + }, + fromAmino(_: QueryFeeTokensRequestAmino): QueryFeeTokensRequest { + const message = createBaseQueryFeeTokensRequest(); + return message; + }, + toAmino(_: QueryFeeTokensRequest): QueryFeeTokensRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryFeeTokensRequestAminoMsg): QueryFeeTokensRequest { + return QueryFeeTokensRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryFeeTokensRequest): QueryFeeTokensRequestAminoMsg { + return { + type: 'osmosis/txfees/query-fee-tokens-request', + value: QueryFeeTokensRequest.toAmino(message), + }; + }, + fromProtoMsg(message: QueryFeeTokensRequestProtoMsg): QueryFeeTokensRequest { + return QueryFeeTokensRequest.decode(message.value); + }, + toProto(message: QueryFeeTokensRequest): Uint8Array { + return QueryFeeTokensRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeTokensRequest): QueryFeeTokensRequestProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryFeeTokensRequest', + value: QueryFeeTokensRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryFeeTokensRequest.typeUrl, + QueryFeeTokensRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryFeeTokensRequest.aminoType, + QueryFeeTokensRequest.typeUrl +); +function createBaseQueryFeeTokensResponse(): QueryFeeTokensResponse { + return { + feeTokens: [], + }; +} +export const QueryFeeTokensResponse = { + typeUrl: '/osmosis.txfees.v1beta1.QueryFeeTokensResponse', + aminoType: 'osmosis/txfees/query-fee-tokens-response', + is(o: any): o is QueryFeeTokensResponse { + return ( + o && + (o.$typeUrl === QueryFeeTokensResponse.typeUrl || + (Array.isArray(o.feeTokens) && + (!o.feeTokens.length || FeeToken.is(o.feeTokens[0])))) + ); + }, + isSDK(o: any): o is QueryFeeTokensResponseSDKType { + return ( + o && + (o.$typeUrl === QueryFeeTokensResponse.typeUrl || + (Array.isArray(o.fee_tokens) && + (!o.fee_tokens.length || FeeToken.isSDK(o.fee_tokens[0])))) + ); + }, + isAmino(o: any): o is QueryFeeTokensResponseAmino { + return ( + o && + (o.$typeUrl === QueryFeeTokensResponse.typeUrl || + (Array.isArray(o.fee_tokens) && + (!o.fee_tokens.length || FeeToken.isAmino(o.fee_tokens[0])))) + ); + }, + encode( + message: QueryFeeTokensResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.feeTokens) { + FeeToken.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryFeeTokensResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeTokensResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feeTokens.push(FeeToken.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryFeeTokensResponse { + const message = createBaseQueryFeeTokensResponse(); + message.feeTokens = + object.feeTokens?.map((e) => FeeToken.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryFeeTokensResponseAmino): QueryFeeTokensResponse { + const message = createBaseQueryFeeTokensResponse(); + message.feeTokens = + object.fee_tokens?.map((e) => FeeToken.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryFeeTokensResponse): QueryFeeTokensResponseAmino { + const obj: any = {}; + if (message.feeTokens) { + obj.fee_tokens = message.feeTokens.map((e) => + e ? FeeToken.toAmino(e) : undefined + ); + } else { + obj.fee_tokens = message.feeTokens; + } + return obj; + }, + fromAminoMsg(object: QueryFeeTokensResponseAminoMsg): QueryFeeTokensResponse { + return QueryFeeTokensResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryFeeTokensResponse): QueryFeeTokensResponseAminoMsg { + return { + type: 'osmosis/txfees/query-fee-tokens-response', + value: QueryFeeTokensResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryFeeTokensResponseProtoMsg + ): QueryFeeTokensResponse { + return QueryFeeTokensResponse.decode(message.value); + }, + toProto(message: QueryFeeTokensResponse): Uint8Array { + return QueryFeeTokensResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeTokensResponse): QueryFeeTokensResponseProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryFeeTokensResponse', + value: QueryFeeTokensResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryFeeTokensResponse.typeUrl, + QueryFeeTokensResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryFeeTokensResponse.aminoType, + QueryFeeTokensResponse.typeUrl +); +function createBaseQueryDenomSpotPriceRequest(): QueryDenomSpotPriceRequest { + return { + denom: '', + }; +} +export const QueryDenomSpotPriceRequest = { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomSpotPriceRequest', + aminoType: 'osmosis/txfees/query-denom-spot-price-request', + is(o: any): o is QueryDenomSpotPriceRequest { + return ( + o && + (o.$typeUrl === QueryDenomSpotPriceRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isSDK(o: any): o is QueryDenomSpotPriceRequestSDKType { + return ( + o && + (o.$typeUrl === QueryDenomSpotPriceRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isAmino(o: any): o is QueryDenomSpotPriceRequestAmino { + return ( + o && + (o.$typeUrl === QueryDenomSpotPriceRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + encode( + message: QueryDenomSpotPriceRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomSpotPriceRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomSpotPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomSpotPriceRequest { + const message = createBaseQueryDenomSpotPriceRequest(); + message.denom = object.denom ?? ''; + return message; + }, + fromAmino( + object: QueryDenomSpotPriceRequestAmino + ): QueryDenomSpotPriceRequest { + const message = createBaseQueryDenomSpotPriceRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino( + message: QueryDenomSpotPriceRequest + ): QueryDenomSpotPriceRequestAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + return obj; + }, + fromAminoMsg( + object: QueryDenomSpotPriceRequestAminoMsg + ): QueryDenomSpotPriceRequest { + return QueryDenomSpotPriceRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomSpotPriceRequest + ): QueryDenomSpotPriceRequestAminoMsg { + return { + type: 'osmosis/txfees/query-denom-spot-price-request', + value: QueryDenomSpotPriceRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomSpotPriceRequestProtoMsg + ): QueryDenomSpotPriceRequest { + return QueryDenomSpotPriceRequest.decode(message.value); + }, + toProto(message: QueryDenomSpotPriceRequest): Uint8Array { + return QueryDenomSpotPriceRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomSpotPriceRequest + ): QueryDenomSpotPriceRequestProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomSpotPriceRequest', + value: QueryDenomSpotPriceRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomSpotPriceRequest.typeUrl, + QueryDenomSpotPriceRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomSpotPriceRequest.aminoType, + QueryDenomSpotPriceRequest.typeUrl +); +function createBaseQueryDenomSpotPriceResponse(): QueryDenomSpotPriceResponse { + return { + poolID: BigInt(0), + spotPrice: '', + }; +} +export const QueryDenomSpotPriceResponse = { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomSpotPriceResponse', + aminoType: 'osmosis/txfees/query-denom-spot-price-response', + is(o: any): o is QueryDenomSpotPriceResponse { + return ( + o && + (o.$typeUrl === QueryDenomSpotPriceResponse.typeUrl || + (typeof o.poolID === 'bigint' && typeof o.spotPrice === 'string')) + ); + }, + isSDK(o: any): o is QueryDenomSpotPriceResponseSDKType { + return ( + o && + (o.$typeUrl === QueryDenomSpotPriceResponse.typeUrl || + (typeof o.poolID === 'bigint' && typeof o.spot_price === 'string')) + ); + }, + isAmino(o: any): o is QueryDenomSpotPriceResponseAmino { + return ( + o && + (o.$typeUrl === QueryDenomSpotPriceResponse.typeUrl || + (typeof o.poolID === 'bigint' && typeof o.spot_price === 'string')) + ); + }, + encode( + message: QueryDenomSpotPriceResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolID !== BigInt(0)) { + writer.uint32(8).uint64(message.poolID); + } + if (message.spotPrice !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.spotPrice, 18).atomics); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomSpotPriceResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomSpotPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolID = reader.uint64(); + break; + case 2: + message.spotPrice = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomSpotPriceResponse { + const message = createBaseQueryDenomSpotPriceResponse(); + message.poolID = + object.poolID !== undefined && object.poolID !== null + ? BigInt(object.poolID.toString()) + : BigInt(0); + message.spotPrice = object.spotPrice ?? ''; + return message; + }, + fromAmino( + object: QueryDenomSpotPriceResponseAmino + ): QueryDenomSpotPriceResponse { + const message = createBaseQueryDenomSpotPriceResponse(); + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; + }, + toAmino( + message: QueryDenomSpotPriceResponse + ): QueryDenomSpotPriceResponseAmino { + const obj: any = {}; + obj.poolID = + message.poolID !== BigInt(0) ? message.poolID.toString() : undefined; + obj.spot_price = message.spotPrice === '' ? undefined : message.spotPrice; + return obj; + }, + fromAminoMsg( + object: QueryDenomSpotPriceResponseAminoMsg + ): QueryDenomSpotPriceResponse { + return QueryDenomSpotPriceResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomSpotPriceResponse + ): QueryDenomSpotPriceResponseAminoMsg { + return { + type: 'osmosis/txfees/query-denom-spot-price-response', + value: QueryDenomSpotPriceResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomSpotPriceResponseProtoMsg + ): QueryDenomSpotPriceResponse { + return QueryDenomSpotPriceResponse.decode(message.value); + }, + toProto(message: QueryDenomSpotPriceResponse): Uint8Array { + return QueryDenomSpotPriceResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomSpotPriceResponse + ): QueryDenomSpotPriceResponseProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomSpotPriceResponse', + value: QueryDenomSpotPriceResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomSpotPriceResponse.typeUrl, + QueryDenomSpotPriceResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomSpotPriceResponse.aminoType, + QueryDenomSpotPriceResponse.typeUrl +); +function createBaseQueryDenomPoolIdRequest(): QueryDenomPoolIdRequest { + return { + denom: '', + }; +} +export const QueryDenomPoolIdRequest = { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomPoolIdRequest', + aminoType: 'osmosis/txfees/query-denom-pool-id-request', + is(o: any): o is QueryDenomPoolIdRequest { + return ( + o && + (o.$typeUrl === QueryDenomPoolIdRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isSDK(o: any): o is QueryDenomPoolIdRequestSDKType { + return ( + o && + (o.$typeUrl === QueryDenomPoolIdRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + isAmino(o: any): o is QueryDenomPoolIdRequestAmino { + return ( + o && + (o.$typeUrl === QueryDenomPoolIdRequest.typeUrl || + typeof o.denom === 'string') + ); + }, + encode( + message: QueryDenomPoolIdRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== '') { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomPoolIdRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomPoolIdRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomPoolIdRequest { + const message = createBaseQueryDenomPoolIdRequest(); + message.denom = object.denom ?? ''; + return message; + }, + fromAmino(object: QueryDenomPoolIdRequestAmino): QueryDenomPoolIdRequest { + const message = createBaseQueryDenomPoolIdRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomPoolIdRequest): QueryDenomPoolIdRequestAmino { + const obj: any = {}; + obj.denom = message.denom === '' ? undefined : message.denom; + return obj; + }, + fromAminoMsg( + object: QueryDenomPoolIdRequestAminoMsg + ): QueryDenomPoolIdRequest { + return QueryDenomPoolIdRequest.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomPoolIdRequest + ): QueryDenomPoolIdRequestAminoMsg { + return { + type: 'osmosis/txfees/query-denom-pool-id-request', + value: QueryDenomPoolIdRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomPoolIdRequestProtoMsg + ): QueryDenomPoolIdRequest { + return QueryDenomPoolIdRequest.decode(message.value); + }, + toProto(message: QueryDenomPoolIdRequest): Uint8Array { + return QueryDenomPoolIdRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomPoolIdRequest + ): QueryDenomPoolIdRequestProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomPoolIdRequest', + value: QueryDenomPoolIdRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomPoolIdRequest.typeUrl, + QueryDenomPoolIdRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomPoolIdRequest.aminoType, + QueryDenomPoolIdRequest.typeUrl +); +function createBaseQueryDenomPoolIdResponse(): QueryDenomPoolIdResponse { + return { + poolID: BigInt(0), + }; +} +export const QueryDenomPoolIdResponse = { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomPoolIdResponse', + aminoType: 'osmosis/txfees/query-denom-pool-id-response', + is(o: any): o is QueryDenomPoolIdResponse { + return ( + o && + (o.$typeUrl === QueryDenomPoolIdResponse.typeUrl || + typeof o.poolID === 'bigint') + ); + }, + isSDK(o: any): o is QueryDenomPoolIdResponseSDKType { + return ( + o && + (o.$typeUrl === QueryDenomPoolIdResponse.typeUrl || + typeof o.poolID === 'bigint') + ); + }, + isAmino(o: any): o is QueryDenomPoolIdResponseAmino { + return ( + o && + (o.$typeUrl === QueryDenomPoolIdResponse.typeUrl || + typeof o.poolID === 'bigint') + ); + }, + encode( + message: QueryDenomPoolIdResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.poolID !== BigInt(0)) { + writer.uint32(8).uint64(message.poolID); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryDenomPoolIdResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomPoolIdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryDenomPoolIdResponse { + const message = createBaseQueryDenomPoolIdResponse(); + message.poolID = + object.poolID !== undefined && object.poolID !== null + ? BigInt(object.poolID.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: QueryDenomPoolIdResponseAmino): QueryDenomPoolIdResponse { + const message = createBaseQueryDenomPoolIdResponse(); + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + return message; + }, + toAmino(message: QueryDenomPoolIdResponse): QueryDenomPoolIdResponseAmino { + const obj: any = {}; + obj.poolID = + message.poolID !== BigInt(0) ? message.poolID.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: QueryDenomPoolIdResponseAminoMsg + ): QueryDenomPoolIdResponse { + return QueryDenomPoolIdResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryDenomPoolIdResponse + ): QueryDenomPoolIdResponseAminoMsg { + return { + type: 'osmosis/txfees/query-denom-pool-id-response', + value: QueryDenomPoolIdResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryDenomPoolIdResponseProtoMsg + ): QueryDenomPoolIdResponse { + return QueryDenomPoolIdResponse.decode(message.value); + }, + toProto(message: QueryDenomPoolIdResponse): Uint8Array { + return QueryDenomPoolIdResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryDenomPoolIdResponse + ): QueryDenomPoolIdResponseProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryDenomPoolIdResponse', + value: QueryDenomPoolIdResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryDenomPoolIdResponse.typeUrl, + QueryDenomPoolIdResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryDenomPoolIdResponse.aminoType, + QueryDenomPoolIdResponse.typeUrl +); +function createBaseQueryBaseDenomRequest(): QueryBaseDenomRequest { + return {}; +} +export const QueryBaseDenomRequest = { + typeUrl: '/osmosis.txfees.v1beta1.QueryBaseDenomRequest', + aminoType: 'osmosis/txfees/query-base-denom-request', + is(o: any): o is QueryBaseDenomRequest { + return o && o.$typeUrl === QueryBaseDenomRequest.typeUrl; + }, + isSDK(o: any): o is QueryBaseDenomRequestSDKType { + return o && o.$typeUrl === QueryBaseDenomRequest.typeUrl; + }, + isAmino(o: any): o is QueryBaseDenomRequestAmino { + return o && o.$typeUrl === QueryBaseDenomRequest.typeUrl; + }, + encode( + _: QueryBaseDenomRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryBaseDenomRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBaseDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryBaseDenomRequest { + const message = createBaseQueryBaseDenomRequest(); + return message; + }, + fromAmino(_: QueryBaseDenomRequestAmino): QueryBaseDenomRequest { + const message = createBaseQueryBaseDenomRequest(); + return message; + }, + toAmino(_: QueryBaseDenomRequest): QueryBaseDenomRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBaseDenomRequestAminoMsg): QueryBaseDenomRequest { + return QueryBaseDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryBaseDenomRequest): QueryBaseDenomRequestAminoMsg { + return { + type: 'osmosis/txfees/query-base-denom-request', + value: QueryBaseDenomRequest.toAmino(message), + }; + }, + fromProtoMsg(message: QueryBaseDenomRequestProtoMsg): QueryBaseDenomRequest { + return QueryBaseDenomRequest.decode(message.value); + }, + toProto(message: QueryBaseDenomRequest): Uint8Array { + return QueryBaseDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBaseDenomRequest): QueryBaseDenomRequestProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryBaseDenomRequest', + value: QueryBaseDenomRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryBaseDenomRequest.typeUrl, + QueryBaseDenomRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryBaseDenomRequest.aminoType, + QueryBaseDenomRequest.typeUrl +); +function createBaseQueryBaseDenomResponse(): QueryBaseDenomResponse { + return { + baseDenom: '', + }; +} +export const QueryBaseDenomResponse = { + typeUrl: '/osmosis.txfees.v1beta1.QueryBaseDenomResponse', + aminoType: 'osmosis/txfees/query-base-denom-response', + is(o: any): o is QueryBaseDenomResponse { + return ( + o && + (o.$typeUrl === QueryBaseDenomResponse.typeUrl || + typeof o.baseDenom === 'string') + ); + }, + isSDK(o: any): o is QueryBaseDenomResponseSDKType { + return ( + o && + (o.$typeUrl === QueryBaseDenomResponse.typeUrl || + typeof o.base_denom === 'string') + ); + }, + isAmino(o: any): o is QueryBaseDenomResponseAmino { + return ( + o && + (o.$typeUrl === QueryBaseDenomResponse.typeUrl || + typeof o.base_denom === 'string') + ); + }, + encode( + message: QueryBaseDenomResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.baseDenom !== '') { + writer.uint32(10).string(message.baseDenom); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryBaseDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBaseDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBaseDenomResponse { + const message = createBaseQueryBaseDenomResponse(); + message.baseDenom = object.baseDenom ?? ''; + return message; + }, + fromAmino(object: QueryBaseDenomResponseAmino): QueryBaseDenomResponse { + const message = createBaseQueryBaseDenomResponse(); + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; + }, + toAmino(message: QueryBaseDenomResponse): QueryBaseDenomResponseAmino { + const obj: any = {}; + obj.base_denom = message.baseDenom === '' ? undefined : message.baseDenom; + return obj; + }, + fromAminoMsg(object: QueryBaseDenomResponseAminoMsg): QueryBaseDenomResponse { + return QueryBaseDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryBaseDenomResponse): QueryBaseDenomResponseAminoMsg { + return { + type: 'osmosis/txfees/query-base-denom-response', + value: QueryBaseDenomResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryBaseDenomResponseProtoMsg + ): QueryBaseDenomResponse { + return QueryBaseDenomResponse.decode(message.value); + }, + toProto(message: QueryBaseDenomResponse): Uint8Array { + return QueryBaseDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBaseDenomResponse): QueryBaseDenomResponseProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryBaseDenomResponse', + value: QueryBaseDenomResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryBaseDenomResponse.typeUrl, + QueryBaseDenomResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryBaseDenomResponse.aminoType, + QueryBaseDenomResponse.typeUrl +); +function createBaseQueryEipBaseFeeRequest(): QueryEipBaseFeeRequest { + return {}; +} +export const QueryEipBaseFeeRequest = { + typeUrl: '/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest', + aminoType: 'osmosis/txfees/query-eip-base-fee-request', + is(o: any): o is QueryEipBaseFeeRequest { + return o && o.$typeUrl === QueryEipBaseFeeRequest.typeUrl; + }, + isSDK(o: any): o is QueryEipBaseFeeRequestSDKType { + return o && o.$typeUrl === QueryEipBaseFeeRequest.typeUrl; + }, + isAmino(o: any): o is QueryEipBaseFeeRequestAmino { + return o && o.$typeUrl === QueryEipBaseFeeRequest.typeUrl; + }, + encode( + _: QueryEipBaseFeeRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryEipBaseFeeRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + fromAmino(_: QueryEipBaseFeeRequestAmino): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + toAmino(_: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryEipBaseFeeRequestAminoMsg): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestAminoMsg { + return { + type: 'osmosis/txfees/query-eip-base-fee-request', + value: QueryEipBaseFeeRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryEipBaseFeeRequestProtoMsg + ): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.decode(message.value); + }, + toProto(message: QueryEipBaseFeeRequest): Uint8Array { + return QueryEipBaseFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest', + value: QueryEipBaseFeeRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryEipBaseFeeRequest.typeUrl, + QueryEipBaseFeeRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryEipBaseFeeRequest.aminoType, + QueryEipBaseFeeRequest.typeUrl +); +function createBaseQueryEipBaseFeeResponse(): QueryEipBaseFeeResponse { + return { + baseFee: '', + }; +} +export const QueryEipBaseFeeResponse = { + typeUrl: '/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse', + aminoType: 'osmosis/txfees/query-eip-base-fee-response', + is(o: any): o is QueryEipBaseFeeResponse { + return ( + o && + (o.$typeUrl === QueryEipBaseFeeResponse.typeUrl || + typeof o.baseFee === 'string') + ); + }, + isSDK(o: any): o is QueryEipBaseFeeResponseSDKType { + return ( + o && + (o.$typeUrl === QueryEipBaseFeeResponse.typeUrl || + typeof o.base_fee === 'string') + ); + }, + isAmino(o: any): o is QueryEipBaseFeeResponseAmino { + return ( + o && + (o.$typeUrl === QueryEipBaseFeeResponse.typeUrl || + typeof o.base_fee === 'string') + ); + }, + encode( + message: QueryEipBaseFeeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.baseFee !== '') { + writer + .uint32(10) + .string(Decimal.fromUserInput(message.baseFee, 18).atomics); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): QueryEipBaseFeeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + message.baseFee = object.baseFee ?? ''; + return message; + }, + fromAmino(object: QueryEipBaseFeeResponseAmino): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + if (object.base_fee !== undefined && object.base_fee !== null) { + message.baseFee = object.base_fee; + } + return message; + }, + toAmino(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseAmino { + const obj: any = {}; + obj.base_fee = message.baseFee === '' ? undefined : message.baseFee; + return obj; + }, + fromAminoMsg( + object: QueryEipBaseFeeResponseAminoMsg + ): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: QueryEipBaseFeeResponse + ): QueryEipBaseFeeResponseAminoMsg { + return { + type: 'osmosis/txfees/query-eip-base-fee-response', + value: QueryEipBaseFeeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: QueryEipBaseFeeResponseProtoMsg + ): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.decode(message.value); + }, + toProto(message: QueryEipBaseFeeResponse): Uint8Array { + return QueryEipBaseFeeResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryEipBaseFeeResponse + ): QueryEipBaseFeeResponseProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse', + value: QueryEipBaseFeeResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + QueryEipBaseFeeResponse.typeUrl, + QueryEipBaseFeeResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryEipBaseFeeResponse.aminoType, + QueryEipBaseFeeResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.amino.ts new file mode 100644 index 00000000..ceeac917 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgSetFeeTokens } from './tx'; +export const AminoConverter = { + '/osmosis.txfees.v1beta1.MsgSetFeeTokens': { + aminoType: 'osmosis/set-fee-tokens', + toAmino: MsgSetFeeTokens.toAmino, + fromAmino: MsgSetFeeTokens.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.registry.ts new file mode 100644 index 00000000..87b32630 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.registry.ts @@ -0,0 +1,38 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { MsgSetFeeTokens } from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.txfees.v1beta1.MsgSetFeeTokens', MsgSetFeeTokens], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value: MsgSetFeeTokens.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value, + }; + }, + }, + fromPartial: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value: MsgSetFeeTokens.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..d208d571 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; + +import { MsgSetFeeTokens, MsgSetFeeTokensResponse } from './tx'; +export interface Msg { + setFeeTokens(request: MsgSetFeeTokens): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setFeeTokens = this.setFeeTokens.bind(this); + } + setFeeTokens(request: MsgSetFeeTokens): Promise { + const data = MsgSetFeeTokens.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.txfees.v1beta1.Msg', + 'SetFeeTokens', + data + ); + return promise.then((data) => + MsgSetFeeTokensResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.ts new file mode 100644 index 00000000..61910625 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/txfees/v1beta1/tx.ts @@ -0,0 +1,252 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from './feetoken'; +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokens { + feeTokens: FeeToken[]; + sender: string; +} +export interface MsgSetFeeTokensProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens'; + value: Uint8Array; +} +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokensAmino { + fee_tokens?: FeeTokenAmino[]; + sender?: string; +} +export interface MsgSetFeeTokensAminoMsg { + type: 'osmosis/set-fee-tokens'; + value: MsgSetFeeTokensAmino; +} +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokensSDKType { + fee_tokens: FeeTokenSDKType[]; + sender: string; +} +export interface MsgSetFeeTokensResponse {} +export interface MsgSetFeeTokensResponseProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse'; + value: Uint8Array; +} +export interface MsgSetFeeTokensResponseAmino {} +export interface MsgSetFeeTokensResponseAminoMsg { + type: 'osmosis/txfees/set-fee-tokens-response'; + value: MsgSetFeeTokensResponseAmino; +} +export interface MsgSetFeeTokensResponseSDKType {} +function createBaseMsgSetFeeTokens(): MsgSetFeeTokens { + return { + feeTokens: [], + sender: '', + }; +} +export const MsgSetFeeTokens = { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + aminoType: 'osmosis/set-fee-tokens', + is(o: any): o is MsgSetFeeTokens { + return ( + o && + (o.$typeUrl === MsgSetFeeTokens.typeUrl || + (Array.isArray(o.feeTokens) && + (!o.feeTokens.length || FeeToken.is(o.feeTokens[0])) && + typeof o.sender === 'string')) + ); + }, + isSDK(o: any): o is MsgSetFeeTokensSDKType { + return ( + o && + (o.$typeUrl === MsgSetFeeTokens.typeUrl || + (Array.isArray(o.fee_tokens) && + (!o.fee_tokens.length || FeeToken.isSDK(o.fee_tokens[0])) && + typeof o.sender === 'string')) + ); + }, + isAmino(o: any): o is MsgSetFeeTokensAmino { + return ( + o && + (o.$typeUrl === MsgSetFeeTokens.typeUrl || + (Array.isArray(o.fee_tokens) && + (!o.fee_tokens.length || FeeToken.isAmino(o.fee_tokens[0])) && + typeof o.sender === 'string')) + ); + }, + encode( + message: MsgSetFeeTokens, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.feeTokens) { + FeeToken.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetFeeTokens { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetFeeTokens(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feeTokens.push(FeeToken.decode(reader, reader.uint32())); + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetFeeTokens { + const message = createBaseMsgSetFeeTokens(); + message.feeTokens = + object.feeTokens?.map((e) => FeeToken.fromPartial(e)) || []; + message.sender = object.sender ?? ''; + return message; + }, + fromAmino(object: MsgSetFeeTokensAmino): MsgSetFeeTokens { + const message = createBaseMsgSetFeeTokens(); + message.feeTokens = + object.fee_tokens?.map((e) => FeeToken.fromAmino(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgSetFeeTokens): MsgSetFeeTokensAmino { + const obj: any = {}; + if (message.feeTokens) { + obj.fee_tokens = message.feeTokens.map((e) => + e ? FeeToken.toAmino(e) : undefined + ); + } else { + obj.fee_tokens = message.feeTokens; + } + obj.sender = message.sender === '' ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgSetFeeTokensAminoMsg): MsgSetFeeTokens { + return MsgSetFeeTokens.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetFeeTokens): MsgSetFeeTokensAminoMsg { + return { + type: 'osmosis/set-fee-tokens', + value: MsgSetFeeTokens.toAmino(message), + }; + }, + fromProtoMsg(message: MsgSetFeeTokensProtoMsg): MsgSetFeeTokens { + return MsgSetFeeTokens.decode(message.value); + }, + toProto(message: MsgSetFeeTokens): Uint8Array { + return MsgSetFeeTokens.encode(message).finish(); + }, + toProtoMsg(message: MsgSetFeeTokens): MsgSetFeeTokensProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value: MsgSetFeeTokens.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register(MsgSetFeeTokens.typeUrl, MsgSetFeeTokens); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetFeeTokens.aminoType, + MsgSetFeeTokens.typeUrl +); +function createBaseMsgSetFeeTokensResponse(): MsgSetFeeTokensResponse { + return {}; +} +export const MsgSetFeeTokensResponse = { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse', + aminoType: 'osmosis/txfees/set-fee-tokens-response', + is(o: any): o is MsgSetFeeTokensResponse { + return o && o.$typeUrl === MsgSetFeeTokensResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetFeeTokensResponseSDKType { + return o && o.$typeUrl === MsgSetFeeTokensResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetFeeTokensResponseAmino { + return o && o.$typeUrl === MsgSetFeeTokensResponse.typeUrl; + }, + encode( + _: MsgSetFeeTokensResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetFeeTokensResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetFeeTokensResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetFeeTokensResponse { + const message = createBaseMsgSetFeeTokensResponse(); + return message; + }, + fromAmino(_: MsgSetFeeTokensResponseAmino): MsgSetFeeTokensResponse { + const message = createBaseMsgSetFeeTokensResponse(); + return message; + }, + toAmino(_: MsgSetFeeTokensResponse): MsgSetFeeTokensResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetFeeTokensResponseAminoMsg + ): MsgSetFeeTokensResponse { + return MsgSetFeeTokensResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetFeeTokensResponse + ): MsgSetFeeTokensResponseAminoMsg { + return { + type: 'osmosis/txfees/set-fee-tokens-response', + value: MsgSetFeeTokensResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetFeeTokensResponseProtoMsg + ): MsgSetFeeTokensResponse { + return MsgSetFeeTokensResponse.decode(message.value); + }, + toProto(message: MsgSetFeeTokensResponse): Uint8Array { + return MsgSetFeeTokensResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetFeeTokensResponse + ): MsgSetFeeTokensResponseProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse', + value: MsgSetFeeTokensResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetFeeTokensResponse.typeUrl, + MsgSetFeeTokensResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetFeeTokensResponse.aminoType, + MsgSetFeeTokensResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.lcd.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.lcd.ts new file mode 100644 index 00000000..5197b42e --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.lcd.ts @@ -0,0 +1,23 @@ +//@ts-nocheck +import { LCDClient } from '@cosmology/lcd'; + +import { + UserValidatorPreferencesRequest, + UserValidatorPreferencesResponseSDKType, +} from './query'; +export class LCDQueryClient { + req: LCDClient; + constructor({ requestClient }: { requestClient: LCDClient }) { + this.req = requestClient; + this.userValidatorPreferences = this.userValidatorPreferences.bind(this); + } + /* Returns the list of ValidatorPreferences for the user. */ + async userValidatorPreferences( + params: UserValidatorPreferencesRequest + ): Promise { + const endpoint = `osmosis/valset-pref/v1beta1/${params.address}`; + return await this.req.get( + endpoint + ); + } +} diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.rpc.Query.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..d5e310e4 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.rpc.Query.ts @@ -0,0 +1,92 @@ +//@ts-nocheck +import { + QueryClient, + createProtobufRpcClient, + ProtobufRpcClient, +} from '@cosmjs/stargate'; +import { useQuery } from '@tanstack/react-query'; + +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; +import { ReactQueryParams } from '../../../react-query'; + +import { + UserValidatorPreferencesRequest, + UserValidatorPreferencesResponse, +} from './query'; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Returns the list of ValidatorPreferences for the user. */ + userValidatorPreferences( + request: UserValidatorPreferencesRequest + ): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.userValidatorPreferences = this.userValidatorPreferences.bind(this); + } + userValidatorPreferences( + request: UserValidatorPreferencesRequest + ): Promise { + const data = UserValidatorPreferencesRequest.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Query', + 'UserValidatorPreferences', + data + ); + return promise.then((data) => + UserValidatorPreferencesResponse.decode(new BinaryReader(data)) + ); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + userValidatorPreferences( + request: UserValidatorPreferencesRequest + ): Promise { + return queryService.userValidatorPreferences(request); + }, + }; +}; +export interface UseUserValidatorPreferencesQuery + extends ReactQueryParams { + request: UserValidatorPreferencesRequest; +} +const _queryClients: WeakMap = + new WeakMap(); +const getQueryService = ( + rpc: ProtobufRpcClient | undefined +): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useUserValidatorPreferences = < + TData = UserValidatorPreferencesResponse + >({ + request, + options, + }: UseUserValidatorPreferencesQuery) => { + return useQuery( + ['userValidatorPreferencesQuery', request], + () => { + if (!queryService) throw new Error('Query Service not initialized'); + return queryService.userValidatorPreferences(request); + }, + options + ); + }; + return { + /** Returns the list of ValidatorPreferences for the user. */ useUserValidatorPreferences, + }; +}; diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.ts new file mode 100644 index 00000000..a09edb2a --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/query.ts @@ -0,0 +1,304 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + ValidatorPreference, + ValidatorPreferenceAmino, + ValidatorPreferenceSDKType, +} from './state'; +/** Request type for UserValidatorPreferences. */ +export interface UserValidatorPreferencesRequest { + /** user account address */ + address: string; +} +export interface UserValidatorPreferencesRequestProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.UserValidatorPreferencesRequest'; + value: Uint8Array; +} +/** Request type for UserValidatorPreferences. */ +export interface UserValidatorPreferencesRequestAmino { + /** user account address */ + address?: string; +} +export interface UserValidatorPreferencesRequestAminoMsg { + type: 'osmosis/valsetpref/user-validator-preferences-request'; + value: UserValidatorPreferencesRequestAmino; +} +/** Request type for UserValidatorPreferences. */ +export interface UserValidatorPreferencesRequestSDKType { + address: string; +} +/** Response type the QueryUserValidatorPreferences query request */ +export interface UserValidatorPreferencesResponse { + preferences: ValidatorPreference[]; +} +export interface UserValidatorPreferencesResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.UserValidatorPreferencesResponse'; + value: Uint8Array; +} +/** Response type the QueryUserValidatorPreferences query request */ +export interface UserValidatorPreferencesResponseAmino { + preferences?: ValidatorPreferenceAmino[]; +} +export interface UserValidatorPreferencesResponseAminoMsg { + type: 'osmosis/valsetpref/user-validator-preferences-response'; + value: UserValidatorPreferencesResponseAmino; +} +/** Response type the QueryUserValidatorPreferences query request */ +export interface UserValidatorPreferencesResponseSDKType { + preferences: ValidatorPreferenceSDKType[]; +} +function createBaseUserValidatorPreferencesRequest(): UserValidatorPreferencesRequest { + return { + address: '', + }; +} +export const UserValidatorPreferencesRequest = { + typeUrl: '/osmosis.valsetpref.v1beta1.UserValidatorPreferencesRequest', + aminoType: 'osmosis/valsetpref/user-validator-preferences-request', + is(o: any): o is UserValidatorPreferencesRequest { + return ( + o && + (o.$typeUrl === UserValidatorPreferencesRequest.typeUrl || + typeof o.address === 'string') + ); + }, + isSDK(o: any): o is UserValidatorPreferencesRequestSDKType { + return ( + o && + (o.$typeUrl === UserValidatorPreferencesRequest.typeUrl || + typeof o.address === 'string') + ); + }, + isAmino(o: any): o is UserValidatorPreferencesRequestAmino { + return ( + o && + (o.$typeUrl === UserValidatorPreferencesRequest.typeUrl || + typeof o.address === 'string') + ); + }, + encode( + message: UserValidatorPreferencesRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UserValidatorPreferencesRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserValidatorPreferencesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): UserValidatorPreferencesRequest { + const message = createBaseUserValidatorPreferencesRequest(); + message.address = object.address ?? ''; + return message; + }, + fromAmino( + object: UserValidatorPreferencesRequestAmino + ): UserValidatorPreferencesRequest { + const message = createBaseUserValidatorPreferencesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino( + message: UserValidatorPreferencesRequest + ): UserValidatorPreferencesRequestAmino { + const obj: any = {}; + obj.address = message.address === '' ? undefined : message.address; + return obj; + }, + fromAminoMsg( + object: UserValidatorPreferencesRequestAminoMsg + ): UserValidatorPreferencesRequest { + return UserValidatorPreferencesRequest.fromAmino(object.value); + }, + toAminoMsg( + message: UserValidatorPreferencesRequest + ): UserValidatorPreferencesRequestAminoMsg { + return { + type: 'osmosis/valsetpref/user-validator-preferences-request', + value: UserValidatorPreferencesRequest.toAmino(message), + }; + }, + fromProtoMsg( + message: UserValidatorPreferencesRequestProtoMsg + ): UserValidatorPreferencesRequest { + return UserValidatorPreferencesRequest.decode(message.value); + }, + toProto(message: UserValidatorPreferencesRequest): Uint8Array { + return UserValidatorPreferencesRequest.encode(message).finish(); + }, + toProtoMsg( + message: UserValidatorPreferencesRequest + ): UserValidatorPreferencesRequestProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.UserValidatorPreferencesRequest', + value: UserValidatorPreferencesRequest.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + UserValidatorPreferencesRequest.typeUrl, + UserValidatorPreferencesRequest +); +GlobalDecoderRegistry.registerAminoProtoMapping( + UserValidatorPreferencesRequest.aminoType, + UserValidatorPreferencesRequest.typeUrl +); +function createBaseUserValidatorPreferencesResponse(): UserValidatorPreferencesResponse { + return { + preferences: [], + }; +} +export const UserValidatorPreferencesResponse = { + typeUrl: '/osmosis.valsetpref.v1beta1.UserValidatorPreferencesResponse', + aminoType: 'osmosis/valsetpref/user-validator-preferences-response', + is(o: any): o is UserValidatorPreferencesResponse { + return ( + o && + (o.$typeUrl === UserValidatorPreferencesResponse.typeUrl || + (Array.isArray(o.preferences) && + (!o.preferences.length || ValidatorPreference.is(o.preferences[0])))) + ); + }, + isSDK(o: any): o is UserValidatorPreferencesResponseSDKType { + return ( + o && + (o.$typeUrl === UserValidatorPreferencesResponse.typeUrl || + (Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isSDK(o.preferences[0])))) + ); + }, + isAmino(o: any): o is UserValidatorPreferencesResponseAmino { + return ( + o && + (o.$typeUrl === UserValidatorPreferencesResponse.typeUrl || + (Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isAmino(o.preferences[0])))) + ); + }, + encode( + message: UserValidatorPreferencesResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.preferences) { + ValidatorPreference.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UserValidatorPreferencesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserValidatorPreferencesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.preferences.push( + ValidatorPreference.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): UserValidatorPreferencesResponse { + const message = createBaseUserValidatorPreferencesResponse(); + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: UserValidatorPreferencesResponseAmino + ): UserValidatorPreferencesResponse { + const message = createBaseUserValidatorPreferencesResponse(); + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromAmino(e)) || []; + return message; + }, + toAmino( + message: UserValidatorPreferencesResponse + ): UserValidatorPreferencesResponseAmino { + const obj: any = {}; + if (message.preferences) { + obj.preferences = message.preferences.map((e) => + e ? ValidatorPreference.toAmino(e) : undefined + ); + } else { + obj.preferences = message.preferences; + } + return obj; + }, + fromAminoMsg( + object: UserValidatorPreferencesResponseAminoMsg + ): UserValidatorPreferencesResponse { + return UserValidatorPreferencesResponse.fromAmino(object.value); + }, + toAminoMsg( + message: UserValidatorPreferencesResponse + ): UserValidatorPreferencesResponseAminoMsg { + return { + type: 'osmosis/valsetpref/user-validator-preferences-response', + value: UserValidatorPreferencesResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: UserValidatorPreferencesResponseProtoMsg + ): UserValidatorPreferencesResponse { + return UserValidatorPreferencesResponse.decode(message.value); + }, + toProto(message: UserValidatorPreferencesResponse): Uint8Array { + return UserValidatorPreferencesResponse.encode(message).finish(); + }, + toProtoMsg( + message: UserValidatorPreferencesResponse + ): UserValidatorPreferencesResponseProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.UserValidatorPreferencesResponse', + value: UserValidatorPreferencesResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + UserValidatorPreferencesResponse.typeUrl, + UserValidatorPreferencesResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + UserValidatorPreferencesResponse.aminoType, + UserValidatorPreferencesResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/state.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/state.ts new file mode 100644 index 00000000..40c62dfc --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/state.ts @@ -0,0 +1,348 @@ +//@ts-nocheck +import { Decimal } from '@cosmjs/math'; + +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; +/** + * ValidatorPreference defines the message structure for + * CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in + * state. If a user does not have a validator set preference list set, and has + * staked, make their preference list default to their current staking + * distribution. + */ +export interface ValidatorPreference { + /** + * val_oper_address holds the validator address the user wants to delegate + * funds to. + */ + valOperAddress: string; + /** weight is decimal between 0 and 1, and they all sum to 1. */ + weight: string; +} +export interface ValidatorPreferenceProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorPreference'; + value: Uint8Array; +} +/** + * ValidatorPreference defines the message structure for + * CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in + * state. If a user does not have a validator set preference list set, and has + * staked, make their preference list default to their current staking + * distribution. + */ +export interface ValidatorPreferenceAmino { + /** + * val_oper_address holds the validator address the user wants to delegate + * funds to. + */ + val_oper_address?: string; + /** weight is decimal between 0 and 1, and they all sum to 1. */ + weight?: string; +} +export interface ValidatorPreferenceAminoMsg { + type: 'osmosis/valsetpref/validator-preference'; + value: ValidatorPreferenceAmino; +} +/** + * ValidatorPreference defines the message structure for + * CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in + * state. If a user does not have a validator set preference list set, and has + * staked, make their preference list default to their current staking + * distribution. + */ +export interface ValidatorPreferenceSDKType { + val_oper_address: string; + weight: string; +} +/** + * ValidatorSetPreferences defines a delegator's validator set preference. + * It contains a list of (validator, percent_allocation) pairs. + * The percent allocation are arranged in decimal notation from 0 to 1 and must + * add up to 1. + */ +export interface ValidatorSetPreferences { + /** preference holds {valAddr, weight} for the user who created it. */ + preferences: ValidatorPreference[]; +} +export interface ValidatorSetPreferencesProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorSetPreferences'; + value: Uint8Array; +} +/** + * ValidatorSetPreferences defines a delegator's validator set preference. + * It contains a list of (validator, percent_allocation) pairs. + * The percent allocation are arranged in decimal notation from 0 to 1 and must + * add up to 1. + */ +export interface ValidatorSetPreferencesAmino { + /** preference holds {valAddr, weight} for the user who created it. */ + preferences?: ValidatorPreferenceAmino[]; +} +export interface ValidatorSetPreferencesAminoMsg { + type: 'osmosis/valsetpref/validator-set-preferences'; + value: ValidatorSetPreferencesAmino; +} +/** + * ValidatorSetPreferences defines a delegator's validator set preference. + * It contains a list of (validator, percent_allocation) pairs. + * The percent allocation are arranged in decimal notation from 0 to 1 and must + * add up to 1. + */ +export interface ValidatorSetPreferencesSDKType { + preferences: ValidatorPreferenceSDKType[]; +} +function createBaseValidatorPreference(): ValidatorPreference { + return { + valOperAddress: '', + weight: '', + }; +} +export const ValidatorPreference = { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorPreference', + aminoType: 'osmosis/valsetpref/validator-preference', + is(o: any): o is ValidatorPreference { + return ( + o && + (o.$typeUrl === ValidatorPreference.typeUrl || + (typeof o.valOperAddress === 'string' && typeof o.weight === 'string')) + ); + }, + isSDK(o: any): o is ValidatorPreferenceSDKType { + return ( + o && + (o.$typeUrl === ValidatorPreference.typeUrl || + (typeof o.val_oper_address === 'string' && + typeof o.weight === 'string')) + ); + }, + isAmino(o: any): o is ValidatorPreferenceAmino { + return ( + o && + (o.$typeUrl === ValidatorPreference.typeUrl || + (typeof o.val_oper_address === 'string' && + typeof o.weight === 'string')) + ); + }, + encode( + message: ValidatorPreference, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.valOperAddress !== '') { + writer.uint32(10).string(message.valOperAddress); + } + if (message.weight !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.weight, 18).atomics); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorPreference { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorPreference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valOperAddress = reader.string(); + break; + case 2: + message.weight = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorPreference { + const message = createBaseValidatorPreference(); + message.valOperAddress = object.valOperAddress ?? ''; + message.weight = object.weight ?? ''; + return message; + }, + fromAmino(object: ValidatorPreferenceAmino): ValidatorPreference { + const message = createBaseValidatorPreference(); + if ( + object.val_oper_address !== undefined && + object.val_oper_address !== null + ) { + message.valOperAddress = object.val_oper_address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; + }, + toAmino(message: ValidatorPreference): ValidatorPreferenceAmino { + const obj: any = {}; + obj.val_oper_address = + message.valOperAddress === '' ? undefined : message.valOperAddress; + obj.weight = message.weight === '' ? undefined : message.weight; + return obj; + }, + fromAminoMsg(object: ValidatorPreferenceAminoMsg): ValidatorPreference { + return ValidatorPreference.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorPreference): ValidatorPreferenceAminoMsg { + return { + type: 'osmosis/valsetpref/validator-preference', + value: ValidatorPreference.toAmino(message), + }; + }, + fromProtoMsg(message: ValidatorPreferenceProtoMsg): ValidatorPreference { + return ValidatorPreference.decode(message.value); + }, + toProto(message: ValidatorPreference): Uint8Array { + return ValidatorPreference.encode(message).finish(); + }, + toProtoMsg(message: ValidatorPreference): ValidatorPreferenceProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorPreference', + value: ValidatorPreference.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ValidatorPreference.typeUrl, + ValidatorPreference +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorPreference.aminoType, + ValidatorPreference.typeUrl +); +function createBaseValidatorSetPreferences(): ValidatorSetPreferences { + return { + preferences: [], + }; +} +export const ValidatorSetPreferences = { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorSetPreferences', + aminoType: 'osmosis/valsetpref/validator-set-preferences', + is(o: any): o is ValidatorSetPreferences { + return ( + o && + (o.$typeUrl === ValidatorSetPreferences.typeUrl || + (Array.isArray(o.preferences) && + (!o.preferences.length || ValidatorPreference.is(o.preferences[0])))) + ); + }, + isSDK(o: any): o is ValidatorSetPreferencesSDKType { + return ( + o && + (o.$typeUrl === ValidatorSetPreferences.typeUrl || + (Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isSDK(o.preferences[0])))) + ); + }, + isAmino(o: any): o is ValidatorSetPreferencesAmino { + return ( + o && + (o.$typeUrl === ValidatorSetPreferences.typeUrl || + (Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isAmino(o.preferences[0])))) + ); + }, + encode( + message: ValidatorSetPreferences, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.preferences) { + ValidatorPreference.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorSetPreferences { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSetPreferences(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.preferences.push( + ValidatorPreference.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): ValidatorSetPreferences { + const message = createBaseValidatorSetPreferences(); + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorSetPreferencesAmino): ValidatorSetPreferences { + const message = createBaseValidatorSetPreferences(); + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorSetPreferences): ValidatorSetPreferencesAmino { + const obj: any = {}; + if (message.preferences) { + obj.preferences = message.preferences.map((e) => + e ? ValidatorPreference.toAmino(e) : undefined + ); + } else { + obj.preferences = message.preferences; + } + return obj; + }, + fromAminoMsg( + object: ValidatorSetPreferencesAminoMsg + ): ValidatorSetPreferences { + return ValidatorSetPreferences.fromAmino(object.value); + }, + toAminoMsg( + message: ValidatorSetPreferences + ): ValidatorSetPreferencesAminoMsg { + return { + type: 'osmosis/valsetpref/validator-set-preferences', + value: ValidatorSetPreferences.toAmino(message), + }; + }, + fromProtoMsg( + message: ValidatorSetPreferencesProtoMsg + ): ValidatorSetPreferences { + return ValidatorSetPreferences.decode(message.value); + }, + toProto(message: ValidatorSetPreferences): Uint8Array { + return ValidatorSetPreferences.encode(message).finish(); + }, + toProtoMsg( + message: ValidatorSetPreferences + ): ValidatorSetPreferencesProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorSetPreferences', + value: ValidatorSetPreferences.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + ValidatorSetPreferences.typeUrl, + ValidatorSetPreferences +); +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorSetPreferences.aminoType, + ValidatorSetPreferences.typeUrl +); diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.amino.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.amino.ts new file mode 100644 index 00000000..13dc8d9f --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.amino.ts @@ -0,0 +1,47 @@ +//@ts-nocheck +import { + MsgSetValidatorSetPreference, + MsgDelegateToValidatorSet, + MsgUndelegateFromValidatorSet, + MsgUndelegateFromRebalancedValidatorSet, + MsgRedelegateValidatorSet, + MsgWithdrawDelegationRewards, + MsgDelegateBondedTokens, +} from './tx'; +export const AminoConverter = { + '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference': { + aminoType: 'osmosis/MsgSetValidatorSetPreference', + toAmino: MsgSetValidatorSetPreference.toAmino, + fromAmino: MsgSetValidatorSetPreference.fromAmino, + }, + '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet': { + aminoType: 'osmosis/MsgDelegateToValidatorSet', + toAmino: MsgDelegateToValidatorSet.toAmino, + fromAmino: MsgDelegateToValidatorSet.fromAmino, + }, + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet': { + aminoType: 'osmosis/MsgUndelegateFromValidatorSet', + toAmino: MsgUndelegateFromValidatorSet.toAmino, + fromAmino: MsgUndelegateFromValidatorSet.fromAmino, + }, + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet': { + aminoType: 'osmosis/MsgUndelegateFromRebalValset', + toAmino: MsgUndelegateFromRebalancedValidatorSet.toAmino, + fromAmino: MsgUndelegateFromRebalancedValidatorSet.fromAmino, + }, + '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet': { + aminoType: 'osmosis/MsgRedelegateValidatorSet', + toAmino: MsgRedelegateValidatorSet.toAmino, + fromAmino: MsgRedelegateValidatorSet.fromAmino, + }, + '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards': { + aminoType: 'osmosis/MsgWithdrawDelegationRewards', + toAmino: MsgWithdrawDelegationRewards.toAmino, + fromAmino: MsgWithdrawDelegationRewards.fromAmino, + }, + '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens': { + aminoType: 'osmosis/valsetpref/delegate-bonded-tokens', + toAmino: MsgDelegateBondedTokens.toAmino, + fromAmino: MsgDelegateBondedTokens.fromAmino, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.registry.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.registry.ts new file mode 100644 index 00000000..ef666df9 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.registry.ts @@ -0,0 +1,190 @@ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing'; + +import { + MsgSetValidatorSetPreference, + MsgDelegateToValidatorSet, + MsgUndelegateFromValidatorSet, + MsgUndelegateFromRebalancedValidatorSet, + MsgRedelegateValidatorSet, + MsgWithdrawDelegationRewards, + MsgDelegateBondedTokens, +} from './tx'; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + MsgSetValidatorSetPreference, + ], + [ + '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + MsgDelegateToValidatorSet, + ], + [ + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + MsgUndelegateFromValidatorSet, + ], + [ + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet', + MsgUndelegateFromRebalancedValidatorSet, + ], + [ + '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + MsgRedelegateValidatorSet, + ], + [ + '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + MsgWithdrawDelegationRewards, + ], + [ + '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + MsgDelegateBondedTokens, + ], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setValidatorSetPreference(value: MsgSetValidatorSetPreference) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.encode(value).finish(), + }; + }, + delegateToValidatorSet(value: MsgDelegateToValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.encode(value).finish(), + }; + }, + undelegateFromValidatorSet(value: MsgUndelegateFromValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + value: MsgUndelegateFromValidatorSet.encode(value).finish(), + }; + }, + undelegateFromRebalancedValidatorSet( + value: MsgUndelegateFromRebalancedValidatorSet + ) { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet', + value: MsgUndelegateFromRebalancedValidatorSet.encode(value).finish(), + }; + }, + redelegateValidatorSet(value: MsgRedelegateValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + value: MsgRedelegateValidatorSet.encode(value).finish(), + }; + }, + withdrawDelegationRewards(value: MsgWithdrawDelegationRewards) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.encode(value).finish(), + }; + }, + delegateBondedTokens(value: MsgDelegateBondedTokens) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value: MsgDelegateBondedTokens.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + setValidatorSetPreference(value: MsgSetValidatorSetPreference) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value, + }; + }, + delegateToValidatorSet(value: MsgDelegateToValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value, + }; + }, + undelegateFromValidatorSet(value: MsgUndelegateFromValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + value, + }; + }, + undelegateFromRebalancedValidatorSet( + value: MsgUndelegateFromRebalancedValidatorSet + ) { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet', + value, + }; + }, + redelegateValidatorSet(value: MsgRedelegateValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + value, + }; + }, + withdrawDelegationRewards(value: MsgWithdrawDelegationRewards) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value, + }; + }, + delegateBondedTokens(value: MsgDelegateBondedTokens) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value, + }; + }, + }, + fromPartial: { + setValidatorSetPreference(value: MsgSetValidatorSetPreference) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.fromPartial(value), + }; + }, + delegateToValidatorSet(value: MsgDelegateToValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.fromPartial(value), + }; + }, + undelegateFromValidatorSet(value: MsgUndelegateFromValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + value: MsgUndelegateFromValidatorSet.fromPartial(value), + }; + }, + undelegateFromRebalancedValidatorSet( + value: MsgUndelegateFromRebalancedValidatorSet + ) { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet', + value: MsgUndelegateFromRebalancedValidatorSet.fromPartial(value), + }; + }, + redelegateValidatorSet(value: MsgRedelegateValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + value: MsgRedelegateValidatorSet.fromPartial(value), + }; + }, + withdrawDelegationRewards(value: MsgWithdrawDelegationRewards) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.fromPartial(value), + }; + }, + delegateBondedTokens(value: MsgDelegateBondedTokens) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value: MsgDelegateBondedTokens.fromPartial(value), + }; + }, + }, +}; diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..fe735c8a --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,186 @@ +//@ts-nocheck +import { Rpc } from '../../../helpers'; +import { BinaryReader } from '../../../binary'; + +import { + MsgSetValidatorSetPreference, + MsgSetValidatorSetPreferenceResponse, + MsgDelegateToValidatorSet, + MsgDelegateToValidatorSetResponse, + MsgUndelegateFromValidatorSet, + MsgUndelegateFromValidatorSetResponse, + MsgUndelegateFromRebalancedValidatorSet, + MsgUndelegateFromRebalancedValidatorSetResponse, + MsgRedelegateValidatorSet, + MsgRedelegateValidatorSetResponse, + MsgWithdrawDelegationRewards, + MsgWithdrawDelegationRewardsResponse, + MsgDelegateBondedTokens, + MsgDelegateBondedTokensResponse, +} from './tx'; +/** Msg defines the valset-pref module's gRPC message service. */ +export interface Msg { + /** + * SetValidatorSetPreference creates a set of validator preference. + * This message will process both create + update request. + */ + setValidatorSetPreference( + request: MsgSetValidatorSetPreference + ): Promise; + /** + * DelegateToValidatorSet gets the owner, coins and delegates to a + * validator-set. + */ + delegateToValidatorSet( + request: MsgDelegateToValidatorSet + ): Promise; + /** + * UndelegateFromValidatorSet gets the owner and coins and undelegates from + * validator-set. The unbonding logic will follow the `Undelegate` logic from + * the sdk. + */ + undelegateFromValidatorSet( + request: MsgUndelegateFromValidatorSet + ): Promise; + /** + * UndelegateFromRebalancedValidatorSet undelegates the proivded amount from + * the validator set, but takes into consideration the current delegations + * to the user's validator set to determine the weights assigned to each. + */ + undelegateFromRebalancedValidatorSet( + request: MsgUndelegateFromRebalancedValidatorSet + ): Promise; + /** + * RedelegateValidatorSet takes the existing validator set and redelegates to + * a new set. + */ + redelegateValidatorSet( + request: MsgRedelegateValidatorSet + ): Promise; + /** + * WithdrawDelegationRewards allows users to claim rewards from the + * validator-set. + */ + withdrawDelegationRewards( + request: MsgWithdrawDelegationRewards + ): Promise; + /** + * DelegateBondedTokens allows users to break the lockup bond and delegate + * osmo tokens to a predefined validator-set. + */ + delegateBondedTokens( + request: MsgDelegateBondedTokens + ): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setValidatorSetPreference = this.setValidatorSetPreference.bind(this); + this.delegateToValidatorSet = this.delegateToValidatorSet.bind(this); + this.undelegateFromValidatorSet = + this.undelegateFromValidatorSet.bind(this); + this.undelegateFromRebalancedValidatorSet = + this.undelegateFromRebalancedValidatorSet.bind(this); + this.redelegateValidatorSet = this.redelegateValidatorSet.bind(this); + this.withdrawDelegationRewards = this.withdrawDelegationRewards.bind(this); + this.delegateBondedTokens = this.delegateBondedTokens.bind(this); + } + setValidatorSetPreference( + request: MsgSetValidatorSetPreference + ): Promise { + const data = MsgSetValidatorSetPreference.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Msg', + 'SetValidatorSetPreference', + data + ); + return promise.then((data) => + MsgSetValidatorSetPreferenceResponse.decode(new BinaryReader(data)) + ); + } + delegateToValidatorSet( + request: MsgDelegateToValidatorSet + ): Promise { + const data = MsgDelegateToValidatorSet.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Msg', + 'DelegateToValidatorSet', + data + ); + return promise.then((data) => + MsgDelegateToValidatorSetResponse.decode(new BinaryReader(data)) + ); + } + undelegateFromValidatorSet( + request: MsgUndelegateFromValidatorSet + ): Promise { + const data = MsgUndelegateFromValidatorSet.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Msg', + 'UndelegateFromValidatorSet', + data + ); + return promise.then((data) => + MsgUndelegateFromValidatorSetResponse.decode(new BinaryReader(data)) + ); + } + undelegateFromRebalancedValidatorSet( + request: MsgUndelegateFromRebalancedValidatorSet + ): Promise { + const data = + MsgUndelegateFromRebalancedValidatorSet.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Msg', + 'UndelegateFromRebalancedValidatorSet', + data + ); + return promise.then((data) => + MsgUndelegateFromRebalancedValidatorSetResponse.decode( + new BinaryReader(data) + ) + ); + } + redelegateValidatorSet( + request: MsgRedelegateValidatorSet + ): Promise { + const data = MsgRedelegateValidatorSet.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Msg', + 'RedelegateValidatorSet', + data + ); + return promise.then((data) => + MsgRedelegateValidatorSetResponse.decode(new BinaryReader(data)) + ); + } + withdrawDelegationRewards( + request: MsgWithdrawDelegationRewards + ): Promise { + const data = MsgWithdrawDelegationRewards.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Msg', + 'WithdrawDelegationRewards', + data + ); + return promise.then((data) => + MsgWithdrawDelegationRewardsResponse.decode(new BinaryReader(data)) + ); + } + delegateBondedTokens( + request: MsgDelegateBondedTokens + ): Promise { + const data = MsgDelegateBondedTokens.encode(request).finish(); + const promise = this.rpc.request( + 'osmosis.valsetpref.v1beta1.Msg', + 'DelegateBondedTokens', + data + ); + return promise.then((data) => + MsgDelegateBondedTokensResponse.decode(new BinaryReader(data)) + ); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; diff --git a/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.ts b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.ts new file mode 100644 index 00000000..0653d208 --- /dev/null +++ b/packages/cosmos/src/proto_export/osmosis/valsetpref/v1beta1/tx.ts @@ -0,0 +1,1972 @@ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType, +} from '../../../cosmos/base/v1beta1/coin'; +import { BinaryReader, BinaryWriter } from '../../../binary'; +import { GlobalDecoderRegistry } from '../../../registry'; + +import { + ValidatorPreference, + ValidatorPreferenceAmino, + ValidatorPreferenceSDKType, +} from './state'; +/** MsgCreateValidatorSetPreference is a list that holds validator-set. */ +export interface MsgSetValidatorSetPreference { + /** delegator is the user who is trying to create a validator-set. */ + delegator: string; + /** list of {valAddr, weight} to delegate to */ + preferences: ValidatorPreference[]; +} +export interface MsgSetValidatorSetPreferenceProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference'; + value: Uint8Array; +} +/** MsgCreateValidatorSetPreference is a list that holds validator-set. */ +export interface MsgSetValidatorSetPreferenceAmino { + /** delegator is the user who is trying to create a validator-set. */ + delegator?: string; + /** list of {valAddr, weight} to delegate to */ + preferences?: ValidatorPreferenceAmino[]; +} +export interface MsgSetValidatorSetPreferenceAminoMsg { + type: 'osmosis/MsgSetValidatorSetPreference'; + value: MsgSetValidatorSetPreferenceAmino; +} +/** MsgCreateValidatorSetPreference is a list that holds validator-set. */ +export interface MsgSetValidatorSetPreferenceSDKType { + delegator: string; + preferences: ValidatorPreferenceSDKType[]; +} +export interface MsgSetValidatorSetPreferenceResponse {} +export interface MsgSetValidatorSetPreferenceResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreferenceResponse'; + value: Uint8Array; +} +export interface MsgSetValidatorSetPreferenceResponseAmino {} +export interface MsgSetValidatorSetPreferenceResponseAminoMsg { + type: 'osmosis/valsetpref/set-validator-set-preference-response'; + value: MsgSetValidatorSetPreferenceResponseAmino; +} +export interface MsgSetValidatorSetPreferenceResponseSDKType {} +/** + * MsgDelegateToValidatorSet allows users to delegate to an existing + * validator-set + */ +export interface MsgDelegateToValidatorSet { + /** delegator is the user who is trying to delegate. */ + delegator: string; + /** + * the amount of tokens the user is trying to delegate. + * For ex: delegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, ValC + * -> 0.2} our staking logic would attempt to delegate 5osmo to A , 3osmo to + * B, 2osmo to C. + */ + coin: Coin; +} +export interface MsgDelegateToValidatorSetProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet'; + value: Uint8Array; +} +/** + * MsgDelegateToValidatorSet allows users to delegate to an existing + * validator-set + */ +export interface MsgDelegateToValidatorSetAmino { + /** delegator is the user who is trying to delegate. */ + delegator?: string; + /** + * the amount of tokens the user is trying to delegate. + * For ex: delegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, ValC + * -> 0.2} our staking logic would attempt to delegate 5osmo to A , 3osmo to + * B, 2osmo to C. + */ + coin?: CoinAmino; +} +export interface MsgDelegateToValidatorSetAminoMsg { + type: 'osmosis/MsgDelegateToValidatorSet'; + value: MsgDelegateToValidatorSetAmino; +} +/** + * MsgDelegateToValidatorSet allows users to delegate to an existing + * validator-set + */ +export interface MsgDelegateToValidatorSetSDKType { + delegator: string; + coin: CoinSDKType; +} +export interface MsgDelegateToValidatorSetResponse {} +export interface MsgDelegateToValidatorSetResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSetResponse'; + value: Uint8Array; +} +export interface MsgDelegateToValidatorSetResponseAmino {} +export interface MsgDelegateToValidatorSetResponseAminoMsg { + type: 'osmosis/valsetpref/delegate-to-validator-set-response'; + value: MsgDelegateToValidatorSetResponseAmino; +} +export interface MsgDelegateToValidatorSetResponseSDKType {} +export interface MsgUndelegateFromValidatorSet { + /** delegator is the user who is trying to undelegate. */ + delegator: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, + * ValC + * -> 0.2} our undelegate logic would attempt to undelegate 5osmo from A , + * 3osmo from B, 2osmo from C + */ + coin: Coin; +} +export interface MsgUndelegateFromValidatorSetProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet'; + value: Uint8Array; +} +export interface MsgUndelegateFromValidatorSetAmino { + /** delegator is the user who is trying to undelegate. */ + delegator?: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, + * ValC + * -> 0.2} our undelegate logic would attempt to undelegate 5osmo from A , + * 3osmo from B, 2osmo from C + */ + coin?: CoinAmino; +} +export interface MsgUndelegateFromValidatorSetAminoMsg { + type: 'osmosis/MsgUndelegateFromValidatorSet'; + value: MsgUndelegateFromValidatorSetAmino; +} +export interface MsgUndelegateFromValidatorSetSDKType { + delegator: string; + coin: CoinSDKType; +} +export interface MsgUndelegateFromValidatorSetResponse {} +export interface MsgUndelegateFromValidatorSetResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSetResponse'; + value: Uint8Array; +} +export interface MsgUndelegateFromValidatorSetResponseAmino {} +export interface MsgUndelegateFromValidatorSetResponseAminoMsg { + type: 'osmosis/valsetpref/undelegate-from-validator-set-response'; + value: MsgUndelegateFromValidatorSetResponseAmino; +} +export interface MsgUndelegateFromValidatorSetResponseSDKType {} +export interface MsgUndelegateFromRebalancedValidatorSet { + /** delegator is the user who is trying to undelegate. */ + delegator: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 50 osmo with validator-set {ValA -> 0.5, ValB -> 0.5} + * Our undelegate logic would first check the current delegation balance. + * If the user has 90 osmo delegated to ValA and 10 osmo delegated to ValB, + * the rebalanced validator set would be {ValA -> 0.9, ValB -> 0.1} + * So now the 45 osmo would be undelegated from ValA and 5 osmo would be + * undelegated from ValB. + */ + coin: Coin; +} +export interface MsgUndelegateFromRebalancedValidatorSetProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet'; + value: Uint8Array; +} +export interface MsgUndelegateFromRebalancedValidatorSetAmino { + /** delegator is the user who is trying to undelegate. */ + delegator?: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 50 osmo with validator-set {ValA -> 0.5, ValB -> 0.5} + * Our undelegate logic would first check the current delegation balance. + * If the user has 90 osmo delegated to ValA and 10 osmo delegated to ValB, + * the rebalanced validator set would be {ValA -> 0.9, ValB -> 0.1} + * So now the 45 osmo would be undelegated from ValA and 5 osmo would be + * undelegated from ValB. + */ + coin?: CoinAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetAminoMsg { + type: 'osmosis/MsgUndelegateFromRebalValset'; + value: MsgUndelegateFromRebalancedValidatorSetAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetSDKType { + delegator: string; + coin: CoinSDKType; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponse {} +export interface MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse'; + value: Uint8Array; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponseAmino {} +export interface MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg { + type: 'osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response'; + value: MsgUndelegateFromRebalancedValidatorSetResponseAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponseSDKType {} +export interface MsgRedelegateValidatorSet { + /** delegator is the user who is trying to create a validator-set. */ + delegator: string; + /** list of {valAddr, weight} to delegate to */ + preferences: ValidatorPreference[]; +} +export interface MsgRedelegateValidatorSetProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet'; + value: Uint8Array; +} +export interface MsgRedelegateValidatorSetAmino { + /** delegator is the user who is trying to create a validator-set. */ + delegator?: string; + /** list of {valAddr, weight} to delegate to */ + preferences?: ValidatorPreferenceAmino[]; +} +export interface MsgRedelegateValidatorSetAminoMsg { + type: 'osmosis/MsgRedelegateValidatorSet'; + value: MsgRedelegateValidatorSetAmino; +} +export interface MsgRedelegateValidatorSetSDKType { + delegator: string; + preferences: ValidatorPreferenceSDKType[]; +} +export interface MsgRedelegateValidatorSetResponse {} +export interface MsgRedelegateValidatorSetResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSetResponse'; + value: Uint8Array; +} +export interface MsgRedelegateValidatorSetResponseAmino {} +export interface MsgRedelegateValidatorSetResponseAminoMsg { + type: 'osmosis/valsetpref/redelegate-validator-set-response'; + value: MsgRedelegateValidatorSetResponseAmino; +} +export interface MsgRedelegateValidatorSetResponseSDKType {} +/** + * MsgWithdrawDelegationRewards allows user to claim staking rewards from the + * validator set. + */ +export interface MsgWithdrawDelegationRewards { + /** delegator is the user who is trying to claim staking rewards. */ + delegator: string; +} +export interface MsgWithdrawDelegationRewardsProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards'; + value: Uint8Array; +} +/** + * MsgWithdrawDelegationRewards allows user to claim staking rewards from the + * validator set. + */ +export interface MsgWithdrawDelegationRewardsAmino { + /** delegator is the user who is trying to claim staking rewards. */ + delegator?: string; +} +export interface MsgWithdrawDelegationRewardsAminoMsg { + type: 'osmosis/MsgWithdrawDelegationRewards'; + value: MsgWithdrawDelegationRewardsAmino; +} +/** + * MsgWithdrawDelegationRewards allows user to claim staking rewards from the + * validator set. + */ +export interface MsgWithdrawDelegationRewardsSDKType { + delegator: string; +} +export interface MsgWithdrawDelegationRewardsResponse {} +export interface MsgWithdrawDelegationRewardsResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewardsResponse'; + value: Uint8Array; +} +export interface MsgWithdrawDelegationRewardsResponseAmino {} +export interface MsgWithdrawDelegationRewardsResponseAminoMsg { + type: 'osmosis/valsetpref/withdraw-delegation-rewards-response'; + value: MsgWithdrawDelegationRewardsResponseAmino; +} +export interface MsgWithdrawDelegationRewardsResponseSDKType {} +/** + * MsgDelegateBondedTokens breaks bonded lockup (by ID) of osmo, of + * length <= 2 weeks and takes all that osmo and delegates according to + * delegator's current validator set preference. + */ +export interface MsgDelegateBondedTokens { + /** delegator is the user who is trying to force unbond osmo and delegate. */ + delegator: string; + /** lockup id of osmo in the pool */ + lockID: bigint; +} +export interface MsgDelegateBondedTokensProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens'; + value: Uint8Array; +} +/** + * MsgDelegateBondedTokens breaks bonded lockup (by ID) of osmo, of + * length <= 2 weeks and takes all that osmo and delegates according to + * delegator's current validator set preference. + */ +export interface MsgDelegateBondedTokensAmino { + /** delegator is the user who is trying to force unbond osmo and delegate. */ + delegator?: string; + /** lockup id of osmo in the pool */ + lockID?: string; +} +export interface MsgDelegateBondedTokensAminoMsg { + type: 'osmosis/valsetpref/delegate-bonded-tokens'; + value: MsgDelegateBondedTokensAmino; +} +/** + * MsgDelegateBondedTokens breaks bonded lockup (by ID) of osmo, of + * length <= 2 weeks and takes all that osmo and delegates according to + * delegator's current validator set preference. + */ +export interface MsgDelegateBondedTokensSDKType { + delegator: string; + lockID: bigint; +} +export interface MsgDelegateBondedTokensResponse {} +export interface MsgDelegateBondedTokensResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokensResponse'; + value: Uint8Array; +} +export interface MsgDelegateBondedTokensResponseAmino {} +export interface MsgDelegateBondedTokensResponseAminoMsg { + type: 'osmosis/valsetpref/delegate-bonded-tokens-response'; + value: MsgDelegateBondedTokensResponseAmino; +} +export interface MsgDelegateBondedTokensResponseSDKType {} +function createBaseMsgSetValidatorSetPreference(): MsgSetValidatorSetPreference { + return { + delegator: '', + preferences: [], + }; +} +export const MsgSetValidatorSetPreference = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + aminoType: 'osmosis/MsgSetValidatorSetPreference', + is(o: any): o is MsgSetValidatorSetPreference { + return ( + o && + (o.$typeUrl === MsgSetValidatorSetPreference.typeUrl || + (typeof o.delegator === 'string' && + Array.isArray(o.preferences) && + (!o.preferences.length || ValidatorPreference.is(o.preferences[0])))) + ); + }, + isSDK(o: any): o is MsgSetValidatorSetPreferenceSDKType { + return ( + o && + (o.$typeUrl === MsgSetValidatorSetPreference.typeUrl || + (typeof o.delegator === 'string' && + Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isSDK(o.preferences[0])))) + ); + }, + isAmino(o: any): o is MsgSetValidatorSetPreferenceAmino { + return ( + o && + (o.$typeUrl === MsgSetValidatorSetPreference.typeUrl || + (typeof o.delegator === 'string' && + Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isAmino(o.preferences[0])))) + ); + }, + encode( + message: MsgSetValidatorSetPreference, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegator !== '') { + writer.uint32(10).string(message.delegator); + } + for (const v of message.preferences) { + ValidatorPreference.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetValidatorSetPreference { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetValidatorSetPreference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 2: + message.preferences.push( + ValidatorPreference.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetValidatorSetPreference { + const message = createBaseMsgSetValidatorSetPreference(); + message.delegator = object.delegator ?? ''; + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromPartial(e)) || []; + return message; + }, + fromAmino( + object: MsgSetValidatorSetPreferenceAmino + ): MsgSetValidatorSetPreference { + const message = createBaseMsgSetValidatorSetPreference(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromAmino(e)) || []; + return message; + }, + toAmino( + message: MsgSetValidatorSetPreference + ): MsgSetValidatorSetPreferenceAmino { + const obj: any = {}; + obj.delegator = message.delegator === '' ? undefined : message.delegator; + if (message.preferences) { + obj.preferences = message.preferences.map((e) => + e ? ValidatorPreference.toAmino(e) : undefined + ); + } else { + obj.preferences = message.preferences; + } + return obj; + }, + fromAminoMsg( + object: MsgSetValidatorSetPreferenceAminoMsg + ): MsgSetValidatorSetPreference { + return MsgSetValidatorSetPreference.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetValidatorSetPreference + ): MsgSetValidatorSetPreferenceAminoMsg { + return { + type: 'osmosis/MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetValidatorSetPreferenceProtoMsg + ): MsgSetValidatorSetPreference { + return MsgSetValidatorSetPreference.decode(message.value); + }, + toProto(message: MsgSetValidatorSetPreference): Uint8Array { + return MsgSetValidatorSetPreference.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetValidatorSetPreference + ): MsgSetValidatorSetPreferenceProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetValidatorSetPreference.typeUrl, + MsgSetValidatorSetPreference +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetValidatorSetPreference.aminoType, + MsgSetValidatorSetPreference.typeUrl +); +function createBaseMsgSetValidatorSetPreferenceResponse(): MsgSetValidatorSetPreferenceResponse { + return {}; +} +export const MsgSetValidatorSetPreferenceResponse = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreferenceResponse', + aminoType: 'osmosis/valsetpref/set-validator-set-preference-response', + is(o: any): o is MsgSetValidatorSetPreferenceResponse { + return o && o.$typeUrl === MsgSetValidatorSetPreferenceResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetValidatorSetPreferenceResponseSDKType { + return o && o.$typeUrl === MsgSetValidatorSetPreferenceResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetValidatorSetPreferenceResponseAmino { + return o && o.$typeUrl === MsgSetValidatorSetPreferenceResponse.typeUrl; + }, + encode( + _: MsgSetValidatorSetPreferenceResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetValidatorSetPreferenceResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetValidatorSetPreferenceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetValidatorSetPreferenceResponse { + const message = createBaseMsgSetValidatorSetPreferenceResponse(); + return message; + }, + fromAmino( + _: MsgSetValidatorSetPreferenceResponseAmino + ): MsgSetValidatorSetPreferenceResponse { + const message = createBaseMsgSetValidatorSetPreferenceResponse(); + return message; + }, + toAmino( + _: MsgSetValidatorSetPreferenceResponse + ): MsgSetValidatorSetPreferenceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetValidatorSetPreferenceResponseAminoMsg + ): MsgSetValidatorSetPreferenceResponse { + return MsgSetValidatorSetPreferenceResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetValidatorSetPreferenceResponse + ): MsgSetValidatorSetPreferenceResponseAminoMsg { + return { + type: 'osmosis/valsetpref/set-validator-set-preference-response', + value: MsgSetValidatorSetPreferenceResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetValidatorSetPreferenceResponseProtoMsg + ): MsgSetValidatorSetPreferenceResponse { + return MsgSetValidatorSetPreferenceResponse.decode(message.value); + }, + toProto(message: MsgSetValidatorSetPreferenceResponse): Uint8Array { + return MsgSetValidatorSetPreferenceResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetValidatorSetPreferenceResponse + ): MsgSetValidatorSetPreferenceResponseProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreferenceResponse', + value: MsgSetValidatorSetPreferenceResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgSetValidatorSetPreferenceResponse.typeUrl, + MsgSetValidatorSetPreferenceResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetValidatorSetPreferenceResponse.aminoType, + MsgSetValidatorSetPreferenceResponse.typeUrl +); +function createBaseMsgDelegateToValidatorSet(): MsgDelegateToValidatorSet { + return { + delegator: '', + coin: Coin.fromPartial({}), + }; +} +export const MsgDelegateToValidatorSet = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + aminoType: 'osmosis/MsgDelegateToValidatorSet', + is(o: any): o is MsgDelegateToValidatorSet { + return ( + o && + (o.$typeUrl === MsgDelegateToValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.is(o.coin))) + ); + }, + isSDK(o: any): o is MsgDelegateToValidatorSetSDKType { + return ( + o && + (o.$typeUrl === MsgDelegateToValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.isSDK(o.coin))) + ); + }, + isAmino(o: any): o is MsgDelegateToValidatorSetAmino { + return ( + o && + (o.$typeUrl === MsgDelegateToValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.isAmino(o.coin))) + ); + }, + encode( + message: MsgDelegateToValidatorSet, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegator !== '') { + writer.uint32(10).string(message.delegator); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateToValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateToValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 2: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgDelegateToValidatorSet { + const message = createBaseMsgDelegateToValidatorSet(); + message.delegator = object.delegator ?? ''; + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined; + return message; + }, + fromAmino(object: MsgDelegateToValidatorSetAmino): MsgDelegateToValidatorSet { + const message = createBaseMsgDelegateToValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino(message: MsgDelegateToValidatorSet): MsgDelegateToValidatorSetAmino { + const obj: any = {}; + obj.delegator = message.delegator === '' ? undefined : message.delegator; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + return obj; + }, + fromAminoMsg( + object: MsgDelegateToValidatorSetAminoMsg + ): MsgDelegateToValidatorSet { + return MsgDelegateToValidatorSet.fromAmino(object.value); + }, + toAminoMsg( + message: MsgDelegateToValidatorSet + ): MsgDelegateToValidatorSetAminoMsg { + return { + type: 'osmosis/MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgDelegateToValidatorSetProtoMsg + ): MsgDelegateToValidatorSet { + return MsgDelegateToValidatorSet.decode(message.value); + }, + toProto(message: MsgDelegateToValidatorSet): Uint8Array { + return MsgDelegateToValidatorSet.encode(message).finish(); + }, + toProtoMsg( + message: MsgDelegateToValidatorSet + ): MsgDelegateToValidatorSetProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgDelegateToValidatorSet.typeUrl, + MsgDelegateToValidatorSet +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDelegateToValidatorSet.aminoType, + MsgDelegateToValidatorSet.typeUrl +); +function createBaseMsgDelegateToValidatorSetResponse(): MsgDelegateToValidatorSetResponse { + return {}; +} +export const MsgDelegateToValidatorSetResponse = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSetResponse', + aminoType: 'osmosis/valsetpref/delegate-to-validator-set-response', + is(o: any): o is MsgDelegateToValidatorSetResponse { + return o && o.$typeUrl === MsgDelegateToValidatorSetResponse.typeUrl; + }, + isSDK(o: any): o is MsgDelegateToValidatorSetResponseSDKType { + return o && o.$typeUrl === MsgDelegateToValidatorSetResponse.typeUrl; + }, + isAmino(o: any): o is MsgDelegateToValidatorSetResponseAmino { + return o && o.$typeUrl === MsgDelegateToValidatorSetResponse.typeUrl; + }, + encode( + _: MsgDelegateToValidatorSetResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateToValidatorSetResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateToValidatorSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgDelegateToValidatorSetResponse { + const message = createBaseMsgDelegateToValidatorSetResponse(); + return message; + }, + fromAmino( + _: MsgDelegateToValidatorSetResponseAmino + ): MsgDelegateToValidatorSetResponse { + const message = createBaseMsgDelegateToValidatorSetResponse(); + return message; + }, + toAmino( + _: MsgDelegateToValidatorSetResponse + ): MsgDelegateToValidatorSetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgDelegateToValidatorSetResponseAminoMsg + ): MsgDelegateToValidatorSetResponse { + return MsgDelegateToValidatorSetResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgDelegateToValidatorSetResponse + ): MsgDelegateToValidatorSetResponseAminoMsg { + return { + type: 'osmosis/valsetpref/delegate-to-validator-set-response', + value: MsgDelegateToValidatorSetResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgDelegateToValidatorSetResponseProtoMsg + ): MsgDelegateToValidatorSetResponse { + return MsgDelegateToValidatorSetResponse.decode(message.value); + }, + toProto(message: MsgDelegateToValidatorSetResponse): Uint8Array { + return MsgDelegateToValidatorSetResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgDelegateToValidatorSetResponse + ): MsgDelegateToValidatorSetResponseProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSetResponse', + value: MsgDelegateToValidatorSetResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgDelegateToValidatorSetResponse.typeUrl, + MsgDelegateToValidatorSetResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDelegateToValidatorSetResponse.aminoType, + MsgDelegateToValidatorSetResponse.typeUrl +); +function createBaseMsgUndelegateFromValidatorSet(): MsgUndelegateFromValidatorSet { + return { + delegator: '', + coin: Coin.fromPartial({}), + }; +} +export const MsgUndelegateFromValidatorSet = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + aminoType: 'osmosis/MsgUndelegateFromValidatorSet', + is(o: any): o is MsgUndelegateFromValidatorSet { + return ( + o && + (o.$typeUrl === MsgUndelegateFromValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.is(o.coin))) + ); + }, + isSDK(o: any): o is MsgUndelegateFromValidatorSetSDKType { + return ( + o && + (o.$typeUrl === MsgUndelegateFromValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.isSDK(o.coin))) + ); + }, + isAmino(o: any): o is MsgUndelegateFromValidatorSetAmino { + return ( + o && + (o.$typeUrl === MsgUndelegateFromValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.isAmino(o.coin))) + ); + }, + encode( + message: MsgUndelegateFromValidatorSet, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegator !== '') { + writer.uint32(10).string(message.delegator); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUndelegateFromValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 3: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUndelegateFromValidatorSet { + const message = createBaseMsgUndelegateFromValidatorSet(); + message.delegator = object.delegator ?? ''; + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined; + return message; + }, + fromAmino( + object: MsgUndelegateFromValidatorSetAmino + ): MsgUndelegateFromValidatorSet { + const message = createBaseMsgUndelegateFromValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino( + message: MsgUndelegateFromValidatorSet + ): MsgUndelegateFromValidatorSetAmino { + const obj: any = {}; + obj.delegator = message.delegator === '' ? undefined : message.delegator; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + return obj; + }, + fromAminoMsg( + object: MsgUndelegateFromValidatorSetAminoMsg + ): MsgUndelegateFromValidatorSet { + return MsgUndelegateFromValidatorSet.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUndelegateFromValidatorSet + ): MsgUndelegateFromValidatorSetAminoMsg { + return { + type: 'osmosis/MsgUndelegateFromValidatorSet', + value: MsgUndelegateFromValidatorSet.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUndelegateFromValidatorSetProtoMsg + ): MsgUndelegateFromValidatorSet { + return MsgUndelegateFromValidatorSet.decode(message.value); + }, + toProto(message: MsgUndelegateFromValidatorSet): Uint8Array { + return MsgUndelegateFromValidatorSet.encode(message).finish(); + }, + toProtoMsg( + message: MsgUndelegateFromValidatorSet + ): MsgUndelegateFromValidatorSetProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + value: MsgUndelegateFromValidatorSet.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUndelegateFromValidatorSet.typeUrl, + MsgUndelegateFromValidatorSet +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUndelegateFromValidatorSet.aminoType, + MsgUndelegateFromValidatorSet.typeUrl +); +function createBaseMsgUndelegateFromValidatorSetResponse(): MsgUndelegateFromValidatorSetResponse { + return {}; +} +export const MsgUndelegateFromValidatorSetResponse = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSetResponse', + aminoType: 'osmosis/valsetpref/undelegate-from-validator-set-response', + is(o: any): o is MsgUndelegateFromValidatorSetResponse { + return o && o.$typeUrl === MsgUndelegateFromValidatorSetResponse.typeUrl; + }, + isSDK(o: any): o is MsgUndelegateFromValidatorSetResponseSDKType { + return o && o.$typeUrl === MsgUndelegateFromValidatorSetResponse.typeUrl; + }, + isAmino(o: any): o is MsgUndelegateFromValidatorSetResponseAmino { + return o && o.$typeUrl === MsgUndelegateFromValidatorSetResponse.typeUrl; + }, + encode( + _: MsgUndelegateFromValidatorSetResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUndelegateFromValidatorSetResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromValidatorSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgUndelegateFromValidatorSetResponse { + const message = createBaseMsgUndelegateFromValidatorSetResponse(); + return message; + }, + fromAmino( + _: MsgUndelegateFromValidatorSetResponseAmino + ): MsgUndelegateFromValidatorSetResponse { + const message = createBaseMsgUndelegateFromValidatorSetResponse(); + return message; + }, + toAmino( + _: MsgUndelegateFromValidatorSetResponse + ): MsgUndelegateFromValidatorSetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgUndelegateFromValidatorSetResponseAminoMsg + ): MsgUndelegateFromValidatorSetResponse { + return MsgUndelegateFromValidatorSetResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUndelegateFromValidatorSetResponse + ): MsgUndelegateFromValidatorSetResponseAminoMsg { + return { + type: 'osmosis/valsetpref/undelegate-from-validator-set-response', + value: MsgUndelegateFromValidatorSetResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUndelegateFromValidatorSetResponseProtoMsg + ): MsgUndelegateFromValidatorSetResponse { + return MsgUndelegateFromValidatorSetResponse.decode(message.value); + }, + toProto(message: MsgUndelegateFromValidatorSetResponse): Uint8Array { + return MsgUndelegateFromValidatorSetResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgUndelegateFromValidatorSetResponse + ): MsgUndelegateFromValidatorSetResponseProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSetResponse', + value: MsgUndelegateFromValidatorSetResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUndelegateFromValidatorSetResponse.typeUrl, + MsgUndelegateFromValidatorSetResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUndelegateFromValidatorSetResponse.aminoType, + MsgUndelegateFromValidatorSetResponse.typeUrl +); +function createBaseMsgUndelegateFromRebalancedValidatorSet(): MsgUndelegateFromRebalancedValidatorSet { + return { + delegator: '', + coin: Coin.fromPartial({}), + }; +} +export const MsgUndelegateFromRebalancedValidatorSet = { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet', + aminoType: 'osmosis/MsgUndelegateFromRebalValset', + is(o: any): o is MsgUndelegateFromRebalancedValidatorSet { + return ( + o && + (o.$typeUrl === MsgUndelegateFromRebalancedValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.is(o.coin))) + ); + }, + isSDK(o: any): o is MsgUndelegateFromRebalancedValidatorSetSDKType { + return ( + o && + (o.$typeUrl === MsgUndelegateFromRebalancedValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.isSDK(o.coin))) + ); + }, + isAmino(o: any): o is MsgUndelegateFromRebalancedValidatorSetAmino { + return ( + o && + (o.$typeUrl === MsgUndelegateFromRebalancedValidatorSet.typeUrl || + (typeof o.delegator === 'string' && Coin.isAmino(o.coin))) + ); + }, + encode( + message: MsgUndelegateFromRebalancedValidatorSet, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegator !== '') { + writer.uint32(10).string(message.delegator); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUndelegateFromRebalancedValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 2: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgUndelegateFromRebalancedValidatorSet { + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + message.delegator = object.delegator ?? ''; + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined; + return message; + }, + fromAmino( + object: MsgUndelegateFromRebalancedValidatorSetAmino + ): MsgUndelegateFromRebalancedValidatorSet { + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino( + message: MsgUndelegateFromRebalancedValidatorSet + ): MsgUndelegateFromRebalancedValidatorSetAmino { + const obj: any = {}; + obj.delegator = message.delegator === '' ? undefined : message.delegator; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + return obj; + }, + fromAminoMsg( + object: MsgUndelegateFromRebalancedValidatorSetAminoMsg + ): MsgUndelegateFromRebalancedValidatorSet { + return MsgUndelegateFromRebalancedValidatorSet.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUndelegateFromRebalancedValidatorSet + ): MsgUndelegateFromRebalancedValidatorSetAminoMsg { + return { + type: 'osmosis/MsgUndelegateFromRebalValset', + value: MsgUndelegateFromRebalancedValidatorSet.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUndelegateFromRebalancedValidatorSetProtoMsg + ): MsgUndelegateFromRebalancedValidatorSet { + return MsgUndelegateFromRebalancedValidatorSet.decode(message.value); + }, + toProto(message: MsgUndelegateFromRebalancedValidatorSet): Uint8Array { + return MsgUndelegateFromRebalancedValidatorSet.encode(message).finish(); + }, + toProtoMsg( + message: MsgUndelegateFromRebalancedValidatorSet + ): MsgUndelegateFromRebalancedValidatorSetProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet', + value: MsgUndelegateFromRebalancedValidatorSet.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUndelegateFromRebalancedValidatorSet.typeUrl, + MsgUndelegateFromRebalancedValidatorSet +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUndelegateFromRebalancedValidatorSet.aminoType, + MsgUndelegateFromRebalancedValidatorSet.typeUrl +); +function createBaseMsgUndelegateFromRebalancedValidatorSetResponse(): MsgUndelegateFromRebalancedValidatorSetResponse { + return {}; +} +export const MsgUndelegateFromRebalancedValidatorSetResponse = { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse', + aminoType: + 'osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response', + is(o: any): o is MsgUndelegateFromRebalancedValidatorSetResponse { + return ( + o && + o.$typeUrl === MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl + ); + }, + isSDK(o: any): o is MsgUndelegateFromRebalancedValidatorSetResponseSDKType { + return ( + o && + o.$typeUrl === MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl + ); + }, + isAmino(o: any): o is MsgUndelegateFromRebalancedValidatorSetResponseAmino { + return ( + o && + o.$typeUrl === MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl + ); + }, + encode( + _: MsgUndelegateFromRebalancedValidatorSetResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUndelegateFromRebalancedValidatorSetResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgUndelegateFromRebalancedValidatorSetResponse { + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + return message; + }, + fromAmino( + _: MsgUndelegateFromRebalancedValidatorSetResponseAmino + ): MsgUndelegateFromRebalancedValidatorSetResponse { + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + return message; + }, + toAmino( + _: MsgUndelegateFromRebalancedValidatorSetResponse + ): MsgUndelegateFromRebalancedValidatorSetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg + ): MsgUndelegateFromRebalancedValidatorSetResponse { + return MsgUndelegateFromRebalancedValidatorSetResponse.fromAmino( + object.value + ); + }, + toAminoMsg( + message: MsgUndelegateFromRebalancedValidatorSetResponse + ): MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg { + return { + type: 'osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response', + value: MsgUndelegateFromRebalancedValidatorSetResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg + ): MsgUndelegateFromRebalancedValidatorSetResponse { + return MsgUndelegateFromRebalancedValidatorSetResponse.decode( + message.value + ); + }, + toProto( + message: MsgUndelegateFromRebalancedValidatorSetResponse + ): Uint8Array { + return MsgUndelegateFromRebalancedValidatorSetResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgUndelegateFromRebalancedValidatorSetResponse + ): MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse', + value: + MsgUndelegateFromRebalancedValidatorSetResponse.encode( + message + ).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl, + MsgUndelegateFromRebalancedValidatorSetResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUndelegateFromRebalancedValidatorSetResponse.aminoType, + MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl +); +function createBaseMsgRedelegateValidatorSet(): MsgRedelegateValidatorSet { + return { + delegator: '', + preferences: [], + }; +} +export const MsgRedelegateValidatorSet = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + aminoType: 'osmosis/MsgRedelegateValidatorSet', + is(o: any): o is MsgRedelegateValidatorSet { + return ( + o && + (o.$typeUrl === MsgRedelegateValidatorSet.typeUrl || + (typeof o.delegator === 'string' && + Array.isArray(o.preferences) && + (!o.preferences.length || ValidatorPreference.is(o.preferences[0])))) + ); + }, + isSDK(o: any): o is MsgRedelegateValidatorSetSDKType { + return ( + o && + (o.$typeUrl === MsgRedelegateValidatorSet.typeUrl || + (typeof o.delegator === 'string' && + Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isSDK(o.preferences[0])))) + ); + }, + isAmino(o: any): o is MsgRedelegateValidatorSetAmino { + return ( + o && + (o.$typeUrl === MsgRedelegateValidatorSet.typeUrl || + (typeof o.delegator === 'string' && + Array.isArray(o.preferences) && + (!o.preferences.length || + ValidatorPreference.isAmino(o.preferences[0])))) + ); + }, + encode( + message: MsgRedelegateValidatorSet, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegator !== '') { + writer.uint32(10).string(message.delegator); + } + for (const v of message.preferences) { + ValidatorPreference.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRedelegateValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRedelegateValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 2: + message.preferences.push( + ValidatorPreference.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgRedelegateValidatorSet { + const message = createBaseMsgRedelegateValidatorSet(); + message.delegator = object.delegator ?? ''; + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgRedelegateValidatorSetAmino): MsgRedelegateValidatorSet { + const message = createBaseMsgRedelegateValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgRedelegateValidatorSet): MsgRedelegateValidatorSetAmino { + const obj: any = {}; + obj.delegator = message.delegator === '' ? undefined : message.delegator; + if (message.preferences) { + obj.preferences = message.preferences.map((e) => + e ? ValidatorPreference.toAmino(e) : undefined + ); + } else { + obj.preferences = message.preferences; + } + return obj; + }, + fromAminoMsg( + object: MsgRedelegateValidatorSetAminoMsg + ): MsgRedelegateValidatorSet { + return MsgRedelegateValidatorSet.fromAmino(object.value); + }, + toAminoMsg( + message: MsgRedelegateValidatorSet + ): MsgRedelegateValidatorSetAminoMsg { + return { + type: 'osmosis/MsgRedelegateValidatorSet', + value: MsgRedelegateValidatorSet.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgRedelegateValidatorSetProtoMsg + ): MsgRedelegateValidatorSet { + return MsgRedelegateValidatorSet.decode(message.value); + }, + toProto(message: MsgRedelegateValidatorSet): Uint8Array { + return MsgRedelegateValidatorSet.encode(message).finish(); + }, + toProtoMsg( + message: MsgRedelegateValidatorSet + ): MsgRedelegateValidatorSetProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + value: MsgRedelegateValidatorSet.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgRedelegateValidatorSet.typeUrl, + MsgRedelegateValidatorSet +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRedelegateValidatorSet.aminoType, + MsgRedelegateValidatorSet.typeUrl +); +function createBaseMsgRedelegateValidatorSetResponse(): MsgRedelegateValidatorSetResponse { + return {}; +} +export const MsgRedelegateValidatorSetResponse = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSetResponse', + aminoType: 'osmosis/valsetpref/redelegate-validator-set-response', + is(o: any): o is MsgRedelegateValidatorSetResponse { + return o && o.$typeUrl === MsgRedelegateValidatorSetResponse.typeUrl; + }, + isSDK(o: any): o is MsgRedelegateValidatorSetResponseSDKType { + return o && o.$typeUrl === MsgRedelegateValidatorSetResponse.typeUrl; + }, + isAmino(o: any): o is MsgRedelegateValidatorSetResponseAmino { + return o && o.$typeUrl === MsgRedelegateValidatorSetResponse.typeUrl; + }, + encode( + _: MsgRedelegateValidatorSetResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRedelegateValidatorSetResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRedelegateValidatorSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgRedelegateValidatorSetResponse { + const message = createBaseMsgRedelegateValidatorSetResponse(); + return message; + }, + fromAmino( + _: MsgRedelegateValidatorSetResponseAmino + ): MsgRedelegateValidatorSetResponse { + const message = createBaseMsgRedelegateValidatorSetResponse(); + return message; + }, + toAmino( + _: MsgRedelegateValidatorSetResponse + ): MsgRedelegateValidatorSetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgRedelegateValidatorSetResponseAminoMsg + ): MsgRedelegateValidatorSetResponse { + return MsgRedelegateValidatorSetResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgRedelegateValidatorSetResponse + ): MsgRedelegateValidatorSetResponseAminoMsg { + return { + type: 'osmosis/valsetpref/redelegate-validator-set-response', + value: MsgRedelegateValidatorSetResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgRedelegateValidatorSetResponseProtoMsg + ): MsgRedelegateValidatorSetResponse { + return MsgRedelegateValidatorSetResponse.decode(message.value); + }, + toProto(message: MsgRedelegateValidatorSetResponse): Uint8Array { + return MsgRedelegateValidatorSetResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgRedelegateValidatorSetResponse + ): MsgRedelegateValidatorSetResponseProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSetResponse', + value: MsgRedelegateValidatorSetResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgRedelegateValidatorSetResponse.typeUrl, + MsgRedelegateValidatorSetResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRedelegateValidatorSetResponse.aminoType, + MsgRedelegateValidatorSetResponse.typeUrl +); +function createBaseMsgWithdrawDelegationRewards(): MsgWithdrawDelegationRewards { + return { + delegator: '', + }; +} +export const MsgWithdrawDelegationRewards = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + aminoType: 'osmosis/MsgWithdrawDelegationRewards', + is(o: any): o is MsgWithdrawDelegationRewards { + return ( + o && + (o.$typeUrl === MsgWithdrawDelegationRewards.typeUrl || + typeof o.delegator === 'string') + ); + }, + isSDK(o: any): o is MsgWithdrawDelegationRewardsSDKType { + return ( + o && + (o.$typeUrl === MsgWithdrawDelegationRewards.typeUrl || + typeof o.delegator === 'string') + ); + }, + isAmino(o: any): o is MsgWithdrawDelegationRewardsAmino { + return ( + o && + (o.$typeUrl === MsgWithdrawDelegationRewards.typeUrl || + typeof o.delegator === 'string') + ); + }, + encode( + message: MsgWithdrawDelegationRewards, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegator !== '') { + writer.uint32(10).string(message.delegator); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawDelegationRewards { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegationRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgWithdrawDelegationRewards { + const message = createBaseMsgWithdrawDelegationRewards(); + message.delegator = object.delegator ?? ''; + return message; + }, + fromAmino( + object: MsgWithdrawDelegationRewardsAmino + ): MsgWithdrawDelegationRewards { + const message = createBaseMsgWithdrawDelegationRewards(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + return message; + }, + toAmino( + message: MsgWithdrawDelegationRewards + ): MsgWithdrawDelegationRewardsAmino { + const obj: any = {}; + obj.delegator = message.delegator === '' ? undefined : message.delegator; + return obj; + }, + fromAminoMsg( + object: MsgWithdrawDelegationRewardsAminoMsg + ): MsgWithdrawDelegationRewards { + return MsgWithdrawDelegationRewards.fromAmino(object.value); + }, + toAminoMsg( + message: MsgWithdrawDelegationRewards + ): MsgWithdrawDelegationRewardsAminoMsg { + return { + type: 'osmosis/MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgWithdrawDelegationRewardsProtoMsg + ): MsgWithdrawDelegationRewards { + return MsgWithdrawDelegationRewards.decode(message.value); + }, + toProto(message: MsgWithdrawDelegationRewards): Uint8Array { + return MsgWithdrawDelegationRewards.encode(message).finish(); + }, + toProtoMsg( + message: MsgWithdrawDelegationRewards + ): MsgWithdrawDelegationRewardsProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgWithdrawDelegationRewards.typeUrl, + MsgWithdrawDelegationRewards +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawDelegationRewards.aminoType, + MsgWithdrawDelegationRewards.typeUrl +); +function createBaseMsgWithdrawDelegationRewardsResponse(): MsgWithdrawDelegationRewardsResponse { + return {}; +} +export const MsgWithdrawDelegationRewardsResponse = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewardsResponse', + aminoType: 'osmosis/valsetpref/withdraw-delegation-rewards-response', + is(o: any): o is MsgWithdrawDelegationRewardsResponse { + return o && o.$typeUrl === MsgWithdrawDelegationRewardsResponse.typeUrl; + }, + isSDK(o: any): o is MsgWithdrawDelegationRewardsResponseSDKType { + return o && o.$typeUrl === MsgWithdrawDelegationRewardsResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawDelegationRewardsResponseAmino { + return o && o.$typeUrl === MsgWithdrawDelegationRewardsResponse.typeUrl; + }, + encode( + _: MsgWithdrawDelegationRewardsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawDelegationRewardsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegationRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgWithdrawDelegationRewardsResponse { + const message = createBaseMsgWithdrawDelegationRewardsResponse(); + return message; + }, + fromAmino( + _: MsgWithdrawDelegationRewardsResponseAmino + ): MsgWithdrawDelegationRewardsResponse { + const message = createBaseMsgWithdrawDelegationRewardsResponse(); + return message; + }, + toAmino( + _: MsgWithdrawDelegationRewardsResponse + ): MsgWithdrawDelegationRewardsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgWithdrawDelegationRewardsResponseAminoMsg + ): MsgWithdrawDelegationRewardsResponse { + return MsgWithdrawDelegationRewardsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgWithdrawDelegationRewardsResponse + ): MsgWithdrawDelegationRewardsResponseAminoMsg { + return { + type: 'osmosis/valsetpref/withdraw-delegation-rewards-response', + value: MsgWithdrawDelegationRewardsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgWithdrawDelegationRewardsResponseProtoMsg + ): MsgWithdrawDelegationRewardsResponse { + return MsgWithdrawDelegationRewardsResponse.decode(message.value); + }, + toProto(message: MsgWithdrawDelegationRewardsResponse): Uint8Array { + return MsgWithdrawDelegationRewardsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgWithdrawDelegationRewardsResponse + ): MsgWithdrawDelegationRewardsResponseProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewardsResponse', + value: MsgWithdrawDelegationRewardsResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgWithdrawDelegationRewardsResponse.typeUrl, + MsgWithdrawDelegationRewardsResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawDelegationRewardsResponse.aminoType, + MsgWithdrawDelegationRewardsResponse.typeUrl +); +function createBaseMsgDelegateBondedTokens(): MsgDelegateBondedTokens { + return { + delegator: '', + lockID: BigInt(0), + }; +} +export const MsgDelegateBondedTokens = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + aminoType: 'osmosis/valsetpref/delegate-bonded-tokens', + is(o: any): o is MsgDelegateBondedTokens { + return ( + o && + (o.$typeUrl === MsgDelegateBondedTokens.typeUrl || + (typeof o.delegator === 'string' && typeof o.lockID === 'bigint')) + ); + }, + isSDK(o: any): o is MsgDelegateBondedTokensSDKType { + return ( + o && + (o.$typeUrl === MsgDelegateBondedTokens.typeUrl || + (typeof o.delegator === 'string' && typeof o.lockID === 'bigint')) + ); + }, + isAmino(o: any): o is MsgDelegateBondedTokensAmino { + return ( + o && + (o.$typeUrl === MsgDelegateBondedTokens.typeUrl || + (typeof o.delegator === 'string' && typeof o.lockID === 'bigint')) + ); + }, + encode( + message: MsgDelegateBondedTokens, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.delegator !== '') { + writer.uint32(10).string(message.delegator); + } + if (message.lockID !== BigInt(0)) { + writer.uint32(16).uint64(message.lockID); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateBondedTokens { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateBondedTokens(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 2: + message.lockID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgDelegateBondedTokens { + const message = createBaseMsgDelegateBondedTokens(); + message.delegator = object.delegator ?? ''; + message.lockID = + object.lockID !== undefined && object.lockID !== null + ? BigInt(object.lockID.toString()) + : BigInt(0); + return message; + }, + fromAmino(object: MsgDelegateBondedTokensAmino): MsgDelegateBondedTokens { + const message = createBaseMsgDelegateBondedTokens(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + return message; + }, + toAmino(message: MsgDelegateBondedTokens): MsgDelegateBondedTokensAmino { + const obj: any = {}; + obj.delegator = message.delegator === '' ? undefined : message.delegator; + obj.lockID = + message.lockID !== BigInt(0) ? message.lockID.toString() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgDelegateBondedTokensAminoMsg + ): MsgDelegateBondedTokens { + return MsgDelegateBondedTokens.fromAmino(object.value); + }, + toAminoMsg( + message: MsgDelegateBondedTokens + ): MsgDelegateBondedTokensAminoMsg { + return { + type: 'osmosis/valsetpref/delegate-bonded-tokens', + value: MsgDelegateBondedTokens.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgDelegateBondedTokensProtoMsg + ): MsgDelegateBondedTokens { + return MsgDelegateBondedTokens.decode(message.value); + }, + toProto(message: MsgDelegateBondedTokens): Uint8Array { + return MsgDelegateBondedTokens.encode(message).finish(); + }, + toProtoMsg( + message: MsgDelegateBondedTokens + ): MsgDelegateBondedTokensProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value: MsgDelegateBondedTokens.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgDelegateBondedTokens.typeUrl, + MsgDelegateBondedTokens +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDelegateBondedTokens.aminoType, + MsgDelegateBondedTokens.typeUrl +); +function createBaseMsgDelegateBondedTokensResponse(): MsgDelegateBondedTokensResponse { + return {}; +} +export const MsgDelegateBondedTokensResponse = { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokensResponse', + aminoType: 'osmosis/valsetpref/delegate-bonded-tokens-response', + is(o: any): o is MsgDelegateBondedTokensResponse { + return o && o.$typeUrl === MsgDelegateBondedTokensResponse.typeUrl; + }, + isSDK(o: any): o is MsgDelegateBondedTokensResponseSDKType { + return o && o.$typeUrl === MsgDelegateBondedTokensResponse.typeUrl; + }, + isAmino(o: any): o is MsgDelegateBondedTokensResponseAmino { + return o && o.$typeUrl === MsgDelegateBondedTokensResponse.typeUrl; + }, + encode( + _: MsgDelegateBondedTokensResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateBondedTokensResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateBondedTokensResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgDelegateBondedTokensResponse { + const message = createBaseMsgDelegateBondedTokensResponse(); + return message; + }, + fromAmino( + _: MsgDelegateBondedTokensResponseAmino + ): MsgDelegateBondedTokensResponse { + const message = createBaseMsgDelegateBondedTokensResponse(); + return message; + }, + toAmino( + _: MsgDelegateBondedTokensResponse + ): MsgDelegateBondedTokensResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgDelegateBondedTokensResponseAminoMsg + ): MsgDelegateBondedTokensResponse { + return MsgDelegateBondedTokensResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgDelegateBondedTokensResponse + ): MsgDelegateBondedTokensResponseAminoMsg { + return { + type: 'osmosis/valsetpref/delegate-bonded-tokens-response', + value: MsgDelegateBondedTokensResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgDelegateBondedTokensResponseProtoMsg + ): MsgDelegateBondedTokensResponse { + return MsgDelegateBondedTokensResponse.decode(message.value); + }, + toProto(message: MsgDelegateBondedTokensResponse): Uint8Array { + return MsgDelegateBondedTokensResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgDelegateBondedTokensResponse + ): MsgDelegateBondedTokensResponseProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokensResponse', + value: MsgDelegateBondedTokensResponse.encode(message).finish(), + }; + }, +}; +GlobalDecoderRegistry.register( + MsgDelegateBondedTokensResponse.typeUrl, + MsgDelegateBondedTokensResponse +); +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDelegateBondedTokensResponse.aminoType, + MsgDelegateBondedTokensResponse.typeUrl +); diff --git a/packages/cosmos/src/proto_export/registry.ts b/packages/cosmos/src/proto_export/registry.ts new file mode 100644 index 00000000..94d550cb --- /dev/null +++ b/packages/cosmos/src/proto_export/registry.ts @@ -0,0 +1,219 @@ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +import { BinaryReader } from './binary'; +import { Any, AnyAmino } from './google/protobuf/any'; +import { IProtoType, TelescopeGeneratedCodec } from './types'; + +export class GlobalDecoderRegistry { + static registry: { + [key: string]: TelescopeGeneratedCodec; + } = {}; + + static aminoProtoMapping: { + [key: string]: string; + } = {}; + + static registerAminoProtoMapping(aminoType: string, typeUrl: string) { + GlobalDecoderRegistry.aminoProtoMapping[aminoType] = typeUrl; + } + + static register( + key: string, + decoder: TelescopeGeneratedCodec + ) { + GlobalDecoderRegistry.registry[key] = decoder; + } + static getDecoder( + key: string + ): TelescopeGeneratedCodec { + return GlobalDecoderRegistry.registry[key]; + } + static getDecoderByInstance( + obj: unknown + ): TelescopeGeneratedCodec | null { + if (obj === undefined || obj === null) { + return null; + } + const protoType = obj as IProtoType; + + if (protoType.$typeUrl) { + return GlobalDecoderRegistry.getDecoder( + protoType.$typeUrl + ); + } + + for (const key in GlobalDecoderRegistry.registry) { + if ( + Object.prototype.hasOwnProperty.call( + GlobalDecoderRegistry.registry, + key + ) + ) { + const element = GlobalDecoderRegistry.registry[key]; + + if (element.is!(obj)) { + return element; + } + + if (element.isSDK && element.isSDK(obj)) { + return element; + } + + if (element.isAmino && element.isAmino(obj)) { + return element; + } + } + } + + return null; + } + static getDecoderByAminoType( + type: string + ): TelescopeGeneratedCodec | null { + if (type === undefined || type === null) { + return null; + } + + const typeUrl = GlobalDecoderRegistry.aminoProtoMapping[type]; + + if (!typeUrl) { + return null; + } + + return GlobalDecoderRegistry.getDecoder(typeUrl); + } + static wrapAny(obj: unknown): Any { + if (Any.is(obj)) { + return obj; + } + + const decoder = getDecoderByInstance(obj); + + return { + typeUrl: decoder.typeUrl, + value: decoder.encode(obj).finish(), + }; + } + static unwrapAny(input: BinaryReader | Uint8Array | Any) { + let data; + + if (Any.is(input)) { + data = input; + } else { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + + data = Any.decode(reader, reader.uint32()); + } + + const decoder = GlobalDecoderRegistry.getDecoder( + data.typeUrl + ); + + if (!decoder) { + return data; + } + + return decoder.decode(data.value); + } + static fromJSON(object: any): T { + const decoder = getDecoderByInstance(object); + return decoder.fromJSON!(object); + } + static toJSON(message: T): any { + const decoder = getDecoderByInstance(message); + return decoder.toJSON!(message); + } + static fromPartial(object: unknown): T { + const decoder = getDecoderByInstance(object); + return decoder ? decoder.fromPartial(object) : (object as T); + } + static fromSDK(object: SDK): T { + const decoder = getDecoderByInstance(object); + return decoder.fromSDK!(object); + } + static fromSDKJSON(object: any): SDK { + const decoder = getDecoderByInstance(object); + return decoder.fromSDKJSON!(object); + } + static toSDK(object: T): SDK { + const decoder = getDecoderByInstance(object); + return decoder.toSDK!(object); + } + static fromAmino(object: Amino): T { + const decoder = getDecoderByInstance(object); + return decoder.fromAmino!(object); + } + static fromAminoMsg(object: AnyAmino): T { + const decoder = GlobalDecoderRegistry.getDecoderByAminoType< + T, + unknown, + Amino + >(object.type); + + if (!decoder) { + throw new Error(`There's no decoder for the amino type ${object.type}`); + } + + return decoder.fromAminoMsg!(object); + } + static toAmino(object: T): Amino { + let data: any; + let decoder: TelescopeGeneratedCodec; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAmino!(data); + } + static toAminoMsg(object: T): AnyAmino { + let data: any; + let decoder: TelescopeGeneratedCodec; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAminoMsg!(data); + } +} + +function getDecoderByInstance( + obj: unknown +): TelescopeGeneratedCodec { + const decoder = GlobalDecoderRegistry.getDecoderByInstance( + obj + ); + + if (!decoder) { + throw new Error( + `There's no decoder for the instance ${JSON.stringify(obj)}` + ); + } + + return decoder; +} + +GlobalDecoderRegistry.register(Any.typeUrl, Any); diff --git a/packages/cosmos/src/proto_export/types.ts b/packages/cosmos/src/proto_export/types.ts new file mode 100644 index 00000000..dd42e74a --- /dev/null +++ b/packages/cosmos/src/proto_export/types.ts @@ -0,0 +1,157 @@ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +import { OfflineSigner } from '@cosmjs/proto-signing'; +import { HttpEndpoint } from '@cosmjs/tendermint-rpc'; + +import { IBinaryReader, IBinaryWriter } from './binary'; +import { Any } from './google/protobuf/any'; + +export type ProtoMsg = Omit & { typeUrl: any }; + +export interface IAminoMsg { + type: any; + value: Amino; +} + +export interface IProtoType { + $typeUrl?: any; +} + +/** + * A type generated by Telescope 1.0. + */ +export interface TelescopeGeneratedCodec< + T = unknown, + SDK = unknown, + Amino = unknown +> { + readonly typeUrl: string; + readonly aminoType?: string; + is?(o: unknown): o is T; + isSDK?(o: unknown): o is SDK; + isAmino?(o: unknown): o is Amino; + encode: (message: T, writer?: IBinaryWriter | any) => IBinaryWriter | any; + decode: (input: IBinaryReader | Uint8Array | any, length?: number) => T; + fromPartial: (object: any) => T | any; + fromJSON?: (object: any) => T | any; + toJSON?: (message: T | any) => any; + fromSDK?: (sdk: SDK) => T; + fromSDKJSON?: (object: any) => SDK; + toSDK?: (message: T) => SDK; + fromAmino?: (amino: Amino) => T; + toAmino?: (message: T) => Amino; + fromAminoMsg?: (aminoMsg: IAminoMsg) => T; + toAminoMsg?: (message: T) => IAminoMsg; + toProto?: (message: T) => Uint8Array; + fromProtoMsg?: (message: ProtoMsg) => T; + toProtoMsg?: (message: T) => Any; +} + +export type TelescopeGeneratedType< + T = unknown, + SDK = unknown, + Amino = unknown +> = TelescopeGeneratedCodec; + +export type GeneratedType = TelescopeGeneratedCodec; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} + +export type EncodeObject = Message; + +export interface Message { + typeUrl: string; + value: T; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface TxRpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; + signAndBroadcast?( + signerAddress: string, + messages: EncodeObject[], + fee: StdFee | 'auto' | number, + memo: string + ): Promise; +} + +export interface SigningClientParams { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +} diff --git a/packages/cosmos/src/proto_export/utf8.ts b/packages/cosmos/src/proto_export/utf8.ts new file mode 100644 index 00000000..4f8c36d4 --- /dev/null +++ b/packages/cosmos/src/proto_export/utf8.ts @@ -0,0 +1,148 @@ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +'use strict'; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function utf8Length(str: string) { + let len = 0, + c = 0; + for (let i = 0; i < str.length; ++i) { + c = str.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ( + (c & 0xfc00) === 0xd800 && + (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i; + len += 4; + } else len += 3; + } + return len; +} + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function utf8Read( + buffer: ArrayLike, + start: number, + end: number +) { + const len = end - start; + if (len < 1) return ''; + const chunk = []; + let parts: string[] = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63); + else if (t > 239 && t < 365) { + t = + (((t & 7) << 18) | + ((buffer[start++] & 63) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63)) - + 0x10000; + chunk[i++] = 0xd800 + (t >> 10); + chunk[i++] = 0xdc00 + (t & 1023); + } else + chunk[i++] = + ((t & 15) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63); + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode(...chunk)); + i = 0; + } + } + if (parts) { + if (i) parts.push(String.fromCharCode(...chunk.slice(0, i))); + return parts.join(''); + } + return String.fromCharCode(...chunk.slice(0, i)); +} + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function utf8Write( + str: string, + buffer: Uint8Array | Array, + offset: number +) { + const start = offset; + let c1, // character 1 + c2; // character 2 + for (let i = 0; i < str.length; ++i) { + c1 = str.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return offset - start; +} diff --git a/packages/cosmos/src/proto_export/varint.ts b/packages/cosmos/src/proto_export/varint.ts new file mode 100644 index 00000000..c15e78db --- /dev/null +++ b/packages/cosmos/src/proto_export/varint.ts @@ -0,0 +1,488 @@ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */ + +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read(this: ReaderLike): [number, number] { + let lowBits = 0; + let highBits = 0; + + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + let middleByte = this.buf[this.pos++]; + + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + throw new Error('invalid varint'); +} + +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo: number, hi: number, bytes: number[]): void { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + + if (!hasMoreBits) { + return; + } + + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + bytes.push((hi >>> 31) & 0x01); +} + +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; + +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec: string): { lo: number; hi: number } { + // Check for minus sign. + const minus = dec[0] === '-'; + if (minus) { + dec = dec.slice(1); + } + + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + + function add1e6digit(begin: number, end?: number) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} + +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo: number, hi: number): string { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? '-' + result : result; +} + +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo: number, hi: number): string { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return ( + digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA) + ); +} + +function toUnsigned(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} + +function newBits(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo | 0, hi: hi | 0 }; +} + +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits: number, highBits: number) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} + +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7: number) => { + const partial = String(digit1e7); + return '0000000'.slice(partial.length) + partial; +}; + +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value: number, bytes: number[]): void { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} + +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read(this: ReaderLike): number { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + + if ((b & 0x80) != 0) throw new Error('invalid varint'); + + this.assertBounds(); + + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} + +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; + +/** + * encode zig zag + */ +export function zzEncode(lo: number, hi: number) { + let mask = hi >> 31; + hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0; + lo = ((lo << 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * decode zig zag + */ +export function zzDecode(lo: number, hi: number) { + let mask = -(lo & 1); + lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0; + hi = ((hi >>> 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * unsigned int32 without moving pos. + */ +export function readUInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + buf[pos + 3] * 0x1000000 + ); +} + +/** + * signed int32 without moving pos. + */ +export function readInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + (buf[pos + 3] << 24) + ); +} + +/** + * writing varint32 to pos + */ +export function writeVarint32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + while (val > 127) { + buf[pos++] = (val & 127) | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * writing varint64 to pos + */ +export function writeVarint64( + val: { lo: number; hi: number }, + buf: Uint8Array | number[], + pos: number +) { + while (val.hi) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +export function int64Length(lo: number, hi: number) { + let part0 = lo, + part1 = ((lo >>> 28) | (hi << 4)) >>> 0, + part2 = hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 + ? 1 + : 2 + : part0 < 2097152 + ? 3 + : 4 + : part1 < 16384 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 + : part2 < 128 + ? 9 + : 10; +} + +export function writeFixed32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; + buf[pos + 1] = (val >>> 8) & 255; + buf[pos + 2] = (val >>> 16) & 255; + buf[pos + 3] = val >>> 24; +} + +export function writeByte( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; +} diff --git a/packages/cosmos/src/signers/private-key.signer.ts b/packages/cosmos/src/signers/private-key.signer.ts index ed9452df..3d9d805f 100644 --- a/packages/cosmos/src/signers/private-key.signer.ts +++ b/packages/cosmos/src/signers/private-key.signer.ts @@ -2,7 +2,7 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing'; import { SigningStargateClient } from '@cosmjs/stargate'; import { fromHex } from '@cosmjs/encoding'; -import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { TxRaw, SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { bech32 } from 'bech32'; import { stringToPath, @@ -13,9 +13,8 @@ import { RawKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { Secp256k1Wallet } from '@cosmjs/amino'; -import { CosmosProvider } from 'src/chain.provider'; -import { SignDoc } from 'osmojs/cosmos/tx/v1beta1/tx'; +import { CosmosProvider } from '../chain.provider'; import { AminoSignDoc, ChainMsg, diff --git a/packages/cosmos/src/signers/seed-phrase.signer.ts b/packages/cosmos/src/signers/seed-phrase.signer.ts index e4ae289d..5f52b38a 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.ts @@ -1,7 +1,7 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { Secp256k1HdWallet } from '@cosmjs/launchpad'; import { SigningStargateClient } from '@cosmjs/stargate'; -import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { TxRaw, SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { bech32 } from 'bech32'; import { stringToPath, @@ -12,9 +12,8 @@ import { MnemonicKey, LCDClient } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'; -import { CosmosProvider } from 'src/chain.provider'; -import { SignDoc } from 'osmojs/cosmos/tx/v1beta1/tx'; +import { CosmosProvider } from '../chain.provider'; import { AminoSignDoc, ChainMsg, diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index a5c643eb..71af01d4 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -4,14 +4,14 @@ import { } from '@cosmjs/stargate/build/signingstargateclient'; import { AminoTypes } from '@cosmjs/stargate/build/aminotypes'; import { Registry } from '@cosmjs/proto-signing/build/registry'; -import { - osmosisProtoRegistry, - osmosisAminoConverters, -} from 'osmojs/osmosis/client'; import axios from 'axios'; import { wasmTypes } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/messages'; import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/aminomessages'; +import { + osmosisProtoRegistry, + osmosisAminoConverters, +} from './proto_export/osmosis/client'; import { COSMOS_MANIFESTS, CosmosHubChains } from './manifests'; import { AminoMsgSend, MsgBody } from './msg'; diff --git a/packages/unlink-all-packages.sh b/packages/unlink-all-packages.sh new file mode 100755 index 00000000..caeddefb --- /dev/null +++ b/packages/unlink-all-packages.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Get the current directory +current_dir=$(pwd) + +# Output file for the yarn link commands +output_file="yarn-unlink-commands.sh" + +# Initialize the output file +echo "#!/bin/bash" > "$output_file" +echo "" >> "$output_file" + +# Iterate over each item in the current directory +for dir in "$current_dir"/*; do + # Check if the item is a directory + if [ -d "$dir" ]; then + # Check if the directory contains a package.json file + if [ -f "$dir/package.json" ]; then + package_name=$(basename "$dir") + echo "Linking package in $dir" + (cd "$dir" && yarn unlink) + echo "yarn unlink @xdefi-tech/chains-$package_name" >> "$output_file" + else + echo "Skipping $dir, no package.json found" + fi + fi +done + +# Make the output file executable +chmod +x "$output_file" + +echo "All packages have been processed." +echo "Run './$output_file' in your target project to link the packages." \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 4f2b5486..bcba76bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2189,10 +2189,10 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg== -"@cosmology/lcd@^0.13.3": - version "0.13.3" - resolved "https://registry.yarnpkg.com/@cosmology/lcd/-/lcd-0.13.3.tgz#4072178cfe979b948ab596c9378b56c4f320d192" - integrity sha512-lihAHCoap0GN/32qcOhiMp6HcoZP8A7GeScZMlmmvBtBk6ocGAStNHjvBR4MayrvyHSCOZCvCAWPh36iFTT8Sw== +"@cosmology/lcd@^0.13.4": + version "0.13.4" + resolved "https://registry.yarnpkg.com/@cosmology/lcd/-/lcd-0.13.4.tgz#5b0a8c309cb0d66f949d271eaf2f02699ae36ad4" + integrity sha512-llClHHHjOCie9PxnXUOxvMcWi0aVjmzkRXM6IBBXluOczRFFog23rPPfrWZPeT30dIX1SGklp0Fek28O76BkvQ== dependencies: axios "1.6.0" @@ -15394,17 +15394,6 @@ osenv@^0.1.5: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -osmojs@16.14.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/osmojs/-/osmojs-16.14.0.tgz#5558e74f76b9b05e6f74dd1bd6f57ae768c5a4f4" - integrity sha512-m4A5X0ZYanQ/u4/Xlz6nU9QqZEQbAKSD8SAKaDR/mIQYB6g3JkzWLgQgLMzMxDNJZKFTJCjWxHBp7al502x2aw== - dependencies: - "@cosmjs/amino" "0.32.3" - "@cosmjs/proto-signing" "0.32.3" - "@cosmjs/stargate" "0.32.3" - "@cosmjs/tendermint-rpc" "0.32.3" - "@cosmology/lcd" "^0.13.3" - outdent@^0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz" @@ -18418,10 +18407,10 @@ ts-proto-descriptors@1.16.0: long "^5.2.3" protobufjs "^7.2.4" -ts-proto@^1.181.0: - version "1.181.0" - resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.181.0.tgz#9f87240c3cd9a6ac512fbbdab09ce51664f9c541" - integrity sha512-5+ZnxOgPsSn/lU93x8ApEFQPHE9G8kZubCSF1/EUjyeKImbGRp27iPXHilelQLOdClYHLUgr3hJwqtVqfsjNYQ== +ts-proto@^1.181.1: + version "1.181.1" + resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.181.1.tgz#d96707087840870cae4d293f9cd6d52ed66bdede" + integrity sha512-lNmd/KEgqWtwDG9mIM3EpcxBx+URRVHkDP/EEJBgQJaQwmZFTk6VjHg56HNQswd114yXGfF+8pKQvJ2iH9KfWw== dependencies: case-anything "^2.1.13" protobufjs "^7.2.4" From 2d477cfdb3b4d07e8cf86a251e02124c192c9343 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 30 Jul 2024 10:18:29 +0000 Subject: [PATCH 085/176] Version packages --- .changeset/great-laws-fry.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/great-laws-fry.md diff --git a/.changeset/great-laws-fry.md b/.changeset/great-laws-fry.md deleted file mode 100644 index fb0c4885..00000000 --- a/.changeset/great-laws-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -use protobuf for cosmos types (remove osmojs dependency) diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 94f4d11e..eb2ad024 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.32 + +### Patch Changes + +- 340ec5ef: use protobuf for cosmos types (remove osmojs dependency) + ## 2.0.31 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 8e4a8522..bed111c1 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.31", + "version": "2.0.32", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From db9785b505e1d7076b0d3f9d1768b879239ea0c2 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:42:11 +0100 Subject: [PATCH 086/176] @szymon/tsup node (#282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add link-all-directories.sh * yarn-link-commands.sh * fix * add unlink * add link-all-directories.sh * yarn-link-commands.sh * fix * add unlink * use tsup but excluse packages * cleanup * bump: add changeset --------- Co-authored-by: Szymon Kapała Co-authored-by: danilxdefi Co-authored-by: dp <25910069+davidp94@users.noreply.github.com> --- .changeset/few-turtles-shop.md | 16 +++++++++ packages/binance/package.json | 4 +-- packages/bitcoin/package.json | 12 +++++-- packages/bitcoincash/package.json | 12 +++++-- packages/core/package.json | 7 ++-- packages/dogecoin/package.json | 12 +++++-- packages/evm/package.json | 6 +++- packages/link-all-packages.sh | 33 +++++++++++++++++++ packages/litecoin/package.json | 12 +++++-- packages/solana/package.json | 12 +++++-- packages/solana/src/gql/index.ts | 1 + packages/tron/package.json | 12 +++++-- packages/utxo/package.json | 3 +- packages/yarn-link-commands.sh | 14 ++++++++ packages/yarn-unlink-commands.sh | 14 ++++++++ templates/basic/new/package.ejs.t | 3 +- .../chains-controller/package.json | 5 +-- utility-packages/graphql/package.json | 3 +- 18 files changed, 156 insertions(+), 25 deletions(-) create mode 100644 .changeset/few-turtles-shop.md create mode 100755 packages/link-all-packages.sh create mode 100755 packages/yarn-link-commands.sh create mode 100755 packages/yarn-unlink-commands.sh diff --git a/.changeset/few-turtles-shop.md b/.changeset/few-turtles-shop.md new file mode 100644 index 00000000..bf8423cc --- /dev/null +++ b/.changeset/few-turtles-shop.md @@ -0,0 +1,16 @@ +--- +'@xdefi-tech/chains-controller': patch +'@xdefi-tech/chains-graphql': patch +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-utxo': patch +'@xdefi-tech/chains-evm': patch +--- + +Feat: update build config diff --git a/packages/binance/package.json b/packages/binance/package.json index 633e35bb..86b3dfa4 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -70,9 +70,7 @@ ], "platform": "browser", "targer": "ES6", - "external": [ - "@binance-chain/javascript-sdk" - ] + "external": ["*"] }, "jest": { "setupFiles": [ diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index bca4518e..8ccb7791 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -73,14 +73,22 @@ "format": "cjs", "splitting": false, "dts": true, - "shims": true, + "shims": false, "types": [ "./dist/signers/web.d.ts", "./dist/signers/react-native.d.ts", "./dist/index.d.ts" ], + "clean": true, + "treeshake": true, "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] + }, + "esbuildOptions": { + "minifyWhitespace": true, + "minifyIdentifiers": true, + "minifySyntax": true }, "jest": { "setupFiles": [ diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index ec2e0a6a..5159bb48 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -76,14 +76,22 @@ "format": "cjs", "splitting": false, "dts": true, - "shims": true, + "shims": false, "types": [ "./dist/signers/web.d.ts", "./dist/signers/react-native.d.ts", "./dist/index.d.ts" ], + "clean": true, + "treeshake": true, "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] + }, + "esbuildOptions": { + "minifyWhitespace": true, + "minifyIdentifiers": true, + "minifySyntax": true }, "jest": { "setupFiles": [ diff --git a/packages/core/package.json b/packages/core/package.json index a92b36f0..7599bdd3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -77,14 +77,17 @@ "!src/custom.d.ts" ], "outDir": "dist", - "format": "cjs", + "format": ["cjs"], "splitting": false, "dts": true, + "keepNames": true, + "sourcemap": true, "types": [ "./dist/index.d.ts" ], "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] }, "jest": { "setupFiles": [], diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 5d4a54a2..31fb32a9 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -72,14 +72,22 @@ "format": "cjs", "splitting": false, "dts": true, - "shims": true, + "shims": false, "types": [ "./dist/signers/web.d.ts", "./dist/signers/react-native.d.ts", "./dist/index.d.ts" ], + "clean": true, + "treeshake": true, "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] + }, + "esbuildOptions": { + "minifyWhitespace": true, + "minifyIdentifiers": true, + "minifySyntax": true }, "jest": { "setupFiles": [ diff --git a/packages/evm/package.json b/packages/evm/package.json index 5b5d4096..6432294a 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -75,8 +75,12 @@ "./dist/signers/react-native.d.ts", "./dist/index.d.ts" ], + "keepNames": true, "platform": "browser", - "target": "ES6" + "target": "ES6", + "sourcemap": true, + "skipNodeModulesBundle": true, + "external": ["*"] }, "jest": { "setupFiles": [ diff --git a/packages/link-all-packages.sh b/packages/link-all-packages.sh new file mode 100755 index 00000000..083b3ee8 --- /dev/null +++ b/packages/link-all-packages.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Get the current directory +current_dir=$(pwd) + +# Output file for the yarn link commands +output_file="yarn-link-commands.sh" + +# Initialize the output file +echo "#!/bin/bash" > "$output_file" +echo "" >> "$output_file" + +# Iterate over each item in the current directory +for dir in "$current_dir"/*; do + # Check if the item is a directory + if [ -d "$dir" ]; then + # Check if the directory contains a package.json file + if [ -f "$dir/package.json" ]; then + package_name=$(basename "$dir") + echo "Linking package in $dir" + (cd "$dir" && yarn link) + echo "yarn link @xdefi-tech/chains-$package_name" >> "$output_file" + else + echo "Skipping $dir, no package.json found" + fi + fi +done + +# Make the output file executable +chmod +x "$output_file" + +echo "All packages have been processed." +echo "Run './$output_file' in your target project to link the packages." \ No newline at end of file diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 723ef06e..d425b556 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -73,14 +73,22 @@ "format": "cjs", "splitting": false, "dts": true, - "shims": true, + "shims": false, "types": [ "./dist/signers/web.d.ts", "./dist/signers/react-native.d.ts", "./dist/index.d.ts" ], + "clean": true, + "treeshake": true, "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] + }, + "esbuildOptions": { + "minifyWhitespace": true, + "minifyIdentifiers": true, + "minifySyntax": true }, "jest": { "setupFiles": [ diff --git a/packages/solana/package.json b/packages/solana/package.json index ac2fed36..976a9744 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -71,14 +71,22 @@ "format": "cjs", "splitting": false, "dts": true, - "shims": true, + "shims": false, "types": [ "./dist/signers/web.d.ts", "./dist/signers/react-native.d.ts", "./dist/index.d.ts" ], + "clean": true, + "treeshake": true, "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] + }, + "esbuildOptions": { + "minifyWhitespace": true, + "minifyIdentifiers": true, + "minifySyntax": true }, "jest": { "setupFiles": [ diff --git a/packages/solana/src/gql/index.ts b/packages/solana/src/gql/index.ts index c682b1e2..aa66c634 100644 --- a/packages/solana/src/gql/index.ts +++ b/packages/solana/src/gql/index.ts @@ -1,2 +1,3 @@ export * from './fragment-masking'; export * from './gql'; +export * from './graphql'; diff --git a/packages/tron/package.json b/packages/tron/package.json index d24b85da..152a2711 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -67,14 +67,22 @@ "format": "cjs", "splitting": false, "dts": true, - "shims": true, + "shims": false, "types": [ "./dist/signers/web.d.ts", "./dist/signers/react-native.d.ts", "./dist/index.d.ts" ], + "clean": true, + "treeshake": true, "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] + }, + "esbuildOptions": { + "minifyWhitespace": true, + "minifyIdentifiers": true, + "minifySyntax": true }, "jest": { "setupFiles": [ diff --git a/packages/utxo/package.json b/packages/utxo/package.json index d041a45a..ff3a20c0 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -60,7 +60,8 @@ "./dist/index.d.ts" ], "platform": "browser", - "target": "ES6" + "target": "ES6", + "external": ["*"] }, "jest": { "preset": "ts-jest/presets/js-with-ts", diff --git a/packages/yarn-link-commands.sh b/packages/yarn-link-commands.sh new file mode 100755 index 00000000..06e5e1cf --- /dev/null +++ b/packages/yarn-link-commands.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +yarn link @xdefi-tech/chains-binance +yarn link @xdefi-tech/chains-bitcoin +yarn link @xdefi-tech/chains-bitcoincash +yarn link @xdefi-tech/chains-core +yarn link @xdefi-tech/chains-cosmos +yarn link @xdefi-tech/chains-dogecoin +yarn link @xdefi-tech/chains-evm +yarn link @xdefi-tech/chains-litecoin +yarn link @xdefi-tech/chains-solana +yarn link @xdefi-tech/chains-thor +yarn link @xdefi-tech/chains-tron +yarn link @xdefi-tech/chains-utxo diff --git a/packages/yarn-unlink-commands.sh b/packages/yarn-unlink-commands.sh new file mode 100755 index 00000000..8eddfbe4 --- /dev/null +++ b/packages/yarn-unlink-commands.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +yarn unlink @xdefi-tech/chains-binance +yarn unlink @xdefi-tech/chains-bitcoin +yarn unlink @xdefi-tech/chains-bitcoincash +yarn unlink @xdefi-tech/chains-core +yarn unlink @xdefi-tech/chains-cosmos +yarn unlink @xdefi-tech/chains-dogecoin +yarn unlink @xdefi-tech/chains-evm +yarn unlink @xdefi-tech/chains-litecoin +yarn unlink @xdefi-tech/chains-solana +yarn unlink @xdefi-tech/chains-thor +yarn unlink @xdefi-tech/chains-tron +yarn unlink @xdefi-tech/chains-utxo diff --git a/templates/basic/new/package.ejs.t b/templates/basic/new/package.ejs.t index 3a87aeac..1b0c6f08 100644 --- a/templates/basic/new/package.ejs.t +++ b/templates/basic/new/package.ejs.t @@ -48,6 +48,7 @@ to: packages/<%= name.toLowerCase() %>/package.json "./signers/web.d.ts", "./signers/react-native.d.ts" ], - "platform": "browser" + "platform": "browser", + "external": ["*"] } } diff --git a/utility-packages/chains-controller/package.json b/utility-packages/chains-controller/package.json index f1438ab1..40b5900a 100644 --- a/utility-packages/chains-controller/package.json +++ b/utility-packages/chains-controller/package.json @@ -60,10 +60,7 @@ ], "platform": "browser", "target": "ES6", - "external": [ - "@xdefi-tech/chains-cosmos", - "@xdefi-tech/chains-btc" - ] + "external": ["*"] }, "jest": { "setupFiles": [ diff --git a/utility-packages/graphql/package.json b/utility-packages/graphql/package.json index c2ff81ff..a0ed30c2 100644 --- a/utility-packages/graphql/package.json +++ b/utility-packages/graphql/package.json @@ -43,6 +43,7 @@ "./dist/index.d.ts" ], "platform": "browser", - "target": "es2015" + "target": "es2015", + "external": ["*"] } } From 1710d127c8a716d613805bffff880a0d021c12c4 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 30 Jul 2024 10:44:43 +0000 Subject: [PATCH 087/176] Version packages --- .changeset/few-turtles-shop.md | 16 ---------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 6 ++++-- packages/bitcoin/CHANGELOG.md | 9 +++++++++ packages/bitcoin/package.json | 8 +++++--- packages/bitcoincash/CHANGELOG.md | 9 +++++++++ packages/bitcoincash/package.json | 8 +++++--- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 10 +++++++--- packages/dogecoin/CHANGELOG.md | 9 +++++++++ packages/dogecoin/package.json | 8 +++++--- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 6 ++++-- packages/litecoin/CHANGELOG.md | 9 +++++++++ packages/litecoin/package.json | 8 +++++--- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 8 +++++--- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 8 +++++--- packages/utxo/CHANGELOG.md | 8 ++++++++ packages/utxo/package.json | 6 ++++-- utility-packages/chains-controller/CHANGELOG.md | 16 ++++++++++++++++ utility-packages/chains-controller/package.json | 6 ++++-- utility-packages/graphql/CHANGELOG.md | 8 ++++++++ utility-packages/graphql/package.json | 6 ++++-- 25 files changed, 163 insertions(+), 47 deletions(-) delete mode 100644 .changeset/few-turtles-shop.md diff --git a/.changeset/few-turtles-shop.md b/.changeset/few-turtles-shop.md deleted file mode 100644 index bf8423cc..00000000 --- a/.changeset/few-turtles-shop.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@xdefi-tech/chains-controller': patch -'@xdefi-tech/chains-graphql': patch -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-utxo': patch -'@xdefi-tech/chains-evm': patch ---- - -Feat: update build config diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 47fe3ccb..2800c62e 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.19 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + ## 2.0.18 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 86b3dfa4..aa683584 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.18", + "version": "2.0.19", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -70,7 +70,9 @@ ], "platform": "browser", "targer": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "jest": { "setupFiles": [ diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 71b6d163..112bff7c 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoin +## 2.0.25 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + - @xdefi-tech/chains-utxo@2.0.12 + ## 2.0.24 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 8ccb7791..938dbd04 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.24", + "version": "2.0.25", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -80,10 +80,12 @@ "./dist/index.d.ts" ], "clean": true, - "treeshake": true, + "treeshake": true, "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "esbuildOptions": { "minifyWhitespace": true, diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 6c4fb32f..03887b66 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.25 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + - @xdefi-tech/chains-utxo@2.0.12 + ## 2.0.24 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 5159bb48..7910de16 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.24", + "version": "2.0.25", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -83,10 +83,12 @@ "./dist/index.d.ts" ], "clean": true, - "treeshake": true, + "treeshake": true, "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "esbuildOptions": { "minifyWhitespace": true, diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 5ba77e6f..103d69d2 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.25 + +### Patch Changes + +- 85b3eb03: Feat: update build config + ## 2.0.24 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 7599bdd3..87940bbe 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.24", + "version": "2.0.25", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -77,7 +77,9 @@ "!src/custom.d.ts" ], "outDir": "dist", - "format": ["cjs"], + "format": [ + "cjs" + ], "splitting": false, "dts": true, "keepNames": true, @@ -87,7 +89,9 @@ ], "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "jest": { "setupFiles": [], diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index db357484..e9b1b9d8 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-dogecoin +## 2.0.24 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + - @xdefi-tech/chains-utxo@2.0.12 + ## 2.0.23 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 31fb32a9..c69cd9ec 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.23", + "version": "2.0.24", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -79,10 +79,12 @@ "./dist/index.d.ts" ], "clean": true, - "treeshake": true, + "treeshake": true, "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "esbuildOptions": { "minifyWhitespace": true, diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 1720b9de..bd64bf47 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.39 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + ## 2.0.38 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 6432294a..c49a406f 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.38", + "version": "2.0.39", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -80,7 +80,9 @@ "target": "ES6", "sourcemap": true, "skipNodeModulesBundle": true, - "external": ["*"] + "external": [ + "*" + ] }, "jest": { "setupFiles": [ diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 678d4cf1..6fb032d7 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-litecoin +## 2.0.22 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + - @xdefi-tech/chains-utxo@2.0.12 + ## 2.0.21 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index d425b556..0d23eaef 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.21", + "version": "2.0.22", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -80,10 +80,12 @@ "./dist/index.d.ts" ], "clean": true, - "treeshake": true, + "treeshake": true, "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "esbuildOptions": { "minifyWhitespace": true, diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 5baf249e..4af3be11 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.26 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + ## 2.0.25 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 976a9744..9e9e1410 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.25", + "version": "2.0.26", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -78,10 +78,12 @@ "./dist/index.d.ts" ], "clean": true, - "treeshake": true, + "treeshake": true, "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "esbuildOptions": { "minifyWhitespace": true, diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 39b1638f..930beaa7 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.27 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + ## 2.0.26 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 152a2711..81d7225c 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.26", + "version": "2.0.27", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -74,10 +74,12 @@ "./dist/index.d.ts" ], "clean": true, - "treeshake": true, + "treeshake": true, "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "esbuildOptions": { "minifyWhitespace": true, diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index 13282b9a..7c2017f9 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-utxo +## 2.0.12 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + ## 2.0.11 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index ff3a20c0..1bbf6876 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.11", + "version": "2.0.12", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", @@ -61,7 +61,9 @@ ], "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "jest": { "preset": "ts-jest/presets/js-with-ts", diff --git a/utility-packages/chains-controller/CHANGELOG.md b/utility-packages/chains-controller/CHANGELOG.md index b727e480..24227bb7 100644 --- a/utility-packages/chains-controller/CHANGELOG.md +++ b/utility-packages/chains-controller/CHANGELOG.md @@ -1,5 +1,21 @@ # @xdefi-tech/chains-controller +## 2.0.8 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-graphql@1.2.16 + - @xdefi-tech/chains-bitcoincash@2.0.25 + - @xdefi-tech/chains-dogecoin@2.0.24 + - @xdefi-tech/chains-litecoin@2.0.22 + - @xdefi-tech/chains-binance@2.0.19 + - @xdefi-tech/chains-bitcoin@2.0.25 + - @xdefi-tech/chains-solana@2.0.26 + - @xdefi-tech/chains-core@2.0.25 + - @xdefi-tech/chains-evm@2.0.39 + ## 2.0.7 ### Patch Changes diff --git a/utility-packages/chains-controller/package.json b/utility-packages/chains-controller/package.json index 40b5900a..0a533b49 100644 --- a/utility-packages/chains-controller/package.json +++ b/utility-packages/chains-controller/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-controller", - "version": "2.0.7", + "version": "2.0.8", "license": "MIT", "repository": "https://github.com/XDeFi-tech/chains/", "main": "dist/index.js", @@ -60,7 +60,9 @@ ], "platform": "browser", "target": "ES6", - "external": ["*"] + "external": [ + "*" + ] }, "jest": { "setupFiles": [ diff --git a/utility-packages/graphql/CHANGELOG.md b/utility-packages/graphql/CHANGELOG.md index df449035..3f183e8e 100644 --- a/utility-packages/graphql/CHANGELOG.md +++ b/utility-packages/graphql/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-graphql +## 1.2.16 + +### Patch Changes + +- 85b3eb03: Feat: update build config +- Updated dependencies [85b3eb03] + - @xdefi-tech/chains-core@2.0.25 + ## 1.2.15 ### Patch Changes diff --git a/utility-packages/graphql/package.json b/utility-packages/graphql/package.json index a0ed30c2..192aa2f8 100644 --- a/utility-packages/graphql/package.json +++ b/utility-packages/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-graphql", - "version": "1.2.15", + "version": "1.2.16", "license": "MIT", "repository": "https://github.com/XDeFi-tech/chains/", "main": "dist/index.js", @@ -44,6 +44,8 @@ ], "platform": "browser", "target": "es2015", - "external": ["*"] + "external": [ + "*" + ] } } From 4b345c96cb9d97e7305cd981ec260395d403f69f Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:29:08 +0700 Subject: [PATCH 088/176] fix: ordinals transfer tx not contain fee (#296) * fix: ordinals transfer tx not contain fee * fix: utxo format for inputBytes from coinselect * fix: test cases --------- Co-authored-by: sotatek-tyler-nguyen4 Co-authored-by: Liam McAweeney Co-authored-by: danilxdefi --- .changeset/shiny-zoos-push.md | 5 ++++ packages/bitcoin/src/msg.spec.ts | 17 ++++------- packages/bitcoin/src/msg.ts | 29 +++++++++++++------ .../src/signers/private-key.signer.spec.ts | 2 +- .../src/signers/seed-phrase.signer.spec.ts | 2 +- 5 files changed, 33 insertions(+), 22 deletions(-) create mode 100644 .changeset/shiny-zoos-push.md diff --git a/.changeset/shiny-zoos-push.md b/.changeset/shiny-zoos-push.md new file mode 100644 index 00000000..795a283f --- /dev/null +++ b/.changeset/shiny-zoos-push.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-bitcoin': patch +--- + +fix: utxo format for inputBytes from coinselect diff --git a/packages/bitcoin/src/msg.spec.ts b/packages/bitcoin/src/msg.spec.ts index 3e58807e..a06e6ac2 100644 --- a/packages/bitcoin/src/msg.spec.ts +++ b/packages/bitcoin/src/msg.spec.ts @@ -462,15 +462,10 @@ describe('msg: Bitcoin dust filter', () => { expect(inputUtxosSize * feeRate).toBeGreaterThan(utxos[0].value); // 1000 < utxo fees => bitcoin dust and shuld be removed const { inputs, outputs } = await msg.buildTx(); - expect(inputs.length).toBe(1); - expect(outputs.length).toBe(1); + expect(inputs.length).toBe(2); + expect(outputs.length).toBe(2); expect(outputs[0].value).toEqual(546); - expect(inputs[0].value).toEqual(3000); - const inputSize = utils.inputBytes(inputs[0]); - const accumBytes = utils.transactionBytes([], outputs); - const fee = (inputSize + accumBytes) * feeRate; - const surplus = 3000 - 546 - fee; // 942 sat < 8 * 148 => bitcoin dust - expect(surplus).toBeLessThan(8 * inputSize); + expect(inputs[0].value).toEqual(1000); }); it('Should not enough balances by fees', async () => { @@ -482,7 +477,7 @@ describe('msg: Bitcoin dust filter', () => { const msg = provider.createMsg({ from: address, to: address, - amount: 0.00003, // 3000 sat + amount: 0.00004, // 4000 sat }); const utxos = await provider.scanUTXOs(address); @@ -518,8 +513,8 @@ describe('msg: Bitcoin dust filter', () => { expect(utxos[0].value).toBeGreaterThan(inputBytesSize * feeRate); const { inputs, outputs } = await msg.buildTx(); - expect(inputs.length).toBe(2); - expect(outputs.length).toBe(2); + expect(inputs.length).toBe(1); + expect(outputs.length).toBe(1); expect(outputs[0].value).toEqual(546); expect(inputs[0].value).toEqual(1000); }); diff --git a/packages/bitcoin/src/msg.ts b/packages/bitcoin/src/msg.ts index 901e7a26..021b84b4 100644 --- a/packages/bitcoin/src/msg.ts +++ b/packages/bitcoin/src/msg.ts @@ -58,7 +58,7 @@ export class ChainMsg extends BaseMsg { const { fee } = await this.getFee(); if (!fee) throw new Error('Fee estimation is required for building transaction'); - const feeRate = Number(fee) * 1e5; + const feeRate = Math.floor(Number(fee) * 1e5); // Calculate dust threshold filter for utxo outputs const dustThreshold = utils.inputBytes({}) * feeRate; @@ -88,7 +88,10 @@ export class ChainMsg extends BaseMsg { ); const { inputs, outputs } = accumulative( - utxosWithoutOrdinals, + utxosWithoutOrdinals.map((utxo) => ({ + ...utxo, + ...utxo?.witnessUtxo, + })), targetOutputs, feeRate ); @@ -115,9 +118,11 @@ export class ChainMsg extends BaseMsg { utxos: UTXO[], ordinalsMapping: { [utxo: string]: NfTv3[] } ): UTXO[] { - return utxos.filter( - (utxo) => !ordinalsMapping[`${utxo.hash}:${utxo.index}`] - ); + // Ascending Value Order: If the UTXOs are passed in ascending order of value, the function might accumulate many small UTXOs before reaching the required amount, potentially resulting in a larger transaction. + // This will reduce the likelihood of creating many small UTXO on a given address. this will mean less dust and detrimental inputs + return utxos + .filter((utxo) => !ordinalsMapping[`${utxo.hash}:${utxo.index}`]) + .sort((a, b) => a.value - b.value); } private async handleOrdinals( @@ -311,14 +316,20 @@ export class ChainMsg extends BaseMsg { } const totalFee = utils.transactionBytes(finalInputs, finalOutputs) * feeRate; + + const blankOutputFee = utils.outputBytes({}) * feeRate; const remainAmount = utils.sumOrNaN(finalInputs) - finalInputs[0].value - valueToSend - - totalFee - - utils.outputBytes({}) * feeRate; - if (remainAmount > dustThreshold) { - finalOutputs.push({ value: remainAmount }); + totalFee; + + if (remainAmount < 0) { + throw new Error('Insufficient Balance for transaction'); + } + + if (remainAmount > dustThreshold + blankOutputFee) { + finalOutputs.push({ value: remainAmount - blankOutputFee }); } return this.createTxBody( diff --git a/packages/bitcoin/src/signers/private-key.signer.spec.ts b/packages/bitcoin/src/signers/private-key.signer.spec.ts index c67dc6d6..a653f219 100644 --- a/packages/bitcoin/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoin/src/signers/private-key.signer.spec.ts @@ -93,7 +93,7 @@ describe('private-key.signer', () => { await signer.sign(message); expect(message.signedTransaction).toEqual( - '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5399040000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022063256998af5b4eb17aab21bfe3db37fda7716561a2df0e58870c237a59a7abf10220407ad63ee39943fb5d1bfcd5808dcde4c72940202f6758f6420888b7975202a7012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' + '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5398050000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022004721285e2f3a5f7a4c248a0cfc49f33d6dc6d583845bc44118551353dfdd50b022036341ed7d0708f4736826b5a35c032cac12056bd41280a28f79bf882cab7525a012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' ); }); diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts index aa676541..b450ccfc 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts @@ -97,7 +97,7 @@ describe('seed-phrase.signer', () => { await signer.sign(message, derivation); expect(message.signedTransaction).toEqual( - '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5399040000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022063256998af5b4eb17aab21bfe3db37fda7716561a2df0e58870c237a59a7abf10220407ad63ee39943fb5d1bfcd5808dcde4c72940202f6758f6420888b7975202a7012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' + '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5398050000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022004721285e2f3a5f7a4c248a0cfc49f33d6dc6d583845bc44118551353dfdd50b022036341ed7d0708f4736826b5a35c032cac12056bd41280a28f79bf882cab7525a012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' ); }); From 7231a9ba1bc909e65fcba6d2f56e28bc91e1d25e Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 1 Aug 2024 14:31:40 +0000 Subject: [PATCH 089/176] Version packages --- .changeset/shiny-zoos-push.md | 5 ----- packages/bitcoin/CHANGELOG.md | 6 ++++++ packages/bitcoin/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/shiny-zoos-push.md diff --git a/.changeset/shiny-zoos-push.md b/.changeset/shiny-zoos-push.md deleted file mode 100644 index 795a283f..00000000 --- a/.changeset/shiny-zoos-push.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoin': patch ---- - -fix: utxo format for inputBytes from coinselect diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 112bff7c..0496e759 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-bitcoin +## 2.0.26 + +### Patch Changes + +- 97b7e929: fix: utxo format for inputBytes from coinselect + ## 2.0.25 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 938dbd04..b47f5887 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.25", + "version": "2.0.26", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 3f02695d255addd08e8921c8fdfe02de715750c4 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:55:38 +0700 Subject: [PATCH 090/176] feat: set no-cache for crypto asset and fetching balance queries (#294) Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/silly-needles-brush.md | 15 +++++++++++++++ .../src/common/client/queries/getCryptoAssets.ts | 1 + .../datasource/indexer/queries/balances.query.ts | 1 + .../src/datasource/indexer/queries/fees.query.ts | 1 + 4 files changed, 18 insertions(+) create mode 100644 .changeset/silly-needles-brush.md diff --git a/.changeset/silly-needles-brush.md b/.changeset/silly-needles-brush.md new file mode 100644 index 00000000..a6f050b9 --- /dev/null +++ b/.changeset/silly-needles-brush.md @@ -0,0 +1,15 @@ +--- +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-evm': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +--- + +feat: add no-cache for crypto asset and fetching balance queries diff --git a/packages/core/src/common/client/queries/getCryptoAssets.ts b/packages/core/src/common/client/queries/getCryptoAssets.ts index 8f8aa71e..bc80ef56 100644 --- a/packages/core/src/common/client/queries/getCryptoAssets.ts +++ b/packages/core/src/common/client/queries/getCryptoAssets.ts @@ -7,5 +7,6 @@ export const getCryptoAssets = (input: Array | CryptoAssetArgs) variables: { input: input, }, + fetchPolicy: 'no-cache', }); }; diff --git a/packages/evm/src/datasource/indexer/queries/balances.query.ts b/packages/evm/src/datasource/indexer/queries/balances.query.ts index b24701fd..d8e0c8f2 100644 --- a/packages/evm/src/datasource/indexer/queries/balances.query.ts +++ b/packages/evm/src/datasource/indexer/queries/balances.query.ts @@ -68,6 +68,7 @@ export const getBalance = async (chain: EVMChains, address: string) => { address, first: 100, }, + fetchPolicy: 'no-cache', }); return filter( diff --git a/packages/evm/src/datasource/indexer/queries/fees.query.ts b/packages/evm/src/datasource/indexer/queries/fees.query.ts index e3ea0f76..81ed7432 100644 --- a/packages/evm/src/datasource/indexer/queries/fees.query.ts +++ b/packages/evm/src/datasource/indexer/queries/fees.query.ts @@ -65,6 +65,7 @@ export const getFees = async (chain: string) => { const response = await gqlClient.query({ query, + fetchPolicy: 'no-cache', }); return response.data[indexerChain].fee; From 3bae69a5797e7f1059bda952fa5a59c4eb32bd0e Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 2 Aug 2024 05:58:01 +0000 Subject: [PATCH 091/176] Version packages --- .changeset/silly-needles-brush.md | 15 --------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 8 ++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 ++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 ++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 ++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- 23 files changed, 97 insertions(+), 26 deletions(-) delete mode 100644 .changeset/silly-needles-brush.md diff --git a/.changeset/silly-needles-brush.md b/.changeset/silly-needles-brush.md deleted file mode 100644 index a6f050b9..00000000 --- a/.changeset/silly-needles-brush.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-evm': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch ---- - -feat: add no-cache for crypto asset and fetching balance queries diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 2800c62e..ad6a809f 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.20 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.19 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index aa683584..c8657ec0 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.19", + "version": "2.0.20", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 0496e759..8cfa32db 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.0.27 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.26 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index b47f5887..ac45d29f 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.26", + "version": "2.0.27", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 03887b66..e6bfe925 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.26 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.25 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 7910de16..6f6d2d16 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.25", + "version": "2.0.26", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 103d69d2..7d46585a 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.26 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries + ## 2.0.25 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 87940bbe..58878909 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.25", + "version": "2.0.26", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index eb2ad024..4e7b4012 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.33 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.32 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index bed111c1..1df78451 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.32", + "version": "2.0.33", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index e9b1b9d8..d33fcfa3 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.0.25 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.24 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index c69cd9ec..a12b889d 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.24", + "version": "2.0.25", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index bd64bf47..757185ec 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.40 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.39 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index c49a406f..b7595c05 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.39", + "version": "2.0.40", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 6fb032d7..df112115 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.0.23 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.22 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 0d23eaef..93289c5a 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.22", + "version": "2.0.23", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 4af3be11..37544596 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.27 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.26 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 9e9e1410..6e740c09 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.26", + "version": "2.0.27", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index e0c16189..c7c01d50 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.0.29 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.28 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 636a3fd7..1dca21b6 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.28", + "version": "2.0.29", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 930beaa7..a17c8d5d 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.28 + +### Patch Changes + +- 4316454e: feat: add no-cache for crypto asset and fetching balance queries +- Updated dependencies [4316454e] + - @xdefi-tech/chains-core@2.0.26 + ## 2.0.27 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 81d7225c..bf034b07 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.27", + "version": "2.0.28", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From b11f4f97f5ad6d5d7d00e5f2129dd0b7cca8addf Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:15:34 +0300 Subject: [PATCH 092/176] fix: nft query for smartchain and cronos EVM (#298) --- .changeset/ten-mice-relate.md | 5 +++++ packages/evm/src/datasource/indexer/queries/nfts.query.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/ten-mice-relate.md diff --git a/.changeset/ten-mice-relate.md b/.changeset/ten-mice-relate.md new file mode 100644 index 00000000..1b3c8419 --- /dev/null +++ b/.changeset/ten-mice-relate.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +Fix: nft query for smartchain and cronos diff --git a/packages/evm/src/datasource/indexer/queries/nfts.query.ts b/packages/evm/src/datasource/indexer/queries/nfts.query.ts index f4fa9eb7..e560de64 100644 --- a/packages/evm/src/datasource/indexer/queries/nfts.query.ts +++ b/packages/evm/src/datasource/indexer/queries/nfts.query.ts @@ -154,11 +154,11 @@ export const getNFTBalance = async (chain: string, address: string) => { query = FANTOM_NFTS_QUERY; chainName = 'fantom'; break; - case 'binancesmartchain': + case 'smartchain': query = BINANCE_SMART_CHAIN_NFTS_QUERY; chainName = 'binanceSmartChain'; break; - case 'cronosevm': + case 'cronos': query = CRONOS_EVM_NFTS_QUERY; chainName = 'cronosEVM'; break; From 37a30b2df5dfa170b4e267a2d4ddcaaa588788c3 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 2 Aug 2024 12:18:01 +0000 Subject: [PATCH 093/176] Version packages --- .changeset/ten-mice-relate.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/ten-mice-relate.md diff --git a/.changeset/ten-mice-relate.md b/.changeset/ten-mice-relate.md deleted file mode 100644 index 1b3c8419..00000000 --- a/.changeset/ten-mice-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -Fix: nft query for smartchain and cronos diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 757185ec..9a59e151 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.41 + +### Patch Changes + +- 5d972f34: Fix: nft query for smartchain and cronos + ## 2.0.40 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index b7595c05..60afda00 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.40", + "version": "2.0.41", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From ddc892e24845b65d90dfb5df9e6c2b53eebea729 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:56:42 +0700 Subject: [PATCH 094/176] Add sign method options and multiSign method (#302) Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/blue-keys-breathe.md | 5 ++ .../src/signers/private-key.signer.spec.ts | 23 ++++++- .../tron/src/signers/private-key.signer.ts | 44 +++++++++++-- .../src/signers/seed-phrase.signer.spec.ts | 21 ++++++ .../tron/src/signers/seed-phrase.signer.ts | 66 ++++++++++++++++--- 5 files changed, 141 insertions(+), 18 deletions(-) create mode 100644 .changeset/blue-keys-breathe.md diff --git a/.changeset/blue-keys-breathe.md b/.changeset/blue-keys-breathe.md new file mode 100644 index 00000000..1b03e5bd --- /dev/null +++ b/.changeset/blue-keys-breathe.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-tron': patch +--- + +Add sign method options and the multiSign method diff --git a/packages/tron/src/signers/private-key.signer.spec.ts b/packages/tron/src/signers/private-key.signer.spec.ts index 7d0004ff..31fa104a 100644 --- a/packages/tron/src/signers/private-key.signer.spec.ts +++ b/packages/tron/src/signers/private-key.signer.spec.ts @@ -1,3 +1,5 @@ +import TronWeb from 'tronweb'; + import { IndexerDataSource } from '../datasource'; import { TronProvider } from '../chain.provider'; import { TRON_MANIFEST } from '../manifests'; @@ -133,10 +135,10 @@ describe('tron private-key.signer', () => { }); ChainMsg.prototype.buildTx = jest.fn().mockResolvedValue({ raw_data_hex: - '0a0218c52208b2dcb6ece39c937140a886d9be87325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541b2431e51da71cf3fbe9a0daf59b2d716213dc8f2121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000000084987d218c5ae2027c419e52c95791e453493821000000000000000000000000000000000000000000000000000000e8d4a5100070cac0d5be8732900180a3c347', + '0a0208c52208620b55abd6d1dfaf40e884cab792325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541617bfdc9fad81202ec6de6d57e2555a415f675d1121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000000084987d218c5ae2027c419e52c95791e453493821000000000000000000000000000000000000000000000000000000e8d4a5100070b5ccc6b79232900180a3c347', }); const { raw_data_hex } = await msg.buildTx(); - const signature = await signer.signMessage(raw_data_hex); + const signature = await signer.signMessage(raw_data_hex, true, true); expect(signature.length).toBe(132); }); @@ -163,8 +165,23 @@ describe('tron private-key.signer', () => { '0a0218c52208b2dcb6ece39c937140a886d9be87325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541b2431e51da71cf3fbe9a0daf59b2d716213dc8f2121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000000084987d218c5ae2027c419e52c95791e453493821000000000000000000000000000000000000000000000000000000e8d4a5100070cac0d5be8732900180a3c347', }); const { raw_data_hex } = await msg.buildTx(); - const signature = await signer.signTransaction(raw_data_hex); + const signature = await signer.signTransaction(raw_data_hex, true, true); expect(signature.length).toBe(132); }); + + it('should multiSignTransaction a TRC20 TX with the private key', async () => { + const tronWeb = new TronWeb({ + fullHost: TRON_MANIFEST.rpcURL, + }); + const transaction = await tronWeb.transactionBuilder.sendTrx( + tronWeb.address.toHex(txInput.to), + 1, + tronWeb.address.toHex(txInput.from) + ); + const signedTx = await signer.multiSignTransaction(transaction, 0); + expect(signedTx.signature).toBeDefined(); + expect(signedTx.signature?.length).toBe(1); + expect(signedTx.signature?.[0].length).toBe(130); + }); }); diff --git a/packages/tron/src/signers/private-key.signer.ts b/packages/tron/src/signers/private-key.signer.ts index 917c90c6..a18a104e 100644 --- a/packages/tron/src/signers/private-key.signer.ts +++ b/packages/tron/src/signers/private-key.signer.ts @@ -1,5 +1,5 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import TronWeb from 'tronweb'; +import TronWeb, { TronTransaction } from 'tronweb'; import type { TronManifest } from 'src/manifests'; import { ChainMsg } from '../msg'; @@ -45,12 +45,21 @@ export class PrivateKeySigner extends Signer.Provider { msg.sign(signature); } - async signMessage(txHex: string): Promise { + async signMessage( + txHex: string, + useTronHeader?: boolean, + multisig?: boolean + ): Promise { const tronWeb = new TronWeb({ fullHost: this.manifest.rpcURL, privateKey: this.key, }); - const signature = await tronWeb.trx.signMessage(txHex, this.key); + const signature = await tronWeb.trx.signMessage( + txHex, + this.key, + useTronHeader, + multisig + ); return signature; } @@ -63,14 +72,39 @@ export class PrivateKeySigner extends Signer.Provider { return signature; } - async signTransaction(txHex: string): Promise { + async signTransaction( + txHex: string, + useTronHeader?: boolean, + multisig?: boolean + ): Promise { const tronWeb = new TronWeb({ fullHost: this.manifest.rpcURL, privateKey: this.key, }); - const signature = await tronWeb.trx.signTransaction(txHex, this.key); + const signature = await tronWeb.trx.signTransaction( + txHex, + this.key, + useTronHeader, + multisig + ); return signature; } + + async multiSignTransaction( + transaction: TronTransaction, + permisionId?: number + ): Promise { + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey: this.key, + }); + const signedTx = await tronWeb.trx.multiSign( + transaction, + this.key, + permisionId + ); + return signedTx; + } } export default PrivateKeySigner; diff --git a/packages/tron/src/signers/seed-phrase.signer.spec.ts b/packages/tron/src/signers/seed-phrase.signer.spec.ts index e9fca7f2..6cfec29b 100644 --- a/packages/tron/src/signers/seed-phrase.signer.spec.ts +++ b/packages/tron/src/signers/seed-phrase.signer.spec.ts @@ -1,3 +1,5 @@ +import TronWeb from 'tronweb'; + import { TronProvider } from '../chain.provider'; import { ChainDataSource } from '../datasource'; import { TRON_MANIFEST } from '../manifests'; @@ -182,6 +184,25 @@ describe('tron seed-phrase.signer', () => { '0x7605f9a707b2bc6ca6c5fc6deaf192868ef70b2c196df784c849d8734413131f67ba100590ecb931548869e771329aea8d137c339570882f3c1314c031bf75cb1c' ); }); + + it('should multiSignTransaction a TRC20 TX with the private key', async () => { + const tronWeb = new TronWeb({ + fullHost: TRON_MANIFEST.rpcURL, + }); + const transaction = await tronWeb.transactionBuilder.sendTrx( + tronWeb.address.toHex(txInput.to), + 1, + tronWeb.address.toHex(txInput.from) + ); + const signedTx = await signer.multiSignTransaction( + transaction, + deriviationPath, + 0 + ); + expect(signedTx.signature).toBeDefined(); + expect(signedTx.signature?.length).toBe(1); + expect(signedTx.signature?.[0].length).toBe(130); + }); }); describe('seed-phase.addressGeneration', () => { diff --git a/packages/tron/src/signers/seed-phrase.signer.ts b/packages/tron/src/signers/seed-phrase.signer.ts index e7c1311c..d69d3be6 100644 --- a/packages/tron/src/signers/seed-phrase.signer.ts +++ b/packages/tron/src/signers/seed-phrase.signer.ts @@ -1,5 +1,5 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import TronWeb from 'tronweb'; +import TronWeb, { TronTransaction } from 'tronweb'; import type { TronManifest } from 'src/manifests'; import { ChainMsg } from '../msg'; @@ -32,28 +32,47 @@ export class SeedPhraseSigner extends Signer.Provider { } } - async sign(msg: ChainMsg, derivation: string): Promise { + async sign( + msg: ChainMsg, + derivation: string, + useTronHeader?: boolean, + multisig?: boolean + ): Promise { const tronAccount = TronWeb.fromMnemonic(this.key, derivation); + const privateKey = tronAccount.privateKey.replace('0x', ''); const tronWeb = new TronWeb({ fullHost: this.manifest.rpcURL, - privateKey: tronAccount.privateKey.replace('0x', ''), + privateKey, }); const txData = await msg.buildTx(); - const signature = await tronWeb.trx.sign(txData); + const signature = await tronWeb.trx.sign( + txData, + privateKey, + useTronHeader, + multisig + ); msg.sign(signature); } - async signMessage(txHex: string, derivation: string): Promise { + async signMessage( + txHex: string, + derivation: string, + useTronHeader?: boolean, + multisig?: boolean + ): Promise { const tronAccount = TronWeb.fromMnemonic(this.key, derivation); + const privateKey = tronAccount.privateKey.replace('0x', ''); const tronWeb = new TronWeb({ fullHost: this.manifest.rpcURL, - privateKey: tronAccount.privateKey.replace('0x', ''), + privateKey, }); const signature = await tronWeb.trx.signMessage( txHex, - tronAccount.privateKey.replace('0x', '') + privateKey, + useTronHeader, + multisig ); return signature; @@ -77,20 +96,47 @@ export class SeedPhraseSigner extends Signer.Provider { return signature; } - async signTransaction(txHex: string, derivation: string): Promise { + async signTransaction( + txHex: string, + derivation: string, + useTronHeader?: boolean, + multisig?: boolean + ): Promise { const tronAccount = TronWeb.fromMnemonic(this.key, derivation); + const privateKey = tronAccount.privateKey.replace('0x', ''); const tronWeb = new TronWeb({ fullHost: this.manifest.rpcURL, - privateKey: tronAccount.privateKey.replace('0x', ''), + privateKey, }); const signature = await tronWeb.trx.signTransaction( txHex, - tronAccount.privateKey.replace('0x', '') + privateKey, + useTronHeader, + multisig ); return signature; } + + async multiSignTransaction( + transaction: TronTransaction, + derivation: string, + permisionId?: number + ): Promise { + const tronAccount = TronWeb.fromMnemonic(this.key, derivation); + const privateKey = tronAccount.privateKey.replace('0x', ''); + const tronWeb = new TronWeb({ + fullHost: this.manifest.rpcURL, + privateKey, + }); + const signature = await tronWeb.trx.multiSign( + transaction, + privateKey, + permisionId + ); + return signature; + } } export default SeedPhraseSigner; From 619a2e2cfa691ba8849fcc7810d11288b4334d88 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 7 Aug 2024 06:59:07 +0000 Subject: [PATCH 095/176] Version packages --- .changeset/blue-keys-breathe.md | 5 ----- packages/tron/CHANGELOG.md | 6 ++++++ packages/tron/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/blue-keys-breathe.md diff --git a/.changeset/blue-keys-breathe.md b/.changeset/blue-keys-breathe.md deleted file mode 100644 index 1b03e5bd..00000000 --- a/.changeset/blue-keys-breathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-tron': patch ---- - -Add sign method options and the multiSign method diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index a17c8d5d..baa68b85 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-tron +## 2.0.29 + +### Patch Changes + +- 9972c424: Add sign method options and the multiSign method + ## 2.0.28 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index bf034b07..6d4f81b2 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.28", + "version": "2.0.29", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 8b8bef6382adac933d797c58f86bf3eaffb5e6b4 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:46:54 +0700 Subject: [PATCH 096/176] fix: error in fee estimation (#299) * fix: error in fee estimation * chore: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/rich-cups-dance.md | 5 ++ packages/cosmos/jest-setup-file.ts | 6 ++ packages/cosmos/src/chain.provider.spec.ts | 39 +++++++--- .../datasource/indexer/indexer.data-source.ts | 77 +++++++++++++------ packages/cosmos/src/msg.ts | 2 +- 5 files changed, 92 insertions(+), 37 deletions(-) create mode 100644 .changeset/rich-cups-dance.md diff --git a/.changeset/rich-cups-dance.md b/.changeset/rich-cups-dance.md new file mode 100644 index 00000000..7549cd9f --- /dev/null +++ b/.changeset/rich-cups-dance.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +fix: error in fee estimation diff --git a/packages/cosmos/jest-setup-file.ts b/packages/cosmos/jest-setup-file.ts index b724edaf..87e7575e 100644 --- a/packages/cosmos/jest-setup-file.ts +++ b/packages/cosmos/jest-setup-file.ts @@ -1,4 +1,10 @@ import 'reflect-metadata'; + +// @ts-ignore +import XMLHttpRequest from 'xhr2'; + +global.XMLHttpRequest = XMLHttpRequest; + import { TextEncoder, TextDecoder } from 'util'; Object.assign(global, { TextDecoder, TextEncoder }); diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index 4adda9da..2fdc3d87 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -2,6 +2,7 @@ import { Response, GasFeeSpeed, TransactionStatus, + MsgEncoding, } from '@xdefi-tech/chains-core'; import { ChainMsg } from './msg'; @@ -108,26 +109,31 @@ describe('chain.provider', () => { expect(balanceData.length).toEqual(2); }); - it('estimateFee() should return fee estimation', async () => { - jest.spyOn(CosmosProvider.prototype, 'estimateFee').mockResolvedValue([ + it('estimatFee() should return fee estimation with encoding string msg', async () => { + const osmosisProvider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); + const msg = osmosisProvider.createMsg( { - gasLimit: 1, - gasPrice: 1, - maxFeePerGas: 1, - baseFeePerGas: 1, - maxPriorityFeePerGas: 1, + data: '{"signDoc":{"accountNumber":"2551461","chainId":"osmosis-1","fee":{"gas":"318939","amount":[{"amount":"1196","denom":"uosmo"}]},"memo":"FE","msgs":[{"typeUrl":"/osmosis.gamm.v1beta1.MsgSwapExactAmountIn","value":{"routes":[{"poolId":"1400","tokenOutDenom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"}],"sender":"osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf","tokenIn":{"amount":"5000000","denom":"uosmo"},"tokenOutMinAmount":"370642"}}],"sequence":"6","timeoutHeight":"18897301"},"signer":"osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf"}', }, - ]); + MsgEncoding.string + ); + const estimateFee = await osmosisProvider.estimateFee( + [msg], + GasFeeSpeed.low + ); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); + it('estimateFee() should return fee estimation with encoding json msg', async () => { const msg = provider.createMsg({ - from: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', - to: 'cosmos1rysuxnc2qdedfxpwj4g26a59yr53kxzd2r7yd4', + from: 'cosmos1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn0cwydm', + to: 'cosmos1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn0cwydm', amount: 0.000001, }); const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.medium); - - expect(estimateFee.length).toEqual(1); expect(estimateFee[0].gasLimit).toBeTruthy(); }); @@ -174,6 +180,15 @@ describe('chain.provider', () => { }); it('getFeeTokens(): should get a list of fee tokens', async () => { + jest.spyOn(CosmosProvider.prototype, 'estimateFee').mockResolvedValue([ + { + gasLimit: 1, + gasPrice: 1, + maxFeePerGas: 1, + baseFeePerGas: 1, + maxPriorityFeePerGas: 1, + }, + ]); jest.setTimeout(30000); const feeTokens = await provider.getFeeTokens(); expect(Array.isArray(feeTokens)).toBe(true); diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index a329636a..fb1227db 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -24,6 +24,7 @@ import { TxRaw, } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'; +import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; // import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; import { ChainMsg } from '../../msg'; @@ -138,30 +139,58 @@ export class IndexerDataSource extends DataSource { const messageData = m.encoding === 'string' ? await m.buildTx() : m.toData(); fromAddress = messageData.from; - messageData.msgs.map((msgTransfer: any) => { - if (msgTransfer.typeUrl.includes('MsgTransfer')) { - _msgs.push({ - typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', - value: MsgTransfer.encode( - MsgTransfer.fromPartial(msgTransfer.value) - ).finish(), - }); - } else if (msgTransfer.typeUrl.includes('MsgSwapExactAmountIn')) { - _msgs.push({ - typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', - value: MsgSwapExactAmountIn.encode( - MsgSwapExactAmountIn.fromPartial(msgTransfer.value) - ).finish(), - }); - } else { - _msgs.push({ - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.encode( - MsgSend.fromPartial(msgTransfer.value) - ).finish(), - }); - } - }); + if (m.encoding === 'string') { + messageData.msgs.map((msgTransfer: any) => { + if (msgTransfer.typeUrl.includes('MsgTransfer')) { + _msgs.push({ + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.encode( + MsgTransfer.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl.includes('MsgSwapExactAmountIn')) { + _msgs.push({ + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode( + MsgSwapExactAmountIn.fromPartial(msgTransfer.value) + ).finish(), + }); + } else { + _msgs.push({ + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.encode( + MsgSend.fromPartial(msgTransfer.value) + ).finish(), + }); + } + }); + } else { + const { msgs: msgsToSend, typeUrl } = m.getMsgToSend(); + msgsToSend.map((msgTransfer: any) => { + if (typeUrl.includes('MsgTransfer')) { + _msgs.push({ + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.encode( + MsgTransfer.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (typeUrl.includes('MsgExecuteContract')) { + _msgs.push({ + typeUrl: '/cosmos.base.v1beta1.MsgExecuteContract', + value: MsgExecuteContract.encode( + MsgExecuteContract.fromPartial(msgTransfer.value) + ).finish(), + }); + } else { + _msgs.push({ + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.encode( + MsgSend.fromPartial(msgTransfer.value) + ).finish(), + }); + } + }); + } } const _feeAmount = msgs.map((m) => { diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 5d1002d7..85f2a811 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -196,7 +196,7 @@ export class ChainMsg extends BasMsg { }; } - private getMsgToSend() { + getMsgToSend() { const msgData = this.toData(); let msgs; let typeUrl = msgData.typeUrl; From 55326cf8992e83eca4039afdfa4776469e0a095b Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 12 Aug 2024 08:49:23 +0000 Subject: [PATCH 097/176] Version packages --- .changeset/rich-cups-dance.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/rich-cups-dance.md diff --git a/.changeset/rich-cups-dance.md b/.changeset/rich-cups-dance.md deleted file mode 100644 index 7549cd9f..00000000 --- a/.changeset/rich-cups-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -fix: error in fee estimation diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 4e7b4012..eb13cbfc 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.34 + +### Patch Changes + +- 631d1476: fix: error in fee estimation + ## 2.0.33 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 1df78451..18b510f1 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.33", + "version": "2.0.34", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From accbafd3b3877655261434d77cf8b986416e02a7 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:53:36 +0700 Subject: [PATCH 098/176] fix: error when fetching balance on cronos and mars chains (#303) * fix: error when fetching balance on cronos and mars chains * chore: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/spicy-months-fail.md | 5 ++++ packages/cosmos/jest-setup-file.ts | 5 ++++ packages/cosmos/src/chain.provider.spec.ts | 27 +++++++++++++++++-- .../src/datasource/chain/chain.data-source.ts | 6 ++++- packages/cosmos/src/manifests.ts | 21 +++++++++++++++ 5 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 .changeset/spicy-months-fail.md diff --git a/.changeset/spicy-months-fail.md b/.changeset/spicy-months-fail.md new file mode 100644 index 00000000..94b9526d --- /dev/null +++ b/.changeset/spicy-months-fail.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +fix: error when fetching balance on cronos and mars chains diff --git a/packages/cosmos/jest-setup-file.ts b/packages/cosmos/jest-setup-file.ts index 87e7575e..7cee7fdc 100644 --- a/packages/cosmos/jest-setup-file.ts +++ b/packages/cosmos/jest-setup-file.ts @@ -10,6 +10,11 @@ Object.assign(global, { TextDecoder, TextEncoder }); const crypto = require('crypto'); +// @ts-ignore +import XMLHttpRequest from 'xhr2'; + +global.XMLHttpRequest = XMLHttpRequest; + Object.defineProperty(globalThis, 'crypto', { value: { getRandomValues: ( diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index 2fdc3d87..a1ec7fb1 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -7,11 +7,12 @@ import { import { ChainMsg } from './msg'; import { CosmosProvider } from './chain.provider'; -import { IndexerDataSource } from './datasource'; +import { ChainDataSource, IndexerDataSource } from './datasource'; import { COSMOS_MANIFESTS } from './manifests'; describe('chain.provider', () => { let provider: CosmosProvider; + const mockedGetBalance = jest.spyOn(CosmosProvider.prototype, 'getBalance'); beforeEach(() => { provider = new CosmosProvider( @@ -41,7 +42,7 @@ describe('chain.provider', () => { }); it('getBalance() should return balance data', async () => { - jest.spyOn(CosmosProvider.prototype, 'getBalance').mockResolvedValue( + mockedGetBalance.mockResolvedValue( new Response( // getData jest.fn().mockImplementation(async () => [ @@ -107,6 +108,8 @@ describe('chain.provider', () => { ); const balanceData = await balance.getData(); expect(balanceData.length).toEqual(2); + // Reset to the original method implementation (non-mocked) + mockedGetBalance.mockRestore(); }); it('estimatFee() should return fee estimation with encoding string msg', async () => { @@ -168,6 +171,26 @@ describe('chain.provider', () => { '6SkceyvCgfYV6bbPnvxYcgUjTqnbY5fZ3gQhFyXxYRhw' ); }); + + it('getBalance() on cronos chain', async () => { + const provider = new CosmosProvider( + new ChainDataSource(COSMOS_MANIFESTS.cronos) + ); + const balance = await provider.getBalance( + 'cro1g5rjj3dsdxnmxz4ydvhxem6hddqs2hgw5wem0f' + ); + expect(await balance.getData()).toBeTruthy(); + }); + + it('getBalance() on mars chain', async () => { + const provider = new CosmosProvider( + new ChainDataSource(COSMOS_MANIFESTS.mars) + ); + const balance = await provider.getBalance( + 'mars1km3nehyxu92vu2whjqhuqkmljvcd4nwvnxz8yt' + ); + expect(await balance.getData()).toBeTruthy(); + }); }); describe('chain.provider', () => { diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 71126227..51d44bc2 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -36,6 +36,7 @@ import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; import { AddressChain, CryptoAssetArgs } from '../../gql/graphql'; import * as manifests from '../../manifests'; import { ChainMsg } from '../../msg'; +import { COSMOS_ADDRESS_CHAIN } from '../../manifests'; @Injectable() export class ChainDataSource extends DataSource { @@ -73,7 +74,10 @@ export class ChainDataSource extends DataSource { ); const balances = response.data.balances as CosmosCoin[]; - const chain = capitalize(this.manifest.chain) as AddressChain; + const chain = + COSMOS_ADDRESS_CHAIN[ + this.manifest.chain as keyof typeof COSMOS_ADDRESS_CHAIN + ]; const cryptoAssetsInput = balances.map(({ denom }) => ({ chain: chain, contract: this.manifest.denom === denom ? null : denom, diff --git a/packages/cosmos/src/manifests.ts b/packages/cosmos/src/manifests.ts index 1925f281..a745eb50 100644 --- a/packages/cosmos/src/manifests.ts +++ b/packages/cosmos/src/manifests.ts @@ -1,5 +1,7 @@ import { Chain } from '@xdefi-tech/chains-core'; +import { AddressChain } from './gql'; + export enum CosmosHubChains { cosmos = 'cosmos', osmosis = 'osmosis', @@ -17,6 +19,25 @@ export enum CosmosHubChains { sei = 'sei', } +export const COSMOS_ADDRESS_CHAIN: { + [key in CosmosHubChains]: AddressChain; +} = { + [CosmosHubChains.cosmos]: AddressChain.Cosmos, + [CosmosHubChains.osmosis]: AddressChain.Osmosis, + [CosmosHubChains.axelar]: AddressChain.Axelar, + [CosmosHubChains.juno]: AddressChain.JUNO, + [CosmosHubChains.crescent]: AddressChain.Crescent, + [CosmosHubChains.kava]: AddressChain.Kava, + [CosmosHubChains.stargaze]: AddressChain.Stargaze, + [CosmosHubChains.akash]: AddressChain.Akash, + [CosmosHubChains.cronos]: AddressChain.CronosPOS, + [CosmosHubChains.kujira]: AddressChain.Kujira, + [CosmosHubChains.stride]: AddressChain.Stride, + [CosmosHubChains.mars]: AddressChain.MarsProtocol, + [CosmosHubChains.terra]: AddressChain.Terra, + [CosmosHubChains.sei]: AddressChain.Sei, +}; + export interface CosmosManifest extends Chain.Manifest { lcdURL: string; rpcURL: string; From c2951d9d548cc09ac54f39c7ff0026b4f7fc0158 Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 12 Aug 2024 08:56:07 +0000 Subject: [PATCH 099/176] Version packages --- .changeset/spicy-months-fail.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/spicy-months-fail.md diff --git a/.changeset/spicy-months-fail.md b/.changeset/spicy-months-fail.md deleted file mode 100644 index 94b9526d..00000000 --- a/.changeset/spicy-months-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -fix: error when fetching balance on cronos and mars chains diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index eb13cbfc..61f33e72 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.35 + +### Patch Changes + +- 9afd5bca: fix: error when fetching balance on cronos and mars chains + ## 2.0.34 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 18b510f1..b1dd3d54 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.34", + "version": "2.0.35", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 5d83cfc2b8a5827a5384db8a3f55e951d7cc6267 Mon Sep 17 00:00:00 2001 From: dp <25910069+davidp94@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:15:20 +0300 Subject: [PATCH 100/176] chore: fix rpcUrl for cronos evm (#306) --- packages/evm/src/manifests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/evm/src/manifests.ts b/packages/evm/src/manifests.ts index 6e750305..734ebb52 100644 --- a/packages/evm/src/manifests.ts +++ b/packages/evm/src/manifests.ts @@ -191,7 +191,7 @@ export const EVM_MANIFESTS: { [EVMChains.cronos]: { name: 'Cronos', description: '', - rpcURL: 'https://cronoscan-rpc.xdefiservices.com', + rpcURL: 'https://evm.cronos.org', chainSymbol: 'CRO', blockExplorerURL: 'https://cronoscan.com', chainId: '25', From 093145a3af7eb7fa416f82ec76e146c825b6cc93 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:52:47 +0700 Subject: [PATCH 101/176] fix: missing strong random number source warning from EVM package (#300) Co-authored-by: sotatek-tyler-nguyen4 --- examples/react/next.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/react/next.config.js b/examples/react/next.config.js index db2fdd16..58a86348 100644 --- a/examples/react/next.config.js +++ b/examples/react/next.config.js @@ -8,3 +8,7 @@ module.exports = withBundleAnalyzer({ return config; } }); + +const crypto = require('crypto'); + +global.crypto = crypto; From 7471edec2933e7620d426f186318415960df7046 Mon Sep 17 00:00:00 2001 From: HoangVD2 <102846781+HoangVD2@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:08:22 +0700 Subject: [PATCH 102/176] chore: remove xDai(Gnosis) - unsupported chain (XDEFI-9524) (#305) * chore: remove xDai(Gnosis) - unsupported chain * chore: remove Gnosis (unsupported) * chore: add changeset * base: update --- .changeset/loud-fishes-return.md | 5 + packages/binance/src/gql/graphql.ts | 36 +- packages/bitcoin/src/gql/graphql.ts | 36 +- packages/bitcoincash/src/gql/graphql.ts | 1134 +++++------------ packages/core/src/common/graphql.ts | 36 +- packages/cosmos/src/gql/graphql.ts | 36 +- packages/dogecoin/src/gql/graphql.ts | 36 +- .../datasource/indexer/queries/nfts.query.ts | 1 - packages/evm/src/gql/graphql.ts | 36 +- packages/litecoin/src/gql/graphql.ts | 36 +- packages/solana/src/gql/graphql.ts | 36 +- packages/thor/src/gql/graphql.ts | 36 +- packages/tron/src/gql/graphql.ts | 36 +- utility-packages/graphql/src/gql/graphql.ts | 4 +- 14 files changed, 663 insertions(+), 841 deletions(-) create mode 100644 .changeset/loud-fishes-return.md diff --git a/.changeset/loud-fishes-return.md b/.changeset/loud-fishes-return.md new file mode 100644 index 00000000..29a515cf --- /dev/null +++ b/.changeset/loud-fishes-return.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +remove xDai(Gnosis) - unsupported chain diff --git a/packages/binance/src/gql/graphql.ts b/packages/binance/src/gql/graphql.ts index 61c8a04a..d88f1953 100644 --- a/packages/binance/src/gql/graphql.ts +++ b/packages/binance/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/bitcoin/src/gql/graphql.ts b/packages/bitcoin/src/gql/graphql.ts index bfbd197f..3071ed91 100644 --- a/packages/bitcoin/src/gql/graphql.ts +++ b/packages/bitcoin/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/bitcoincash/src/gql/graphql.ts b/packages/bitcoincash/src/gql/graphql.ts index 341628c3..cf1df8e7 100644 --- a/packages/bitcoincash/src/gql/graphql.ts +++ b/packages/bitcoincash/src/gql/graphql.ts @@ -2,15 +2,9 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = Omit & { - [SubKey in K]?: Maybe; -}; -export type MakeMaybe = Omit & { - [SubKey in K]: Maybe; -}; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -192,7 +186,7 @@ export enum AddressChain { Umee = 'Umee', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync', + zkSync = 'zkSync' } /** Portfolio by wallet address */ @@ -324,12 +318,14 @@ export type Arbitrum = { version: Array; }; + export type ArbitrumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ArbitrumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -337,16 +333,19 @@ export type ArbitrumBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type ArbitrumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type ArbitrumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type ArbitrumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -604,11 +603,11 @@ export type AssetHistory = { export enum AssetInternalType { CRYPTOCURRENCY = 'CRYPTOCURRENCY', LP_TOKEN = 'LP_TOKEN', - TOKEN = 'TOKEN', + TOKEN = 'TOKEN' } export enum AssetSortBy { - MARKET_CAP = 'MARKET_CAP', + MARKET_CAP = 'MARKET_CAP' } export type AssetTokenContractType = { @@ -728,6 +727,7 @@ export type AssetType = { trending?: Maybe>; }; + export type AssetTypeAllAssetsArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -735,6 +735,7 @@ export type AssetTypeAllAssetsArgs = { page: ConnectionArgs; }; + export type AssetTypeCompositeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -742,10 +743,12 @@ export type AssetTypeCompositeTokensArgs = { page: ConnectionArgs; }; + export type AssetTypeCryptoAssetsArgs = { input: Array; }; + export type AssetTypeCryptoCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -753,11 +756,13 @@ export type AssetTypeCryptoCurrenciesArgs = { page: ConnectionArgs; }; + export type AssetTypeDappsArgs = { address: Scalars['String']; chain: Scalars['String']; }; + export type AssetTypeFiatCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -765,6 +770,7 @@ export type AssetTypeFiatCurrenciesArgs = { page: ConnectionArgs; }; + export type AssetTypeLpTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -772,15 +778,18 @@ export type AssetTypeLpTokensArgs = { page: ConnectionArgs; }; + export type AssetTypeNftsV0Args = { keys: Array; }; + export type AssetTypeSearchArgs = { filter?: InputMaybe; page: ConnectionArgs; }; + export type AssetTypeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -788,6 +797,7 @@ export type AssetTypeTokensArgs = { page: ConnectionArgs; }; + export type AssetTypeTokensV0Args = { input: Array; }; @@ -842,12 +852,14 @@ export type Aurora = { version: Array; }; + export type AuroraActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type AuroraBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -855,16 +867,19 @@ export type AuroraBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type AuroraLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type AuroraNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type AuroraTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -890,12 +905,14 @@ export type Avalanche = { version: Array; }; + export type AvalancheActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type AvalancheBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -903,16 +920,19 @@ export type AvalancheBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type AvalancheLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type AvalancheNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type AvalancheTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -955,12 +975,14 @@ export type Base = { version: Array; }; + export type BaseActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type BaseBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -968,11 +990,13 @@ export type BaseBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type BaseNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type BaseTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1000,10 +1024,12 @@ export type Binance = { transactions: BinanceTransactionConnection; }; + export type BinanceBalancesArgs = { address: Scalars['String']; }; + export type BinanceTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1029,12 +1055,14 @@ export type BinanceSmartChain = { version: Array; }; + export type BinanceSmartChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type BinanceSmartChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1042,16 +1070,19 @@ export type BinanceSmartChainBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type BinanceSmartChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type BinanceSmartChainNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type BinanceSmartChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1113,29 +1144,35 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; + export type BitcoinChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; + export type BitcoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type BitcoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type BitcoinChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type BitcoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1144,23 +1181,27 @@ export type BitcoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type BitcoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type BitcoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type BitcoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type BitcoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1186,24 +1227,29 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; + export type BitcoinChainTestNetActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; + export type BitcoinChainTestNetBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type BitcoinChainTestNetGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type BitcoinChainTestNetTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1212,23 +1258,27 @@ export type BitcoinChainTestNetTransactionsArgs = { pageSize: Scalars['Int']; }; + export type BitcoinChainTestNetTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type BitcoinChainTestNetTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type BitcoinChainTestNetUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type BitcoinChainTestNetUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1254,24 +1304,29 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; + export type BitcoincashChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; + export type BitcoincashChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type BitcoincashChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type BitcoincashChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1280,23 +1335,27 @@ export type BitcoincashChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type BitcoincashChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type BitcoincashChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type BitcoincashChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type BitcoincashChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1325,12 +1384,14 @@ export type Blast = { version: Array; }; + export type BlastActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type BlastBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1338,11 +1399,13 @@ export type BlastBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type BlastNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type BlastTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1380,7 +1443,7 @@ export type BridgeTokenInput = { export enum CacheControlScope { PRIVATE = 'PRIVATE', - PUBLIC = 'PUBLIC', + PUBLIC = 'PUBLIC' } export type CantoEvm = { @@ -1400,12 +1463,14 @@ export type CantoEvm = { version: Array; }; + export type CantoEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type CantoEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1413,16 +1478,19 @@ export type CantoEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type CantoEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type CantoEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type CantoEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1447,12 +1515,14 @@ export type Celo = { version: Array; }; + export type CeloActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type CeloBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1460,11 +1530,13 @@ export type CeloBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type CeloNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type CeloTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1481,7 +1553,7 @@ export enum Chain { FANTOM = 'FANTOM', HARMONY = 'HARMONY', OPTIMISM = 'OPTIMISM', - POLYGON = 'POLYGON', + POLYGON = 'POLYGON' } export type ChainType = { @@ -1552,6 +1624,7 @@ export type CosmosBalanceChain = { version: Array; }; + export type CosmosBalanceChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1572,17 +1645,20 @@ export type CosmosBasedChain = { version: Array; }; + export type CosmosBasedChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type CosmosBasedChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1665,12 +1741,14 @@ export type CronosEvm = { version: Array; }; + export type CronosEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type CronosEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1678,16 +1756,19 @@ export type CronosEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type CronosEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type CronosEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type CronosEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1854,18 +1935,7 @@ export type DelegateStakeActivityV0 = { }; /** Detailed activity represent more details about transaction */ -export type DetailedActivityV0 = - | DelegateStakeActivityV0 - | DirectStakeActivityV0 - | DirectUnstakeActivityV0 - | GasTankDepositActivityV0 - | GasTankWithdrawActivityV0 - | OffchainReceiveAssetActivityV0 - | OffchainSendAssetActivityV0 - | SwapAssetActivityV0 - | TokenApproveActivityV0 - | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; +export type DetailedActivityV0 = DelegateStakeActivityV0 | DirectStakeActivityV0 | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 | UndelegateStakeActivityV0 | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -1903,24 +1973,29 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; + export type DogeChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type DogeChainBalancesArgs = { address: Scalars['String']; }; + export type DogeChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type DogeChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type DogeChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1929,23 +2004,27 @@ export type DogeChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type DogeChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type DogeChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type DogeChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type DogeChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -2047,12 +2126,14 @@ export type Ethereum = { version: Array; }; + export type EthereumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type EthereumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2060,16 +2141,19 @@ export type EthereumBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type EthereumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type EthereumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type EthereumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2152,12 +2236,14 @@ export type Fantom = { version: Array; }; + export type FantomActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type FantomBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2165,16 +2251,19 @@ export type FantomBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type FantomLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type FantomNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type FantomTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2190,10 +2279,7 @@ export type Fee = { }; /** Represent possible fee details specific to chain */ -export type FeeDetailsV0 = - | EvmFeeDetailsV0 - | ThorChainFeeDetailsV0 - | TronFeeDetailsV0; +export type FeeDetailsV0 = EvmFeeDetailsV0 | ThorChainFeeDetailsV0 | TronFeeDetailsV0; export type FeeInputType = { feeRateTransaction: Scalars['Float']; @@ -2311,12 +2397,14 @@ export type Gnosis = { version: Array; }; + export type GnosisActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type GnosisBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2324,16 +2412,19 @@ export type GnosisBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type GnosisLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type GnosisNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type GnosisTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2359,6 +2450,7 @@ export type InvestingType = { pools: Array; }; + export type InvestingTypePoolsArgs = { filter?: InputMaybe; }; @@ -2379,21 +2471,25 @@ export type JunoChain = { version: Array; }; + export type JunoChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type JunoChainNftsArgs = { address: Scalars['String']; }; + export type JunoChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2448,12 +2544,14 @@ export type Linea = { version: Array; }; + export type LineaActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type LineaBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2461,11 +2559,13 @@ export type LineaBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type LineaNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type LineaTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2494,24 +2594,29 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; + export type LitecoinChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; + export type LitecoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; + export type LitecoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; + export type LitecoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -2520,23 +2625,27 @@ export type LitecoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; + export type LitecoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; + export type LitecoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; + export type LitecoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; + export type LitecoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -2572,12 +2681,14 @@ export type Mantle = { version: Array; }; + export type MantleActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type MantleBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2585,11 +2696,13 @@ export type MantleBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type MantleNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type MantleTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2622,17 +2735,20 @@ export type MayaChain = { version: Array; }; + export type MayaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type MayaChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; + export type MayaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2687,12 +2803,14 @@ export type Mode = { version: Array; }; + export type ModeActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ModeBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2700,11 +2818,13 @@ export type ModeBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type ModeNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type ModeTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2719,7 +2839,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2727,36 +2849,51 @@ export type Mutation = { upsertReferrer?: Maybe; }; + export type MutationAddCommentArgs = { address: Scalars['String']; comment: Scalars['String']; source: Scalars['String']; }; + export type MutationCreateReferrerArgs = { referrer: CreateReferrer; }; + export type MutationTransactionHashV2Args = { routeId: Scalars['String']; tradeId: Scalars['String']; transactionHash: Scalars['String']; }; + +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; + export type MutationTransactionsV2Args = { routeData: RouteInputTypeV2; }; + export type MutationTransactonHashArgs = { routeId: Scalars['String']; signedHash: Scalars['String']; tradeId: Scalars['Float']; }; + export type MutationUpsertReferrerArgs = { address: Scalars['String']; feeTier: Scalars['String']; @@ -2878,14 +3015,17 @@ export type NearChain = { version: Array; }; + export type NearChainBalancesArgs = { address: Scalars['String']; }; + export type NearChainNftsArgs = { address: Scalars['String']; }; + export type NearChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2950,7 +3090,7 @@ export enum NftChainType { Gnosis = 'Gnosis', Optimism = 'Optimism', Polygon = 'Polygon', - Solana = 'Solana', + Solana = 'Solana' } /** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ @@ -2997,12 +3137,14 @@ export type OpBnb = { version: Array; }; + export type OpBnbActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type OpBnbBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3010,11 +3152,13 @@ export type OpBnbBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type OpBnbNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type OpBnbTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3066,12 +3210,14 @@ export type Optimism = { version: Array; }; + export type OptimismActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type OptimismBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3079,16 +3225,19 @@ export type OptimismBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type OptimismLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type OptimismNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type OptimismTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3158,12 +3307,14 @@ export type Polygon = { version: Array; }; + export type PolygonActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type PolygonBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3171,16 +3322,19 @@ export type PolygonBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type PolygonLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type PolygonNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type PolygonTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3193,7 +3347,7 @@ export enum Pool { Aave = 'Aave', Benqi = 'Benqi', Bitswap = 'Bitswap', - IronBank = 'IronBank', + IronBank = 'IronBank' } export type PoolType = { @@ -3294,7 +3448,7 @@ export enum PortfolioChainVariant { TerraClassic = 'TerraClassic', TomoChain = 'TomoChain', Tron = 'Tron', - Umee = 'Umee', + Umee = 'Umee' } export type PostRouteTypeV2 = { @@ -3307,7 +3461,7 @@ export enum PriceHistoryInterval { day = 'day', month = 'month', week = 'week', - year = 'year', + year = 'year' } /** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ @@ -3450,30 +3604,36 @@ export type Query = { zkSync: ZkSync; }; + export type QueryChainsArgs = { filter?: InputMaybe; }; + export type QueryCompositeTokensArgs = { after?: InputMaybe; ids?: InputMaybe>; }; + export type QueryCryptoCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; symbols?: InputMaybe>; }; + export type QueryDappArgs = { app: DAppReputationInput; }; + export type QueryFiatCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; }; + export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3481,6 +3641,7 @@ export type QueryReputationArgs = { offest?: Scalars['Int']; }; + export type QueryReputationV2Args = { address: Scalars['String']; approved?: InputMaybe; @@ -3489,16 +3650,19 @@ export type QueryReputationV2Args = { first?: Scalars['Int']; }; + export type QueryTokensArgs = { after?: InputMaybe; filter?: InputMaybe; }; + export type QueryTrackWalletConnectArgs = { walletAddress: Scalars['String']; walletProvider: Scalars['String']; }; + export type QueryWalletInfoArgs = { address: Scalars['String']; }; @@ -3737,7 +3901,7 @@ export enum ReputationChains { Zilliqa = 'Zilliqa', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync', + zkSync = 'zkSync' } export type ReputationComment = { @@ -3957,6 +4121,7 @@ export type RoutingChainType = { tokens: Array; }; + export type RoutingChainTypeTokensArgs = { addresses?: InputMaybe>; srcToken?: InputMaybe; @@ -4001,6 +4166,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4039,10 +4212,12 @@ export type RoutingType = { trades?: Maybe>; }; + export type RoutingTypeChainArgs = { name: Scalars['String']; }; + export type RoutingTypeRouteArgs = { addresses: Array; amountSource?: InputMaybe; @@ -4052,21 +4227,25 @@ export type RoutingTypeRouteArgs = { srcToken: Scalars['String']; }; + export type RoutingTypeTokenArgs = { id: Scalars['String']; }; + export type RoutingTypeTokensArgs = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; + export type RoutingTypeTradesArgs = { routeId: Scalars['String']; }; export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,28 +4266,40 @@ export type RoutingTypeV2 = { tradesV2: Array; }; + +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; + export type RoutingTypeV2BridgeableTokensArgs = { bridgeToken?: InputMaybe; tokenId?: InputMaybe; }; + export type RoutingTypeV2ChainV2Args = { name: Scalars['String']; }; + export type RoutingTypeV2DailyVolumeArgs = { startDate?: Scalars['String']; }; + export type RoutingTypeV2IsAssetSwappableArgs = { address: Scalars['String']; chainName: Scalars['String']; }; + export type RoutingTypeV2RefuelArgs = { addresses: Array; amountSource?: InputMaybe; @@ -4118,37 +4309,42 @@ export type RoutingTypeV2RefuelArgs = { srcToken: Scalars['String']; }; + export type RoutingTypeV2RefuelInfoArgs = { destChain: Scalars['String']; srcChain: Scalars['String']; }; + export type RoutingTypeV2RouteV2Args = { addresses: Array; amountSource?: InputMaybe; destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; srcToken: Scalars['String']; }; + export type RoutingTypeV2TokenV2Args = { id: Scalars['String']; }; + export type RoutingTypeV2TokensV2Args = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; + export type RoutingTypeV2TradeV2Args = { tradeId: Scalars['String']; }; + export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; @@ -4167,12 +4363,14 @@ export type Scroll = { version: Array; }; + export type ScrollActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ScrollBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4180,11 +4378,13 @@ export type ScrollBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type ScrollNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type ScrollTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4292,32 +4492,38 @@ export type SolanaChain = { version: Array; }; + export type SolanaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type SolanaChainAssetHistoryBalancesV0Args = { address: Scalars['String']; minUntil?: InputMaybe; skipAssetServiceFiltering?: Scalars['Boolean']; }; + export type SolanaChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type SolanaChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; + export type SolanaChainNftsArgs = { address: Scalars['String']; }; + export type SolanaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4381,21 +4587,25 @@ export type StargazeChain = { version: Array; }; + export type StargazeChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type StargazeChainNftsArgs = { address: Scalars['String']; }; + export type StargazeChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4459,11 +4669,13 @@ export type TerraChain = { version: Array; }; + export type TerraChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; + export type TerraChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; @@ -4482,17 +4694,20 @@ export type ThorChain = { version: Array; }; + export type ThorChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ThorChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; + export type ThorChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4589,7 +4804,7 @@ export enum TimePeriod { DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', - YEAR = 'YEAR', + YEAR = 'YEAR' } /** Unlimited or specific amount of asset approved to spend for spender address */ @@ -4606,7 +4821,7 @@ export enum TokenCategory { LST_TOKEN = 'LST_TOKEN', SHITCOIN = 'SHITCOIN', STABLECOIN = 'STABLECOIN', - TRENDING_TOKEN = 'TRENDING_TOKEN', + TRENDING_TOKEN = 'TRENDING_TOKEN' } export type TokenContractType = { @@ -4708,7 +4923,7 @@ export enum TransactionStatus { /** Transaction was sent and is in the mempool (or equivalent for the chain) */ PENDING = 'PENDING', /** Transaction was included in a block and successfully executed */ - SUCCESS = 'SUCCESS', + SUCCESS = 'SUCCESS' } /** Represents the status of a transaction with optional details */ @@ -4724,7 +4939,7 @@ export enum TransactionType { STAKE = 'STAKE', SWAP = 'SWAP', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW', + WITHDRAW = 'WITHDRAW' } export type TrendingCoingeckoType = { @@ -4769,12 +4984,14 @@ export type Tron = { version: Array; }; + export type TronActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type TronBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4782,11 +4999,13 @@ export type TronBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type TronNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type TronTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4857,58 +5076,72 @@ export type TxClassifier = { getBlockchairTxsByQuery: Scalars['String']; }; + export type TxClassifierAnalyzeEvmTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; + export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { payload: BlowfishSolanaTxPayload; }; + export type TxClassifierAnalyzeTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; + export type TxClassifierAnalyzeTxV1HexagateArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierAnalyzeTxV2HexagateArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierDecodeTransactionV2Args = { payload: EvmTransactionPayload; }; + export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3Args = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3TenderlyArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { payload: Array; }; + export type TxClassifierExplainTransactionV4TenderlyArgs = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierExplainTransactionV5Args = { payload: EvmTransactionPayloadV2; }; + export type TxClassifierGetBlockchairTxsByQueryArgs = { chain: TxClassifierChains; limit: Scalars['Int']; @@ -4930,7 +5163,7 @@ export enum TxClassifierChains { linea = 'linea', optimism = 'optimism', polygon = 'polygon', - solana = 'solana', + solana = 'solana' } export enum TxClassifierTxType { @@ -4942,7 +5175,7 @@ export enum TxClassifierTxType { SWAP = 'SWAP', TRANSFER = 'TRANSFER', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW', + WITHDRAW = 'WITHDRAW' } export type TxSecurityIssue = { @@ -5044,12 +5277,14 @@ export type UserPortfolio = { walletHistory?: Maybe; }; + export type UserPortfolioAddressHistoryArgs = { address: Scalars['String']; chain: PortfolioChainVariant; timePeriod: TimePeriod; }; + export type UserPortfolioWalletHistoryArgs = { accounts: Array; maxAggregationTimeout?: InputMaybe; @@ -5207,6 +5442,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ @@ -5223,12 +5467,14 @@ export type ZetaChain = { version: Array; }; + export type ZetaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ZetaChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5236,11 +5482,13 @@ export type ZetaChainBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type ZetaChainNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type ZetaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5265,12 +5513,14 @@ export type ZkSync = { version: Array; }; + export type ZkSyncActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; + export type ZkSyncBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5278,11 +5528,13 @@ export type ZkSyncBalancesArgs = { tokenAddresses?: InputMaybe>; }; + export type ZkSyncNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; + export type ZkSyncTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5295,47 +5547,13 @@ export type BitcoinCashBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; -export type BitcoinCashBalanceQuery = { - __typename?: 'Query'; - bitcoincash: { - __typename?: 'BitcoincashChain'; - balances: Array<{ - __typename?: 'Balance'; - address: string; - amount: { __typename?: 'Amount'; value: string }; - asset: { - __typename?: 'CryptoAsset'; - chain?: string | null; - contract?: string | null; - decimals?: number | null; - id?: string | null; - image?: string | null; - name?: string | null; - symbol?: string | null; - price?: { - __typename?: 'AssetAmountType'; - amount: string; - dayPriceChange?: string | null; - } | null; - }; - }>; - }; -}; - -export type GetBitcoinCashFeesQueryVariables = Exact<{ [key: string]: never }>; - -export type GetBitcoinCashFeesQuery = { - __typename?: 'Query'; - bitcoincash: { - __typename?: 'BitcoincashChain'; - fee?: { - __typename?: 'DefaultGasFee'; - high?: number | null; - low?: number | null; - medium?: number | null; - } | null; - }; -}; + +export type BitcoinCashBalanceQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', balances: Array<{ __typename?: 'Balance', address: string, amount: { __typename?: 'Amount', value: string }, asset: { __typename?: 'CryptoAsset', chain?: string | null, contract?: string | null, decimals?: number | null, id?: string | null, image?: string | null, name?: string | null, symbol?: string | null, price?: { __typename?: 'AssetAmountType', amount: string, dayPriceChange?: string | null } | null } }> } }; + +export type GetBitcoinCashFeesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetBitcoinCashFeesQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', fee?: { __typename?: 'DefaultGasFee', high?: number | null, low?: number | null, medium?: number | null } | null } }; export type GetBitcoinCashTransactionsQueryVariables = Exact<{ address: Scalars['String']; @@ -5343,753 +5561,35 @@ export type GetBitcoinCashTransactionsQueryVariables = Exact<{ pageNumber: Scalars['Int']; }>; -export type GetBitcoinCashTransactionsQuery = { - __typename?: 'Query'; - bitcoincash: { - __typename?: 'BitcoincashChain'; - transactionsV2: Array<{ - __typename?: 'UTXOTransactionV2'; - blockNumber?: number | null; - hash: string; - timestamp?: any | null; - status?: string | null; - balanceChange?: { __typename?: 'Amount'; value: string } | null; - fee?: { __typename?: 'Amount'; value: string } | null; - inputs?: Array<{ - __typename?: 'Input'; - address: string; - amount: { __typename?: 'Amount'; value: string }; - }> | null; - outputs?: Array<{ - __typename?: 'Output'; - address: string; - amount: { __typename?: 'Amount'; value: string }; - }> | null; - }>; - }; -}; + +export type GetBitcoinCashTransactionsQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', transactionsV2: Array<{ __typename?: 'UTXOTransactionV2', blockNumber?: number | null, hash: string, timestamp?: any | null, status?: string | null, balanceChange?: { __typename?: 'Amount', value: string } | null, fee?: { __typename?: 'Amount', value: string } | null, inputs?: Array<{ __typename?: 'Input', address: string, amount: { __typename?: 'Amount', value: string } }> | null, outputs?: Array<{ __typename?: 'Output', address: string, amount: { __typename?: 'Amount', value: string } }> | null }> } }; export type BitcoinCashBroadcastTransactionQueryVariables = Exact<{ rawHex: Scalars['String']; }>; -export type BitcoinCashBroadcastTransactionQuery = { - __typename?: 'Query'; - bitcoincash: { - __typename?: 'BitcoincashChain'; - broadcastTransaction: string; - }; -}; + +export type BitcoinCashBroadcastTransactionQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', broadcastTransaction: string } }; export type BitcoinCashScanUtxOsQueryVariables = Exact<{ address: Scalars['String']; page: Scalars['Int']; }>; -export type BitcoinCashScanUtxOsQuery = { - __typename?: 'Query'; - bitcoincash: { - __typename?: 'BitcoincashChain'; - unspentTxOutputsV5: Array<{ - __typename?: 'UnspentTransactionOutputV5'; - oTxHash: string; - oIndex: number; - oTxHex?: string | null; - address?: string | null; - isCoinbase?: boolean | null; - scriptHex?: string | null; - value: { __typename?: 'Amount'; value: string }; - }>; - }; -}; + +export type BitcoinCashScanUtxOsQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', unspentTxOutputsV5: Array<{ __typename?: 'UnspentTransactionOutputV5', oTxHash: string, oIndex: number, oTxHex?: string | null, address?: string | null, isCoinbase?: boolean | null, scriptHex?: string | null, value: { __typename?: 'Amount', value: string } }> } }; export type BitcoinCashGetTransactionByHashQueryVariables = Exact<{ txHash: Scalars['String']; }>; -export type BitcoinCashGetTransactionByHashQuery = { - __typename?: 'Query'; - bitcoincash: { - __typename?: 'BitcoincashChain'; - getTransactionByHashV5: { - __typename?: 'UtxotransactionByHashV5'; - hex?: string | null; - txid?: string | null; - hash: string; - size: number; - version: number; - locktime?: number | null; - confirmations?: number | null; - blocktime?: number | null; - time?: number | null; - blockhash?: string | null; - blockNumber?: number | null; - sourceOfData: string; - inputs: Array<{ __typename?: 'Input'; address: string }>; - outputs: Array<{ __typename?: 'Output'; address: string }>; - }; - }; -}; - -export const BitcoinCashBalanceDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'BitcoinCashBalance' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'bitcoincash' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'balances' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'address' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'address' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'amount' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'asset' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'chain' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'contract' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'decimals' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'id' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'image' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'name' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'price' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'amount' }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'dayPriceChange', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'symbol' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - BitcoinCashBalanceQuery, - BitcoinCashBalanceQueryVariables ->; -export const GetBitcoinCashFeesDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetBitcoinCashFees' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'bitcoincash' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'fee' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'high' } }, - { kind: 'Field', name: { kind: 'Name', value: 'low' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'medium' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - GetBitcoinCashFeesQuery, - GetBitcoinCashFeesQueryVariables ->; -export const GetBitcoinCashTransactionsDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetBitcoinCashTransactions' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'pageSize' }, - }, - type: { - kind: 'NonNullType', - type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, - }, - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'pageNumber' }, - }, - type: { - kind: 'NonNullType', - type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'bitcoincash' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'transactionsV2' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'address' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'pageSize' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'pageSize' }, - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'pageNumber' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'pageNumber' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'balanceChange' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'blockNumber' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'fee' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - }, - ], - }, - }, - { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'inputs' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'address' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'amount' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'outputs' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'amount' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'address' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'timestamp' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'status' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - GetBitcoinCashTransactionsQuery, - GetBitcoinCashTransactionsQueryVariables ->; -export const BitcoinCashBroadcastTransactionDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'BitcoinCashBroadcastTransaction' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'rawHex' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'bitcoincash' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'broadcastTransaction' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'rawHex' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'rawHex' }, - }, - }, - ], - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - BitcoinCashBroadcastTransactionQuery, - BitcoinCashBroadcastTransactionQueryVariables ->; -export const BitcoinCashScanUtxOsDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'BitcoinCashScanUTXOs' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - { - kind: 'VariableDefinition', - variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } }, - type: { - kind: 'NonNullType', - type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'bitcoincash' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'unspentTxOutputsV5' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'address' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'address' }, - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'page' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'page' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'oTxHash' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'oIndex' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'value' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'oTxHex' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'address' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'isCoinbase' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'scriptHex' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - BitcoinCashScanUtxOsQuery, - BitcoinCashScanUtxOsQueryVariables ->; -export const BitcoinCashGetTransactionByHashDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'BitcoinCashGetTransactionByHash' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'txHash' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'bitcoincash' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'getTransactionByHashV5' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'txHash' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'txHash' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'hex' } }, - { kind: 'Field', name: { kind: 'Name', value: 'txid' } }, - { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, - { kind: 'Field', name: { kind: 'Name', value: 'size' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'version' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'locktime' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'confirmations' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'blocktime' }, - }, - { kind: 'Field', name: { kind: 'Name', value: 'time' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'blockhash' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'blockNumber' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'sourceOfData' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'inputs' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'address' }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'outputs' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'address' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - BitcoinCashGetTransactionByHashQuery, - BitcoinCashGetTransactionByHashQueryVariables ->; + +export type BitcoinCashGetTransactionByHashQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', getTransactionByHashV5: { __typename?: 'UtxotransactionByHashV5', hex?: string | null, txid?: string | null, hash: string, size: number, version: number, locktime?: number | null, confirmations?: number | null, blocktime?: number | null, time?: number | null, blockhash?: string | null, blockNumber?: number | null, sourceOfData: string, inputs: Array<{ __typename?: 'Input', address: string }>, outputs: Array<{ __typename?: 'Output', address: string }> } } }; + + +export const BitcoinCashBalanceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashBalance"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balances"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chain"}},{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"dayPriceChange"}}]}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetBitcoinCashFeesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBitcoinCashFees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"high"}},{"kind":"Field","name":{"kind":"Name","value":"low"}},{"kind":"Field","name":{"kind":"Name","value":"medium"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetBitcoinCashTransactionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBitcoinCashTransactions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageNumber"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionsV2"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageNumber"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageNumber"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balanceChange"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode; +export const BitcoinCashBroadcastTransactionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashBroadcastTransaction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rawHex"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"broadcastTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rawHex"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rawHex"}}}]}]}}]}}]} as unknown as DocumentNode; +export const BitcoinCashScanUtxOsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashScanUTXOs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unspentTxOutputsV5"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}},{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"oIndex"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"oTxHex"}},{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"isCoinbase"}},{"kind":"Field","name":{"kind":"Name","value":"scriptHex"}}]}}]}}]}}]} as unknown as DocumentNode; +export const BitcoinCashGetTransactionByHashDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashGetTransactionByHash"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"txHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getTransactionByHashV5"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"txHash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hex"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"locktime"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"blocktime"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"blockhash"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"sourceOfData"}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/core/src/common/graphql.ts b/packages/core/src/common/graphql.ts index 7af6d5f9..ac9ba10a 100644 --- a/packages/core/src/common/graphql.ts +++ b/packages/core/src/common/graphql.ts @@ -1859,7 +1859,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2710,7 +2711,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2734,6 +2737,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -3992,6 +4002,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4058,6 +4076,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4078,6 +4097,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4120,7 +4144,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5198,6 +5221,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/cosmos/src/gql/graphql.ts b/packages/cosmos/src/gql/graphql.ts index 1b0a23eb..b9d9561d 100644 --- a/packages/cosmos/src/gql/graphql.ts +++ b/packages/cosmos/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/dogecoin/src/gql/graphql.ts b/packages/dogecoin/src/gql/graphql.ts index ab71bc62..4214de14 100644 --- a/packages/dogecoin/src/gql/graphql.ts +++ b/packages/dogecoin/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/evm/src/datasource/indexer/queries/nfts.query.ts b/packages/evm/src/datasource/indexer/queries/nfts.query.ts index e560de64..87e74ae5 100644 --- a/packages/evm/src/datasource/indexer/queries/nfts.query.ts +++ b/packages/evm/src/datasource/indexer/queries/nfts.query.ts @@ -129,7 +129,6 @@ export const GNOSIS_NFTS_QUERY = gql` } } } - ${LEGACY_NFTS_FRAGMENT} `; diff --git a/packages/evm/src/gql/graphql.ts b/packages/evm/src/gql/graphql.ts index 33c0836a..9f1643f6 100644 --- a/packages/evm/src/gql/graphql.ts +++ b/packages/evm/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/litecoin/src/gql/graphql.ts b/packages/litecoin/src/gql/graphql.ts index 66106106..ca8bde5c 100644 --- a/packages/litecoin/src/gql/graphql.ts +++ b/packages/litecoin/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/solana/src/gql/graphql.ts b/packages/solana/src/gql/graphql.ts index 32c2924e..ffec1056 100644 --- a/packages/solana/src/gql/graphql.ts +++ b/packages/solana/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/thor/src/gql/graphql.ts b/packages/thor/src/gql/graphql.ts index 93391f09..f32e80ad 100644 --- a/packages/thor/src/gql/graphql.ts +++ b/packages/thor/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/packages/tron/src/gql/graphql.ts b/packages/tron/src/gql/graphql.ts index 2313377b..219d887e 100644 --- a/packages/tron/src/gql/graphql.ts +++ b/packages/tron/src/gql/graphql.ts @@ -1865,7 +1865,8 @@ export type DetailedActivityV0 = | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 - | UndelegateStakeActivityV0; + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2719,7 +2720,9 @@ export type Mutation = { claimFees?: Maybe; /** Publicly exposed Create a referrer */ createReferrer?: Maybe; + /** @deprecated added the transactionHashV3 which supports the new swap history logging, use transactionHashV3 instead */ transactionHashV2: Scalars['String']; + transactionHashV3: Scalars['String']; transactions: Array; transactionsV2: PostRouteTypeV2; transactonHash: Scalars['String']; @@ -2743,6 +2746,13 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; +export type MutationTransactionHashV3Args = { + accountId: Scalars['String']; + routeId: Scalars['String']; + tradeId: Scalars['String']; + transactionHash: Scalars['String']; +}; + export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4001,6 +4011,14 @@ export type RoutingFeeTypeV2 = { xdefiSwapFeeDollar?: Maybe; }; +export type RoutingSwapHistory = { + __typename?: 'RoutingSwapHistory'; + activityType: Scalars['String']; + createdAt: Scalars['DateTime']; + inputAsset?: Maybe; + outputAsset?: Maybe; +}; + export type RoutingTokenInputType = { asset?: InputMaybe; id: Scalars['ID']; @@ -4067,6 +4085,7 @@ export type RoutingTypeTradesArgs = { export type RoutingTypeV2 = { __typename?: 'RoutingTypeV2'; + SwapHistory: Array; addressCheckV2: AddressRouteCheckTypeV2; allReferrers?: Maybe>; bridgeableTokens: Array; @@ -4087,6 +4106,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; +export type RoutingTypeV2SwapHistoryArgs = { + accountId: Scalars['String']; + limit?: Scalars['Int']; +}; + export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; @@ -4129,7 +4153,6 @@ export type RoutingTypeV2RouteV2Args = { destAddress: Scalars['String']; destToken: Scalars['String']; infiniteApproval?: InputMaybe; - isLedgerLive?: InputMaybe; isOptedIn?: InputMaybe; referral?: InputMaybe; slippage: Scalars['String']; @@ -5207,6 +5230,15 @@ export type WalletPortfolioFiat = { sum?: Maybe; }; +/** Transfer of asset that was previously staked */ +export type WithdrawUnstakedActivityV0 = { + __typename?: 'WithdrawUnstakedActivityV0'; + amount?: Maybe; + asset?: Maybe; + /** on Solana (stake account) */ + from?: Maybe; +}; + export type ZetaChain = { __typename?: 'ZetaChain'; /** activity history for address in descending order */ diff --git a/utility-packages/graphql/src/gql/graphql.ts b/utility-packages/graphql/src/gql/graphql.ts index 47661b33..1be38b00 100644 --- a/utility-packages/graphql/src/gql/graphql.ts +++ b/utility-packages/graphql/src/gql/graphql.ts @@ -179,7 +179,6 @@ export enum AddressChain { Tron = 'Tron', Umee = 'Umee', opBNB = 'opBNB', - xDAI = 'xDAI', zkSync = 'zkSync', } @@ -2590,8 +2589,8 @@ export enum NftChainType { BinanceSmartChain = 'BinanceSmartChain', Bitcoin = 'Bitcoin', Ethereum = 'Ethereum', - Gnosis = 'Gnosis', Optimism = 'Optimism', + Gnosis = 'Gnosis', Polygon = 'Polygon', Solana = 'Solana', } @@ -3345,7 +3344,6 @@ export enum ReputationChains { Wax = 'Wax', Zilliqa = 'Zilliqa', opBNB = 'opBNB', - xDAI = 'xDAI', zkSync = 'zkSync', } From 29ef3477ab3f8fc570e7724aff73f25c99fa9a0d Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 12 Aug 2024 16:10:47 +0000 Subject: [PATCH 103/176] Version packages --- .changeset/loud-fishes-return.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/loud-fishes-return.md diff --git a/.changeset/loud-fishes-return.md b/.changeset/loud-fishes-return.md deleted file mode 100644 index 29a515cf..00000000 --- a/.changeset/loud-fishes-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -remove xDai(Gnosis) - unsupported chain diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 9a59e151..3d7f7f09 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.42 + +### Patch Changes + +- 6f3aa96e: remove xDai(Gnosis) - unsupported chain + ## 2.0.41 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 60afda00..d6e96570 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.41", + "version": "2.0.42", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 796b006a9c86df99f7dd97a8beb789116347071d Mon Sep 17 00:00:00 2001 From: HoangVD2 <102846781+HoangVD2@users.noreply.github.com> Date: Tue, 13 Aug 2024 18:48:07 +0700 Subject: [PATCH 104/176] feat: add priceChange to getData function (XDEFI-9568) (#301) * feat: add dayPriceChange to getData function * base: add priceChange (day/week/month/year) * base: update priceChange * chore: update * base: update core priceChange * chore: update * chore: add tests for priceChange * chore * update --- .changeset/smooth-experts-remain.md | 15 +++++++++++ packages/binance/src/chain.provider.spec.ts | 12 +++++++++ .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/bitcoin/src/chain.provider.spec.ts | 12 +++++++++ .../datasource/indexer/indexer.data-source.ts | 3 +++ .../bitcoincash/src/chain.provider.spec.ts | 10 +++++++ .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/bitcoincash/src/gql/graphql.ts | 18 +++++++++---- packages/core/src/core/asset/asset.ts | 13 ++++++++++ packages/cosmos/src/chain.provider.spec.ts | 12 +++++++-- .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/dogecoin/src/chain.provider.spec.ts | 10 +++++++ .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/evm/src/chain.provider.spec.ts | 10 +++++++ .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/litecoin/src/chain.provider.spec.ts | 10 +++++++ .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/solana/src/chain.provider.spec.ts | 10 +++++++ .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/thor/src/chain.provider.spec.ts | 9 +++++++ .../datasource/indexer/gql/mayachain.graphql | 1 + .../datasource/indexer/gql/thorchain.graphql | 1 + .../datasource/indexer/indexer.data-source.ts | 3 +++ packages/thor/src/gql/gql.ts | 12 ++++----- packages/thor/src/gql/graphql.ts | 26 +++++++++++++++++-- .../datasource/indexer/indexer.data-source.ts | 3 +++ 26 files changed, 196 insertions(+), 15 deletions(-) create mode 100644 .changeset/smooth-experts-remain.md diff --git a/.changeset/smooth-experts-remain.md b/.changeset/smooth-experts-remain.md new file mode 100644 index 00000000..c75e5451 --- /dev/null +++ b/.changeset/smooth-experts-remain.md @@ -0,0 +1,15 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-evm': patch +--- + +add priceChange (dayPriceChange) to getData function (getBalance response) diff --git a/packages/binance/src/chain.provider.spec.ts b/packages/binance/src/chain.provider.spec.ts index 0707f3a6..a317f600 100644 --- a/packages/binance/src/chain.provider.spec.ts +++ b/packages/binance/src/chain.provider.spec.ts @@ -45,6 +45,10 @@ describe('chain.provider', () => { native: false, address: '0x1b0e27D4733b5e6499354085114F2A5D21A00C60', decimals: 8, + price: '0.00008282', + priceChange: { + dayPriceChange: '-0.00000001', + }, }, amount: '1000', }, @@ -60,6 +64,10 @@ describe('chain.provider', () => { native: false, address: '0x1b0e27D4733b5e6499354085114F2A5D21A00C60', decimals: 8, + price: '0.00008282', + priceChange: { + dayPriceChange: '-0.00000001', + }, }, amount: '1000', }, @@ -75,6 +83,10 @@ describe('chain.provider', () => { expect(balanceData.length).toEqual(1); expect(balanceData[0].amount).toEqual('1000'); expect(balanceData[0].asset.symbol).toEqual('ANDY'); + expect(balanceData[0].asset.price).toEqual('0.00008282'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual( + '-0.00000001' + ); } else { const balance = await provider.getBalance( '0x0AFfB0a96FBefAa97dCe488DfD97512346cf3Ab8' diff --git a/packages/binance/src/datasource/indexer/indexer.data-source.ts b/packages/binance/src/datasource/indexer/indexer.data-source.ts index 5b3109b8..d51cff74 100644 --- a/packages/binance/src/datasource/indexer/indexer.data-source.ts +++ b/packages/binance/src/datasource/indexer/indexer.data-source.ts @@ -51,6 +51,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals || 0, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), new BigNumber(amount.value) .dividedBy(10 ** (asset.decimals || 0)) diff --git a/packages/bitcoin/src/chain.provider.spec.ts b/packages/bitcoin/src/chain.provider.spec.ts index 9f2da5d1..c28ed81c 100644 --- a/packages/bitcoin/src/chain.provider.spec.ts +++ b/packages/bitcoin/src/chain.provider.spec.ts @@ -53,6 +53,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '65000.00', decimals: 8, + priceChange: { + dayPriceChange: '-4.187565214298426', + }, }, amount: '100', }, @@ -69,6 +72,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '65000.00', decimals: 8, + priceChange: { + dayPriceChange: '-4.187565214298426', + }, }, amount: '100', }, @@ -84,6 +90,10 @@ describe('chain.provider', () => { expect(balanceData.length).toEqual(1); expect(balanceData[0].amount).toEqual('100'); expect(balanceData[0].asset.symbol).toEqual('BTC'); + expect(balanceData[0].asset.price).toEqual('65000.00'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual( + '-4.187565214298426' + ); } else { const balance = await provider.getBalance( 'bc1qfcsf4tue7jcgedd4s06ws765dvqw5kjn2zztvw' @@ -94,6 +104,8 @@ describe('chain.provider', () => { expect(balanceData[0]).toBeInstanceOf(Coin); expect(balanceData[0].amount).toBeTruthy(); expect(balanceData[0].asset.symbol).toEqual('BTC'); + expect(balanceData[0].asset.price).toBeTruthy(); + expect(balanceData[0].asset.priceChange.dayPriceChange).toBeTruthy(); } }); diff --git a/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts b/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts index 21a977a0..9f99077b 100644 --- a/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts +++ b/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts @@ -91,6 +91,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals || 0, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), utils.formatUnits(amount.value, asset.decimals || 0) ) diff --git a/packages/bitcoincash/src/chain.provider.spec.ts b/packages/bitcoincash/src/chain.provider.spec.ts index 94acd858..f3708daf 100644 --- a/packages/bitcoincash/src/chain.provider.spec.ts +++ b/packages/bitcoincash/src/chain.provider.spec.ts @@ -72,6 +72,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 8, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -88,6 +91,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 8, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -103,6 +109,8 @@ describe('chain.provider', () => { expect(balanceData.length).toEqual(1); expect(balanceData[0].amount).toEqual('1000'); expect(balanceData[0].asset.symbol).toEqual('BCH'); + expect(balanceData[0].asset.price).toEqual('443.21'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('-1'); } else { const balance = await provider.getBalance( 'bitcoincash:qpauz5p7js7efhxtcy780lwra7qhvswqwvstca7ffu' @@ -114,6 +122,8 @@ describe('chain.provider', () => { expect(balanceData[0]).toBeInstanceOf(Coin); expect(balanceData[0].amount).toBeTruthy(); expect(balanceData[0].asset.symbol).toEqual('BCH'); + expect(balanceData[0].asset.price).toBeTruthy(); + expect(balanceData[0].asset.priceChange.dayPriceChange).toBeTruthy(); } } }); diff --git a/packages/bitcoincash/src/datasource/indexer/indexer.data-source.ts b/packages/bitcoincash/src/datasource/indexer/indexer.data-source.ts index cb60667d..3397f64a 100644 --- a/packages/bitcoincash/src/datasource/indexer/indexer.data-source.ts +++ b/packages/bitcoincash/src/datasource/indexer/indexer.data-source.ts @@ -90,6 +90,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals || 0, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), utils.formatUnits(amount.value, asset.decimals || 0) ) diff --git a/packages/bitcoincash/src/gql/graphql.ts b/packages/bitcoincash/src/gql/graphql.ts index cf1df8e7..6fd5c564 100644 --- a/packages/bitcoincash/src/gql/graphql.ts +++ b/packages/bitcoincash/src/gql/graphql.ts @@ -1935,7 +1935,19 @@ export type DelegateStakeActivityV0 = { }; /** Detailed activity represent more details about transaction */ -export type DetailedActivityV0 = DelegateStakeActivityV0 | DirectStakeActivityV0 | DirectUnstakeActivityV0 | GasTankDepositActivityV0 | GasTankWithdrawActivityV0 | OffchainReceiveAssetActivityV0 | OffchainSendAssetActivityV0 | SwapAssetActivityV0 | TokenApproveActivityV0 | TokenRevokeActivityV0 | UndelegateStakeActivityV0 | WithdrawUnstakedActivityV0; +export type DetailedActivityV0 = + | DelegateStakeActivityV0 + | DirectStakeActivityV0 + | DirectUnstakeActivityV0 + | GasTankDepositActivityV0 + | GasTankWithdrawActivityV0 + | OffchainReceiveAssetActivityV0 + | OffchainSendAssetActivityV0 + | SwapAssetActivityV0 + | TokenApproveActivityV0 + | TokenRevokeActivityV0 + | UndelegateStakeActivityV0 + | WithdrawUnstakedActivityV0; /** Stake by creating own node */ export type DirectStakeActivityV0 = { @@ -2868,7 +2880,6 @@ export type MutationTransactionHashV2Args = { transactionHash: Scalars['String']; }; - export type MutationTransactionHashV3Args = { accountId: Scalars['String']; routeId: Scalars['String']; @@ -2876,7 +2887,6 @@ export type MutationTransactionHashV3Args = { transactionHash: Scalars['String']; }; - export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; @@ -4266,13 +4276,11 @@ export type RoutingTypeV2 = { tradesV2: Array; }; - export type RoutingTypeV2SwapHistoryArgs = { accountId: Scalars['String']; limit?: Scalars['Int']; }; - export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; diff --git a/packages/core/src/core/asset/asset.ts b/packages/core/src/core/asset/asset.ts index d0f169f6..73181ac8 100644 --- a/packages/core/src/core/asset/asset.ts +++ b/packages/core/src/core/asset/asset.ts @@ -11,6 +11,12 @@ export interface AssetData { address?: string | null; price?: string; priceHistory?: number[][]; + priceChange?: { + dayPriceChange?: string | null; + weekPriceChange?: string | null; + monthPriceChange?: string | null; + yearPriceChange?: string | null; + }; } export class Asset { @@ -30,6 +36,7 @@ export class Asset { ...(data.price && { price: data.price }), ...(data.decimals && { decimals: data.decimals }), ...(data.priceHistory && { priceHistory: data.priceHistory }), + ...(data.priceChange && { priceChange: data.priceChange }), }; } @@ -77,6 +84,12 @@ export class Asset { return this.data.priceHistory; } + get priceChange() { + return { + ...this.data.priceChange, + }; + } + /** * Create a new Asset using provided data object * diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index a1ec7fb1..8e7a12f2 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -56,6 +56,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 18, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -84,6 +87,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 18, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -108,8 +114,10 @@ describe('chain.provider', () => { ); const balanceData = await balance.getData(); expect(balanceData.length).toEqual(2); - // Reset to the original method implementation (non-mocked) - mockedGetBalance.mockRestore(); + expect(balanceData[0].amount).toEqual('1000'); + expect(balanceData[0].asset.symbol).toEqual('ATOM'); + expect(balanceData[0].asset.price).toEqual('443.21'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('-1'); }); it('estimatFee() should return fee estimation with encoding string msg', async () => { diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index fb1227db..9cf4f446 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -86,6 +86,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract!, price: asset.price?.amount, decimals: asset.price?.scalingFactor, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), new BigNumber(amount.value).dividedBy(10 ** (asset.decimals as number)) ); diff --git a/packages/dogecoin/src/chain.provider.spec.ts b/packages/dogecoin/src/chain.provider.spec.ts index 5a5f83d0..8f85ea57 100644 --- a/packages/dogecoin/src/chain.provider.spec.ts +++ b/packages/dogecoin/src/chain.provider.spec.ts @@ -56,6 +56,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 8, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -72,6 +75,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 8, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -85,6 +91,10 @@ describe('chain.provider', () => { const balanceData = await balance.getData(); expect(balanceData.length).toBeGreaterThanOrEqual(0); + expect(balanceData[0].amount).toBeTruthy(); + expect(balanceData[0].asset.symbol).toEqual('DOGE'); + expect(balanceData[0].asset.price).toEqual('443.21'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('-1'); } else { const balance = await provider.getBalance( 'DPbphsB3Hgb4Q2Sz32e2NoLbmofMNrp1wn' diff --git a/packages/dogecoin/src/datasource/indexer/indexer.data-source.ts b/packages/dogecoin/src/datasource/indexer/indexer.data-source.ts index a888d623..8b05cff0 100644 --- a/packages/dogecoin/src/datasource/indexer/indexer.data-source.ts +++ b/packages/dogecoin/src/datasource/indexer/indexer.data-source.ts @@ -91,6 +91,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals || 0, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), utils.formatUnits(amount.value, asset.decimals || 0) ) diff --git a/packages/evm/src/chain.provider.spec.ts b/packages/evm/src/chain.provider.spec.ts index 62bdd04e..81c1e67e 100644 --- a/packages/evm/src/chain.provider.spec.ts +++ b/packages/evm/src/chain.provider.spec.ts @@ -102,6 +102,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '345.55', decimals: 18, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -130,6 +133,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '345.55', decimals: 18, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -157,6 +163,8 @@ describe('chain.provider', () => { expect(balanceData.length).toEqual(2); expect(balanceData[0].amount.toString()).toEqual('1000'); expect(balanceData[0].asset.symbol).toEqual('ETH'); + expect(balanceData[0].asset.price).toEqual('345.55'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('-1'); expect(balanceData[1].amount.toString()).toEqual('1000'); expect(balanceData[1].asset.symbol).toEqual('stETH'); } else { @@ -169,6 +177,8 @@ describe('chain.provider', () => { if (balanceData.length > 0) { expect(balanceData[0]).toBeInstanceOf(Coin); expect(balanceData[0].amount).toBeTruthy(); + expect(balanceData[0].asset.price).toBeTruthy(); + expect(balanceData[0].asset.priceChange.dayPriceChange).toBeTruthy(); } } }); diff --git a/packages/evm/src/datasource/indexer/indexer.data-source.ts b/packages/evm/src/datasource/indexer/indexer.data-source.ts index 081e91d1..5cebac24 100644 --- a/packages/evm/src/datasource/indexer/indexer.data-source.ts +++ b/packages/evm/src/datasource/indexer/indexer.data-source.ts @@ -115,6 +115,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), new BigNumber(amount.value) .integerValue() diff --git a/packages/litecoin/src/chain.provider.spec.ts b/packages/litecoin/src/chain.provider.spec.ts index 313dc9df..8afc236c 100644 --- a/packages/litecoin/src/chain.provider.spec.ts +++ b/packages/litecoin/src/chain.provider.spec.ts @@ -63,6 +63,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 8, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -79,6 +82,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '443.21', decimals: 8, + priceChange: { + dayPriceChange: '-1', + }, }, amount: '1000', }, @@ -94,6 +100,8 @@ describe('chain.provider', () => { expect(balanceData.length).toEqual(1); expect(balanceData[0].amount).toEqual('1000'); expect(balanceData[0].asset.symbol).toEqual('LTC'); + expect(balanceData[0].asset.price).toEqual('443.21'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('-1'); } else { const balance = await provider.getBalance( 'ltc1qt33t2l2fa2t0plm2s3euxvewc079q89ytyjxt5' @@ -104,6 +112,8 @@ describe('chain.provider', () => { if (balanceData.length > 0) { expect(balanceData[0]).toBeInstanceOf(Coin); expect(balanceData[0].amount).toBeTruthy(); + expect(balanceData[0].asset.price).toBeTruthy(); + expect(balanceData[0].asset.priceChange.dayPriceChange).toBeTruthy(); } } }); diff --git a/packages/litecoin/src/datasource/indexer/indexer.data-source.ts b/packages/litecoin/src/datasource/indexer/indexer.data-source.ts index 08980920..5194ce3f 100644 --- a/packages/litecoin/src/datasource/indexer/indexer.data-source.ts +++ b/packages/litecoin/src/datasource/indexer/indexer.data-source.ts @@ -90,6 +90,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals || 0, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), utils.formatUnits(amount.value, asset.decimals || 0) ) diff --git a/packages/solana/src/chain.provider.spec.ts b/packages/solana/src/chain.provider.spec.ts index 9faf8b2c..2f0548a7 100644 --- a/packages/solana/src/chain.provider.spec.ts +++ b/packages/solana/src/chain.provider.spec.ts @@ -56,6 +56,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '123', decimals: 8, + priceChange: { + dayPriceChange: '3', + }, }, amount: '1000', }, @@ -84,6 +87,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '123', decimals: 8, + priceChange: { + dayPriceChange: '3', + }, }, amount: '1000', }, @@ -113,6 +119,8 @@ describe('chain.provider', () => { expect(balanceData[0].asset.symbol).toEqual('SOL'); expect(balanceData[1].amount).toEqual('1000'); expect(balanceData[1].asset.symbol).toEqual('BONK'); + expect(balanceData[0].asset.price).toEqual('123'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('3'); } else { const balance = await chainProvider.getBalance( 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5' @@ -123,6 +131,8 @@ describe('chain.provider', () => { if (balanceData.length > 0) { expect(balanceData[0]).toBeInstanceOf(Coin); expect(balanceData[0].amount).toBeTruthy(); + expect(balanceData[0].asset.price).toBeTruthy(); + expect(balanceData[0].asset.priceChange.dayPriceChange).toBeTruthy(); } } }); diff --git a/packages/solana/src/datasource/indexer/indexer.data-source.ts b/packages/solana/src/datasource/indexer/indexer.data-source.ts index a37e0878..26f7b5cd 100644 --- a/packages/solana/src/datasource/indexer/indexer.data-source.ts +++ b/packages/solana/src/datasource/indexer/indexer.data-source.ts @@ -53,6 +53,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), new BigNumber(amount.value) .integerValue() diff --git a/packages/thor/src/chain.provider.spec.ts b/packages/thor/src/chain.provider.spec.ts index 7faa5be6..9f2ce844 100644 --- a/packages/thor/src/chain.provider.spec.ts +++ b/packages/thor/src/chain.provider.spec.ts @@ -27,6 +27,7 @@ jest.mock('./datasource/indexer/queries/balances.query', () => ({ 'https://xdefi-prod-static.s3.eu-west-1.amazonaws.com/thorchain.png', price: { amount: '6.12', + dayPriceChange: '0.01', }, symbol: 'RUNE', }, @@ -163,6 +164,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '6.03', decimals: 8, + priceChange: { + dayPriceChange: '0.01', + }, }, amount: '1000', }, @@ -179,6 +183,9 @@ describe('chain.provider', () => { id: 'f164fe78-afb4-4eeb-b5c7-bca104857cda', price: '6.03', decimals: 8, + priceChange: { + dayPriceChange: '0.01', + }, }, amount: '1000', }, @@ -194,6 +201,8 @@ describe('chain.provider', () => { expect(balanceData.length).toEqual(1); expect(balanceData[0].amount).toEqual('1000'); expect(balanceData[0].asset.symbol).toEqual('RUNE'); + expect(balanceData[0].asset.price).toEqual('6.03'); + expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('0.01'); }); it('estimateFee() should return fee estimation', async () => { diff --git a/packages/thor/src/datasource/indexer/gql/mayachain.graphql b/packages/thor/src/datasource/indexer/gql/mayachain.graphql index 50890076..2fcc92a4 100644 --- a/packages/thor/src/datasource/indexer/gql/mayachain.graphql +++ b/packages/thor/src/datasource/indexer/gql/mayachain.graphql @@ -14,6 +14,7 @@ query GetMayachainBalances($address: String!) { image price { amount + dayPriceChange } symbol } diff --git a/packages/thor/src/datasource/indexer/gql/thorchain.graphql b/packages/thor/src/datasource/indexer/gql/thorchain.graphql index 3cd10a7d..f71bb974 100644 --- a/packages/thor/src/datasource/indexer/gql/thorchain.graphql +++ b/packages/thor/src/datasource/indexer/gql/thorchain.graphql @@ -14,6 +14,7 @@ query GetThorchainBalances($address: String!) { image price { amount + dayPriceChange } symbol } diff --git a/packages/thor/src/datasource/indexer/indexer.data-source.ts b/packages/thor/src/datasource/indexer/indexer.data-source.ts index 04a6bb3a..cfa71db3 100644 --- a/packages/thor/src/datasource/indexer/indexer.data-source.ts +++ b/packages/thor/src/datasource/indexer/indexer.data-source.ts @@ -64,6 +64,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.price?.scalingFactor, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), new BigNumber(amount.value) .integerValue() diff --git a/packages/thor/src/gql/gql.ts b/packages/thor/src/gql/gql.ts index 2fc5533e..80e85aa0 100644 --- a/packages/thor/src/gql/gql.ts +++ b/packages/thor/src/gql/gql.ts @@ -13,9 +13,9 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { - 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': + 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': types.GetMayachainBalancesDocument, - 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': + 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}': types.GetThorchainBalancesDocument, 'query GetCryptoAssets($input: [CryptoAssetArgs!]!) {\n assets {\n cryptoAssets(input: $input) {\n chain\n contract\n id\n name\n symbol\n image\n decimals\n price {\n amount\n scalingFactor\n }\n }\n }\n}': types.GetCryptoAssetsDocument, @@ -39,14 +39,14 @@ export function gql(source: string): unknown; * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( - source: 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' -): typeof documents['query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; + source: 'query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' +): typeof documents['query GetMayachainBalances($address: String!) {\n mayachain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetMayachainTransactions($address: String!, $first: Int!, $after: String) {\n mayachain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetMayachainStatus {\n mayachain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetMayachainFee {\n mayachain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( - source: 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' -): typeof documents['query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; + source: 'query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}' +): typeof documents['query GetThorchainBalances($address: String!) {\n thorchain {\n balances(address: $address) {\n address\n amount {\n value\n }\n asset {\n chain\n contract\n decimals\n id\n name\n image\n price {\n amount\n dayPriceChange\n }\n symbol\n }\n }\n }\n}\n\nquery GetThorchainTransactions($address: String!, $first: Int!, $after: String) {\n thorchain {\n transactions(address: $address, first: $first, after: $after) {\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n fee {\n amount {\n value\n }\n asset {\n chain\n contract\n id\n decimals\n image\n name\n symbol\n price {\n amount\n }\n type\n }\n }\n hash\n status\n timestamp\n transfers {\n amount {\n value\n }\n asset {\n ... on CryptoAsset {\n chain\n contract\n decimals\n id\n image\n name\n price {\n amount\n }\n symbol\n type\n }\n }\n fromAddress\n toAddress\n }\n }\n }\n }\n }\n}\n\nquery GetThorchainStatus {\n thorchain {\n status {\n lastBlock\n }\n }\n}\n\nquery GetThorchainFee {\n thorchain {\n fee {\n outboundTransactionFee\n nativeTransactionFee\n tnsRegisterFee\n tnsFeeOnSale\n tnsFeePerBlock\n }\n }\n}']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/thor/src/gql/graphql.ts b/packages/thor/src/gql/graphql.ts index f32e80ad..7d1f27a4 100644 --- a/packages/thor/src/gql/graphql.ts +++ b/packages/thor/src/gql/graphql.ts @@ -5344,7 +5344,11 @@ export type GetMayachainBalancesQuery = { name?: string | null; image?: string | null; symbol?: string | null; - price?: { __typename?: 'AssetAmountType'; amount: string } | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; }; }>; }; @@ -5467,7 +5471,11 @@ export type GetThorchainBalancesQuery = { name?: string | null; image?: string | null; symbol?: string | null; - price?: { __typename?: 'AssetAmountType'; amount: string } | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; }; }>; }; @@ -5700,6 +5708,13 @@ export const GetMayachainBalancesDocument = { kind: 'Field', name: { kind: 'Name', value: 'amount' }, }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, ], }, }, @@ -6328,6 +6343,13 @@ export const GetThorchainBalancesDocument = { kind: 'Field', name: { kind: 'Name', value: 'amount' }, }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, ], }, }, diff --git a/packages/tron/src/datasource/indexer/indexer.data-source.ts b/packages/tron/src/datasource/indexer/indexer.data-source.ts index ce3bc53a..9032a6eb 100644 --- a/packages/tron/src/datasource/indexer/indexer.data-source.ts +++ b/packages/tron/src/datasource/indexer/indexer.data-source.ts @@ -61,6 +61,9 @@ export class IndexerDataSource extends DataSource { address: asset.contract, price: asset.price?.amount, decimals: asset.decimals || 0, + priceChange: { + dayPriceChange: asset.price?.dayPriceChange, + }, }), formatUnits(amount.value, asset.decimals || 0) ) From 9dda4cd66032d266ed28ca566d72e32300dd41d5 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 13 Aug 2024 11:50:35 +0000 Subject: [PATCH 105/176] Version packages --- .changeset/smooth-experts-remain.md | 15 --------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 8 ++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 ++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 ++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 ++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- 23 files changed, 97 insertions(+), 26 deletions(-) delete mode 100644 .changeset/smooth-experts-remain.md diff --git a/.changeset/smooth-experts-remain.md b/.changeset/smooth-experts-remain.md deleted file mode 100644 index c75e5451..00000000 --- a/.changeset/smooth-experts-remain.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-evm': patch ---- - -add priceChange (dayPriceChange) to getData function (getBalance response) diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index ad6a809f..55e9d159 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.21 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.20 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index c8657ec0..b0430faa 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.20", + "version": "2.0.21", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 8cfa32db..f7fe2442 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.0.28 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.27 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index ac45d29f..ecc01030 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.27", + "version": "2.0.28", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index e6bfe925..ca6c59d6 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.27 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.26 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 6f6d2d16..9f239dfd 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.26", + "version": "2.0.27", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 7d46585a..4b0e3d39 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.27 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) + ## 2.0.26 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 58878909..850b927c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.26", + "version": "2.0.27", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 61f33e72..0a758f46 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.36 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.35 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index b1dd3d54..d934dc18 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.35", + "version": "2.0.36", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index d33fcfa3..cd4a232e 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.0.26 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.25 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index a12b889d..1f3a1ead 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.25", + "version": "2.0.26", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 3d7f7f09..bd4bac72 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.43 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.42 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index d6e96570..bdbf6211 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.42", + "version": "2.0.43", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index df112115..68c36e2a 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.0.24 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.23 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 93289c5a..5a39a986 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.23", + "version": "2.0.24", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 37544596..5cd6614d 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.0.28 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.27 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 6e740c09..1b488303 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.27", + "version": "2.0.28", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index c7c01d50..66407f79 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.0.30 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.29 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 1dca21b6..5081f2f1 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.29", + "version": "2.0.30", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index baa68b85..e0041202 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.30 + +### Patch Changes + +- ac6e391d: add priceChange (dayPriceChange) to getData function (getBalance response) +- Updated dependencies [ac6e391d] + - @xdefi-tech/chains-core@2.0.27 + ## 2.0.29 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 6d4f81b2..e49a5c14 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.29", + "version": "2.0.30", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 6fa7ed742ebd3dd3c2cec543b0777c7bc265dffb Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:10:06 +0700 Subject: [PATCH 106/176] chore: update fee estimation on tron (#312) * chore: update fee estimation on tron * chore: update fee estimation on tron --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/serious-bats-teach.md | 6 ++ packages/core/src/core/interfaces/index.ts | 2 +- packages/tron/src/chain.provider.spec.ts | 50 ++++++++++++----- packages/tron/src/chain.provider.ts | 55 +++++++++++++------ .../src/datasource/chain/chain.data-source.ts | 31 +++++++++++ .../datasource/indexer/indexer.data-source.ts | 31 +++++++++++ packages/tron/src/msg.ts | 2 +- 7 files changed, 142 insertions(+), 35 deletions(-) create mode 100644 .changeset/serious-bats-teach.md diff --git a/.changeset/serious-bats-teach.md b/.changeset/serious-bats-teach.md new file mode 100644 index 00000000..009e505b --- /dev/null +++ b/.changeset/serious-bats-teach.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-tron': patch +--- + +chore: update fee estimation on tron diff --git a/packages/core/src/core/interfaces/index.ts b/packages/core/src/core/interfaces/index.ts index e8e43a14..c2eddd5a 100644 --- a/packages/core/src/core/interfaces/index.ts +++ b/packages/core/src/core/interfaces/index.ts @@ -13,7 +13,7 @@ export interface FeeData { export interface TronFee { bandwidth: number; energy: number; - cost: number; + fee: number; willRevert: boolean; } diff --git a/packages/tron/src/chain.provider.spec.ts b/packages/tron/src/chain.provider.spec.ts index 93ed1055..5105c8da 100644 --- a/packages/tron/src/chain.provider.spec.ts +++ b/packages/tron/src/chain.provider.spec.ts @@ -25,6 +25,11 @@ jest.spyOn(TronWeb, 'createAccount').mockResolvedValue({ '0404B604296010A55D40000B798EE8454ECCC1F8900E70B1ADF47C9887625D8BAE3866351A6FA0B5370623268410D33D345F63344121455849C9C28F9389ED9731', }); +const mockedAccountResource = jest.spyOn( + ChainDataSource.prototype, + 'getAccountResource' +); + describe('chain.providers.chain', () => { let providers: TronProviders; const messageData = { @@ -81,18 +86,16 @@ describe('chain.providers.chain', () => { expect(fees.length).toEqual(1); expect(fees[0].bandwidth).toEqual(265); expect(fees[0].energy).toEqual(0); - expect(fees[0].cost).toEqual(0.265); + expect(fees[0].fee).toEqual(0); msg = new ChainMsg({ ...messageData, provider: providers.indexer }); fees = await providers.indexer.estimateFee([msg]); expect(fees.length).toEqual(1); expect(fees[0].bandwidth).toEqual(265); expect(fees[0].energy).toEqual(0); - expect(fees[0].cost).toEqual(0.265); + expect(fees[0].fee).toEqual(0); }); - jest.setTimeout(15000); - it('should estimate fees for an unsigned TRC20 transaction using any data source', async () => { let msg = new ChainMsg({ ...messageData, @@ -105,7 +108,7 @@ describe('chain.providers.chain', () => { let fees = await providers.chain.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); - expect(fees[0].cost).toEqual('27.255900345'); + expect(fees[0].fee).toEqual(27.2559); expect(fees[0].willRevert).toBeFalsy(); msg = new ChainMsg({ @@ -119,12 +122,10 @@ describe('chain.providers.chain', () => { fees = await providers.indexer.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); - expect(fees[0].cost).toEqual('27.255900345'); + expect(fees[0].fee).toEqual(27.2559); expect(fees[0].willRevert).toBeFalsy(); }); - jest.setTimeout(15000); - it('should estimate fees for a TRX transaction using a chain data source', async () => { const msg = new ChainMsg({ ...messageData, provider: providers.chain }); const signer = new PrivateKeySigner(pk, TRON_MANIFEST); @@ -149,8 +150,6 @@ describe('chain.providers.chain', () => { expect(fees[0].energy).toEqual(0); }); - jest.setTimeout(15000); - it('should estimate fees for a TRC20 transaction using a chain data source', async () => { const msg = new ChainMsg({ ...messageData, @@ -166,12 +165,10 @@ describe('chain.providers.chain', () => { const fees = await providers.chain.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); - expect(fees[0].cost).toEqual('27.255900345'); + expect(fees[0].fee).toEqual(27.2559); expect(fees[0].willRevert).toBeFalsy(); }); - jest.setTimeout(15000); - it('should estimate fees for a TRC20 transaction using an indexer data source', async () => { const msg = new ChainMsg({ ...messageData, @@ -187,11 +184,34 @@ describe('chain.providers.chain', () => { const fees = await providers.indexer.estimateFee([msg]); expect(fees[0].bandwidth).toEqual(345); expect(fees[0].energy).toEqual(64895); - expect(fees[0].cost).toEqual('27.255900345'); + expect(fees[0].fee).toEqual(27.2559); expect(fees[0].willRevert).toBeFalsy(); }); - jest.setTimeout(15000); + it('should subtract free bandwidth and energy when estimate fee', async () => { + mockedAccountResource.mockResolvedValue({ + freeBandwidth: 245, + freeEnergy: 54895, + }); + + const msg = new ChainMsg({ + ...messageData, + contractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', + tokenType: TokenType.TRC20, + decimals: 6, + provider: providers.indexer, + }); + const signer = new PrivateKeySigner(pk, TRON_MANIFEST); + + await signer.sign(msg); + + const fees = await providers.chain.estimateFee([msg]); + expect(fees[0].bandwidth).toEqual(345); + expect(fees[0].energy).toEqual(64895); + expect(fees[0].fee).toEqual(4.3); // (345 - 245) * 1000 + (64895 - 54895) * 420 = 4300000 SUN => 4.3 TRX + expect(fees[0].willRevert).toBeFalsy(); + mockedAccountResource.mockRestore(); + }); it('should get a token transaction from the blockchain using a chain data source', async () => { const txData = await providers.chain.getTransaction( diff --git a/packages/tron/src/chain.provider.ts b/packages/tron/src/chain.provider.ts index 7d35fc86..7b379808 100644 --- a/packages/tron/src/chain.provider.ts +++ b/packages/tron/src/chain.provider.ts @@ -57,13 +57,15 @@ export class TronProvider extends Chain.Provider { // Can change with a network update / fork, but not worth using an API call here. // 1000 SUN (not TRX) for bandwidth and 420 SUN for energy per unit. - const bandiwtdthPrice = 1000; + const bandwidthPrice = 1000; const energyPrice = 420; for (let i = 0; i < msgs.length; i++) { const msg = msgs[i]; const msgBody = msg.toData() as MsgBody; + const { freeBandwidth, freeEnergy } = + await this.dataSource.getAccountResource(msgBody.from); let tx: TronTransaction; @@ -72,32 +74,47 @@ export class TronProvider extends Chain.Provider { const account = await this.rpcProvider.createAccount(); msg.data.from = account.address.base58; const dummyTx = await msg.buildTx(); - tx = await this.rpcProvider.trx.sign(dummyTx, account.privateKey); + tx = await this.rpcProvider.trx.sign( + dummyTx as TronTransaction, + account.privateKey + ); msg.data.from = originalAddress; } else { - tx = msg.signedTransaction; + tx = msg.signedTransaction as TronTransaction; } - const transactionByteLength = - 9 + - 60 + - Buffer.from(tx.raw_data_hex, 'hex').byteLength + - Buffer.from(tx.signature ? tx.signature[0] : '', 'hex').byteLength; - + // Reference: https://developers.tron.network/docs/faq#5-how-to-calculate-the-bandwidth-and-energy-consumed-when-callingdeploying-a-contract + const DATA_HEX_PROTOBUF_LENGTH = 3; + const MAX_RESULT_SIZE_IN_TX = 64; + const A_SIGNATURE = 67; + const signatureListSize = tx.signature?.length ?? 1; + const bandwidthUsed = + tx.raw_data_hex.length / 2 + + DATA_HEX_PROTOBUF_LENGTH + + MAX_RESULT_SIZE_IN_TX + + signatureListSize * A_SIGNATURE; + + // Reference: https://developers.tron.network/docs/tron-protocol-transaction#bandwidth-fee const bandwidthConsumed = - (transactionByteLength * bandiwtdthPrice) / 1000; + Math.max(bandwidthUsed - freeBandwidth, 0) * bandwidthPrice; // in SUN - if (!msgBody.tokenType || msgBody.tokenType === TokenType.None) { + // Native token and TRC10 only use bandwidth + if ( + !msgBody.tokenType || + msgBody.tokenType === TokenType.None || + msgBody.tokenType === TokenType.TRC10 + ) { feeData.push({ - bandwidth: bandwidthConsumed, + bandwidth: bandwidthUsed, energy: 0, - cost: bandwidthConsumed / bandiwtdthPrice, + fee: Number(this.rpcProvider.fromSun(bandwidthConsumed)), willRevert: false, }); } else if ( msgBody.tokenType === TokenType.TRC20 && msgBody.contractAddress ) { + // Reference: https://developers.tron.network/docs/tron-protocol-transaction#energy-fee const { energy, willRevert } = await ( this.dataSource as ChainDataSource ).estimateEnergy( @@ -110,10 +127,12 @@ export class TronProvider extends Chain.Provider { ); feeData.push({ - bandwidth: bandwidthConsumed, + bandwidth: bandwidthUsed, energy: energy, - cost: this.rpcProvider.fromSun( - bandwidthConsumed / bandiwtdthPrice + energy * energyPrice + fee: Number( + this.rpcProvider.fromSun( + bandwidthConsumed + Math.max(energy - freeEnergy, 0) * energyPrice + ) ), willRevert, }); @@ -177,10 +196,10 @@ export class TronProvider extends Chain.Provider { hash: tx.txID, from: '', to: '', - status: tx.blockNumber + status: tx.raw_data.ref_block_num ? TransactionStatus.success : TransactionStatus.pending, - date: tx.blockTimeStamp, + date: tx.raw_data.timestamp, amount: '', }; diff --git a/packages/tron/src/datasource/chain/chain.data-source.ts b/packages/tron/src/datasource/chain/chain.data-source.ts index f7665215..322f3028 100644 --- a/packages/tron/src/datasource/chain/chain.data-source.ts +++ b/packages/tron/src/datasource/chain/chain.data-source.ts @@ -296,4 +296,35 @@ export class ChainDataSource extends DataSource { async getNonce(_address: string): Promise { throw new Error('Method not implemented.'); } + + async getAccountResource(address: string) { + try { + const response = await this.httpProvider.post( + `/wallet/getaccountresource`, + JSON.stringify({ address, visible: true }), + { + headers: { + accept: 'application/json', + 'Content-Type': 'application/json', + }, + } + ); + + const { + freeNetLimit, + freeNetUsed = 0, + NetUsed = 0, + NetLimit = 0, + EnergyUsed = 0, + EnergyLimit = 0, + } = response.data; + + return { + freeBandwidth: NetLimit + freeNetLimit - NetUsed - freeNetUsed, + freeEnergy: EnergyLimit - EnergyUsed, + }; + } catch (error) { + throw new Error('Error getting account resource!'); + } + } } diff --git a/packages/tron/src/datasource/indexer/indexer.data-source.ts b/packages/tron/src/datasource/indexer/indexer.data-source.ts index 9032a6eb..8fb92d69 100644 --- a/packages/tron/src/datasource/indexer/indexer.data-source.ts +++ b/packages/tron/src/datasource/indexer/indexer.data-source.ts @@ -201,4 +201,35 @@ export class IndexerDataSource extends DataSource { async getNonce(_address: string): Promise { throw new Error('Method not implemented.'); } + + async getAccountResource(address: string) { + try { + const response = await this.httpProvider.post( + `/wallet/getaccountresource`, + JSON.stringify({ address, visible: true }), + { + headers: { + accept: 'application/json', + 'Content-Type': 'application/json', + }, + } + ); + + const { + freeNetLimit, + freeNetUsed = 0, + NetUsed = 0, + NetLimit = 0, + EnergyUsed = 0, + EnergyLimit = 0, + } = response.data; + + return { + freeBandwidth: NetLimit + freeNetLimit - NetUsed - freeNetUsed, + freeEnergy: EnergyLimit - EnergyUsed, + }; + } catch (error) { + throw new Error('Error getting account resource!'); + } + } } diff --git a/packages/tron/src/msg.ts b/packages/tron/src/msg.ts index 4f1be29d..021c6d96 100644 --- a/packages/tron/src/msg.ts +++ b/packages/tron/src/msg.ts @@ -15,7 +15,7 @@ export enum TokenType { export interface TronFee { bandwidth: number; energy: number; - cost: number; + fee: number; willRevert: boolean; } From 5a40ee682d8ee098ef6de65fd6b4bcb650e0bc09 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 14 Aug 2024 08:13:23 +0000 Subject: [PATCH 107/176] Version packages --- .changeset/serious-bats-teach.md | 6 ------ packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 .changeset/serious-bats-teach.md diff --git a/.changeset/serious-bats-teach.md b/.changeset/serious-bats-teach.md deleted file mode 100644 index 009e505b..00000000 --- a/.changeset/serious-bats-teach.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-tron': patch ---- - -chore: update fee estimation on tron diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 4b0e3d39..78877c3f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.28 + +### Patch Changes + +- d53373c4: chore: update fee estimation on tron + ## 2.0.27 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 850b927c..c255335b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.27", + "version": "2.0.28", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index e0041202..ea78c319 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.31 + +### Patch Changes + +- d53373c4: chore: update fee estimation on tron +- Updated dependencies [d53373c4] + - @xdefi-tech/chains-core@2.0.28 + ## 2.0.30 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index e49a5c14..25045c64 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.30", + "version": "2.0.31", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 743cd06ef110ee8de976147074beea23e8299064 Mon Sep 17 00:00:00 2001 From: Amin Limbada Date: Wed, 14 Aug 2024 12:26:18 +0200 Subject: [PATCH 108/176] chore: update ledger sign method to take prefix from manifest (#315) * chore: update ledger sign method to take prefix from manifest * fix: changeset file --------- Co-authored-by: danilxdefi --- .changeset/neat-dragons-know.md | 5 +++++ packages/cosmos/src/signers/ledger.signer.spec.ts | 2 +- packages/cosmos/src/signers/ledger.signer.ts | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/neat-dragons-know.md diff --git a/.changeset/neat-dragons-know.md b/.changeset/neat-dragons-know.md new file mode 100644 index 00000000..424df994 --- /dev/null +++ b/.changeset/neat-dragons-know.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +chore: update ledger sign method to take prefix from manifest diff --git a/packages/cosmos/src/signers/ledger.signer.spec.ts b/packages/cosmos/src/signers/ledger.signer.spec.ts index 38f4422a..04e3f020 100644 --- a/packages/cosmos/src/signers/ledger.signer.spec.ts +++ b/packages/cosmos/src/signers/ledger.signer.spec.ts @@ -101,7 +101,7 @@ describe('cosmos::ledger.signer', () => { }); it('should sign a transaction using a ledger device', async () => { - await signer.sign(message, derivationPath, 'cosmos'); + await signer.sign(message, derivationPath); expect(message.signedTransaction).toBeTruthy(); }); diff --git a/packages/cosmos/src/signers/ledger.signer.ts b/packages/cosmos/src/signers/ledger.signer.ts index 4e2e8467..e0078055 100644 --- a/packages/cosmos/src/signers/ledger.signer.ts +++ b/packages/cosmos/src/signers/ledger.signer.ts @@ -37,7 +37,7 @@ export class LedgerSigner extends Signer.Provider { return address; } - async sign(msg: ChainMsg, derivation: string, prefix: string): Promise { + async sign(msg: ChainMsg, derivation: string): Promise { if (!derivation.startsWith('m/')) { derivation = 'm/' + derivation; } @@ -46,7 +46,7 @@ export class LedgerSigner extends Signer.Provider { const app = new LedgerApp(this.transport as Transport, { testModeAllowed: true, hdPaths: [hdPath], - prefix, + prefix: msg.provider.manifest.prefix, }); const client = await SigningStargateClient.connectWithSigner( From 0f7e4cfe38b2ee98622a35962d48577f4d83304c Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 14 Aug 2024 10:28:42 +0000 Subject: [PATCH 109/176] Version packages --- .changeset/neat-dragons-know.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/neat-dragons-know.md diff --git a/.changeset/neat-dragons-know.md b/.changeset/neat-dragons-know.md deleted file mode 100644 index 424df994..00000000 --- a/.changeset/neat-dragons-know.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -chore: update ledger sign method to take prefix from manifest diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 0a758f46..785dedb6 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.37 + +### Patch Changes + +- 688bc6f7: chore: update ledger sign method to take prefix from manifest + ## 2.0.36 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index d934dc18..a4b269a2 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.36", + "version": "2.0.37", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 5d14c4bfdbe2cb93d02e55e01b0b757bed32d775 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 14 Aug 2024 20:55:44 +0700 Subject: [PATCH 110/176] chore: Move extra IBC logic into the chains-lib (#307) Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/giant-parrots-explain.md | 5 + packages/cosmos/src/chain.provider.ts | 34 +++++++ .../src/signers/seed-phrase.signer.spec.ts | 96 +++++++++++++------ packages/cosmos/src/utils.ts | 82 +++++++++------- 4 files changed, 157 insertions(+), 60 deletions(-) create mode 100644 .changeset/giant-parrots-explain.md diff --git a/.changeset/giant-parrots-explain.md b/.changeset/giant-parrots-explain.md new file mode 100644 index 00000000..fb95971d --- /dev/null +++ b/.changeset/giant-parrots-explain.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +chore: refactor ibc tranfer methods diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index 78fabe95..f94b6819 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -50,6 +50,14 @@ export interface IBCData { originDenom: string; } +export interface IBCPayload { + amountIn: string; + sourceAssetDenom: string; + sourceAssetChain: manifests.CosmosHubChains; + destAssetChain: manifests.CosmosHubChains; + addresses: Record; +} + @ChainDecorator('CosmosProvider', { deps: [], providerType: 'Cosmos', @@ -218,6 +226,32 @@ export class CosmosProvider extends Chain.Provider { return this.dataSource.getAccount(address); } + async createIBCTransferMsg(payload: IBCPayload) { + const { sourceAssetDenom, sourceAssetChain, destAssetChain, addresses } = + payload; + const amountIn = (Number(payload.amountIn) * 1e6).toString(); + const { + getIBCTransferRouter, + createIBCTransferMsg: _createIBCTransferMsg, + getIBCDestAsset, + } = CosmosProvider.utils; + const { destAssetDenom } = await getIBCDestAsset( + sourceAssetChain, + destAssetChain, + sourceAssetDenom + ); + + if (!destAssetDenom) throw new Error('destAssetDenom missing'); + const route = await getIBCTransferRouter( + amountIn, + sourceAssetDenom, + sourceAssetChain, + destAssetDenom, + destAssetChain + ); + return await _createIBCTransferMsg(route, addresses); + } + /** * * @param denom the denom of IBC token diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index e8aafe40..ff507764 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -541,50 +541,92 @@ describe('IBC token transfer', () => { let destChain: CosmosHubChains; let destAssetDenom: string; let derivations: string; - let prefix: { [key: string]: string }; - const { getIBCTransferRouter, createIBCTransferMsg } = CosmosProvider.utils; + let provider: CosmosProvider; + let addresses: Record; beforeEach(async () => { jest.setTimeout(60 * 1000); + provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); mnemonic = 'question unusual episode tree fresh lawn enforce vocal attitude quarter solution shove early arch topic'; signer = new SeedPhraseSigner(mnemonic); derivations = "m/44'/118'/0'/0/0"; + const addressEntries: [CosmosHubChains, string][] = await Promise.all( + Object.values(CosmosHubChains).map(async (chain) => { + return [ + chain, + await signer.getAddress( + derivations, + COSMOS_MANIFESTS[chain as CosmosHubChains].prefix + ), + ]; + }) + ); + addresses = Object.fromEntries(addressEntries) as Record< + CosmosHubChains, + string + >; + }); + it('Create success tx to transfer uatom from osmosis to akash', async () => { sourceChain = CosmosHubChains.osmosis; destChain = CosmosHubChains.akash; sourceAssetDenom = 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2'; // uatom on osmosis - destAssetDenom = - 'ibc/2E5D0AC026AC1AFA65A23023BA4F24BB8DDF94F118EDC0BAD6F625BFC557CDED'; // uatom on akash - prefix = { - [COSMOS_MANIFESTS[sourceChain].chainId]: - COSMOS_MANIFESTS[sourceChain].prefix, - [COSMOS_MANIFESTS[destChain].chainId]: COSMOS_MANIFESTS[destChain].prefix, - }; + const msgBodies = await provider.createIBCTransferMsg({ + amountIn: '0.1', + sourceAssetDenom, + sourceAssetChain: sourceChain, + destAssetChain: destChain, + addresses, + }); + expect(msgBodies[0].msgs).toBeDefined(); + const ibcTrasferMsg = msgBodies[0].msgs![0]; + expect(ibcTrasferMsg.typeUrl).toBe( + '/ibc.applications.transfer.v1.MsgTransfer' + ); + expect(ibcTrasferMsg.value.sender).toBe(addresses['osmosis']); + expect(ibcTrasferMsg.value.token.denom).toBe(sourceAssetDenom); + expect(ibcTrasferMsg.value.token.amount).toBe('100000'); // 0.1 * 1e6 + expect(ibcTrasferMsg.value.receiver).toBe(addresses['cosmos']); + expect(ibcTrasferMsg.value.memo).toContain(addresses['akash']); + + const chainMsg = await provider.createMsg(msgBodies[0]); + await signer.sign(chainMsg, derivations); + expect(chainMsg.signedTransaction).toBeTruthy(); }); - it('Create success tx to transfer uatom from osmosis to akash', async () => { - const route = await getIBCTransferRouter( - // Get route to transfer from osmosis to akash - '1', + it('Create success tx to transfer with path unwinding', async () => { + sourceChain = CosmosHubChains.osmosis; + destChain = CosmosHubChains.cosmos; + sourceAssetDenom = + 'ibc/1DBD74F7D8022AFE3D79A2502C0FCFFF6EDC74F7342117A676B623830B859994'; // uatom/transfer/channel-208/transfer/channel-2 + const msgBodies = await provider.createIBCTransferMsg({ + amountIn: '0.1', sourceAssetDenom, - sourceChain, - destAssetDenom, - destChain - ); - const userAddresses = await Promise.all( - (route.chain_ids as string[]).map((chainId) => - signer.getAddress(derivations, prefix[chainId]) - ) + sourceAssetChain: sourceChain, + destAssetChain: destChain, + addresses, + }); + expect(msgBodies[0].msgs).toBeDefined(); + const firstIbcTrasferMsg = msgBodies[0].msgs![0]; + expect(firstIbcTrasferMsg.typeUrl).toBe( + '/ibc.applications.transfer.v1.MsgTransfer' ); - const msgBody = await createIBCTransferMsg(route, userAddresses); - const provider = new CosmosProvider( - new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + expect(firstIbcTrasferMsg.value.sender).toBe(addresses['osmosis']); + expect(firstIbcTrasferMsg.value.token.denom).toBe(sourceAssetDenom); + expect(firstIbcTrasferMsg.value.token.amount).toBe('100000'); // 0.1 * 1e6 + expect(firstIbcTrasferMsg.value.receiver).toBe(addresses['axelar']); + + const secondIbcTrasferMsg = msgBodies[1].msgs![0]; + expect(secondIbcTrasferMsg.typeUrl).toBe( + '/ibc.applications.transfer.v1.MsgTransfer' ); - const message = provider.createMsg(msgBody); - await signer.sign(message, derivations); - expect(message.signedTransaction).toBeTruthy(); + expect(secondIbcTrasferMsg.value.sender).toBe(addresses['axelar']); + expect(secondIbcTrasferMsg.value.token.amount).toBe('100000'); // 0.1 * 1e6 + expect(secondIbcTrasferMsg.value.receiver).toBe(addresses['cosmos']); }); }); diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index 71af01d4..c74a9608 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -145,8 +145,8 @@ export const getIBCTransferRouter = async ( export const createIBCTransferMsg = async ( route: RouteData, - userAddresses: string[] -): Promise => { + userAddresses: Record +): Promise => { const { source_asset_denom, source_asset_chain_id, @@ -156,6 +156,19 @@ export const createIBCTransferMsg = async ( amount_out, operations, } = route; + const addressList = route.chain_ids.reduce( + (arr: string[], chainId: string): string[] => { + for (const chain in COSMOS_MANIFESTS) { + if (COSMOS_MANIFESTS[chain as CosmosHubChains]!.chainId === chainId) { + const address = userAddresses[chain as CosmosHubChains]; + if (address) arr.push(address); + return arr; + } + } + throw new Error(`No manifest found for ${chainId}`); + }, + [] + ); const bodyTx = { source_asset_denom, source_asset_chain_id, @@ -164,41 +177,44 @@ export const createIBCTransferMsg = async ( amount_in, amount_out, operations, - address_list: userAddresses, + address_list: addressList, }; const { data } = await skipAxiosClient.post('v2/fungible/msgs', bodyTx); - const { msg, msg_type_url } = data.msgs[0].multi_chain_msg; - const msgConvert = JSON.parse(msg); - const message: MsgBody = { - from: userAddresses[0], - to: '', - amount: '0', - typeUrl: msg_type_url, - msgs: [ - { - typeUrl: msg_type_url, - value: { - sourcePort: msgConvert.source_port, - sourceChannel: msgConvert.source_channel, - sender: msgConvert.sender, - token: { - denom: msgConvert.token.denom, - amount: msgConvert.token.amount, + return data.msgs.map(({ multi_chain_msg: { msg, msg_type_url } }: any) => { + const msgConvert = JSON.parse(msg); + const message: MsgBody = { + from: msgConvert.sender, + to: msgConvert.receiver, + amount: '0', + typeUrl: msg_type_url, + msgs: [ + { + typeUrl: msg_type_url, + value: { + sourcePort: msgConvert.source_port, + sourceChannel: msgConvert.source_channel, + sender: msgConvert.sender, + token: { + denom: msgConvert.token.denom, + amount: msgConvert.token.amount, + }, + receiver: msgConvert.receiver, + timeoutHeight: msgConvert.timeout_height + ? { + revisionNumber: + msgConvert.timeout_height.revision_number ?? 0, + revisionHeight: + msgConvert.timeout_height.revision_height ?? 0, + } + : undefined, + timeoutTimestamp: msgConvert.timeout_timestamp, + memo: msgConvert.memo, }, - receiver: msgConvert.receiver, - timeoutHeight: msgConvert.timeout_height - ? { - revisionNumber: msgConvert.timeout_height.revision_number ?? 0, - revisionHeight: msgConvert.timeout_height.revision_height ?? 0, - } - : undefined, - timeoutTimestamp: msgConvert.timeout_timestamp, - memo: msgConvert.memo, }, - }, - ], - }; - return message; + ], + }; + return message; + }); }; export const getIBCDestAsset = async ( From 7c40db259c54df1fc611f9a854a69465aaa37531 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 14 Aug 2024 13:58:15 +0000 Subject: [PATCH 111/176] Version packages --- .changeset/giant-parrots-explain.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/giant-parrots-explain.md diff --git a/.changeset/giant-parrots-explain.md b/.changeset/giant-parrots-explain.md deleted file mode 100644 index fb95971d..00000000 --- a/.changeset/giant-parrots-explain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -chore: refactor ibc tranfer methods diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 785dedb6..0f47dfa0 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.38 + +### Patch Changes + +- 196ec779: chore: refactor ibc tranfer methods + ## 2.0.37 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index a4b269a2..bbdd689c 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.37", + "version": "2.0.38", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 1a9ba1bf66700f8ebfa743889f1349d3fb6ba756 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:48:46 +0300 Subject: [PATCH 112/176] feat: add fallback for calculating fees; (#304) * feat: add fallback for calculating fees; fix: XDEFI-9565 * feat: improve getting fees from RPS, add gas limit estimation * fix: _estimateGasLimit params for chain datasource --- .changeset/wise-pugs-enjoy.md | 5 + packages/evm/src/chain.provider.ts | 42 +++- .../src/datasource/chain/chain.data-source.ts | 4 +- .../datasource/indexer/indexer.data-source.ts | 6 +- .../datasource/indexer/queries/fees.query.ts | 1 + packages/evm/src/manifests.ts | 6 +- packages/evm/src/types.ts | 2 +- packages/evm/src/utils/get-fees.ts | 198 ++++++++++++++++++ packages/evm/src/utils/index.ts | 1 + 9 files changed, 254 insertions(+), 11 deletions(-) create mode 100644 .changeset/wise-pugs-enjoy.md create mode 100644 packages/evm/src/utils/get-fees.ts diff --git a/.changeset/wise-pugs-enjoy.md b/.changeset/wise-pugs-enjoy.md new file mode 100644 index 00000000..5b4f7162 --- /dev/null +++ b/.changeset/wise-pugs-enjoy.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +Feat: add fallback for calculating fees diff --git a/packages/evm/src/chain.provider.ts b/packages/evm/src/chain.provider.ts index 5d8011ab..12a9c23a 100644 --- a/packages/evm/src/chain.provider.ts +++ b/packages/evm/src/chain.provider.ts @@ -21,7 +21,12 @@ import { some } from 'lodash'; import { ChainDataSource, IndexerDataSource } from './datasource'; import { ChainMsg } from './msg'; -import { decryptParams, paramToString } from './utils'; +import { + decryptParams, + paramToString, + getFeesFromRPC, + getGasLimitFromRPC, +} from './utils'; @ChainDecorator('EvmProvider', { deps: [], @@ -77,8 +82,37 @@ export class EvmProvider extends Chain.Provider { ); } - async estimateFee(msgs: Msg[], speed: GasFeeSpeed): Promise { - return this.dataSource.estimateFee(msgs, speed); + async _getFeesFromRpc( + msgs: Msg[], + speed: GasFeeSpeed, + isEIP1559: undefined | boolean = undefined + ) { + const promises = msgs.map((msg) => + getFeesFromRPC( + msg as ChainMsg, + speed, + this.manifest.feeGasStep, + isEIP1559 + ) + ); + return Promise.all(promises); + } + + async estimateFee( + msgs: Msg[], + speed: GasFeeSpeed, + options?: { forceUseRpc: boolean; isEIP1559?: boolean } // useful for custom chains + ): Promise { + if (options?.forceUseRpc) { + return this._getFeesFromRpc(msgs, speed, options?.isEIP1559); + } + + try { + return await this.dataSource.estimateFee(msgs, speed); + } catch (err) { + console.warn('Failed to estimate fee. Fallback to RFC method', err); + return this._getFeesFromRpc(msgs, speed); + } } async getNFTBalance(address: string) { @@ -142,6 +176,8 @@ export class EvmProvider extends Chain.Provider { return { paramToString, decryptParams, + getFeesFromRPC, + getGasLimitFromRPC, }; } diff --git a/packages/evm/src/datasource/chain/chain.data-source.ts b/packages/evm/src/datasource/chain/chain.data-source.ts index d09b0750..724c26fb 100644 --- a/packages/evm/src/datasource/chain/chain.data-source.ts +++ b/packages/evm/src/datasource/chain/chain.data-source.ts @@ -184,7 +184,7 @@ export class ChainDataSource extends DataSource { throw new Error('Method not implemented.'); } - private async _estimateGasLimit( + async _estimateGasLimit( txParams: RestEstimateGasRequest ): Promise { try { @@ -269,11 +269,9 @@ export class ChainDataSource extends DataSource { gasLimit = DEFAULT_CONTRACT_FEE; } } else { - const { contractData } = await msg.getDataFromContract(); const calculatedGasLimit = await this._estimateGasLimit({ from: msgData.from, to: msgData.to, - value: contractData.value as string, ...(msgData.data && { data: msgData.data }), }); if (calculatedGasLimit) { diff --git a/packages/evm/src/datasource/indexer/indexer.data-source.ts b/packages/evm/src/datasource/indexer/indexer.data-source.ts index 5cebac24..cab26880 100644 --- a/packages/evm/src/datasource/indexer/indexer.data-source.ts +++ b/packages/evm/src/datasource/indexer/indexer.data-source.ts @@ -177,7 +177,7 @@ export class IndexerDataSource extends DataSource { ); } - private async _estimateGasLimit( + async _estimateGasLimit( txParams: RestEstimateGasRequest ): Promise { try { @@ -250,6 +250,7 @@ export class IndexerDataSource extends DataSource { ); } } else if (msgData.contractAddress) { + // ERC transaction const { contract, contractData } = await msg.getDataFromContract(); if (!contract) { throw new Error( @@ -268,11 +269,10 @@ export class IndexerDataSource extends DataSource { gasLimit = DEFAULT_CONTRACT_FEE; } } else { - const { contractData } = await msg.getDataFromContract(); + // common transaction const calculatedGasLimit = await this._estimateGasLimit({ from: msgData.from, to: msgData.to, - value: contractData.value as string, ...(msgData.data && { data: msgData.data }), }); if (calculatedGasLimit) { diff --git a/packages/evm/src/datasource/indexer/queries/fees.query.ts b/packages/evm/src/datasource/indexer/queries/fees.query.ts index 81ed7432..0ee1f088 100644 --- a/packages/evm/src/datasource/indexer/queries/fees.query.ts +++ b/packages/evm/src/datasource/indexer/queries/fees.query.ts @@ -16,6 +16,7 @@ import { import { EVMChains } from '../../../manifests'; export const getFees = async (chain: string) => { + // if you update this function, make sure to update packages/evm/src/utils/get-fees.ts let indexerChain = chain; let query: any; diff --git a/packages/evm/src/manifests.ts b/packages/evm/src/manifests.ts index 734ebb52..c43cb6bd 100644 --- a/packages/evm/src/manifests.ts +++ b/packages/evm/src/manifests.ts @@ -15,8 +15,12 @@ export enum EVMChains { gnosis = 'gnosis', } +export interface EVMChainManifest extends Chain.Manifest { + maxGapAmount?: number; +} + export const EVM_MANIFESTS: { - [key in EVMChains]: Chain.Manifest & { maxGapAmount?: number }; + [key in EVMChains]: EVMChainManifest; } = { [EVMChains.ethereum]: { name: 'Ethereum', diff --git a/packages/evm/src/types.ts b/packages/evm/src/types.ts index 2bdfcd48..79f9a73e 100644 --- a/packages/evm/src/types.ts +++ b/packages/evm/src/types.ts @@ -1,6 +1,6 @@ export interface RestEstimateGasRequest { from: string; to: string; - value: string; // hex string + value?: string; // hex string data?: string; } diff --git a/packages/evm/src/utils/get-fees.ts b/packages/evm/src/utils/get-fees.ts new file mode 100644 index 00000000..cc2fb004 --- /dev/null +++ b/packages/evm/src/utils/get-fees.ts @@ -0,0 +1,198 @@ +import axios, { Axios } from 'axios'; +import { FeeData, GasFeeSpeed } from '@xdefi-tech/chains-core'; +import BigNumber from 'bignumber.js'; + +import { EVMChains } from '../manifests'; +import { DEFAULT_CONTRACT_FEE } from '../constants'; +import { ChainMsg } from '../msg'; +import { RestEstimateGasRequest } from '../types'; + +export const isEIP1559Supported = (chain: string): boolean => { + // it is hardcoded value from our indexers details at packages/evm/src/datasource/indexer/queries/fees.query.ts + return ( + chain !== EVMChains.aurora && + chain !== EVMChains.smartchain && + chain !== EVMChains.arbitrum + ); +}; + +export interface FeeMultipliers { + low: number; + medium: number; + high: number; +} + +const gwei = 10 ** 9; + +export const getGasLimitFromRPC = async ( + msg: ChainMsg, + rest?: Axios +): Promise => { + if (!rest) { + rest = axios.create({ baseURL: msg.provider.manifest.rpcURL }); + } + try { + const msgData = msg.toData(); + let requestParams: RestEstimateGasRequest; + if (msgData.contractAddress) { + const { contractData } = await msg.getDataFromContract(); + requestParams = { + from: msgData.from, + to: contractData.to as string, + value: contractData.value as string, + data: contractData.data as string, + }; + } else { + requestParams = { + from: msgData.from, + to: msgData.to, + ...(msgData.data && { data: msgData.data }), + }; + } + + const { data: response } = await rest.post('/', { + method: 'eth_estimateGas', + params: [requestParams], + id: 'get_gas_limit', + jsonrpc: '2.0', + }); + if (!response.result) { + console.warn( + 'Empty response getGasLimitFromRPC from PRC, using default', + requestParams, + response + ); + return DEFAULT_CONTRACT_FEE; + } + return parseInt(response.result); + } catch (err) { + console.warn( + 'Failed to fetch gas limit, using default', + DEFAULT_CONTRACT_FEE + ); + console.error(err); + return DEFAULT_CONTRACT_FEE; + } +}; + +/** + * Fetches fees from the RPC endpoint. Returns the fees in gwei. + * + * @param msg {ChainMsg} - message to be sent + * @param speed {GasFeeSpeed} - speed of the fee (low, medium, high) + * @param multipliers {FeeMultipliers} - multipliers for low, medium, high fees + * @param isEIP1559 {boolean} - whether the chain supports EIP1559, if not, fetches legacy fees + */ +export const getFeesFromRPC = async ( + msg: ChainMsg, + speed: GasFeeSpeed, + multipliers: FeeMultipliers = { low: 1, medium: 1.25, high: 1.5 }, + isEIP1559: boolean = isEIP1559Supported(msg.provider.manifest.chain) +): Promise => { + try { + /* Calculating prices */ + const rest = axios.create({ baseURL: msg.provider.manifest.rpcURL }); + + if (!isEIP1559) { + const { data } = await rest.post('/', { + jsonrpc: '2.0', + method: 'eth_gasPrice', + params: [], + id: `default-fees-${msg.provider.manifest.chain}`, + }); + + if (!data?.result) { + throw new Error('Failed to fetch default fees'); + } + + const defaultFees = { + low: (data.result * multipliers.low) / gwei, + medium: (data.result * multipliers.medium) / gwei, + high: (data.result * multipliers.high) / gwei, + }; + + return { + gasPrice: defaultFees[speed], + gasLimit: await getGasLimitFromRPC(msg, rest), + }; + } + + const baseFeePromise = rest.post('/', { + jsonrpc: '2.0', + method: 'eth_gasPrice', + params: [], + id: `base-fees-${msg.provider.manifest.chain}`, + }); + const priorityFeePromise = rest.post('/', { + jsonrpc: '2.0', + method: 'eth_maxPriorityFeePerGas', + params: [], + id: `priority-fee-per-gas-${msg.provider.manifest.chain}`, + }); + + const [baseFeeData, priorityFeeData] = await Promise.all([ + baseFeePromise, + priorityFeePromise, + ]); + + if (!baseFeeData?.data?.result || !priorityFeeData?.data?.result) { + throw new Error('Failed to fetch eip1559 fees'); + } + + const baseFee = baseFeeData.data.result; + const priorityFee = priorityFeeData.data.result; + const maxPriorityFeePerGas = new BigNumber(priorityFee) + .integerValue(BigNumber.ROUND_CEIL) + .dividedBy(gwei); + + const baseFees = { + low: new BigNumber(baseFee) + .multipliedBy(multipliers.low) + .integerValue(BigNumber.ROUND_CEIL) + .dividedBy(gwei), + medium: new BigNumber(baseFee) + .multipliedBy(multipliers.medium) + .integerValue(BigNumber.ROUND_CEIL) + .dividedBy(gwei), + high: new BigNumber(baseFee) + .multipliedBy(multipliers.high) + .integerValue(BigNumber.ROUND_CEIL) + .dividedBy(gwei), + }; + + const eip1559Fees = { + low: { + baseFeePerGas: baseFees.low.toNumber(), + maxPriorityFeePerGas: maxPriorityFeePerGas.toNumber(), + maxFeePerGas: new BigNumber(baseFees.low) + .plus(maxPriorityFeePerGas) + .toNumber(), + }, + medium: { + baseFeePerGas: baseFees.medium.toNumber(), + maxPriorityFeePerGas: maxPriorityFeePerGas.toNumber(), + maxFeePerGas: new BigNumber(baseFees.medium) + .plus(maxPriorityFeePerGas) + .toNumber(), + }, + high: { + baseFeePerGas: baseFees.high.toNumber(), + maxPriorityFeePerGas: maxPriorityFeePerGas.toNumber(), + maxFeePerGas: new BigNumber(baseFees.high) + .plus(maxPriorityFeePerGas) + .toNumber(), + }, + }; + + return { + gasPrice: undefined, + gasLimit: await getGasLimitFromRPC(msg, rest), + maxFeePerGas: eip1559Fees[speed].maxFeePerGas, + baseFeePerGas: eip1559Fees[speed].baseFeePerGas, + maxPriorityFeePerGas: eip1559Fees[speed].maxPriorityFeePerGas, + }; + } catch (err) { + console.error(err); + throw err; + } +}; diff --git a/packages/evm/src/utils/index.ts b/packages/evm/src/utils/index.ts index 3464c6a8..10c83fd0 100644 --- a/packages/evm/src/utils/index.ts +++ b/packages/evm/src/utils/index.ts @@ -1,2 +1,3 @@ export * from './parser'; export * from './decrypt-params'; +export * from './get-fees'; From 792b683fa835e9bf8cf32fc22e96091c0edb8b10 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 15 Aug 2024 14:51:10 +0000 Subject: [PATCH 113/176] Version packages --- .changeset/wise-pugs-enjoy.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/wise-pugs-enjoy.md diff --git a/.changeset/wise-pugs-enjoy.md b/.changeset/wise-pugs-enjoy.md deleted file mode 100644 index 5b4f7162..00000000 --- a/.changeset/wise-pugs-enjoy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -Feat: add fallback for calculating fees diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index bd4bac72..dd725d0b 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.44 + +### Patch Changes + +- e53967a2: Feat: add fallback for calculating fees + ## 2.0.43 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index bdbf6211..ed03a5f9 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.43", + "version": "2.0.44", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 0b029c00760f5efeeb8b1ba50336c2f2cf9c22f5 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Mon, 19 Aug 2024 21:19:04 +0700 Subject: [PATCH 114/176] chore: add example for request adr-36 signature & sign direct aux (#320) Co-authored-by: sotatek-tyler-nguyen4 --- .../core/src/core/chain/chain.provider.ts | 2 +- packages/cosmos/src/msg.ts | 2 +- .../src/signers/private-key.signer.spec.ts | 104 ++++++++------- .../src/signers/seed-phrase.signer.spec.ts | 124 +++++++++++++++--- 4 files changed, 170 insertions(+), 62 deletions(-) diff --git a/packages/core/src/core/chain/chain.provider.ts b/packages/core/src/core/chain/chain.provider.ts index 65307d4f..6ce26ea5 100644 --- a/packages/core/src/core/chain/chain.provider.ts +++ b/packages/core/src/core/chain/chain.provider.ts @@ -11,7 +11,7 @@ import { Balance, DataSource, MsgEncoding, Response, FeeData, TronFee } from 'co import { forEach } from 'lodash'; export interface IOptions { - signers?: typeof SignerProvider[]; + signers?: (typeof SignerProvider)[]; providerId?: string; } diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 85f2a811..2a62caec 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -107,7 +107,7 @@ export interface DirectSignDoc { */ chainId?: string; /** account_number is the account number of the account in state */ - accountNumber?: string; + accountNumber?: string | bigint; } export interface SignMsgSendResponse { diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index 77997a81..1de8576e 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -2,6 +2,8 @@ import { MsgEncoding } from '@xdefi-tech/chains-core'; import { Hash, PrivKeySecp256k1 } from '@keplr-wallet/crypto'; import { bech32 } from 'bech32'; import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; +import { SignDocDirectAux } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { makeMultisignedTxBytes } from '@cosmjs/stargate'; import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; @@ -9,6 +11,7 @@ import { COSMOS_MANIFESTS } from '../manifests'; import { ChainMsg, CosmosChainType, CosmosSignMode, MsgBody } from '../msg'; import { PrivateKeySigner } from './private-key.signer'; +import { Secp256k1, Secp256k1Signature, sha256 } from '@cosmjs/crypto'; type CosmosHdPathTypes = { cosmos: string; @@ -334,7 +337,7 @@ describe('private-key.signer', () => { }, msgs: [ { - type: 'sign/msgSignData', + type: 'sign/MsgSignData', value: { signer: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', data: 'SGVsbG8=', // echo -n "Hello" | base64 @@ -357,63 +360,76 @@ describe('private-key.signer', () => { 'tendermint/PubKeySecp256k1' ); expect(signedTx.signature.signature).toEqual( - 'gzgi+GKdyLOhRHQRBQol0zOcl/J0idmL2MMIrE2f+AU7txWSpdX3irnPHa73BXokYh0mkxB2/o4iZzsr3kiWmQ==' + '4oHTVOF4EtiizvPajDe2+l/iOE6goG7zuySs1qNeZ+wSHUl74oFioE/pSta/7Z0n7rL6z9zL3s14yfYldkne+Q==' ); + const serialized = serializeSignDoc(signDoc); + const signatureBytes = Buffer.from(signedTx.signature.signature, 'base64'); + const isVerified = await Secp256k1.verifySignature( + Secp256k1Signature.fromFixedLength(signatureBytes), + sha256(serialized), + Buffer.from(signedTx.signature.pub_key.value, 'base64') + ); + expect(isVerified).toBe(true); }); it('Should sign doc direct aux with sign amino mode', async () => { - // const signDoc = SignDocDirectAux.fromPartial({ - // chainId: 'cosmoshub-4', - // accountNumber: 1895821n, - // bodyBytes: new Uint8Array( - // Buffer.from( - // '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', - // 'hex' - // ) - // ), - // publicKey: { - // value: Buffer.from('A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu==', 'base64'), - // typeUrl: '/cosmos.crypto.secp256k1.PubKey', - // }, - // sequence: 0n, - // }); - // console.log('🚀 ~ it ~ signDoc:', SignDocDirectAux.toAminoMsg(signDoc)); - const signDoc = { - chain_id: 'cosmoshub-4', - account_number: '1895821', - sequence: '0', - fee: { - amount: [{ denom: 'uatom', amount: '1000' }], - gas: '200000', + const signDoc = SignDocDirectAux.fromPartial({ + chainId: 'cosmoshub-4', + accountNumber: 1895821n, + bodyBytes: new Uint8Array( + Buffer.from( + '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', + 'hex' + ) + ), + publicKey: { + value: Buffer.from( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu==', + 'base64' + ), + typeUrl: '/cosmos.crypto.secp256k1.PubKey', }, - msgs: [ - { - type: 'cosmos-sdk/SignDocDirectAux', - value: { - body_bytes: - 'CjIKHC9jb3Ntb3MuYmFuay52MWJldGExLk1zZ1NlbmQSEhoQCgV1YXRvbRIHMTAwMDAwMA==', - pub_key: { - type: 'tendermint/PubKeySecp256k1', - value: 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu', - }, - chain_id: 'cosmoshub-4', - account_number: '1895821', - }, - }, - ], - memo: '', - }; + }); const signer = new PrivateKeySigner(privateKeys.cosmos); const signedTx = await signer.signRawTransaction( signDoc, provider, - CosmosSignMode.SIGN_AMINO + CosmosSignMode.SIGN_DIRECT ); expect(signedTx.signature.pub_key.value).toEqual( 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' ); expect(signedTx.signature.signature).toEqual( - '7WG+1gvdV0dN/l1ntIK67im1H4wp+8kgACuCQ64cM1MgmXCiM7Q0+C3RZot7uFU6grNiJExtYEw9zakIxqsXwg==' + 'pyBuAh++d0s6JqaYpIpRBwIU8lwOxT8kV3s8Df5UM4UZepaCF1PaawGf55azY5PHJXSgBfyUx1MjYFHnHgAahQ==' + ); + const signatures = new Map(); + signatures.set( + await signer.getAddress(derivations.cosmos), + new Uint8Array(Buffer.from(signedTx.signature.signature)) + ); + const multisigTxBytes = makeMultisignedTxBytes( + { + type: 'tendermint/PubKeyMultisigThreshold', + value: { + threshold: '1', + pubkeys: [signedTx.signature.pub_key], + }, + }, + 0, + { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + new Uint8Array( + Buffer.from( + '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', + 'hex' + ) + ), + signatures + ); + expect(Buffer.from(multisigTxBytes).toString('hex')).toEqual( + '0a340a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d12073130303030303012a2010a8a010a770a292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579124a080112460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103dda39b22c1f8e2c2d11da3bc4517f80b461aa69f10e761e34576f4f09ccfa1ee120f120d0a05080112018012040a02087f12130a0d0a057561746f6d12043130303010c09a0c1a5a0a587079427541682b2b643073364a7161597049705242774955386c774f7854386b56337338446635554d34555a6570614346315061617747663535617a593550484a5853674266795578314d6a5946486e4867416168513d3d' ); }); }); diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index ff507764..3b3af428 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -6,8 +6,11 @@ import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { COSMOS_MANIFESTS, CosmosHubChains } from '../manifests'; import { ChainMsg, CosmosChainType, CosmosSignMode, MsgBody } from '../msg'; +import { SignDocDirectAux, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import SeedPhraseSigner from './seed-phrase.signer'; +import { Secp256k1, Secp256k1Signature, sha256 } from '@cosmjs/crypto'; +import { makeMultisignedTxBytes } from '@cosmjs/stargate'; jest.mock('@cosmjs/stargate/build/signingstargateclient', () => { return { @@ -23,20 +26,19 @@ jest.mock('@cosmjs/stargate/build/signingstargateclient', () => { createDefaultAminoConverters: jest.fn().mockResolvedValue([]), }; }); - -jest.mock('cosmjs-types/cosmos/tx/v1beta1/tx', () => { - const originalModule = jest.requireActual( - 'cosmjs-types/cosmos/tx/v1beta1/tx' - ); - return { - TxRaw: { - encode: jest.fn().mockImplementation(() => { - return { finish: jest.fn().mockReturnValue([1, 1, 1]) }; - }), - }, - SignDoc: originalModule.SignDoc, - }; -}); +// jest.mock('cosmjs-types/cosmos/tx/v1beta1/tx', () => { +// const originalModule = jest.requireActual( +// 'cosmjs-types/cosmos/tx/v1beta1/tx' +// ); +// return { +// TxRaw: { +// encode: jest.fn().mockImplementation(() => { +// return { finish: jest.fn().mockReturnValue([1, 1, 1]) }; +// }), +// }, +// ...originalModule +// }; +// }); type CosmosHdPathTypes = { cosmos: string; @@ -108,11 +110,22 @@ describe('seed-phrase.signer', () => { }); it('should sign direct a transaction using a seed phrase', async () => { + const originalEncode = TxRaw.encode; + TxRaw.encode = jest.fn().mockImplementation(() => { + return { finish: jest.fn().mockReturnValue(Uint8Array.from([1, 1, 1])) }; + }); + await signer.sign(message, derivations.cosmos); expect(message.signedTransaction).toBeTruthy(); + + TxRaw.encode = originalEncode; }); it('should sign amino a transaction using a seed phrase', async () => { + const originalEncode = TxRaw.encode; + TxRaw.encode = jest.fn().mockImplementation(() => { + return { finish: jest.fn().mockReturnValue(Uint8Array.from([1, 1, 1])) }; + }); await signer.sign( message, derivations.cosmos, @@ -120,6 +133,7 @@ describe('seed-phrase.signer', () => { CosmosSignMode.SIGN_AMINO ); expect(message.signedTransaction).toBeTruthy(); + TxRaw.encode = originalEncode; }); it('Should sign raw tx with amino mode', async () => { @@ -200,7 +214,7 @@ describe('seed-phrase.signer', () => { }, msgs: [ { - type: 'sign/msgSignData', + type: 'sign/MsgSignData', value: { signer: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', data: 'SGVsbG8=', // echo -n "Hello" | base64 @@ -223,7 +237,75 @@ describe('seed-phrase.signer', () => { 'tendermint/PubKeySecp256k1' ); expect(signedTx.signature.signature).toEqual( - 'gzgi+GKdyLOhRHQRBQol0zOcl/J0idmL2MMIrE2f+AU7txWSpdX3irnPHa73BXokYh0mkxB2/o4iZzsr3kiWmQ==' + '4oHTVOF4EtiizvPajDe2+l/iOE6goG7zuySs1qNeZ+wSHUl74oFioE/pSta/7Z0n7rL6z9zL3s14yfYldkne+Q==' + ); + const serialized = serializeSignDoc(signDoc); + const signatureBytes = Buffer.from(signedTx.signature.signature, 'base64'); + const isVerified = await Secp256k1.verifySignature( + Secp256k1Signature.fromFixedLength(signatureBytes), + sha256(serialized), + Buffer.from(signedTx.signature.pub_key.value, 'base64') + ); + expect(isVerified).toBe(true); + }); + + it('Should sign doc direct aux with sign amino mode', async () => { + const signDoc = SignDocDirectAux.fromPartial({ + chainId: 'cosmoshub-4', + accountNumber: 1895821n, + bodyBytes: new Uint8Array( + Buffer.from( + '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', + 'hex' + ) + ), + publicKey: { + value: Buffer.from( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu==', + 'base64' + ), + typeUrl: '/cosmos.crypto.secp256k1.PubKey', + }, + }); + const signedTx = await signer.signRawTransaction( + signDoc, + provider, + CosmosSignMode.SIGN_DIRECT + ); + expect(signedTx.signature.pub_key.value).toEqual( + 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' + ); + expect(signedTx.signature.signature).toEqual( + 'pyBuAh++d0s6JqaYpIpRBwIU8lwOxT8kV3s8Df5UM4UZepaCF1PaawGf55azY5PHJXSgBfyUx1MjYFHnHgAahQ==' + ); + const signatures = new Map(); + signatures.set( + await signer.getAddress(derivations.cosmos), + new Uint8Array(Buffer.from(signedTx.signature.signature)) + ); + const multisigTxBytes = makeMultisignedTxBytes( + { + type: 'tendermint/PubKeyMultisigThreshold', + value: { + threshold: '1', + pubkeys: [signedTx.signature.pub_key], + }, + }, + 0, + { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', + }, + new Uint8Array( + Buffer.from( + '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', + 'hex' + ) + ), + signatures + ); + expect(Buffer.from(multisigTxBytes).toString('hex')).toEqual( + '0a340a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d12073130303030303012a2010a8a010a770a292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579124a080112460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103dda39b22c1f8e2c2d11da3bc4517f80b461aa69f10e761e34576f4f09ccfa1ee120f120d0a05080112018012040a02087f12130a0d0a057561746f6d12043130303010c09a0c1a5a0a587079427541682b2b643073364a7161597049705242774955386c774f7854386b56337338446635554d34555a6570614346315061617747663535617a593550484a5853674266795578314d6a5946486e4867416168513d3d' ); }); }); @@ -503,6 +585,10 @@ describe('abstrction fee', () => { jest.setTimeout(15000); it('should sign a transaction using a seed phrase', async () => { + const originalEncode = TxRaw.encode; + TxRaw.encode = jest.fn().mockImplementation(() => { + return { finish: jest.fn().mockReturnValue(Uint8Array.from([1, 1, 1])) }; + }); const ibcToken = 'ibc/B547DC9B897E7C3AA5B824696110B8E3D2C31E3ED3F02FF363DCBAD82457E07E'; // uxki; const txInput = { @@ -530,6 +616,7 @@ describe('abstrction fee', () => { await signer.sign(message, derivation); expect(message.signedTransaction).toBeTruthy(); expect((buildTxData as any).fee.amount[0].amount).toEqual(fee); + TxRaw.encode = originalEncode; }); }); @@ -572,6 +659,10 @@ describe('IBC token transfer', () => { }); it('Create success tx to transfer uatom from osmosis to akash', async () => { + const originalEncode = TxRaw.encode; + TxRaw.encode = jest.fn().mockImplementation(() => { + return { finish: jest.fn().mockReturnValue(Uint8Array.from([1, 1, 1])) }; + }); sourceChain = CosmosHubChains.osmosis; destChain = CosmosHubChains.akash; sourceAssetDenom = @@ -597,6 +688,7 @@ describe('IBC token transfer', () => { const chainMsg = await provider.createMsg(msgBodies[0]); await signer.sign(chainMsg, derivations); expect(chainMsg.signedTransaction).toBeTruthy(); + TxRaw.encode = originalEncode; }); it('Create success tx to transfer with path unwinding', async () => { From f4af0222d7f53e82aa9de17d210cff700029e673 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:07:32 +0100 Subject: [PATCH 115/176] Fix/swap pool manager (#319) * fix: sign dapps cosmos * chore: remove broken tests * fix: lint * fix: send * fix: lint * fix: lint * fix: test * fix: cosmos tests * version: add changeset * fix: merge conflicts, fix lint * fix: fix lint --------- Co-authored-by: danilxdefi --- .changeset/cold-dryers-bake.md | 5 + .changeset/stupid-poets-approve.md | 5 + packages/bitcoincash/src/gql/graphql.ts | 1084 ++++++++++++----- .../core/src/core/chain/chain.provider.ts | 2 +- .../src/datasource/chain/chain.data-source.ts | 4 +- .../datasource/indexer/indexer.data-source.ts | 194 +-- packages/cosmos/src/msg.spec.ts | 17 +- packages/cosmos/src/msg.ts | 164 ++- packages/cosmos/src/signers/ledger.signer.ts | 1 - .../src/signers/private-key.signer.spec.ts | 114 +- .../cosmos/src/signers/private-key.signer.ts | 99 +- .../src/signers/seed-phrase.signer.spec.ts | 13 +- packages/cosmos/src/utils.ts | 4 +- yarn.lock | 31 +- 14 files changed, 1143 insertions(+), 594 deletions(-) create mode 100644 .changeset/cold-dryers-bake.md create mode 100644 .changeset/stupid-poets-approve.md diff --git a/.changeset/cold-dryers-bake.md b/.changeset/cold-dryers-bake.md new file mode 100644 index 00000000..6d8688cc --- /dev/null +++ b/.changeset/cold-dryers-bake.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +--- + +Fix: update gql generic file diff --git a/.changeset/stupid-poets-approve.md b/.changeset/stupid-poets-approve.md new file mode 100644 index 00000000..d1d36f9b --- /dev/null +++ b/.changeset/stupid-poets-approve.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +Fix: improve build tx with swap pool manager diff --git a/packages/bitcoincash/src/gql/graphql.ts b/packages/bitcoincash/src/gql/graphql.ts index 6fd5c564..03f4b83e 100644 --- a/packages/bitcoincash/src/gql/graphql.ts +++ b/packages/bitcoincash/src/gql/graphql.ts @@ -2,9 +2,15 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -186,7 +192,7 @@ export enum AddressChain { Umee = 'Umee', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync' + zkSync = 'zkSync', } /** Portfolio by wallet address */ @@ -318,14 +324,12 @@ export type Arbitrum = { version: Array; }; - export type ArbitrumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ArbitrumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -333,19 +337,16 @@ export type ArbitrumBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ArbitrumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type ArbitrumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ArbitrumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -603,11 +604,11 @@ export type AssetHistory = { export enum AssetInternalType { CRYPTOCURRENCY = 'CRYPTOCURRENCY', LP_TOKEN = 'LP_TOKEN', - TOKEN = 'TOKEN' + TOKEN = 'TOKEN', } export enum AssetSortBy { - MARKET_CAP = 'MARKET_CAP' + MARKET_CAP = 'MARKET_CAP', } export type AssetTokenContractType = { @@ -727,7 +728,6 @@ export type AssetType = { trending?: Maybe>; }; - export type AssetTypeAllAssetsArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -735,7 +735,6 @@ export type AssetTypeAllAssetsArgs = { page: ConnectionArgs; }; - export type AssetTypeCompositeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -743,12 +742,10 @@ export type AssetTypeCompositeTokensArgs = { page: ConnectionArgs; }; - export type AssetTypeCryptoAssetsArgs = { input: Array; }; - export type AssetTypeCryptoCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -756,13 +753,11 @@ export type AssetTypeCryptoCurrenciesArgs = { page: ConnectionArgs; }; - export type AssetTypeDappsArgs = { address: Scalars['String']; chain: Scalars['String']; }; - export type AssetTypeFiatCurrenciesArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -770,7 +765,6 @@ export type AssetTypeFiatCurrenciesArgs = { page: ConnectionArgs; }; - export type AssetTypeLpTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -778,18 +772,15 @@ export type AssetTypeLpTokensArgs = { page: ConnectionArgs; }; - export type AssetTypeNftsV0Args = { keys: Array; }; - export type AssetTypeSearchArgs = { filter?: InputMaybe; page: ConnectionArgs; }; - export type AssetTypeTokensArgs = { after?: InputMaybe; afterPrice?: InputMaybe; @@ -797,7 +788,6 @@ export type AssetTypeTokensArgs = { page: ConnectionArgs; }; - export type AssetTypeTokensV0Args = { input: Array; }; @@ -852,14 +842,12 @@ export type Aurora = { version: Array; }; - export type AuroraActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type AuroraBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -867,19 +855,16 @@ export type AuroraBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type AuroraLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type AuroraNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type AuroraTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -905,14 +890,12 @@ export type Avalanche = { version: Array; }; - export type AvalancheActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type AvalancheBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -920,19 +903,16 @@ export type AvalancheBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type AvalancheLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type AvalancheNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type AvalancheTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -975,14 +955,12 @@ export type Base = { version: Array; }; - export type BaseActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BaseBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -990,13 +968,11 @@ export type BaseBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type BaseNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type BaseTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1024,12 +1000,10 @@ export type Binance = { transactions: BinanceTransactionConnection; }; - export type BinanceBalancesArgs = { address: Scalars['String']; }; - export type BinanceTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1055,14 +1029,12 @@ export type BinanceSmartChain = { version: Array; }; - export type BinanceSmartChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BinanceSmartChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1070,19 +1042,16 @@ export type BinanceSmartChainBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type BinanceSmartChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type BinanceSmartChainNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type BinanceSmartChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1144,35 +1113,29 @@ export type BitcoinChain = { unspentTxOutputsV5: Array; }; - export type BitcoinChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BitcoinChainBalancesArgs = { address: Scalars['String']; }; - export type BitcoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type BitcoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type BitcoinChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type BitcoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1181,27 +1144,23 @@ export type BitcoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type BitcoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type BitcoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type BitcoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type BitcoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1227,29 +1186,24 @@ export type BitcoinChainTestNet = { unspentTxOutputsV5: Array; }; - export type BitcoinChainTestNetActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BitcoinChainTestNetBalancesArgs = { address: Scalars['String']; }; - export type BitcoinChainTestNetBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type BitcoinChainTestNetGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type BitcoinChainTestNetTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1258,27 +1212,23 @@ export type BitcoinChainTestNetTransactionsArgs = { pageSize: Scalars['Int']; }; - export type BitcoinChainTestNetTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type BitcoinChainTestNetTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type BitcoinChainTestNetUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type BitcoinChainTestNetUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1304,29 +1254,24 @@ export type BitcoincashChain = { unspentTxOutputsV5: Array; }; - export type BitcoincashChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BitcoincashChainBalancesArgs = { address: Scalars['String']; }; - export type BitcoincashChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type BitcoincashChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type BitcoincashChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -1335,27 +1280,23 @@ export type BitcoincashChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type BitcoincashChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type BitcoincashChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type BitcoincashChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type BitcoincashChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -1384,14 +1325,12 @@ export type Blast = { version: Array; }; - export type BlastActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type BlastBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1399,13 +1338,11 @@ export type BlastBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type BlastNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type BlastTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1443,7 +1380,7 @@ export type BridgeTokenInput = { export enum CacheControlScope { PRIVATE = 'PRIVATE', - PUBLIC = 'PUBLIC' + PUBLIC = 'PUBLIC', } export type CantoEvm = { @@ -1463,14 +1400,12 @@ export type CantoEvm = { version: Array; }; - export type CantoEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CantoEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1478,19 +1413,16 @@ export type CantoEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type CantoEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type CantoEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type CantoEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1515,14 +1447,12 @@ export type Celo = { version: Array; }; - export type CeloActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CeloBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1530,13 +1460,11 @@ export type CeloBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type CeloNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type CeloTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1553,7 +1481,7 @@ export enum Chain { FANTOM = 'FANTOM', HARMONY = 'HARMONY', OPTIMISM = 'OPTIMISM', - POLYGON = 'POLYGON' + POLYGON = 'POLYGON', } export type ChainType = { @@ -1624,7 +1552,6 @@ export type CosmosBalanceChain = { version: Array; }; - export type CosmosBalanceChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; @@ -1645,20 +1572,17 @@ export type CosmosBasedChain = { version: Array; }; - export type CosmosBasedChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CosmosBasedChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type CosmosBasedChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1741,14 +1665,12 @@ export type CronosEvm = { version: Array; }; - export type CronosEvmActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type CronosEvmBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1756,19 +1678,16 @@ export type CronosEvmBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type CronosEvmLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type CronosEvmNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type CronosEvmTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -1985,29 +1904,24 @@ export type DogeChain = { unspentTxOutputsV5: Array; }; - export type DogeChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type DogeChainBalancesArgs = { address: Scalars['String']; }; - export type DogeChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type DogeChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type DogeChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -2016,27 +1930,23 @@ export type DogeChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type DogeChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type DogeChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type DogeChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type DogeChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -2138,14 +2048,12 @@ export type Ethereum = { version: Array; }; - export type EthereumActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type EthereumBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2153,19 +2061,16 @@ export type EthereumBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type EthereumLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type EthereumNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type EthereumTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2248,14 +2153,12 @@ export type Fantom = { version: Array; }; - export type FantomActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type FantomBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2263,19 +2166,16 @@ export type FantomBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type FantomLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type FantomNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type FantomTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2291,7 +2191,10 @@ export type Fee = { }; /** Represent possible fee details specific to chain */ -export type FeeDetailsV0 = EvmFeeDetailsV0 | ThorChainFeeDetailsV0 | TronFeeDetailsV0; +export type FeeDetailsV0 = + | EvmFeeDetailsV0 + | ThorChainFeeDetailsV0 + | TronFeeDetailsV0; export type FeeInputType = { feeRateTransaction: Scalars['Float']; @@ -2409,14 +2312,12 @@ export type Gnosis = { version: Array; }; - export type GnosisActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type GnosisBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2424,19 +2325,16 @@ export type GnosisBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type GnosisLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type GnosisNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type GnosisTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2462,7 +2360,6 @@ export type InvestingType = { pools: Array; }; - export type InvestingTypePoolsArgs = { filter?: InputMaybe; }; @@ -2483,25 +2380,21 @@ export type JunoChain = { version: Array; }; - export type JunoChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type JunoChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type JunoChainNftsArgs = { address: Scalars['String']; }; - export type JunoChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2556,14 +2449,12 @@ export type Linea = { version: Array; }; - export type LineaActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type LineaBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2571,13 +2462,11 @@ export type LineaBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type LineaNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type LineaTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2606,29 +2495,24 @@ export type LitecoinChain = { unspentTxOutputsV5: Array; }; - export type LitecoinChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type LitecoinChainBalancesArgs = { address: Scalars['String']; }; - export type LitecoinChainBroadcastTransactionArgs = { rawHex: Scalars['String']; }; - export type LitecoinChainGetTransactionByHashV5Args = { txHash: Scalars['String']; }; - export type LitecoinChainTransactionsArgs = { address: Scalars['String']; blockRange?: OptBlockRange; @@ -2637,27 +2521,23 @@ export type LitecoinChainTransactionsArgs = { pageSize: Scalars['Int']; }; - export type LitecoinChainTransactionsV2Args = { address: Scalars['String']; pageNumber: Scalars['Int']; pageSize: Scalars['Int']; }; - export type LitecoinChainTransactionsV3Args = { address: Scalars['String']; after?: InputMaybe; first: Scalars['Int']; }; - export type LitecoinChainUnspentTxOutputsArgs = { address: Scalars['String']; page: Scalars['Int']; }; - export type LitecoinChainUnspentTxOutputsV5Args = { address: Scalars['String']; page: Scalars['Int']; @@ -2693,14 +2573,12 @@ export type Mantle = { version: Array; }; - export type MantleActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type MantleBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2708,13 +2586,11 @@ export type MantleBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type MantleNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type MantleTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2747,20 +2623,17 @@ export type MayaChain = { version: Array; }; - export type MayaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type MayaChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; - export type MayaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2815,14 +2688,12 @@ export type Mode = { version: Array; }; - export type ModeActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ModeBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2830,13 +2701,11 @@ export type ModeBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ModeNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ModeTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -2861,19 +2730,16 @@ export type Mutation = { upsertReferrer?: Maybe; }; - export type MutationAddCommentArgs = { address: Scalars['String']; comment: Scalars['String']; source: Scalars['String']; }; - export type MutationCreateReferrerArgs = { referrer: CreateReferrer; }; - export type MutationTransactionHashV2Args = { routeId: Scalars['String']; tradeId: Scalars['String']; @@ -2891,19 +2757,16 @@ export type MutationTransactionsArgs = { routeData: RouteTransactionInputType; }; - export type MutationTransactionsV2Args = { routeData: RouteInputTypeV2; }; - export type MutationTransactonHashArgs = { routeId: Scalars['String']; signedHash: Scalars['String']; tradeId: Scalars['Float']; }; - export type MutationUpsertReferrerArgs = { address: Scalars['String']; feeTier: Scalars['String']; @@ -3025,17 +2888,14 @@ export type NearChain = { version: Array; }; - export type NearChainBalancesArgs = { address: Scalars['String']; }; - export type NearChainNftsArgs = { address: Scalars['String']; }; - export type NearChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3100,7 +2960,7 @@ export enum NftChainType { Gnosis = 'Gnosis', Optimism = 'Optimism', Polygon = 'Polygon', - Solana = 'Solana' + Solana = 'Solana', } /** Receive off-chain asset activity with on-chain proof (for example compressed NFT on Solana with Merkle tree) */ @@ -3147,14 +3007,12 @@ export type OpBnb = { version: Array; }; - export type OpBnbActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type OpBnbBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3162,13 +3020,11 @@ export type OpBnbBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type OpBnbNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type OpBnbTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3220,14 +3076,12 @@ export type Optimism = { version: Array; }; - export type OptimismActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type OptimismBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3235,19 +3089,16 @@ export type OptimismBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type OptimismLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type OptimismNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type OptimismTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3317,14 +3168,12 @@ export type Polygon = { version: Array; }; - export type PolygonActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type PolygonBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3332,19 +3181,16 @@ export type PolygonBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type PolygonLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type PolygonNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type PolygonTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -3357,7 +3203,7 @@ export enum Pool { Aave = 'Aave', Benqi = 'Benqi', Bitswap = 'Bitswap', - IronBank = 'IronBank' + IronBank = 'IronBank', } export type PoolType = { @@ -3458,7 +3304,7 @@ export enum PortfolioChainVariant { TerraClassic = 'TerraClassic', TomoChain = 'TomoChain', Tron = 'Tron', - Umee = 'Umee' + Umee = 'Umee', } export type PostRouteTypeV2 = { @@ -3471,7 +3317,7 @@ export enum PriceHistoryInterval { day = 'day', month = 'month', week = 'week', - year = 'year' + year = 'year', } /** Prices history contains history information for each asset: its price, market caps and total volumes. All those metrics provided for different time frames: day, week, month and year. */ @@ -3614,36 +3460,30 @@ export type Query = { zkSync: ZkSync; }; - export type QueryChainsArgs = { filter?: InputMaybe; }; - export type QueryCompositeTokensArgs = { after?: InputMaybe; ids?: InputMaybe>; }; - export type QueryCryptoCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; symbols?: InputMaybe>; }; - export type QueryDappArgs = { app: DAppReputationInput; }; - export type QueryFiatCurrenciesArgs = { after?: InputMaybe; ids?: InputMaybe>; }; - export type QueryReputationArgs = { address: Scalars['String']; approved?: InputMaybe; @@ -3651,7 +3491,6 @@ export type QueryReputationArgs = { offest?: Scalars['Int']; }; - export type QueryReputationV2Args = { address: Scalars['String']; approved?: InputMaybe; @@ -3660,19 +3499,16 @@ export type QueryReputationV2Args = { first?: Scalars['Int']; }; - export type QueryTokensArgs = { after?: InputMaybe; filter?: InputMaybe; }; - export type QueryTrackWalletConnectArgs = { walletAddress: Scalars['String']; walletProvider: Scalars['String']; }; - export type QueryWalletInfoArgs = { address: Scalars['String']; }; @@ -3911,7 +3747,7 @@ export enum ReputationChains { Zilliqa = 'Zilliqa', opBNB = 'opBNB', xDAI = 'xDAI', - zkSync = 'zkSync' + zkSync = 'zkSync', } export type ReputationComment = { @@ -4131,7 +3967,6 @@ export type RoutingChainType = { tokens: Array; }; - export type RoutingChainTypeTokensArgs = { addresses?: InputMaybe>; srcToken?: InputMaybe; @@ -4222,12 +4057,10 @@ export type RoutingType = { trades?: Maybe>; }; - export type RoutingTypeChainArgs = { name: Scalars['String']; }; - export type RoutingTypeRouteArgs = { addresses: Array; amountSource?: InputMaybe; @@ -4237,18 +4070,15 @@ export type RoutingTypeRouteArgs = { srcToken: Scalars['String']; }; - export type RoutingTypeTokenArgs = { id: Scalars['String']; }; - export type RoutingTypeTokensArgs = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; - export type RoutingTypeTradesArgs = { routeId: Scalars['String']; }; @@ -4285,29 +4115,24 @@ export type RoutingTypeV2AddressCheckV2Args = { address: AddressRouteInputTypeV2; }; - export type RoutingTypeV2BridgeableTokensArgs = { bridgeToken?: InputMaybe; tokenId?: InputMaybe; }; - export type RoutingTypeV2ChainV2Args = { name: Scalars['String']; }; - export type RoutingTypeV2DailyVolumeArgs = { startDate?: Scalars['String']; }; - export type RoutingTypeV2IsAssetSwappableArgs = { address: Scalars['String']; chainName: Scalars['String']; }; - export type RoutingTypeV2RefuelArgs = { addresses: Array; amountSource?: InputMaybe; @@ -4317,13 +4142,11 @@ export type RoutingTypeV2RefuelArgs = { srcToken: Scalars['String']; }; - export type RoutingTypeV2RefuelInfoArgs = { destChain: Scalars['String']; srcChain: Scalars['String']; }; - export type RoutingTypeV2RouteV2Args = { addresses: Array; amountSource?: InputMaybe; @@ -4336,23 +4159,19 @@ export type RoutingTypeV2RouteV2Args = { srcToken: Scalars['String']; }; - export type RoutingTypeV2TokenV2Args = { id: Scalars['String']; }; - export type RoutingTypeV2TokensV2Args = { names?: InputMaybe>; tokenIds?: InputMaybe>; }; - export type RoutingTypeV2TradeV2Args = { tradeId: Scalars['String']; }; - export type RoutingTypeV2TradesV2Args = { routeId: Scalars['String']; }; @@ -4371,14 +4190,12 @@ export type Scroll = { version: Array; }; - export type ScrollActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ScrollBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4386,13 +4203,11 @@ export type ScrollBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ScrollNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ScrollTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4500,38 +4315,32 @@ export type SolanaChain = { version: Array; }; - export type SolanaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type SolanaChainAssetHistoryBalancesV0Args = { address: Scalars['String']; minUntil?: InputMaybe; skipAssetServiceFiltering?: Scalars['Boolean']; }; - export type SolanaChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type SolanaChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; }; - export type SolanaChainNftsArgs = { address: Scalars['String']; }; - export type SolanaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4595,25 +4404,21 @@ export type StargazeChain = { version: Array; }; - export type StargazeChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type StargazeChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type StargazeChainNftsArgs = { address: Scalars['String']; }; - export type StargazeChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4677,13 +4482,11 @@ export type TerraChain = { version: Array; }; - export type TerraChainBalancesArgs = { address: Scalars['String']; tokenAddresses?: InputMaybe>; }; - export type TerraChainLegacyNfTsArgs = { address: Scalars['String']; tokenId?: InputMaybe; @@ -4702,20 +4505,17 @@ export type ThorChain = { version: Array; }; - export type ThorChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ThorChainBalancesArgs = { address: Scalars['String']; tokenAddress?: InputMaybe>; }; - export type ThorChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -4812,7 +4612,7 @@ export enum TimePeriod { DAY = 'DAY', MONTH = 'MONTH', WEEK = 'WEEK', - YEAR = 'YEAR' + YEAR = 'YEAR', } /** Unlimited or specific amount of asset approved to spend for spender address */ @@ -4829,7 +4629,7 @@ export enum TokenCategory { LST_TOKEN = 'LST_TOKEN', SHITCOIN = 'SHITCOIN', STABLECOIN = 'STABLECOIN', - TRENDING_TOKEN = 'TRENDING_TOKEN' + TRENDING_TOKEN = 'TRENDING_TOKEN', } export type TokenContractType = { @@ -4931,7 +4731,7 @@ export enum TransactionStatus { /** Transaction was sent and is in the mempool (or equivalent for the chain) */ PENDING = 'PENDING', /** Transaction was included in a block and successfully executed */ - SUCCESS = 'SUCCESS' + SUCCESS = 'SUCCESS', } /** Represents the status of a transaction with optional details */ @@ -4947,7 +4747,7 @@ export enum TransactionType { STAKE = 'STAKE', SWAP = 'SWAP', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW' + WITHDRAW = 'WITHDRAW', } export type TrendingCoingeckoType = { @@ -4992,14 +4792,12 @@ export type Tron = { version: Array; }; - export type TronActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type TronBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5007,13 +4805,11 @@ export type TronBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type TronNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type TronTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5084,72 +4880,58 @@ export type TxClassifier = { getBlockchairTxsByQuery: Scalars['String']; }; - export type TxClassifierAnalyzeEvmTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; - export type TxClassifierAnalyzeSolanaTxBlowfishArgs = { payload: BlowfishSolanaTxPayload; }; - export type TxClassifierAnalyzeTxBlowfishArgs = { payload: BlowfishEvmTxPayload; }; - export type TxClassifierAnalyzeTxV1HexagateArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierAnalyzeTxV2HexagateArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierDecodeTransactionV2Args = { payload: EvmTransactionPayload; }; - export type TxClassifierExplainEvmTxWithRiskAnalysisV1Args = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3Args = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3DebugTraceCallArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3TenderlyArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV3TenderlyBundledArgs = { payload: Array; }; - export type TxClassifierExplainTransactionV4TenderlyArgs = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierExplainTransactionV5Args = { payload: EvmTransactionPayloadV2; }; - export type TxClassifierGetBlockchairTxsByQueryArgs = { chain: TxClassifierChains; limit: Scalars['Int']; @@ -5171,7 +4953,7 @@ export enum TxClassifierChains { linea = 'linea', optimism = 'optimism', polygon = 'polygon', - solana = 'solana' + solana = 'solana', } export enum TxClassifierTxType { @@ -5183,7 +4965,7 @@ export enum TxClassifierTxType { SWAP = 'SWAP', TRANSFER = 'TRANSFER', UNCLASSIFIED = 'UNCLASSIFIED', - WITHDRAW = 'WITHDRAW' + WITHDRAW = 'WITHDRAW', } export type TxSecurityIssue = { @@ -5285,14 +5067,12 @@ export type UserPortfolio = { walletHistory?: Maybe; }; - export type UserPortfolioAddressHistoryArgs = { address: Scalars['String']; chain: PortfolioChainVariant; timePeriod: TimePeriod; }; - export type UserPortfolioWalletHistoryArgs = { accounts: Array; maxAggregationTimeout?: InputMaybe; @@ -5475,14 +5255,12 @@ export type ZetaChain = { version: Array; }; - export type ZetaChainActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ZetaChainBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5490,13 +5268,11 @@ export type ZetaChainBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ZetaChainNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ZetaChainTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5521,14 +5297,12 @@ export type ZkSync = { version: Array; }; - export type ZkSyncActivityHistoryV0Args = { address: Scalars['String']; after?: InputMaybe; first?: Scalars['Int']; }; - export type ZkSyncBalancesArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5536,13 +5310,11 @@ export type ZkSyncBalancesArgs = { tokenAddresses?: InputMaybe>; }; - export type ZkSyncNftsArgs = { address: Scalars['String']; first?: InputMaybe; }; - export type ZkSyncTransactionsArgs = { address: Scalars['String']; after?: InputMaybe; @@ -5555,13 +5327,47 @@ export type BitcoinCashBalanceQueryVariables = Exact<{ address: Scalars['String']; }>; - -export type BitcoinCashBalanceQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', balances: Array<{ __typename?: 'Balance', address: string, amount: { __typename?: 'Amount', value: string }, asset: { __typename?: 'CryptoAsset', chain?: string | null, contract?: string | null, decimals?: number | null, id?: string | null, image?: string | null, name?: string | null, symbol?: string | null, price?: { __typename?: 'AssetAmountType', amount: string, dayPriceChange?: string | null } | null } }> } }; - -export type GetBitcoinCashFeesQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetBitcoinCashFeesQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', fee?: { __typename?: 'DefaultGasFee', high?: number | null, low?: number | null, medium?: number | null } | null } }; +export type BitcoinCashBalanceQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + balances: Array<{ + __typename?: 'Balance'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + asset: { + __typename?: 'CryptoAsset'; + chain?: string | null; + contract?: string | null; + decimals?: number | null; + id?: string | null; + image?: string | null; + name?: string | null; + symbol?: string | null; + price?: { + __typename?: 'AssetAmountType'; + amount: string; + dayPriceChange?: string | null; + } | null; + }; + }>; + }; +}; + +export type GetBitcoinCashFeesQueryVariables = Exact<{ [key: string]: never }>; + +export type GetBitcoinCashFeesQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + fee?: { + __typename?: 'DefaultGasFee'; + high?: number | null; + low?: number | null; + medium?: number | null; + } | null; + }; +}; export type GetBitcoinCashTransactionsQueryVariables = Exact<{ address: Scalars['String']; @@ -5569,35 +5375,753 @@ export type GetBitcoinCashTransactionsQueryVariables = Exact<{ pageNumber: Scalars['Int']; }>; - -export type GetBitcoinCashTransactionsQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', transactionsV2: Array<{ __typename?: 'UTXOTransactionV2', blockNumber?: number | null, hash: string, timestamp?: any | null, status?: string | null, balanceChange?: { __typename?: 'Amount', value: string } | null, fee?: { __typename?: 'Amount', value: string } | null, inputs?: Array<{ __typename?: 'Input', address: string, amount: { __typename?: 'Amount', value: string } }> | null, outputs?: Array<{ __typename?: 'Output', address: string, amount: { __typename?: 'Amount', value: string } }> | null }> } }; +export type GetBitcoinCashTransactionsQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + transactionsV2: Array<{ + __typename?: 'UTXOTransactionV2'; + blockNumber?: number | null; + hash: string; + timestamp?: any | null; + status?: string | null; + balanceChange?: { __typename?: 'Amount'; value: string } | null; + fee?: { __typename?: 'Amount'; value: string } | null; + inputs?: Array<{ + __typename?: 'Input'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + outputs?: Array<{ + __typename?: 'Output'; + address: string; + amount: { __typename?: 'Amount'; value: string }; + }> | null; + }>; + }; +}; export type BitcoinCashBroadcastTransactionQueryVariables = Exact<{ rawHex: Scalars['String']; }>; - -export type BitcoinCashBroadcastTransactionQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', broadcastTransaction: string } }; +export type BitcoinCashBroadcastTransactionQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + broadcastTransaction: string; + }; +}; export type BitcoinCashScanUtxOsQueryVariables = Exact<{ address: Scalars['String']; page: Scalars['Int']; }>; - -export type BitcoinCashScanUtxOsQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', unspentTxOutputsV5: Array<{ __typename?: 'UnspentTransactionOutputV5', oTxHash: string, oIndex: number, oTxHex?: string | null, address?: string | null, isCoinbase?: boolean | null, scriptHex?: string | null, value: { __typename?: 'Amount', value: string } }> } }; +export type BitcoinCashScanUtxOsQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + unspentTxOutputsV5: Array<{ + __typename?: 'UnspentTransactionOutputV5'; + oTxHash: string; + oIndex: number; + oTxHex?: string | null; + address?: string | null; + isCoinbase?: boolean | null; + scriptHex?: string | null; + value: { __typename?: 'Amount'; value: string }; + }>; + }; +}; export type BitcoinCashGetTransactionByHashQueryVariables = Exact<{ txHash: Scalars['String']; }>; - -export type BitcoinCashGetTransactionByHashQuery = { __typename?: 'Query', bitcoincash: { __typename?: 'BitcoincashChain', getTransactionByHashV5: { __typename?: 'UtxotransactionByHashV5', hex?: string | null, txid?: string | null, hash: string, size: number, version: number, locktime?: number | null, confirmations?: number | null, blocktime?: number | null, time?: number | null, blockhash?: string | null, blockNumber?: number | null, sourceOfData: string, inputs: Array<{ __typename?: 'Input', address: string }>, outputs: Array<{ __typename?: 'Output', address: string }> } } }; - - -export const BitcoinCashBalanceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashBalance"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balances"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chain"}},{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"dayPriceChange"}}]}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetBitcoinCashFeesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBitcoinCashFees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"high"}},{"kind":"Field","name":{"kind":"Name","value":"low"}},{"kind":"Field","name":{"kind":"Name","value":"medium"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetBitcoinCashTransactionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBitcoinCashTransactions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageNumber"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionsV2"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageNumber"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageNumber"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balanceChange"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"fee"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode; -export const BitcoinCashBroadcastTransactionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashBroadcastTransaction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rawHex"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"broadcastTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rawHex"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rawHex"}}}]}]}}]}}]} as unknown as DocumentNode; -export const BitcoinCashScanUtxOsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashScanUTXOs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unspentTxOutputsV5"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}},{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"oIndex"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"oTxHex"}},{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"isCoinbase"}},{"kind":"Field","name":{"kind":"Name","value":"scriptHex"}}]}}]}}]}}]} as unknown as DocumentNode; -export const BitcoinCashGetTransactionByHashDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BitcoinCashGetTransactionByHash"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"txHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bitcoincash"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getTransactionByHashV5"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"txHash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hex"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"locktime"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"blocktime"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"blockhash"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"sourceOfData"}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export type BitcoinCashGetTransactionByHashQuery = { + __typename?: 'Query'; + bitcoincash: { + __typename?: 'BitcoincashChain'; + getTransactionByHashV5: { + __typename?: 'UtxotransactionByHashV5'; + hex?: string | null; + txid?: string | null; + hash: string; + size: number; + version: number; + locktime?: number | null; + confirmations?: number | null; + blocktime?: number | null; + time?: number | null; + blockhash?: string | null; + blockNumber?: number | null; + sourceOfData: string; + inputs: Array<{ __typename?: 'Input'; address: string }>; + outputs: Array<{ __typename?: 'Output'; address: string }>; + }; + }; +}; + +export const BitcoinCashBalanceDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashBalance' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balances' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'asset' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'chain' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'contract' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'decimals' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'id' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'image' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'name' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'price' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: 'dayPriceChange', + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'symbol' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashBalanceQuery, + BitcoinCashBalanceQueryVariables +>; +export const GetBitcoinCashFeesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBitcoinCashFees' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'high' } }, + { kind: 'Field', name: { kind: 'Name', value: 'low' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'medium' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBitcoinCashFeesQuery, + GetBitcoinCashFeesQueryVariables +>; +export const GetBitcoinCashTransactionsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetBitcoinCashTransactions' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'transactionsV2' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageSize' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageSize' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'pageNumber' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'pageNumber' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'balanceChange' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'fee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'status' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + GetBitcoinCashTransactionsQuery, + GetBitcoinCashTransactionsQueryVariables +>; +export const BitcoinCashBroadcastTransactionDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashBroadcastTransaction' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'broadcastTransaction' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'rawHex' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'rawHex' }, + }, + }, + ], + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashBroadcastTransactionQuery, + BitcoinCashBroadcastTransactionQueryVariables +>; +export const BitcoinCashScanUtxOsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashScanUTXOs' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'unspentTxOutputsV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'address' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'address' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'page' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'page' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oIndex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'oTxHex' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'isCoinbase' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'scriptHex' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashScanUtxOsQuery, + BitcoinCashScanUtxOsQueryVariables +>; +export const BitcoinCashGetTransactionByHashDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'BitcoinCashGetTransactionByHash' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'bitcoincash' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'getTransactionByHashV5' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'txHash' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'txHash' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'hex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'txid' } }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { kind: 'Field', name: { kind: 'Name', value: 'size' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'version' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'locktime' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'confirmations' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blocktime' }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'time' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockhash' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'blockNumber' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'sourceOfData' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'inputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'outputs' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'address' }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BitcoinCashGetTransactionByHashQuery, + BitcoinCashGetTransactionByHashQueryVariables +>; diff --git a/packages/core/src/core/chain/chain.provider.ts b/packages/core/src/core/chain/chain.provider.ts index 6ce26ea5..65307d4f 100644 --- a/packages/core/src/core/chain/chain.provider.ts +++ b/packages/core/src/core/chain/chain.provider.ts @@ -11,7 +11,7 @@ import { Balance, DataSource, MsgEncoding, Response, FeeData, TronFee } from 'co import { forEach } from 'lodash'; export interface IOptions { - signers?: (typeof SignerProvider)[]; + signers?: typeof SignerProvider[]; providerId?: string; } diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 51d44bc2..976c414a 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -20,7 +20,7 @@ import { setupBankExtension, } from '@cosmjs/launchpad'; import cosmosclient from '@cosmos-client/core'; -import { uniqBy, capitalize } from 'lodash'; +import { uniqBy } from 'lodash'; import { Account } from '@cosmjs/stargate'; import axios, { AxiosInstance } from 'axios'; import { @@ -33,7 +33,7 @@ import { import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'; import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; -import { AddressChain, CryptoAssetArgs } from '../../gql/graphql'; +import { CryptoAssetArgs } from '../../gql/graphql'; import * as manifests from '../../manifests'; import { ChainMsg } from '../../msg'; import { COSMOS_ADDRESS_CHAIN } from '../../manifests'; diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index 9cf4f446..4ecd9097 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -24,13 +24,13 @@ import { TxRaw, } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'; -import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; // import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; import { ChainMsg } from '../../msg'; import * as manifests from '../../manifests'; import { CosmosHubChains } from '../../manifests'; import { MsgSwapExactAmountIn } from '../../proto_export/osmosis/gamm/v1beta1/tx'; +import { MsgSwapExactAmountIn as MsgSwapExactAmountInPoolManager } from '../../proto_export/osmosis/poolmanager/v1beta1/tx'; import { MsgTransfer } from '../../proto_export/ibc/applications/transfer/v1/tx'; import { MsgSend } from '../../proto_export/cosmos/bank/v1beta1/tx'; @@ -136,57 +136,87 @@ export class IndexerDataSource extends DataSource { async estimateFee(msgs: ChainMsg[], speed: GasFeeSpeed): Promise { let fromAddress = ''; - const _msgs: any[] = []; + const feeData: FeeData[] = []; + const gasFeeOptions = await this.gasFeeOptions(); + const _feeAmount = msgs.map((m) => { + const messageData = m.toData(); + if (messageData.feeOptions) { + return { + denom: messageData.feeOptions.gasFee.denom, + amount: new BigNumber(this.manifest.feeGasStep[speed]) + .multipliedBy(10 ** this.manifest.decimals) + .toString(), + }; + } + return { + denom: this.manifest.denom, + amount: new BigNumber(this.manifest.feeGasStep[speed]) + .multipliedBy(10 ** this.manifest.decimals) + .toString(), + }; + }); for (let index = 0; index < msgs.length; index++) { const m = msgs[index]; const messageData = - m.encoding === 'string' ? await m.buildTx() : m.toData(); + m.encoding === 'string' ? await m.buildTx() : await m.toData(); fromAddress = messageData.from; - if (m.encoding === 'string') { + const _msgs: any[] = []; + if (messageData.msgs?.length) { messageData.msgs.map((msgTransfer: any) => { - if (msgTransfer.typeUrl.includes('MsgTransfer')) { + if (msgTransfer.typeUrl === MsgTransfer.typeUrl) { _msgs.push({ - typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + typeUrl: MsgTransfer.typeUrl, value: MsgTransfer.encode( MsgTransfer.fromPartial(msgTransfer.value) ).finish(), }); - } else if (msgTransfer.typeUrl.includes('MsgSwapExactAmountIn')) { + } else if ( + msgTransfer.typeUrl === MsgSwapExactAmountInPoolManager.typeUrl + ) { _msgs.push({ - typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', - value: MsgSwapExactAmountIn.encode( - MsgSwapExactAmountIn.fromPartial(msgTransfer.value) + typeUrl: MsgSwapExactAmountInPoolManager.typeUrl, + value: MsgSwapExactAmountInPoolManager.encode( + MsgSwapExactAmountInPoolManager.fromPartial(msgTransfer.value) ).finish(), }); - } else { + } else if (msgTransfer.typeUrl === MsgSwapExactAmountIn.typeUrl) { _msgs.push({ - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.encode( - MsgSend.fromPartial(msgTransfer.value) + typeUrl: MsgSwapExactAmountIn.typeUrl, + value: MsgSwapExactAmountIn.encode( + MsgSwapExactAmountIn.fromPartial(msgTransfer.value) ).finish(), }); } }); } else { - const { msgs: msgsToSend, typeUrl } = m.getMsgToSend(); + const msgsToSend = m.getMsgToSend(); msgsToSend.map((msgTransfer: any) => { - if (typeUrl.includes('MsgTransfer')) { + if (msgTransfer.typeUrl === MsgTransfer.typeUrl) { _msgs.push({ - typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + typeUrl: MsgTransfer.typeUrl, value: MsgTransfer.encode( MsgTransfer.fromPartial(msgTransfer.value) ).finish(), }); - } else if (typeUrl.includes('MsgExecuteContract')) { + } else if ( + msgTransfer.typeUrl === MsgSwapExactAmountInPoolManager.typeUrl + ) { _msgs.push({ - typeUrl: '/cosmos.base.v1beta1.MsgExecuteContract', - value: MsgExecuteContract.encode( - MsgExecuteContract.fromPartial(msgTransfer.value) + typeUrl: MsgSwapExactAmountInPoolManager.typeUrl, + value: MsgSwapExactAmountInPoolManager.encode( + MsgSwapExactAmountInPoolManager.fromPartial(msgTransfer.value) ).finish(), }); - } else { + } else if (msgTransfer.typeUrl === MsgSwapExactAmountIn.typeUrl) { _msgs.push({ - typeUrl: '/cosmos.bank.v1beta1.MsgSend', + typeUrl: MsgSwapExactAmountIn.typeUrl, + value: MsgSwapExactAmountIn.encode( + MsgSwapExactAmountIn.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl === MsgSend.typeUrl) { + _msgs.push({ + typeUrl: MsgSend.typeUrl, value: MsgSend.encode( MsgSend.fromPartial(msgTransfer.value) ).finish(), @@ -194,77 +224,69 @@ export class IndexerDataSource extends DataSource { } }); } - } - - const _feeAmount = msgs.map((m) => { - const messageData = m.toData(); - if (messageData.feeOptions) { - return { - denom: messageData.feeOptions.gasFee.denom, - amount: new BigNumber(this.manifest.feeGasStep[speed]) - .multipliedBy(10 ** this.manifest.decimals) - .toString(), - }; - } - return { - denom: this.manifest.denom, - amount: new BigNumber(this.manifest.feeGasStep[speed]) - .multipliedBy(10 ** this.manifest.decimals) - .toString(), - }; - }); - - const account = await this.getAccount(fromAddress); - if (!account) { - return [ - { + const account = await this.getAccount(fromAddress); + if (!account) { + feeData.push({ gasLimit: 200000, gasPrice: this.manifest.feeGasStep[speed], - }, - ]; - } - const tx = TxRaw.encode({ - bodyBytes: TxBody.encode( - TxBody.fromPartial({ - messages: _msgs, - memo: undefined, - }) - ).finish(), - authInfoBytes: AuthInfo.encode({ - signerInfos: [ - SignerInfo.fromPartial({ - modeInfo: { - single: { - mode: SignMode.SIGN_MODE_LEGACY_AMINO_JSON, - }, - multi: void 0, - }, - sequence: BigInt(account.sequence), - }), - ], - fee: Fee.fromPartial({ - amount: _feeAmount as any, - }), - }).finish(), - signatures: [new Uint8Array(64)], - }).finish(); - const { data } = await this.lcdAxiosClient.post( - '/cosmos/tx/v1beta1/simulate', - { - txBytes: Buffer.from(tx).toString('base64'), + }); + continue; } - ); - - const gasFeeOptions = await this.gasFeeOptions(); + let tx; + if (messageData.signDoc?.bodyBytes) { + tx = TxRaw.encode({ + bodyBytes: Uint8Array.from( + Object.values(messageData.signDoc.bodyBytes) + ), + authInfoBytes: Uint8Array.from( + Object.values(messageData.signDoc.authInfoBytes) + ), + signatures: [new Uint8Array(64)], + }).finish(); + } else { + tx = TxRaw.encode({ + bodyBytes: TxBody.encode( + TxBody.fromPartial({ + messages: _msgs, + memo: undefined, + }) + ).finish(), + authInfoBytes: AuthInfo.encode({ + signerInfos: [ + SignerInfo.fromPartial({ + modeInfo: { + single: { + mode: SignMode.SIGN_MODE_LEGACY_AMINO_JSON, + }, + multi: void 0, + }, + sequence: BigInt(account.sequence), + }), + ], + fee: Fee.fromPartial({ + amount: _feeAmount as any, + }), + }).finish(), + signatures: [new Uint8Array(64)], + }).finish(); + } + const { data } = await this.lcdAxiosClient + .post('/cosmos/tx/v1beta1/simulate', { + txBytes: Buffer.from(tx).toString('base64'), + }) + .catch((e) => { + throw new Error(e?.response?.data?.message ?? 'Error'); + }); - return [ - { + feeData.push({ gasLimit: Math.ceil(parseInt(data.gas_info.gas_used) * 2), gasPrice: gasFeeOptions ? (gasFeeOptions[speed] as number) : this.manifest.feeGasStep[speed], - }, - ]; + }); + } + + return feeData; } async gasFeeOptions(): Promise { diff --git a/packages/cosmos/src/msg.spec.ts b/packages/cosmos/src/msg.spec.ts index 4509277a..0b0135f8 100644 --- a/packages/cosmos/src/msg.spec.ts +++ b/packages/cosmos/src/msg.spec.ts @@ -105,6 +105,9 @@ describe('msg', () => { maxGapAmount: 0.0001, }, }; + provider = new CosmosProvider( + new ChainDataSource(COSMOS_MANIFESTS.osmosis) + ); }); it('buildTx with insufficient balance should throw an error', async () => { @@ -240,19 +243,6 @@ describe('msg', () => { }); it('getFee should return fee estimation', async () => { - const chainMsg = new ChainMsg( - { - from: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - to: 'cosmos1g6qu6hm4v3s3vq7438jehn9fzxg9p720yesq2q', - amount: '0.000001', - }, - mockProvider, - MsgEncoding.object - ); - provider = new CosmosProvider( - new ChainDataSource(COSMOS_MANIFESTS.osmosis) - ); - CosmosProvider.prototype.getBalance = jest.fn().mockResolvedValue({ getData: () => new Promise((resolve) => @@ -311,7 +301,6 @@ describe('msg', () => { const feeEstimation = await chainMsg.getFee(); const gap = provider.manifest?.maxGapAmount || 0; - expect(response).toEqual( new BigNumber('1000') .minus(feeEstimation.fee || 0) diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 2a62caec..98d7c6d8 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -23,7 +23,10 @@ import { MsgSend } from './proto_export/cosmos/bank/v1beta1/tx'; import type { CosmosProvider } from './chain.provider'; import { MsgSwapExactAmountIn } from './proto_export/osmosis/gamm/v1beta1/tx'; import { MessageComposer as MessageComposerGamm } from './proto_export/osmosis/gamm/v1beta1/tx.registry'; +import { MessageComposer as MessageComposerPoolManager } from './proto_export/osmosis/poolmanager/v1beta1/tx.registry'; import { AminoConverter as AminoConverterGamm } from './proto_export/osmosis/gamm/v1beta1/tx.amino'; +import { AminoConverter } from './proto_export/osmosis/poolmanager/v1beta1/tx.amino'; +import { MsgSwapExactAmountIn as PoolManagerMsgSwapExactAmountIn } from './proto_export/osmosis/poolmanager/v1beta1/tx'; export type MsgBody = { from: string; @@ -144,32 +147,87 @@ export class ChainMsg extends BasMsg { .toString(); } - private getIBCTransferMsg(rawMsg: any) { + private getIBCTransferMsg(rawMsg: any, signMode: CosmosSignMode) { const ibcCheck = rawMsg.token.denom.split('/'); if (ibcCheck?.[0] === 'ibc') { rawMsg.token.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; } - if (rawMsg.timeoutTimestamp) { - rawMsg.timeoutTimestamp = Long.fromValue(rawMsg.timeoutTimestamp); + + let parser: (input: any) => MsgTransfer = MsgTransfer.fromPartial; + if (signMode === CosmosSignMode.SIGN_AMINO) { + parser = MsgTransfer.fromAmino; + if (rawMsg.timeout_timestamp) { + rawMsg.timeout_timestamp = Long.fromValue( + rawMsg.timeout_timestamp + ).toString(); + } + } else { + if (rawMsg.timeoutTimestamp) { + rawMsg.timeoutTimestamp = Long.fromValue(rawMsg.timeoutTimestamp); + } } - const ibcTransfer = MsgTransfer.fromPartial(rawMsg); + + const ibcTransfer = parser(rawMsg); return MessageComposerIbc.withTypeUrl.transfer(ibcTransfer); } - private getSwapMsg(rawMsg: any) { - rawMsg.tokenIn.amount = rawMsg.tokenIn.amount.toString(); - const ibcCheck = rawMsg.tokenIn.denom.split('/'); - if (ibcCheck?.[0] === 'ibc') { - rawMsg.tokenIn.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + private getSwapMsg(rawMsg: any, signMode: CosmosSignMode) { + let parser: (input: any) => MsgSwapExactAmountIn = + MsgSwapExactAmountIn.fromPartial; + if (signMode === CosmosSignMode.SIGN_AMINO) { + parser = MsgSwapExactAmountIn.fromAmino; + rawMsg.token_in.amount = rawMsg.token_in.amount.toString(); + const ibcCheck = rawMsg.token_in.denom.split('/'); + if (ibcCheck?.[0] === 'ibc') { + rawMsg.tokenIn.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + } + rawMsg.token_out_min_amount = rawMsg.token_out_min_amount.toString(); + } else { + rawMsg.tokenIn.amount = rawMsg.tokenIn.amount.toString(); + const ibcCheck = rawMsg.tokenIn.denom.split('/'); + if (ibcCheck?.[0] === 'ibc') { + rawMsg.tokenIn.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + } + rawMsg.tokenOutMinAmount = rawMsg.tokenOutMinAmount.toString(); } - rawMsg.tokenOutMinAmount = rawMsg.tokenOutMinAmount.toString(); - const msgSwapExactAmountIn = MsgSwapExactAmountIn.fromPartial(rawMsg); + const msgSwapExactAmountIn = parser(rawMsg); return MessageComposerGamm.withTypeUrl.swapExactAmountIn( msgSwapExactAmountIn ); } + private getSwapMsgPoolManager(rawMsg: any, signMode: CosmosSignMode) { + let parser: (input: any) => PoolManagerMsgSwapExactAmountIn = + PoolManagerMsgSwapExactAmountIn.fromPartial; + if (signMode === CosmosSignMode.SIGN_AMINO) { + parser = PoolManagerMsgSwapExactAmountIn.fromAmino; + if (!rawMsg.token_in) return; + if (!rawMsg.token_out_min_amount) return; + rawMsg.token_in.amount = rawMsg.token_in?.amount.toString(); + const ibcCheck = rawMsg.token_in.denom?.split('/'); + if (ibcCheck?.[0] === 'ibc') { + rawMsg.token_in.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + } + rawMsg.token_out_min_amount = rawMsg.token_out_min_amount.toString(); + const msgSwapExactAmountIn = parser(rawMsg); + return MessageComposerPoolManager.withTypeUrl.swapExactAmountIn( + msgSwapExactAmountIn + ); + } else { + rawMsg.tokenIn.amount = rawMsg.tokenIn.amount.toString(); + const ibcCheck = rawMsg.tokenIn.denom.split('/'); + if (ibcCheck?.[0] === 'ibc') { + rawMsg.tokenIn.denom = `ibc/${ibcCheck?.[1]?.toUpperCase()}`; + } + rawMsg.tokenOutMinAmount = rawMsg.tokenOutMinAmount.toString(); + const msgSwapExactAmountIn = parser(rawMsg); + return MessageComposerPoolManager.withTypeUrl.swapExactAmountIn( + msgSwapExactAmountIn + ); + } + } + private getMsgSend(rawMsg: any) { rawMsg.amount = rawMsg.amount.map((coin: AminoCoin) => { const ibcCheck = coin.denom.split('/'); @@ -196,14 +254,14 @@ export class ChainMsg extends BasMsg { }; } - getMsgToSend() { + getMsgToSend(): { typeUrl: string; value: any }[] { const msgData = this.toData(); let msgs; let typeUrl = msgData.typeUrl; if (typeUrl && typeUrl === '/ibc.applications.transfer.v1.MsgTransfer') { // transferring IBC token - msgs = msgData.msgs; + msgs = msgData.msgs ?? []; } else if (msgData.contractAddress && msgData.nftId) { // sending nft typeUrl = msgData.typeUrl || '/cosmwasm.wasm.v1.MsgExecuteContract'; @@ -242,15 +300,17 @@ export class ChainMsg extends BasMsg { }, ]; } - - return { - msgs, - typeUrl, - }; + return msgs; } async buildTx() { const msgData = this.toData(); + let signMode = CosmosSignMode.SIGN_DIRECT; + const isAmino = (EncodingTypes: object, key: string): boolean => { + return Object.values(EncodingTypes).find( + (converter) => converter.aminoType === key + ); + }; if (this.encoding === MsgEncoding.string) { if (!msgData.data || typeof msgData.data !== 'string') { @@ -258,11 +318,22 @@ export class ChainMsg extends BasMsg { 'Invalid msg data, see examples to build msg from data' ); } - const { - signDoc: { fee, memo, msgs, sequence, account_number }, - signer, - } = JSON.parse(msgData.data); - + const { signDoc, signer } = JSON.parse(msgData.data); + const isDirectSignDoc = (signDoc: any): signDoc is DirectSignDoc => { + return !!signDoc?.bodyBytes; + }; + const { fee, memo, msgs, sequence, account_number } = signDoc; + if (isDirectSignDoc(signDoc)) { + return { + signMode, + raw: true, + signDoc, + msgs: [], + from: signer ?? msgData.from, + to: '', + value: 0, + }; + } const encodedMsgs = msgs.map((signDocMsg: any) => { const key: string = signDocMsg?.['@type'] || @@ -273,19 +344,41 @@ export class ChainMsg extends BasMsg { const isIBCTransfer = AminoConverterIbc[key as keyof typeof AminoConverterIbc]; - if (isIBCTransfer) { - return this.getIBCTransferMsg(rawMsg); + const isIBCTransferAmino = isAmino(AminoConverterIbc, key); + if (isIBCTransfer || isIBCTransferAmino) { + if (isIBCTransferAmino) signMode = CosmosSignMode.SIGN_AMINO; + return this.getIBCTransferMsg(rawMsg, signMode); } const isMsgSwapExactAmountIn = AminoConverterGamm[key as keyof typeof AminoConverterGamm]; - if (isMsgSwapExactAmountIn) { - return this.getSwapMsg(rawMsg); + const isMsgSwapExactAmountInAmino = isAmino(AminoConverterGamm, key); + if (isMsgSwapExactAmountIn || isMsgSwapExactAmountInAmino) { + if (isMsgSwapExactAmountInAmino) signMode = CosmosSignMode.SIGN_AMINO; + return this.getSwapMsg(rawMsg, signMode); + } + const isMsgSwapExactAmountInPoolManager = + AminoConverter[key as keyof typeof AminoConverter]; + + const isMsgSwapExactAmountInPoolManagerAmino = isAmino( + AminoConverter, + key + ); + + if ( + isMsgSwapExactAmountInPoolManager || + isMsgSwapExactAmountInPoolManagerAmino + ) { + if (isMsgSwapExactAmountInPoolManagerAmino) + signMode = CosmosSignMode.SIGN_AMINO; + return this.getSwapMsgPoolManager(rawMsg, signMode); } const isMsgSend = AminoConverterCosmos[key as keyof typeof AminoConverterCosmos]; - if (isMsgSend) { + const isMsgSendAmino = isAmino(AminoConverterCosmos, key); + if (isMsgSend || isMsgSendAmino) { + if (isMsgSendAmino) signMode = CosmosSignMode.SIGN_AMINO; return this.getMsgSend(rawMsg); } @@ -295,6 +388,9 @@ export class ChainMsg extends BasMsg { }); return { + signMode, + raw: false, + signDoc, msgs: encodedMsgs, fee: { amount: fee.amount.map(({ amount, denom }: any) => ({ @@ -306,13 +402,13 @@ export class ChainMsg extends BasMsg { ...(memo && { memo }), sequence: parseInt(sequence), accountNumber: parseInt(account_number), - from: signer, + from: signer ?? msgData.from, to: '', value: 0, }; } - const { typeUrl, msgs } = this.getMsgToSend(); + const _msgs = this.getMsgToSend(); const feeOptions = msgData.feeOptions; if (!msgData.gasLimit && !msgData.gasPrice && this.provider) { @@ -344,11 +440,9 @@ export class ChainMsg extends BasMsg { }; const acc = await this.provider.getAccount(msgData.from); + const msgs = _msgs.length > 0 ? _msgs : msgData.msgs || _msgs; return { - msgs: - typeUrl === '/ibc.applications.transfer.v1.MsgTransfer' - ? msgs - : msgData.msgs || msgs, + msgs, ...(msgData.memo && { memo: msgData.memo }), fee, ...(acc && { @@ -359,7 +453,7 @@ export class ChainMsg extends BasMsg { from: msgData.from, denom: msgData.denom || this.provider.manifest.denom, value: this.getValue(), - typeUrl, + typeUrl: msgs[0].typeUrl, contractAddress: msgData.contractAddress, nftId: msgData.nftId, }; diff --git a/packages/cosmos/src/signers/ledger.signer.ts b/packages/cosmos/src/signers/ledger.signer.ts index e0078055..f19668c1 100644 --- a/packages/cosmos/src/signers/ledger.signer.ts +++ b/packages/cosmos/src/signers/ledger.signer.ts @@ -6,7 +6,6 @@ import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SigningStargateClient } from '@cosmjs/stargate'; import { bech32 } from 'bech32'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; -import { CosmosProvider } from 'src/chain.provider'; import { AminoSignDoc, ChainMsg } from '../msg'; import { STARGATE_CLIENT_OPTIONS } from '../utils'; diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index 1de8576e..cef3abc4 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -2,16 +2,15 @@ import { MsgEncoding } from '@xdefi-tech/chains-core'; import { Hash, PrivKeySecp256k1 } from '@keplr-wallet/crypto'; import { bech32 } from 'bech32'; import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; -import { SignDocDirectAux } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { makeMultisignedTxBytes } from '@cosmjs/stargate'; +import { Secp256k1, Secp256k1Signature, sha256 } from '@cosmjs/crypto'; import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { COSMOS_MANIFESTS } from '../manifests'; -import { ChainMsg, CosmosChainType, CosmosSignMode, MsgBody } from '../msg'; +import { ChainMsg, CosmosSignMode, MsgBody } from '../msg'; import { PrivateKeySigner } from './private-key.signer'; -import { Secp256k1, Secp256k1Signature, sha256 } from '@cosmjs/crypto'; type CosmosHdPathTypes = { cosmos: string; @@ -119,12 +118,7 @@ describe('private-key.signer', () => { }); it('should sign amimo a transaction using a private key', async () => { - await cosmosSigner.sign( - message, - '', - CosmosChainType.Cosmos, - CosmosSignMode.SIGN_AMINO - ); + await cosmosSigner.sign(message, ''); expect(message.signedTransaction).toBeTruthy(); }); @@ -207,58 +201,12 @@ describe('private-key.signer', () => { // Sign msg with direct sign mode const signer = new PrivateKeySigner(privateKeys.cosmos); - await signer.sign( - chainMsg, - '', - CosmosChainType.Cosmos, - CosmosSignMode.SIGN_DIRECT - ); + await signer.sign(chainMsg, ''); expect(chainMsg.signedTransaction).toEqual( 'Co0BCooBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmoKLWNvc21vczFnNnF1NmhtNHYzczN2cTc0MzhqZWhuOWZ6eGc5cDcyMHllc3EycRItY29zbW9zMWc2cXU2aG00djNzM3ZxNzQzOGplaG45Znp4ZzlwNzIweWVzcTJxGgoKBXVhdG9tEgExEmcKUApGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQPdo5siwfjiwtEdo7xFF/gLRhqmnxDnYeNFdvTwnM+h7hIECgIIARgBEhMKDQoFdWF0b20SBDI1MDAQwJoMGkDMqz7SD1+2tvYlImP5HGOLF0/wjqpDAyMODMKnmh8bmkjdarqIGVnN+FgLzEaKHUpIc1c6n8iwCkh/a8SW1yfr' ); }); - it('Should create msg adn sign it with animo mode', async () => { - const chainMsg = provider.createMsg(txInput); - - const txData = await chainMsg.buildTx(); - - // Check tx msgs before signinng - const expectedMsg = { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: { - fromAddress: txInput.from, - toAddress: txInput.to, - amount: [ - { - denom: 'uatom', - amount: '1', // txInput * 10 ** decimals - }, - ], - }, - }; - expect(txData.msgs[0]).toEqual(expectedMsg); - - // Check tx fee info before signing - const expectedFee = { - amount: [{ denom: 'uatom', amount: '2500' }], - gas: '200000', - }; - expect(txData.fee).toEqual(expectedFee); - - // Sign msg with amino sign mode - const signer = new PrivateKeySigner(privateKeys.cosmos); - await signer.sign( - chainMsg, - '', - CosmosChainType.Cosmos, - CosmosSignMode.SIGN_AMINO - ); - expect(chainMsg.signedTransaction).toEqual( - 'Co0BCooBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmoKLWNvc21vczFnNnF1NmhtNHYzczN2cTc0MzhqZWhuOWZ6eGc5cDcyMHllc3EycRItY29zbW9zMWc2cXU2aG00djNzM3ZxNzQzOGplaG45Znp4ZzlwNzIweWVzcTJxGgoKBXVhdG9tEgExEmcKUApGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQPdo5siwfjiwtEdo7xFF/gLRhqmnxDnYeNFdvTwnM+h7hIECgIIfxgBEhMKDQoFdWF0b20SBDI1MDAQwJoMGkCMICf5+o/tooHugIHu8JFVWQ1Gj8EjJVKWHdZOJSEuBWyh+Wt/k8b4A0EWzhwI8B4nHvGEPGjmLWVI6USX1wQs' - ); - }); - it('Should sign raw tx with amino mode', async () => { const signDoc = { chain_id: 'cosmoshub-4', @@ -284,7 +232,7 @@ describe('private-key.signer', () => { const signer = new PrivateKeySigner(privateKeys.cosmos); const signedTx = await signer.signRawTransaction( signDoc, - provider, + provider.manifest.prefix, CosmosSignMode.SIGN_AMINO ); expect(signedTx.signature.pub_key.value).toEqual( @@ -315,7 +263,7 @@ describe('private-key.signer', () => { const signer = new PrivateKeySigner(privateKeys.cosmos); const signedTx = await signer.signRawTransaction( signDoc, - provider, + provider.manifest.prefix, CosmosSignMode.SIGN_DIRECT ); expect(signedTx.signature.pub_key.value).toEqual( @@ -350,7 +298,7 @@ describe('private-key.signer', () => { const signer = new PrivateKeySigner(privateKeys.cosmos); const signedTx = await signer.signRawTransaction( signDoc, - provider, + provider.manifest.prefix, CosmosSignMode.SIGN_AMINO ); expect(signedTx.signature.pub_key.value).toEqual( @@ -373,34 +321,42 @@ describe('private-key.signer', () => { }); it('Should sign doc direct aux with sign amino mode', async () => { - const signDoc = SignDocDirectAux.fromPartial({ - chainId: 'cosmoshub-4', - accountNumber: 1895821n, - bodyBytes: new Uint8Array( - Buffer.from( - '0a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d120731303030303030', - 'hex' - ) - ), - publicKey: { - value: Buffer.from( - 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu==', - 'base64' - ), - typeUrl: '/cosmos.crypto.secp256k1.PubKey', + const signDoc = { + chain_id: 'cosmoshub-4', + account_number: '1895821', + sequence: '0', + fee: { + amount: [{ denom: 'uatom', amount: '1000' }], + gas: '200000', }, - }); + msgs: [ + { + type: 'cosmos-sdk/SignDocDirectAux', + value: { + body_bytes: + 'CjIKHC9jb3Ntb3MuYmFuay52MWJldGExLk1zZ1NlbmQSEhoQCgV1YXRvbRIHMTAwMDAwMA==', + pub_key: { + type: 'tendermint/PubKeySecp256k1', + value: 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu', + }, + chain_id: 'cosmoshub-4', + account_number: '1895821', + }, + }, + ], + memo: '', + }; const signer = new PrivateKeySigner(privateKeys.cosmos); const signedTx = await signer.signRawTransaction( signDoc, - provider, - CosmosSignMode.SIGN_DIRECT + provider.manifest.prefix, + CosmosSignMode.SIGN_AMINO ); expect(signedTx.signature.pub_key.value).toEqual( 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' ); expect(signedTx.signature.signature).toEqual( - 'pyBuAh++d0s6JqaYpIpRBwIU8lwOxT8kV3s8Df5UM4UZepaCF1PaawGf55azY5PHJXSgBfyUx1MjYFHnHgAahQ==' + '7WG+1gvdV0dN/l1ntIK67im1H4wp+8kgACuCQ64cM1MgmXCiM7Q0+C3RZot7uFU6grNiJExtYEw9zakIxqsXwg==' ); const signatures = new Map(); signatures.set( @@ -429,7 +385,7 @@ describe('private-key.signer', () => { signatures ); expect(Buffer.from(multisigTxBytes).toString('hex')).toEqual( - '0a340a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d12073130303030303012a2010a8a010a770a292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579124a080112460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103dda39b22c1f8e2c2d11da3bc4517f80b461aa69f10e761e34576f4f09ccfa1ee120f120d0a05080112018012040a02087f12130a0d0a057561746f6d12043130303010c09a0c1a5a0a587079427541682b2b643073364a7161597049705242774955386c774f7854386b56337338446635554d34555a6570614346315061617747663535617a593550484a5853674266795578314d6a5946486e4867416168513d3d' + '0a340a320a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412121a100a057561746f6d12073130303030303012a2010a8a010a770a292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579124a080112460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103dda39b22c1f8e2c2d11da3bc4517f80b461aa69f10e761e34576f4f09ccfa1ee120f120d0a05080112018012040a02087f12130a0d0a057561746f6d12043130303010c09a0c1a5a0a583757472b316776645630644e2f6c316e74494b3637696d31483477702b386b6741437543513634634d314d676d5843694d3751302b4333525a6f74377546553667724e694a457874594577397a616b497871735877673d3d' ); }); }); diff --git a/packages/cosmos/src/signers/private-key.signer.ts b/packages/cosmos/src/signers/private-key.signer.ts index 3d9d805f..cb83f6e7 100644 --- a/packages/cosmos/src/signers/private-key.signer.ts +++ b/packages/cosmos/src/signers/private-key.signer.ts @@ -1,24 +1,22 @@ -import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; +import { MsgEncoding, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing'; import { SigningStargateClient } from '@cosmjs/stargate'; import { fromHex } from '@cosmjs/encoding'; -import { TxRaw, SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { AuthInfo, SignDoc, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { bech32 } from 'bech32'; import { - stringToPath, pathToString, + stringToPath, } from '@cosmjs/launchpad/node_modules/@cosmjs/crypto'; import { Wallet } from 'ethers'; -import { RawKey, LCDClient } from '@terra-money/feather.js'; +import { RawKey } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { Secp256k1Wallet } from '@cosmjs/amino'; -import { CosmosProvider } from '../chain.provider'; import { AminoSignDoc, ChainMsg, - CosmosChainType, CosmosSignMode, DirectSignDoc, SignMsgSendResponse, @@ -67,45 +65,36 @@ export class PrivateKeySigner extends Signer.Provider { return wallet.address; } - async sign( - msg: ChainMsg, - _derivation?: string, - chainType?: CosmosChainType, - signMode?: CosmosSignMode - ): Promise { - if (chainType === CosmosChainType.Cosmos || !chainType) { - const signedTx = - signMode === CosmosSignMode.SIGN_DIRECT || !signMode - ? await this.signDirect(msg) - : await this.signAmino(msg); - const txBytes = TxRaw.encode(signedTx as TxRaw).finish(); - const rawTx = Buffer.from(txBytes).toString('base64'); - msg.sign(rawTx); - return; - } else if (chainType === CosmosChainType.Terra) { - const txData = await msg.buildTx(); - const clientOptions: Record = {}; - clientOptions[msg.provider.manifest.chainId] = { - chainID: msg.provider.manifest.chainId, - lcd: msg.provider.manifest.lcdURL, - gasAdjustment: 1.75, - gasPrices: { - uluna: 0.015, - }, - prefix: msg.provider.manifest.prefix, // bech32 prefix, used by the LCD to understand which is the right chain to query - }; - const lcdClient = new LCDClient(clientOptions); - const terraWallet = lcdClient.wallet( - new RawKey(Buffer.from(this.key, 'hex')) + async sign(msg: ChainMsg, _derivation?: string): Promise { + const { signMode, raw, signDoc } = await msg.buildTx(); + if (raw) { + if (msg.encoding === MsgEncoding.string) { + signDoc.bodyBytes = Uint8Array.from(Object.values(signDoc.bodyBytes)); + signDoc.authInfoBytes = Uint8Array.from( + Object.values(signDoc.authInfoBytes) + ); + const authInfo = AuthInfo.decode(signDoc.authInfoBytes); + signDoc.authInfoBytes = AuthInfo.encode(authInfo).finish(); + } + const res = await this.signRawTransaction( + signDoc, + msg.provider.manifest.prefix, + signMode ); - - const tx = await terraWallet.createAndSignTx({ - msgs: [txData.msgs], - chainID: msg.provider.manifest.chainId, - }); - - msg.sign(Buffer.from(tx.toBytes()).toString('base64')); + msg.sign(res); + return; + } else { + if (signMode === CosmosSignMode.SIGN_DIRECT || !signMode) { + const signedTx = await this.signDirect(msg); + const txBytes = TxRaw.encode(signedTx as TxRaw).finish(); + const rawTx = Buffer.from(txBytes).toString('base64'); + msg.sign(rawTx); + return; + } + const signedTx = await this.signAmino(msg); + msg.sign(signedTx); } + return; } async signDirect(msg: ChainMsg) { @@ -130,33 +119,25 @@ export class PrivateKeySigner extends Signer.Provider { msg.provider.manifest.prefix ); const [{ address: senderAddress }] = await wallet.getAccounts(); - const client = await SigningStargateClient.connectWithSigner( - msg.provider.manifest.rpcURL, - wallet, - STARGATE_CLIENT_OPTIONS - ); - return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); + return wallet.signAmino(senderAddress, txData.signDoc); } async signAminoRawTransaction( signDoc: AminoSignDoc, - provider: CosmosProvider + prefix: string ): Promise { - const wallet = await Secp256k1Wallet.fromKey( - fromHex(this.key), - provider.manifest.prefix - ); + const wallet = await Secp256k1Wallet.fromKey(fromHex(this.key), prefix); const [{ address: senderAddress }] = await wallet.getAccounts(); return wallet.signAmino(senderAddress, signDoc); } async signDirectRawTransaction( signDoc: DirectSignDoc, - provider: CosmosProvider + prefix: string ): Promise { const wallet = await DirectSecp256k1Wallet.fromKey( fromHex(this.key), - provider.manifest.prefix + prefix ); const [{ address: senderAddress }] = await wallet.getAccounts(); @@ -173,12 +154,12 @@ export class PrivateKeySigner extends Signer.Provider { async signRawTransaction( signDoc: AminoSignDoc | DirectSignDoc, - provider: CosmosProvider, + prefix: string, signMode: CosmosSignMode ): Promise { return signMode === CosmosSignMode.SIGN_AMINO - ? this.signAminoRawTransaction(signDoc as AminoSignDoc, provider) - : this.signDirectRawTransaction(signDoc as DirectSignDoc, provider); + ? this.signAminoRawTransaction(signDoc as AminoSignDoc, prefix) + : this.signDirectRawTransaction(signDoc as DirectSignDoc, prefix); } async verifyMessage( diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index 3b3af428..85da13cc 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -1,16 +1,16 @@ import { Hash, PrivKeySecp256k1 } from '@keplr-wallet/crypto'; import { bech32 } from 'bech32'; import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; +import { SignDocDirectAux, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { Secp256k1, Secp256k1Signature, sha256 } from '@cosmjs/crypto'; +import { makeMultisignedTxBytes } from '@cosmjs/stargate'; import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { COSMOS_MANIFESTS, CosmosHubChains } from '../manifests'; import { ChainMsg, CosmosChainType, CosmosSignMode, MsgBody } from '../msg'; -import { SignDocDirectAux, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import SeedPhraseSigner from './seed-phrase.signer'; -import { Secp256k1, Secp256k1Signature, sha256 } from '@cosmjs/crypto'; -import { makeMultisignedTxBytes } from '@cosmjs/stargate'; jest.mock('@cosmjs/stargate/build/signingstargateclient', () => { return { @@ -626,7 +626,6 @@ describe('IBC token transfer', () => { let sourceChain: CosmosHubChains; let sourceAssetDenom: string; let destChain: CosmosHubChains; - let destAssetDenom: string; let derivations: string; let provider: CosmosProvider; let addresses: Record; @@ -675,7 +674,7 @@ describe('IBC token transfer', () => { addresses, }); expect(msgBodies[0].msgs).toBeDefined(); - const ibcTrasferMsg = msgBodies[0].msgs![0]; + const ibcTrasferMsg = msgBodies[0].msgs?.[0]; expect(ibcTrasferMsg.typeUrl).toBe( '/ibc.applications.transfer.v1.MsgTransfer' ); @@ -704,7 +703,7 @@ describe('IBC token transfer', () => { addresses, }); expect(msgBodies[0].msgs).toBeDefined(); - const firstIbcTrasferMsg = msgBodies[0].msgs![0]; + const firstIbcTrasferMsg = msgBodies[0].msgs?.[0]; expect(firstIbcTrasferMsg.typeUrl).toBe( '/ibc.applications.transfer.v1.MsgTransfer' ); @@ -713,7 +712,7 @@ describe('IBC token transfer', () => { expect(firstIbcTrasferMsg.value.token.amount).toBe('100000'); // 0.1 * 1e6 expect(firstIbcTrasferMsg.value.receiver).toBe(addresses['axelar']); - const secondIbcTrasferMsg = msgBodies[1].msgs![0]; + const secondIbcTrasferMsg = msgBodies[1].msgs?.[0]; expect(secondIbcTrasferMsg.typeUrl).toBe( '/ibc.applications.transfer.v1.MsgTransfer' ); diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index c74a9608..5ac8d6a3 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -13,7 +13,7 @@ import { osmosisAminoConverters, } from './proto_export/osmosis/client'; import { COSMOS_MANIFESTS, CosmosHubChains } from './manifests'; -import { AminoMsgSend, MsgBody } from './msg'; +import { MsgBody } from './msg'; export interface ChainAsset { denom: string; @@ -159,7 +159,7 @@ export const createIBCTransferMsg = async ( const addressList = route.chain_ids.reduce( (arr: string[], chainId: string): string[] => { for (const chain in COSMOS_MANIFESTS) { - if (COSMOS_MANIFESTS[chain as CosmosHubChains]!.chainId === chainId) { + if (COSMOS_MANIFESTS[chain as CosmosHubChains]?.chainId === chainId) { const address = userAddresses[chain as CosmosHubChains]; if (address) arr.push(address); return arr; diff --git a/yarn.lock b/yarn.lock index bcba76bd..d368169d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17647,7 +17647,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17665,15 +17665,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -17775,7 +17766,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17796,13 +17787,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -19510,7 +19494,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -19528,15 +19512,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From fd4ad6b7657affe80f1da152b2f07190653c38de Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 20 Aug 2024 09:10:04 +0000 Subject: [PATCH 116/176] Version packages --- .changeset/cold-dryers-bake.md | 5 ----- .changeset/stupid-poets-approve.md | 5 ----- packages/bitcoincash/CHANGELOG.md | 6 ++++++ packages/bitcoincash/package.json | 2 +- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) delete mode 100644 .changeset/cold-dryers-bake.md delete mode 100644 .changeset/stupid-poets-approve.md diff --git a/.changeset/cold-dryers-bake.md b/.changeset/cold-dryers-bake.md deleted file mode 100644 index 6d8688cc..00000000 --- a/.changeset/cold-dryers-bake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch ---- - -Fix: update gql generic file diff --git a/.changeset/stupid-poets-approve.md b/.changeset/stupid-poets-approve.md deleted file mode 100644 index d1d36f9b..00000000 --- a/.changeset/stupid-poets-approve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -Fix: improve build tx with swap pool manager diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index ca6c59d6..45e85bec 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-bitcoincash +## 2.0.28 + +### Patch Changes + +- 63cbdc41: Fix: update gql generic file + ## 2.0.27 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 9f239dfd..653164cb 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.27", + "version": "2.0.28", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 0f47dfa0..5c7a5924 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.39 + +### Patch Changes + +- 63cbdc41: Fix: improve build tx with swap pool manager + ## 2.0.38 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index bbdd689c..e3fc58cc 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.38", + "version": "2.0.39", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 53df09443d2098ca3b8f3b2a9cfd96ee0a634c2d Mon Sep 17 00:00:00 2001 From: Amur Date: Thu, 22 Aug 2024 14:30:57 +0100 Subject: [PATCH 117/176] feat: move from bip32/39 to scures bips (#325) --- .changeset/chatty-pears-thank.md | 10 +++ packages/bitcoin/package.json | 20 ++--- packages/bitcoin/src/custom.d.ts | 1 + .../bitcoin/src/signers/seed-phrase.signer.ts | 14 ++-- packages/bitcoincash/package.json | 18 ++--- .../src/signers/seed-phrase.signer.ts | 17 ++-- packages/dogecoin/package.json | 18 ++--- .../src/signers/seed-phrase.signer.ts | 19 +++-- packages/litecoin/package.json | 18 ++--- .../src/signers/seed-phrase.signer.ts | 19 +++-- packages/solana/package.json | 15 ++-- .../solana/src/signers/seed-phrase.signer.ts | 2 +- packages/thor/package.json | 18 ++--- .../thor/src/signers/seed-phrase.signer.ts | 11 +-- packages/thor/tsup.config.cjs | 2 +- yarn.lock | 81 ++++++++++++++----- 16 files changed, 169 insertions(+), 114 deletions(-) create mode 100644 .changeset/chatty-pears-thank.md diff --git a/.changeset/chatty-pears-thank.md b/.changeset/chatty-pears-thank.md new file mode 100644 index 00000000..baa7c26b --- /dev/null +++ b/.changeset/chatty-pears-thank.md @@ -0,0 +1,10 @@ +--- +'@xdefi-tech/chains-bitcoincash': minor +'@xdefi-tech/chains-dogecoin': minor +'@xdefi-tech/chains-litecoin': minor +'@xdefi-tech/chains-bitcoin': minor +'@xdefi-tech/chains-solana': minor +'@xdefi-tech/chains-thor': minor +--- + +Switched to scure bip32/bip39 diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index ecc01030..10cee4c4 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -11,18 +11,18 @@ "README.md" ], "devDependencies": { - "jest": "27.5.1", - "jest-environment-jsdom": "27.5.1", - "jest-watch-typeahead": "1.0.0", - "ts-jest": "27.1.4", - "tsup": "6.6.3", - "typescript": "4.8.3", "@graphql-codegen/cli": "3.2.2", "@graphql-codegen/client-preset": "2.1.1", "@graphql-codegen/named-operations-object": "2.3.1", "@graphql-codegen/near-operation-file-preset": "2.5.0", "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0" + "graphql": "16.6.0", + "jest": "27.5.1", + "jest-environment-jsdom": "27.5.1", + "jest-watch-typeahead": "1.0.0", + "ts-jest": "27.1.4", + "tsup": "6.6.3", + "typescript": "4.8.3" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -30,16 +30,16 @@ "@ledgerhq/hw-transport-mocker": "6.28.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", - "@scure/bip32": "1.3.3", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.2.1", "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bignumber.js": "9.1.2", - "bip32": "2.0.4", - "bip39": "3.1.0", "bitcoinjs-lib": "5.2.0", + "coininfo": "^5.2.1", "coinselect": "3.1.13", "eslint-config-custom": "*", "reflect-metadata": "0.1.13", diff --git a/packages/bitcoin/src/custom.d.ts b/packages/bitcoin/src/custom.d.ts index 523722fa..d818cf0d 100644 --- a/packages/bitcoin/src/custom.d.ts +++ b/packages/bitcoin/src/custom.d.ts @@ -1,4 +1,5 @@ declare module 'coinselect'; +declare module 'coininfo'; declare module 'coinselect/accumulative'; declare module 'coinselect/utils'; declare module 'tiny-secp256k1/index.js'; diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.ts b/packages/bitcoin/src/signers/seed-phrase.signer.ts index c4486bac..7c1359d7 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.ts @@ -1,10 +1,11 @@ /*eslint import/namespace: [2, { allowComputed: true }]*/ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import * as bip39 from 'bip39'; -import * as bip32 from 'bip32'; +import * as bip39 from '@scure/bip39'; +import * as bip32 from '@scure/bip32'; import { secp256k1 } from '@noble/curves/secp256k1'; import * as btc from '@scure/btc-signer'; import * as Bitcoin from 'bitcoinjs-lib'; +import coininfo from 'coininfo'; import { ChainMsg } from '../msg'; @@ -15,10 +16,11 @@ export class SeedPhraseSigner extends Signer.Provider { throw new Error('Seed phrase not set!'); } const seed = await bip39.mnemonicToSeed(this.key, ''); - const root = bip32.fromSeed(seed); - const master = root.derivePath(derivation); - - return master.toWIF(); + const root = bip32.HDKey.fromMasterSeed(seed); + const master = root.derive(derivation); + const bitcoinNetwork = coininfo.bitcoin.main.toBitcoinJS(); + const wif = btc.WIF(bitcoinNetwork).encode(master.privateKey!); + return wif; } async getAddress(derivation: string): Promise { diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 653164cb..069dba38 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -11,18 +11,18 @@ "README.md" ], "devDependencies": { - "jest": "27.5.1", - "jest-environment-jsdom": "27.5.1", - "jest-watch-typeahead": "1.0.0", - "ts-jest": "27.1.4", - "tsup": "6.6.3", - "typescript": "4.8.3", "@graphql-codegen/cli": "3.2.2", "@graphql-codegen/client-preset": "2.1.1", "@graphql-codegen/named-operations-object": "2.3.1", "@graphql-codegen/near-operation-file-preset": "2.5.0", "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0" + "graphql": "16.6.0", + "jest": "27.5.1", + "jest-environment-jsdom": "27.5.1", + "jest-watch-typeahead": "1.0.0", + "ts-jest": "27.1.4", + "tsup": "6.6.3", + "typescript": "4.8.3" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -31,14 +31,14 @@ "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", "@psf/bitcoincashjs-lib": "4.0.3", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.2.1", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bchaddrjs": "0.5.2", "bignumber.js": "9.1.2", - "bip32": "2.0.4", - "bip39": "3.1.0", "bitcoinjs-lib": "5.2.0", "coininfo": "5.2.1", "coinkey": "3.0.0", diff --git a/packages/bitcoincash/src/signers/seed-phrase.signer.ts b/packages/bitcoincash/src/signers/seed-phrase.signer.ts index a1a95286..f3a731c5 100644 --- a/packages/bitcoincash/src/signers/seed-phrase.signer.ts +++ b/packages/bitcoincash/src/signers/seed-phrase.signer.ts @@ -1,10 +1,11 @@ /*eslint import/namespace: [2, { allowComputed: true }]*/ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { UTXO } from '@xdefi-tech/chains-utxo'; -import * as bip32 from 'bip32'; -import * as bip39 from 'bip39'; +import * as bip32 from '@scure/bip32'; +import * as bip39 from '@scure/bip39'; import * as BitcoinCash from '@psf/bitcoincashjs-lib'; import * as Bitcoin from 'bitcoinjs-lib'; +import * as btc from '@scure/btc-signer'; import coininfo from 'coininfo'; import * as bchaddr from 'bchaddrjs'; @@ -16,12 +17,12 @@ export class SeedPhraseSigner extends Signer.Provider { if (!this.key) { throw new Error('Seed phrase not set!'); } - - const seed = await bip39.mnemonicToSeed(this.key); - const root = bip32.fromSeed(seed, coininfo.bitcoincash.main.toBitcoinJS()); - const master = root.derivePath(derivation); - - return master.toWIF(); + const seed = await bip39.mnemonicToSeed(this.key, ''); + const root = bip32.HDKey.fromMasterSeed(seed); + const master = root.derive(derivation); + const bitcoincashNetwork = coininfo.bitcoincash.main.toBitcoinJS(); + const wif = btc.WIF(bitcoincashNetwork).encode(master.privateKey!); + return wif; } async getAddress(derivation: string): Promise { diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 1f3a1ead..206e64a9 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -11,18 +11,18 @@ "README.md" ], "devDependencies": { - "jest": "27.5.1", - "jest-environment-jsdom": "27.5.1", - "jest-watch-typeahead": "1.0.0", - "ts-jest": "27.1.4", - "tsup": "6.6.3", - "typescript": "4.8.3", "@graphql-codegen/cli": "3.2.2", "@graphql-codegen/client-preset": "2.1.1", "@graphql-codegen/named-operations-object": "2.3.1", "@graphql-codegen/near-operation-file-preset": "2.5.0", "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0" + "graphql": "16.6.0", + "jest": "27.5.1", + "jest-environment-jsdom": "27.5.1", + "jest-watch-typeahead": "1.0.0", + "ts-jest": "27.1.4", + "tsup": "6.6.3", + "typescript": "4.8.3" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -30,13 +30,13 @@ "@ledgerhq/hw-transport-mocker": "6.28.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.2.1", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bignumber.js": "9.1.2", - "bip32": "2.0.4", - "bip39": "3.1.0", "bitcoinjs-lib": "5.2.0", "coininfo": "5.2.1", "coinselect": "3.1.13", diff --git a/packages/dogecoin/src/signers/seed-phrase.signer.ts b/packages/dogecoin/src/signers/seed-phrase.signer.ts index a3ae8903..be0d5f4a 100644 --- a/packages/dogecoin/src/signers/seed-phrase.signer.ts +++ b/packages/dogecoin/src/signers/seed-phrase.signer.ts @@ -3,8 +3,8 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import coininfo from 'coininfo'; import { secp256k1 } from '@noble/curves/secp256k1'; import * as btc from '@scure/btc-signer'; -import * as bip32 from 'bip32'; -import * as bip39 from 'bip39'; +import * as bip32 from '@scure/bip32'; +import * as bip39 from '@scure/bip39'; import * as Dogecoin from 'bitcoinjs-lib'; import { ChainMsg } from '../msg'; @@ -13,15 +13,14 @@ import { ChainMsg } from '../msg'; export class SeedPhraseSigner extends Signer.Provider { async getPrivateKey(derivation: string): Promise { if (!this.key) { - throw new Error('Private key not set!'); + throw new Error('Seed phrase not set!'); } - - const network = coininfo.dogecoin.main.toBitcoinJS(); - const seed = await bip39.mnemonicToSeed(this.key); - const root = bip32.fromSeed(seed, network); - const master = root.derivePath(derivation); - - return master.toWIF(); + const seed = await bip39.mnemonicToSeed(this.key, ''); + const root = bip32.HDKey.fromMasterSeed(seed); + const master = root.derive(derivation); + const dogecoinNetwork = coininfo.dogecoin.main.toBitcoinJS(); + const wif = btc.WIF(dogecoinNetwork).encode(master.privateKey!); + return wif; } async getAddress(derivation: string): Promise { diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 5a39a986..0256d983 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -11,18 +11,18 @@ "README.md" ], "devDependencies": { - "jest": "27.5.1", - "jest-environment-jsdom": "27.5.1", - "jest-watch-typeahead": "1.0.0", - "ts-jest": "27.1.4", - "tsup": "6.6.3", - "typescript": "4.8.3", "@graphql-codegen/cli": "3.2.2", "@graphql-codegen/client-preset": "2.1.1", "@graphql-codegen/named-operations-object": "2.3.1", "@graphql-codegen/near-operation-file-preset": "2.5.0", "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0" + "graphql": "16.6.0", + "jest": "27.5.1", + "jest-environment-jsdom": "27.5.1", + "jest-watch-typeahead": "1.0.0", + "ts-jest": "27.1.4", + "tsup": "6.6.3", + "typescript": "4.8.3" }, "dependencies": { "@ledgerhq/hw-app-btc": "10.0.0", @@ -30,13 +30,13 @@ "@ledgerhq/hw-transport-mocker": "6.28.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.2.1", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", "bignumber.js": "9.0.2", - "bip32": "2.0.4", - "bip39": "3.1.0", "bitcoinjs-lib": "5.2.0", "coininfo": "5.2.1", "coinselect": "3.1.13", diff --git a/packages/litecoin/src/signers/seed-phrase.signer.ts b/packages/litecoin/src/signers/seed-phrase.signer.ts index 3ff22281..ca43ef60 100644 --- a/packages/litecoin/src/signers/seed-phrase.signer.ts +++ b/packages/litecoin/src/signers/seed-phrase.signer.ts @@ -3,8 +3,8 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import coininfo from 'coininfo'; import { secp256k1 } from '@noble/curves/secp256k1'; import * as btc from '@scure/btc-signer'; -import * as bip32 from 'bip32'; -import * as bip39 from 'bip39'; +import * as bip32 from '@scure/bip32'; +import * as bip39 from '@scure/bip39'; import * as Litecoin from 'bitcoinjs-lib'; import { ChainMsg } from '../msg'; @@ -13,15 +13,14 @@ import { ChainMsg } from '../msg'; export class SeedPhraseSigner extends Signer.Provider { async getPrivateKey(derivation: string): Promise { if (!this.key) { - throw new Error('Private key not set!'); + throw new Error('Seed phrase not set!'); } - - const network = coininfo.litecoin.main.toBitcoinJS(); - const seed = await bip39.mnemonicToSeed(this.key); - const root = bip32.fromSeed(seed, network); - const master = root.derivePath(derivation); - - return master.toWIF(); + const seed = await bip39.mnemonicToSeed(this.key, ''); + const root = bip32.HDKey.fromMasterSeed(seed); + const master = root.derive(derivation); + const litecoinNetwork = coininfo.litecoin.main.toBitcoinJS(); + const wif = btc.WIF(litecoinNetwork).encode(master.privateKey!); + return wif; } async getAddress(derivation: string): Promise { diff --git a/packages/solana/package.json b/packages/solana/package.json index 1b488303..2b654ff8 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -11,19 +11,19 @@ "README.md" ], "devDependencies": { + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", "eslint-config-custom": "*", + "graphql": "16.6.0", "jest": "27.5.1", "jest-environment-jsdom": "27.5.1", "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", "typescript": "4.8.3", - "@graphql-codegen/cli": "3.2.2", - "@graphql-codegen/client-preset": "2.1.1", - "@graphql-codegen/named-operations-object": "2.3.1", - "@graphql-codegen/near-operation-file-preset": "2.5.0", - "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0", "xhr2": "0.2.1" }, "dependencies": { @@ -31,11 +31,12 @@ "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@metaplex-foundation/mpl-token-metadata": "2.13.0", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", "@solana/spl-token": "0.4.6", "@solana/web3.js": "1.91.8", "@xdefi-tech/chains-core": "*", "bignumber.js": "9.1.2", - "bip39": "3.1.0", "bs58": "5.0.0", "ed25519-hd-key": "1.3.0", "eslint-config-custom": "*", diff --git a/packages/solana/src/signers/seed-phrase.signer.ts b/packages/solana/src/signers/seed-phrase.signer.ts index 9d9716eb..5bbddf36 100644 --- a/packages/solana/src/signers/seed-phrase.signer.ts +++ b/packages/solana/src/signers/seed-phrase.signer.ts @@ -4,7 +4,7 @@ import { Transaction as SolanaTransaction, VersionedTransaction, } from '@solana/web3.js'; -import * as bip39 from 'bip39'; +import * as bip39 from '@scure/bip39'; import { derivePath } from 'ed25519-hd-key'; import bs58 from 'bs58'; import nacl from 'tweetnacl'; diff --git a/packages/thor/package.json b/packages/thor/package.json index 5081f2f1..271ba21e 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -12,33 +12,33 @@ ], "devDependencies": { "@esbuild-plugins/node-modules-polyfill": "0.2.2", + "@graphql-codegen/cli": "3.2.2", + "@graphql-codegen/client-preset": "2.1.1", + "@graphql-codegen/named-operations-object": "2.3.1", + "@graphql-codegen/near-operation-file-preset": "2.5.0", + "@graphql-codegen/typescript-document-nodes": "3.0.2", "eslint-config-custom": "*", + "graphql": "16.6.0", "jest": "27.5.1", "jest-environment-jsdom": "27.5.1", "jest-watch-typeahead": "1.0.0", "ts-jest": "27.1.4", "tsup": "6.6.3", - "typescript": "4.8.3", - "@graphql-codegen/cli": "3.2.2", - "@graphql-codegen/client-preset": "2.1.1", - "@graphql-codegen/named-operations-object": "2.3.1", - "@graphql-codegen/near-operation-file-preset": "2.5.0", - "@graphql-codegen/typescript-document-nodes": "3.0.2", - "graphql": "16.6.0" + "typescript": "4.8.3" }, "dependencies": { "@cosmjs/launchpad": "0.27.1", "@cosmos-client/core": "0.47.1", "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", "@thorchain/ledger-thorchain": "0.1.0-alpha.2", "@xdefi-tech/chains-core": "*", "axios": "1.4.0", "bech32": "2.0.0", "bech32-buffer": "0.2.1", "bignumber.js": "9.1.2", - "bip32": "2.0.4", - "bip39": "3.1.0", "crypto-browserify": "3.12.0", "lodash": "4.17.21", "long": "5.2.3", diff --git a/packages/thor/src/signers/seed-phrase.signer.ts b/packages/thor/src/signers/seed-phrase.signer.ts index 45ad3aa4..4378a213 100644 --- a/packages/thor/src/signers/seed-phrase.signer.ts +++ b/packages/thor/src/signers/seed-phrase.signer.ts @@ -1,7 +1,8 @@ import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import cosmosclient from '@cosmos-client/core'; -import * as bip39 from 'bip39'; -import * as bip32 from 'bip32'; +import * as bip39 from '@scure/bip39'; +import { wordlist as bip39WordList } from '@scure/bip39/wordlists/english'; +import * as bip32 from '@scure/bip32'; import Long from 'long'; import { Secp256k1HdWallet } from '@cosmjs/launchpad'; import { @@ -21,12 +22,12 @@ export class SeedPhraseSigner extends Signer.Provider { async getCosmosPrivateKey( derivation: string ): Promise { - if (!bip39.validateMnemonic(this.key)) { + if (!bip39.validateMnemonic(this.key, bip39WordList)) { throw new Error('Invalid phrase'); } const seed = await bip39.mnemonicToSeed(this.key); - const node = bip32.fromSeed(seed); - const child = node.derivePath(derivation); + const node = bip32.HDKey.fromMasterSeed(seed); + const child = node.derive(derivation); if (!child.privateKey) { throw new Error('Invalid child'); diff --git a/packages/thor/tsup.config.cjs b/packages/thor/tsup.config.cjs index f9b62316..a6a5f1bb 100644 --- a/packages/thor/tsup.config.cjs +++ b/packages/thor/tsup.config.cjs @@ -20,7 +20,7 @@ module.exports = { ], platform: 'browser', target: 'ES6', - external: ['crypto', 'bip32'], + external: ['crypto', '@scure/bip32'], plugins: [NodeModulesPolyfillPlugin()], }, }; diff --git a/yarn.lock b/yarn.lock index d368169d..572afe53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5047,6 +5047,13 @@ dependencies: "@noble/hashes" "1.5.0" +"@noble/curves@~1.4.0": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" + integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/hashes@1.3.2": version "1.3.2" resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz" @@ -5552,6 +5559,11 @@ resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.5.tgz" integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== +"@scure/base@~1.1.6": + version "1.1.7" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.7.tgz#fe973311a5c6267846aa131bc72e96c5d40d2b30" + integrity sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g== + "@scure/bip32@1.3.3": version "1.3.3" resolved "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.3.tgz" @@ -5561,6 +5573,15 @@ "@noble/hashes" "~1.3.2" "@scure/base" "~1.1.4" +"@scure/bip32@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.4.0.tgz#4e1f1e196abedcef395b33b9674a042524e20d67" + integrity sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg== + dependencies: + "@noble/curves" "~1.4.0" + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + "@scure/bip39@1.2.2": version "1.2.2" resolved "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.2.tgz" @@ -5569,6 +5590,14 @@ "@noble/hashes" "~1.3.2" "@scure/base" "~1.1.4" +"@scure/bip39@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.3.0.tgz#0f258c16823ddd00739461ac31398b4e7d6a18c3" + integrity sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ== + dependencies: + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + "@scure/btc-signer@1.2.1": version "1.2.1" resolved "https://registry.npmjs.org/@scure/btc-signer/-/btc-signer-1.2.1.tgz" @@ -8105,19 +8134,6 @@ bip32-path@^0.4.2: resolved "https://registry.npmjs.org/bip32-path/-/bip32-path-0.4.2.tgz" integrity sha512-ZBMCELjJfcNMkz5bDuJ1WrYvjlhEF5k6mQ8vUr4N7MbVRsXei7ZOg8VhhwMfNiW68NWmLkgkc6WvTickrLGprQ== -bip32@2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/bip32/-/bip32-2.0.4.tgz" - integrity sha512-ioPytarPDIrWckWMuK4RNUtvwhvWEc2fvuhnO0WEwu732k5OLjUXv4rXi2c/KJHw9ZMNQMkYRJrBw81RujShGQ== - dependencies: - "@types/node" "10.12.18" - bs58check "^2.1.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - tiny-secp256k1 "^1.1.0" - typeforce "^1.11.5" - wif "^2.0.6" - bip32@^2.0.4, bip32@^2.0.5, bip32@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/bip32/-/bip32-2.0.6.tgz" @@ -8131,7 +8147,7 @@ bip32@^2.0.4, bip32@^2.0.5, bip32@^2.0.6: typeforce "^1.11.5" wif "^2.0.6" -bip39@3.1.0, bip39@^3.0.2, bip39@^3.0.3, bip39@^3.0.4: +bip39@^3.0.2, bip39@^3.0.3, bip39@^3.0.4: version "3.1.0" resolved "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz" integrity sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A== @@ -8958,9 +8974,9 @@ code-point-at@^1.0.0: resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== -coininfo@5.2.1: +coininfo@5.2.1, coininfo@^5.2.1: version "5.2.1" - resolved "https://registry.npmjs.org/coininfo/-/coininfo-5.2.1.tgz" + resolved "https://registry.yarnpkg.com/coininfo/-/coininfo-5.2.1.tgz#15c2526fe31fa616095538a0a63fa5d8760dbf99" integrity sha512-mqSQIhAMgeiySzS0Ei33qno0oN/JQt9X3I6J1zx4eIYUnObGPuoLOrpssoqU84ZQoIpJGt3mQdEd2dL3sZJADw== dependencies: safe-buffer "^5.1.1" @@ -17647,7 +17663,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17665,6 +17681,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -17766,7 +17791,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17787,6 +17812,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -18172,7 +18204,7 @@ through@2, "through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8: resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -tiny-secp256k1@1.1.6, tiny-secp256k1@^1.1.0, tiny-secp256k1@^1.1.1, tiny-secp256k1@^1.1.3, tiny-secp256k1@^1.1.6: +tiny-secp256k1@1.1.6, tiny-secp256k1@^1.1.1, tiny-secp256k1@^1.1.3, tiny-secp256k1@^1.1.6: version "1.1.6" resolved "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz" integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== @@ -19494,7 +19526,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -19512,6 +19544,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From 54c5e623f43df07fcf194038dddaeb9e900bfa69 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 22 Aug 2024 13:33:25 +0000 Subject: [PATCH 118/176] Version packages --- .changeset/chatty-pears-thank.md | 10 ---------- packages/bitcoin/CHANGELOG.md | 6 ++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 6 ++++++ packages/bitcoincash/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 6 ++++++ packages/dogecoin/package.json | 2 +- packages/litecoin/CHANGELOG.md | 6 ++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 6 ++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 13 files changed, 42 insertions(+), 16 deletions(-) delete mode 100644 .changeset/chatty-pears-thank.md diff --git a/.changeset/chatty-pears-thank.md b/.changeset/chatty-pears-thank.md deleted file mode 100644 index baa7c26b..00000000 --- a/.changeset/chatty-pears-thank.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': minor -'@xdefi-tech/chains-dogecoin': minor -'@xdefi-tech/chains-litecoin': minor -'@xdefi-tech/chains-bitcoin': minor -'@xdefi-tech/chains-solana': minor -'@xdefi-tech/chains-thor': minor ---- - -Switched to scure bip32/bip39 diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index f7fe2442..b32688fe 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-bitcoin +## 2.1.0 + +### Minor Changes + +- 9121608c: Switched to scure bip32/bip39 + ## 2.0.28 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 10cee4c4..30cd5e48 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.0.28", + "version": "2.1.0", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 45e85bec..9e1183c9 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-bitcoincash +## 2.1.0 + +### Minor Changes + +- 9121608c: Switched to scure bip32/bip39 + ## 2.0.28 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 069dba38..26909230 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.0.28", + "version": "2.1.0", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index cd4a232e..52dc06fb 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-dogecoin +## 2.1.0 + +### Minor Changes + +- 9121608c: Switched to scure bip32/bip39 + ## 2.0.26 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 206e64a9..c8cf66bc 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.0.26", + "version": "2.1.0", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 68c36e2a..051286cb 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-litecoin +## 2.1.0 + +### Minor Changes + +- 9121608c: Switched to scure bip32/bip39 + ## 2.0.24 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 0256d983..85e3f12f 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.0.24", + "version": "2.1.0", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 5cd6614d..d8a204ea 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-solana +## 2.1.0 + +### Minor Changes + +- 9121608c: Switched to scure bip32/bip39 + ## 2.0.28 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 2b654ff8..1c9cf44a 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.0.28", + "version": "2.1.0", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 66407f79..8bf2707a 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.1.0 + +### Minor Changes + +- 9121608c: Switched to scure bip32/bip39 + ## 2.0.30 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 271ba21e..f3ac33de 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.0.30", + "version": "2.1.0", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From da48d30423e43e621fb9a1b048ca8bc1fcacd2f3 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:21:13 +0700 Subject: [PATCH 119/176] fix: send on solana for secondary token to new accounts (#324) * fix: send on solana for secondary token to new accounts * bump: version --------- Co-authored-by: sotatek-tyler-nguyen4 Co-authored-by: danilxdefi --- .changeset/curly-onions-scream.md | 5 ++ packages/solana/src/msg.spec.ts | 103 ++++++++++-------------------- packages/solana/src/msg.ts | 15 ++++- 3 files changed, 53 insertions(+), 70 deletions(-) create mode 100644 .changeset/curly-onions-scream.md diff --git a/.changeset/curly-onions-scream.md b/.changeset/curly-onions-scream.md new file mode 100644 index 00000000..a6bb0f98 --- /dev/null +++ b/.changeset/curly-onions-scream.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-solana': patch +--- + +fix: send on solana for secondary token to new accounts diff --git a/packages/solana/src/msg.spec.ts b/packages/solana/src/msg.spec.ts index 25e5ff42..cd683cef 100644 --- a/packages/solana/src/msg.spec.ts +++ b/packages/solana/src/msg.spec.ts @@ -1,26 +1,19 @@ import { MsgEncoding, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import { - getMint, - getAssociatedTokenAddress, - createTransferInstruction, TOKEN_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, } from '@solana/spl-token'; import { LAMPORTS_PER_SOL, PublicKey, - TransactionInstruction, + Transaction as SolanaTransaction, } from '@solana/web3.js'; import { ChainMsg } from './msg'; - -// Mock dependencies -jest.mock('@solana/spl-token', () => ({ - ...jest.requireActual('@solana/spl-token'), - getMint: jest.fn(), - getAssociatedTokenAddress: jest.fn(), - createTransferInstruction: jest.fn(), -})); +import { SolanaProvider } from './chain.provider'; +import { IndexerDataSource } from './datasource'; +import { SOLANA_MANIFEST } from './manifests'; describe('msg', () => { let mockProvider: any; @@ -111,63 +104,6 @@ describe('msg', () => { expect(txBody.gasPrice).toBe(5000); }); - it('buildTx with non-native token', async () => { - const chainMsg = new ChainMsg( - { - from: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', - to: 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5', - amount: 0.000001, - contractAddress: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263', // BONK - }, - mockProvider, - MsgEncoding.object - ); - - const decimals = 8; - const value = new BigNumber('0.000001') - .multipliedBy(10 ** decimals) - .toNumber(); - - (getMint as jest.Mock).mockResolvedValue({ decimals }); - const fromTokenAcc = new PublicKey( - 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU6' - ); - const toTokenAcc = new PublicKey( - 'C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU6' - ); - - (getAssociatedTokenAddress as jest.Mock).mockResolvedValueOnce( - fromTokenAcc - ); - (getAssociatedTokenAddress as jest.Mock).mockResolvedValueOnce(toTokenAcc); - - const mockInstruction = new TransactionInstruction({ - keys: [ - { pubkey: fromTokenAcc, isSigner: false, isWritable: true }, - { pubkey: toTokenAcc, isSigner: false, isWritable: true }, - { - pubkey: new PublicKey('C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5'), - isSigner: true, - isWritable: false, - }, - ], - programId: TOKEN_PROGRAM_ID, - data: Buffer.from([]), - }); - - (createTransferInstruction as jest.Mock).mockReturnValue(mockInstruction); - - const txBody = await chainMsg.buildTx(); - expect(txBody.value).toBe(value); - expect(txBody.to).toBe('C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5'); - expect(txBody.from).toBe('C2J2ZbD3E41B6ZwufDcsbTHFrLhAoN6bHTBZjWd5DiU5'); - expect(txBody.gasPrice).toBe(5000); - expect(txBody.decimals).toBe(decimals); - expect(txBody.programId).toEqual(TOKEN_PROGRAM_ID); - expect(txBody.toTokenAddress).toBe(toTokenAcc.toBase58()); - expect(txBody.fromTokenAddress).toBe(fromTokenAcc.toBase58()); - }); - it('getFee should return fee estimation', async () => { const chainMsg = new ChainMsg( { @@ -248,4 +184,33 @@ describe('msg', () => { expect(response).toEqual(new BigNumber('1000').minus(gap).toString()); }); + + it('Should create associated token account instruction when sending secondary token to new account', async () => { + const provider = new SolanaProvider(new IndexerDataSource(SOLANA_MANIFEST)); + const msg = provider.createMsg({ + from: '5UghpDRDYPger6vqVCrvvvRQsg3NZ5CNzJWfPyKTZpf2', + to: 'EwSJ1V4zGUbJBbURwBViezwEo8Ei8UkSDigg9dvBmQXk', + contractAddress: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', + amount: '0.0001', + }); + const builtMsg = await msg.buildTx(); + const tx = builtMsg.tx as SolanaTransaction; + expect(tx.instructions.length).toBe(2); + expect(tx.instructions[0].programId).toBe(ASSOCIATED_TOKEN_PROGRAM_ID); + expect(tx.instructions[1].programId).toBe(TOKEN_PROGRAM_ID); + }); + + it('Should not create associated token account instruction when sending secondary token to account containing token', async () => { + const provider = new SolanaProvider(new IndexerDataSource(SOLANA_MANIFEST)); + const msg = provider.createMsg({ + from: '5UghpDRDYPger6vqVCrvvvRQsg3NZ5CNzJWfPyKTZpf2', + to: 'EwSJ1V4zGUbJBbURwBViezwEo8Ei8UkSDigg9dvBmQXk', + contractAddress: 'Hg675ypQpBUwP3wiWjq8pFQxr6rjnT2QRH4Vi519jdiP', + amount: '0.0001', + }); + const builtMsg = await msg.buildTx(); + const tx = builtMsg.tx as SolanaTransaction; + expect(tx.instructions.length).toBe(1); + expect(tx.instructions[0].programId).toBe(TOKEN_PROGRAM_ID); + }); }); diff --git a/packages/solana/src/msg.ts b/packages/solana/src/msg.ts index bdb19de0..920af4ea 100644 --- a/packages/solana/src/msg.ts +++ b/packages/solana/src/msg.ts @@ -17,7 +17,9 @@ import { VersionedTransaction, } from '@solana/web3.js'; import { + createAssociatedTokenAccountInstruction, createTransferInstruction, + getAccount, getAssociatedTokenAddress, getMint, TOKEN_PROGRAM_ID, @@ -117,7 +119,6 @@ export class ChainMsg extends BasMsg { let instruction; if (msgData.contractAddress) { const mintPublicKey = new PublicKey(msgData.contractAddress); - const mint = await getMint( this.provider.rpcProvider, mintPublicKey, @@ -132,6 +133,18 @@ export class ChainMsg extends BasMsg { getAssociatedTokenAddress(mint.address, senderPublicKey), getAssociatedTokenAddress(mint.address, recipientPublicKey), ]); + try { + await getAccount(this.provider.rpcProvider, toTokenAcc); + } catch (error) { + transaction.add( + createAssociatedTokenAccountInstruction( + senderPublicKey, + toTokenAcc, + recipientPublicKey, + mint.address + ) + ); + } contractInfo.contractAddress = msgData.contractAddress; contractInfo.toTokenAddress = toTokenAcc.toBase58(); contractInfo.fromTokenAddress = fromTokenAcc.toBase58(); From e9726c7e44444a05a36b81e6d339f917a2e02aef Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 23 Aug 2024 10:23:38 +0000 Subject: [PATCH 120/176] Version packages --- .changeset/curly-onions-scream.md | 5 ----- packages/solana/CHANGELOG.md | 6 ++++++ packages/solana/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/curly-onions-scream.md diff --git a/.changeset/curly-onions-scream.md b/.changeset/curly-onions-scream.md deleted file mode 100644 index a6bb0f98..00000000 --- a/.changeset/curly-onions-scream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-solana': patch ---- - -fix: send on solana for secondary token to new accounts diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index d8a204ea..7ac640e4 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-solana +## 2.1.1 + +### Patch Changes + +- 5fc3fd95: fix: send on solana for secondary token to new accounts + ## 2.1.0 ### Minor Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 1c9cf44a..42ed3865 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.1.0", + "version": "2.1.1", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From c3df3eb136f5563eebf14d1b682a704e19ad5bbe Mon Sep 17 00:00:00 2001 From: Amin Limbada Date: Fri, 23 Aug 2024 14:33:02 +0400 Subject: [PATCH 121/176] fix: trezor signing for EVM (#327) --- .changeset/thin-flowers-chew.md | 5 +++++ packages/evm/src/signers/trezor.signer.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/thin-flowers-chew.md diff --git a/.changeset/thin-flowers-chew.md b/.changeset/thin-flowers-chew.md new file mode 100644 index 00000000..6d9e8414 --- /dev/null +++ b/.changeset/thin-flowers-chew.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +fix: hex odd length error for trezor signing diff --git a/packages/evm/src/signers/trezor.signer.ts b/packages/evm/src/signers/trezor.signer.ts index 33682892..c8fec761 100644 --- a/packages/evm/src/signers/trezor.signer.ts +++ b/packages/evm/src/signers/trezor.signer.ts @@ -43,7 +43,7 @@ export class TrezorSigner extends Signer.TrezorProvider { chainId: parseInt(txData.chainId), nonce: txData.nonce, gasLimit: txData.gasLimit, - value: txData.value, + value: txData.value === '0x0' ? '0x00' : txData.value, gasPrice: txData.gasPrice, data: txData.data, }; @@ -53,7 +53,7 @@ export class TrezorSigner extends Signer.TrezorProvider { chainId: parseInt(txData.chainId), nonce: txData.nonce, gasLimit: txData.gasLimit, - value: txData.value, + value: txData.value === '0x0' ? '0x00' : txData.value, maxFeePerGas: txData.maxFeePerGas, maxPriorityFeePerGas: txData.maxPriorityFeePerGas, data: txData.data, From b7ab2ac8f3c8de6229f7843771287bbeaed188cd Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 23 Aug 2024 10:35:25 +0000 Subject: [PATCH 122/176] Version packages --- .changeset/thin-flowers-chew.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/thin-flowers-chew.md diff --git a/.changeset/thin-flowers-chew.md b/.changeset/thin-flowers-chew.md deleted file mode 100644 index 6d9e8414..00000000 --- a/.changeset/thin-flowers-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -fix: hex odd length error for trezor signing diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index dd725d0b..a681a433 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.45 + +### Patch Changes + +- 1d2bf619: fix: hex odd length error for trezor signing + ## 2.0.44 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index ed03a5f9..83ac45e7 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.44", + "version": "2.0.45", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From fc2e02323e16f05289c02da803fffa50f45b988a Mon Sep 17 00:00:00 2001 From: Amin Limbada Date: Fri, 23 Aug 2024 18:05:34 +0400 Subject: [PATCH 123/176] fix: remove 'm/' prefix from derivation in LedgerSigner for Tron and Thor (#328) --- .changeset/gorgeous-items-cross.md | 6 ++++++ packages/thor/src/signers/ledger.signer.ts | 1 + packages/tron/src/signers/ledger.signer.ts | 12 ++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .changeset/gorgeous-items-cross.md diff --git a/.changeset/gorgeous-items-cross.md b/.changeset/gorgeous-items-cross.md new file mode 100644 index 00000000..6196c696 --- /dev/null +++ b/.changeset/gorgeous-items-cross.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +--- + +fix: remove 'm/' prefix from derivation in LedgerSigner for Tron and Thor diff --git a/packages/thor/src/signers/ledger.signer.ts b/packages/thor/src/signers/ledger.signer.ts index f64f497a..e84b4094 100644 --- a/packages/thor/src/signers/ledger.signer.ts +++ b/packages/thor/src/signers/ledger.signer.ts @@ -35,6 +35,7 @@ export class LedgerSigner extends Signer.Provider { await msg.buildTx(); if (txBody) { const derivationArray = derivation + .replace('m/', '') .replace(/'/g, '') .split('/') .map(Number); diff --git a/packages/tron/src/signers/ledger.signer.ts b/packages/tron/src/signers/ledger.signer.ts index ade25d4d..98de68b9 100644 --- a/packages/tron/src/signers/ledger.signer.ts +++ b/packages/tron/src/signers/ledger.signer.ts @@ -15,7 +15,7 @@ export class LedgerSigner extends Signer.Provider { async getAddress(derivation: string): Promise { const trx = new Trx(this.transport as Transport); - const address = await trx.getAddress(derivation); + const address = await trx.getAddress(derivation.replace('m/', '')); return address.address; } @@ -24,7 +24,11 @@ export class LedgerSigner extends Signer.Provider { const trx = new Trx(this.transport as Transport); const tx = await msg.buildTx(); - const signedTx = await trx.signTransaction(derivation, tx.raw_data_hex, []); + const signedTx = await trx.signTransaction( + derivation.replace('m/', ''), + tx.raw_data_hex, + [] + ); tx.signature = [signedTx]; @@ -38,7 +42,7 @@ export class LedgerSigner extends Signer.Provider { async signMessageV2(message: string, derivation: string) { const trx = new Trx(this.transport as Transport); const signature = await trx.signPersonalMessage( - derivation, + derivation.replace('m/', ''), Buffer.from(message).toString('hex') ); @@ -52,7 +56,7 @@ export class LedgerSigner extends Signer.Provider { ) { const trx = new Trx(this.transport as Transport); const signature = await trx.signTransaction( - derivation, + derivation.replace('m/', ''), txHex, tokenSignature ); From 10e736a8843827954bc6a48b933fc61cf5edda81 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 23 Aug 2024 14:08:04 +0000 Subject: [PATCH 124/176] Version packages --- .changeset/gorgeous-items-cross.md | 6 ------ packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 6 ++++++ packages/tron/package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 .changeset/gorgeous-items-cross.md diff --git a/.changeset/gorgeous-items-cross.md b/.changeset/gorgeous-items-cross.md deleted file mode 100644 index 6196c696..00000000 --- a/.changeset/gorgeous-items-cross.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch ---- - -fix: remove 'm/' prefix from derivation in LedgerSigner for Tron and Thor diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 8bf2707a..e052b57e 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.1.1 + +### Patch Changes + +- 75fc2fee: fix: remove 'm/' prefix from derivation in LedgerSigner for Tron and Thor + ## 2.1.0 ### Minor Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index f3ac33de..ca19c17c 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.1.0", + "version": "2.1.1", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index ea78c319..28f2eb42 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-tron +## 2.0.32 + +### Patch Changes + +- 75fc2fee: fix: remove 'm/' prefix from derivation in LedgerSigner for Tron and Thor + ## 2.0.31 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 25045c64..a8cfa80f 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.31", + "version": "2.0.32", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From a1006c2a2110bfb323e587b83f0547fc733ca6a9 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:23:29 +0100 Subject: [PATCH 125/176] fix: sign to encode for dapps (#329) * fix: sign to encode for dapps * chore: remove verify sig on sol broadcast as the old sig number could make it fail * fdsfsd * chore: bump --- .changeset/three-parents-suffer.md | 5 +++ packages/solana/src/chain.provider.ts | 16 ++++++++-- packages/solana/src/msg.ts | 3 +- .../solana/src/signers/ledger.signer.spec.ts | 4 +-- packages/solana/src/signers/ledger.signer.ts | 9 ++++-- .../src/signers/private-key.signer.spec.ts | 8 ++--- .../solana/src/signers/private-key.signer.ts | 13 +++++++- .../src/signers/seed-phrase.signer.spec.ts | 16 +++++----- .../solana/src/signers/seed-phrase.signer.ts | 13 +++++++- yarn.lock | 31 ++----------------- 10 files changed, 69 insertions(+), 49 deletions(-) create mode 100644 .changeset/three-parents-suffer.md diff --git a/.changeset/three-parents-suffer.md b/.changeset/three-parents-suffer.md new file mode 100644 index 00000000..1e42a6ce --- /dev/null +++ b/.changeset/three-parents-suffer.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-solana': patch +--- + +fix solana signing diff --git a/packages/solana/src/chain.provider.ts b/packages/solana/src/chain.provider.ts index d72387e3..72264b54 100644 --- a/packages/solana/src/chain.provider.ts +++ b/packages/solana/src/chain.provider.ts @@ -15,8 +15,13 @@ import { TransactionData, TransactionStatus, } from '@xdefi-tech/chains-core'; -import { Connection, PublicKey } from '@solana/web3.js'; +import { + Connection, + PublicKey, + Transaction as SolanaTransaction, +} from '@solana/web3.js'; import { some } from 'lodash'; +import bs58 from 'bs58'; import { IndexerDataSource } from './datasource'; import { ChainMsg } from './msg'; @@ -81,8 +86,15 @@ export class SolanaProvider extends Chain.Provider { const transactions: Transaction[] = []; for (const msg of msgs) { + const { tx: _tx } = await msg.buildTx(); + const pubKey = new PublicKey(msg.signedTransaction.pubKey); + const base58Sig = bs58.decode(msg.signedTransaction.sig); + const buffer = Buffer.from(base58Sig); + const tx = _tx as SolanaTransaction; + tx.addSignature(pubKey, buffer); + const serializeTx = tx.serialize({ verifySignatures: false }); const hash = await this.rpcProvider.sendRawTransaction( - msg.signedTransaction, + Buffer.from(serializeTx), { skipPreflight: true, maxRetries: 2, diff --git a/packages/solana/src/msg.ts b/packages/solana/src/msg.ts index 920af4ea..62cd1ba9 100644 --- a/packages/solana/src/msg.ts +++ b/packages/solana/src/msg.ts @@ -28,6 +28,7 @@ import bs58 from 'bs58'; import type { SolanaProvider } from './chain.provider'; import { DEFAULT_FEE } from './constants'; +import { SolanaSignature } from './types'; export interface MsgBody { amount: NumberIsh; @@ -64,7 +65,7 @@ export enum TransactionType { } export class ChainMsg extends BasMsg { - declare signedTransaction: Buffer; + declare signedTransaction: SolanaSignature; declare provider: SolanaProvider; constructor(data: MsgBody, provider: SolanaProvider, encoding: MsgEncoding) { diff --git a/packages/solana/src/signers/ledger.signer.spec.ts b/packages/solana/src/signers/ledger.signer.spec.ts index 89a32b70..7ecdb14d 100644 --- a/packages/solana/src/signers/ledger.signer.spec.ts +++ b/packages/solana/src/signers/ledger.signer.spec.ts @@ -73,8 +73,8 @@ describe('ledger.signer', () => { await signer.sign(message, "44'/501'/0'"); - expect(message.signedTransaction.toString('hex')).toBe( - '016132ba1ca152cf3fdf70bc76ac49f3c0fe7468f24e7d051ba11ebf2b8c4e30a14c97623fa089924f9320026cabfc412f242bc0db8e405d9c7ea6e608f8d4120a0100010316821af3d7d203354d558ce9f6828ce040fe388541c1b7cdadc9dcd03bda42fba216d8118c45c50f08f511fcbffa02d9e23f670c8765b135be2d58ef49bb95990000000000000000000000000000000000000000000000000000000000000000de371d4c7efe41c73e69650c01ee6f845716e0578dcbb8cc6760f31cfab73d0d01020200010c020000008096980000000000' + expect(message.signedTransaction.sig).toBe( + '2wiGcgsNdq2qHMHrLpsjf7PJz9PqndHSE6kCyZjMTo45ZzhmT95GLXYLWmsCT6mF8vGubdBdUnsL9yfHNuH8HNfB' ); }); diff --git a/packages/solana/src/signers/ledger.signer.ts b/packages/solana/src/signers/ledger.signer.ts index 2528fa06..e70415b1 100644 --- a/packages/solana/src/signers/ledger.signer.ts +++ b/packages/solana/src/signers/ledger.signer.ts @@ -6,6 +6,7 @@ import { } from '@solana/web3.js'; import Transport from '@ledgerhq/hw-transport'; import { MsgEncoding, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; +import bs58 from 'bs58'; import { ChainMsg } from '../msg'; @@ -54,9 +55,13 @@ export class LedgerSigner extends Signer.Provider { } const addressBuffer = await app.getAddress(derivation); - tx.addSignature(new PublicKey(addressBuffer.address), signedTx.signature); + const pubKey = new PublicKey(addressBuffer.address); + const signature = bs58.encode(signedTx.signature); - msg.sign(tx.serialize()); + msg.sign({ + pubKey, + sig: signature, + }); } } diff --git a/packages/solana/src/signers/private-key.signer.spec.ts b/packages/solana/src/signers/private-key.signer.spec.ts index 057b9d22..65679fd4 100644 --- a/packages/solana/src/signers/private-key.signer.spec.ts +++ b/packages/solana/src/signers/private-key.signer.spec.ts @@ -49,8 +49,8 @@ describe('private-key.signer', () => { }); await signer.sign(message); - expect(message.signedTransaction.toString('hex')).toBe( - '01cddbcf18f06a7d75dd6da254bf1c8169bae2446fce1c55fca85930e11b29ea6e4968335156697f6662d4768ba27102384c1be5a95dcc818a3e478387f3bc620b01000203a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000084411db3e89763453608d1096cf16877aac2dba6a0a73d094d32aba4540031f602020009031027000000000000010200000c02000000e803000000000000' + expect(message.signedTransaction.sig).toBe( + '57iTmcMGXr4oM34uhaAmxiUqhxkFRLu7pSaXgxtLuNmo3w76nRDWL9voW2Dmk8c8UqNEbVYnAWXoSHrRh7WgX3EJ' ); }); @@ -64,8 +64,8 @@ describe('private-key.signer', () => { ); await signer.sign(message); - expect(message.signedTransaction.toString('hex')).toBe( - '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' + expect(message.signedTransaction.sig).toBe( + '4CtKVtgpCE4HfDkaWs74L3ZCbVCHzy2Qwy4pzjRoXEX4TYhZQCfNiWoSEdiJtfYg2g9aK5YvYpEe1229tLW3HMYt' ); }); diff --git a/packages/solana/src/signers/private-key.signer.ts b/packages/solana/src/signers/private-key.signer.ts index 883c4b46..71ec4428 100644 --- a/packages/solana/src/signers/private-key.signer.ts +++ b/packages/solana/src/signers/private-key.signer.ts @@ -44,8 +44,19 @@ export class PrivateKeySigner extends Signer.Provider { if (!serializedTx) { throw new Error('Failed to serialize transaction'); } + const pubKey = account.publicKey.toBase58(); + const signedTransaction = VersionedTransaction.deserialize(serializedTx); + const signatureIndex = + signedTransaction.message.staticAccountKeys.findIndex( + (pKey) => pKey.toBase58() === pubKey + ); - msg.sign(serializedTx); + const signature = bs58.encode(signedTransaction.signatures[signatureIndex]); + + msg.sign({ + pubKey, + sig: signature, + }); } async signMessage(msg: ChainMsg): Promise { diff --git a/packages/solana/src/signers/seed-phrase.signer.spec.ts b/packages/solana/src/signers/seed-phrase.signer.spec.ts index 69ccb4a5..b09026a5 100644 --- a/packages/solana/src/signers/seed-phrase.signer.spec.ts +++ b/packages/solana/src/signers/seed-phrase.signer.spec.ts @@ -54,8 +54,8 @@ describe('seed-phrase.signer', () => { }); await signer.sign(message, derivation); - expect(message.signedTransaction.toString('hex')).toBe( - '01cddbcf18f06a7d75dd6da254bf1c8169bae2446fce1c55fca85930e11b29ea6e4968335156697f6662d4768ba27102384c1be5a95dcc818a3e478387f3bc620b01000203a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000084411db3e89763453608d1096cf16877aac2dba6a0a73d094d32aba4540031f602020009031027000000000000010200000c02000000e803000000000000' + expect(message.signedTransaction.sig).toBe( + '57iTmcMGXr4oM34uhaAmxiUqhxkFRLu7pSaXgxtLuNmo3w76nRDWL9voW2Dmk8c8UqNEbVYnAWXoSHrRh7WgX3EJ' ); }); @@ -69,8 +69,8 @@ describe('seed-phrase.signer', () => { ); await signer.sign(message, derivation); - expect(message.signedTransaction.toString('hex')).toBe( - '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' + expect(message.signedTransaction.sig).toBe( + '4CtKVtgpCE4HfDkaWs74L3ZCbVCHzy2Qwy4pzjRoXEX4TYhZQCfNiWoSEdiJtfYg2g9aK5YvYpEe1229tLW3HMYt' ); }); @@ -83,8 +83,8 @@ describe('seed-phrase.signer', () => { ); await signer.sign(message, derivation); - expect(message.signedTransaction.toString('hex')).toBe( - '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' + expect(message.signedTransaction.sig).toBe( + '4CtKVtgpCE4HfDkaWs74L3ZCbVCHzy2Qwy4pzjRoXEX4TYhZQCfNiWoSEdiJtfYg2g9aK5YvYpEe1229tLW3HMYt' ); }); @@ -97,8 +97,8 @@ describe('seed-phrase.signer', () => { ); await signer.sign(message, derivation); - expect(message.signedTransaction.toString('hex')).toBe( - '01a04ccd06ebc893b53138ebf6f059fc51ec892fa00d19dff2ac9d2a4bdc3bc59bc8436f794cc40642e12f9e6a84dc1a4a9ac6129fff8653444e6647f5ce43c2098001000812a3c563b0519a293f7323680e09a6a3b4bb9a451ed3eaaf7067cc38505563f3c60b48074f75b8ea3069c9ed3f06bc3219782ae4cd8e5c9d37498256b1984b9d5018a2cd01b2b0b7ee35655ff567e50f4ac4bb9636b0c474d4fd284e174b9fce2130a468e848c4f9b291e2cb2ccab31dda41a9074b9b3e8c50de3c1158edcbb85d32776280c1836dede84e3fa3b677dc81f171c47a9c6c3a0f0732449b22d5ba9f58ef677fb5635e6473724b70e16b640554034ea47a1c7b3fcd88853c415d3254915b51f1d83bec26a647d060cd7a9153b7ff0d2fd92802994662afb5b657ff76a71be6a25624e805320ca11bc6216b6d2ba4eb24be47af89633cb14d215ba50ec447da5ba40f8db962bfde8cde608f6a5b5fc323bc27003a9e8fa55714892ac0d492308d761e7843e34782b9ef0cc9be058e640652c32c37b6b793f80c79fc3900000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000000479d55bf231c06eee74c56ece681507fdb1b2dea3f48e5102b1cda256bc138f06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a93ab8903fb735cab1c67c59af4857edf61b0af832a50a7c59e321919e0ec8a9bc8c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8599d3db5bc480d04eeb544586fd26ab3d7f318e1f238b1410aa9551c58c2aaeec1b43ffa27f5d7f64a74c09b1f295879de4b09ab36dfc9dd514b321aa7b38ce5e812e081ba75a2cb7b6c45e71956320fff9efc9038188b6159489f622218a39f76080b000502c05c15000b00090304170100000000000f06000600260a0d01010a0200060c0200000040420f00000000000d010601110f06000800100a0d01010c3b0d0e000605020826100c0c110c240e231505011612140d031307040c2519251a170109292a1b250e0d0d2825181c0c270d0e22021d09201e211f2b2dc1209b3341d69c8104030000001a64000126640102110064020340420f0000000000383a4103000000002c01000d030600000109037afad01452803db10e4f653b05a83b9c1d4f34035c2ca8ca85416113565c15770581797e807f027b7ae81bfe457af55bcc131f155f35f0040e763dba745fd61860e28a664b88d33b1a06bfeac4e8e7c3062d1f0632c2c037b16ad8e9677679a7af719edc613890f031e4eb75fbac9779aa0c4232e90198068081797e7f78017c' + expect(message.signedTransaction.sig).toBe( + '4CtKVtgpCE4HfDkaWs74L3ZCbVCHzy2Qwy4pzjRoXEX4TYhZQCfNiWoSEdiJtfYg2g9aK5YvYpEe1229tLW3HMYt' ); }); diff --git a/packages/solana/src/signers/seed-phrase.signer.ts b/packages/solana/src/signers/seed-phrase.signer.ts index 5bbddf36..f077608b 100644 --- a/packages/solana/src/signers/seed-phrase.signer.ts +++ b/packages/solana/src/signers/seed-phrase.signer.ts @@ -57,8 +57,19 @@ export class SeedPhraseSigner extends Signer.Provider { if (!serializedTx) { throw new Error('Failed to serialize transaction'); } + const pubKey = account.publicKey.toBase58(); + const signedTransaction = VersionedTransaction.deserialize(serializedTx); + const signatureIndex = + signedTransaction.message.staticAccountKeys.findIndex( + (pKey) => pKey.toBase58() === pubKey + ); - msg.sign(serializedTx); + const signature = bs58.encode(signedTransaction.signatures[signatureIndex]); + + msg.sign({ + pubKey, + sig: signature, + }); } async signMessage( diff --git a/yarn.lock b/yarn.lock index 572afe53..25c10ef6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17663,7 +17663,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17681,15 +17681,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -17791,7 +17782,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17812,13 +17803,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -19526,7 +19510,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -19544,15 +19528,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From 11b80d5b93115fb04f251342d7bc021f04cfc81a Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 26 Aug 2024 09:25:58 +0000 Subject: [PATCH 126/176] Version packages --- .changeset/three-parents-suffer.md | 5 ----- packages/solana/CHANGELOG.md | 6 ++++++ packages/solana/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/three-parents-suffer.md diff --git a/.changeset/three-parents-suffer.md b/.changeset/three-parents-suffer.md deleted file mode 100644 index 1e42a6ce..00000000 --- a/.changeset/three-parents-suffer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-solana': patch ---- - -fix solana signing diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 7ac640e4..38965db2 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-solana +## 2.1.2 + +### Patch Changes + +- f12c368f: fix solana signing + ## 2.1.1 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 42ed3865..115373c3 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.1.1", + "version": "2.1.2", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 7c7772158772ef974c00ee97649a9a672b34b01b Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:43:41 +0700 Subject: [PATCH 127/176] fix: logic to handle getAccount errors (#336) Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/friendly-nails-kick.md | 5 +++++ packages/solana/src/msg.ts | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 .changeset/friendly-nails-kick.md diff --git a/.changeset/friendly-nails-kick.md b/.changeset/friendly-nails-kick.md new file mode 100644 index 00000000..b63baa9e --- /dev/null +++ b/.changeset/friendly-nails-kick.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-solana': patch +--- + +fix: logic to handle getAccount errors diff --git a/packages/solana/src/msg.ts b/packages/solana/src/msg.ts index 62cd1ba9..07952ed1 100644 --- a/packages/solana/src/msg.ts +++ b/packages/solana/src/msg.ts @@ -23,6 +23,8 @@ import { getAssociatedTokenAddress, getMint, TOKEN_PROGRAM_ID, + TokenAccountNotFoundError, + TokenInvalidAccountOwnerError, } from '@solana/spl-token'; import bs58 from 'bs58'; @@ -137,14 +139,19 @@ export class ChainMsg extends BasMsg { try { await getAccount(this.provider.rpcProvider, toTokenAcc); } catch (error) { - transaction.add( - createAssociatedTokenAccountInstruction( - senderPublicKey, - toTokenAcc, - recipientPublicKey, - mint.address - ) - ); + if ( + error instanceof TokenAccountNotFoundError || + error instanceof TokenInvalidAccountOwnerError + ) { + transaction.add( + createAssociatedTokenAccountInstruction( + senderPublicKey, + toTokenAcc, + recipientPublicKey, + mint.address + ) + ); + } } contractInfo.contractAddress = msgData.contractAddress; contractInfo.toTokenAddress = toTokenAcc.toBase58(); From 2210e388deca46f9c23a79f9d1a50c6bf0588322 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:45:50 +0700 Subject: [PATCH 128/176] chore: Add documentation for afterBlock when using getBalance with RPCs that have a block limit (#323) Co-authored-by: sotatek-tyler-nguyen4 --- packages/evm/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/evm/README.md b/packages/evm/README.md index 8b1a29d9..e37115a6 100644 --- a/packages/evm/README.md +++ b/packages/evm/README.md @@ -81,6 +81,17 @@ const response = await provider.getBalance( ['0x0000000000000000000000000000000000000000'] // List token addresses ); const data = await response.getData(); + +// Fetcher balance with after block +// Some RPC providers have a limit on the number of blocks that can be fetched in a single request. +// In this case, you can use the afterBlock parameter to fetch the balance from a specific block number. +const afterBlock = + (await provider.rpcProvider.getBlockNumber()) - limitationBlock; +const response = await provider.getBalance( + '0x1234567890123456789012345678901234567890', + afterBlock // Default value is latest block number - 1000 +); +const data = await response.getData(); ``` ## Usage ethers provides From cbda4b570f248c0323aeffa4859158db005adac7 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 27 Aug 2024 09:48:18 +0000 Subject: [PATCH 129/176] Version packages --- .changeset/friendly-nails-kick.md | 5 ----- packages/solana/CHANGELOG.md | 6 ++++++ packages/solana/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/friendly-nails-kick.md diff --git a/.changeset/friendly-nails-kick.md b/.changeset/friendly-nails-kick.md deleted file mode 100644 index b63baa9e..00000000 --- a/.changeset/friendly-nails-kick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-solana': patch ---- - -fix: logic to handle getAccount errors diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 38965db2..8acd2746 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-solana +## 2.1.3 + +### Patch Changes + +- 4b849010: fix: logic to handle getAccount errors + ## 2.1.2 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 115373c3..d0faa8c1 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.1.2", + "version": "2.1.3", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From f049ff0472bd6d8d47b96b10f36a7a9f16974e79 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:00:36 +0700 Subject: [PATCH 130/176] chore: align fee estimation on ChainDatasource with IndexDatasource (#322) Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/polite-emus-juggle.md | 5 + packages/cosmos/src/chain.provider.spec.ts | 38 +++- .../src/datasource/chain/chain.data-source.ts | 205 ++++++++++++------ 3 files changed, 184 insertions(+), 64 deletions(-) create mode 100644 .changeset/polite-emus-juggle.md diff --git a/.changeset/polite-emus-juggle.md b/.changeset/polite-emus-juggle.md new file mode 100644 index 00000000..e4dd81ba --- /dev/null +++ b/.changeset/polite-emus-juggle.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +chore: align fee estimation on ChainDatasource with IndexDatasource diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index 8e7a12f2..c525b128 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -120,7 +120,7 @@ describe('chain.provider', () => { expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('-1'); }); - it('estimatFee() should return fee estimation with encoding string msg', async () => { + it('estimateFee() should return fee estimation with encoding string message using IndexerDataSource', async () => { const osmosisProvider = new CosmosProvider( new IndexerDataSource(COSMOS_MANIFESTS.osmosis) ); @@ -137,7 +137,41 @@ describe('chain.provider', () => { expect(estimateFee[0].gasLimit).toBeTruthy(); }); - it('estimateFee() should return fee estimation with encoding json msg', async () => { + it('estimateFee() should return fee estimation with encoding string message using ChainDataSource', async () => { + const osmosisProvider = new CosmosProvider( + new ChainDataSource(COSMOS_MANIFESTS.osmosis) + ); + const msg = osmosisProvider.createMsg( + { + data: '{"signDoc":{"accountNumber":"2551461","chainId":"osmosis-1","fee":{"gas":"318939","amount":[{"amount":"1196","denom":"uosmo"}]},"memo":"FE","msgs":[{"typeUrl":"/osmosis.gamm.v1beta1.MsgSwapExactAmountIn","value":{"routes":[{"poolId":"1400","tokenOutDenom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"}],"sender":"osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf","tokenIn":{"amount":"5000000","denom":"uosmo"},"tokenOutMinAmount":"370642"}}],"sequence":"6","timeoutHeight":"18897301"},"signer":"osmo1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn8ra5mf"}', + }, + MsgEncoding.string + ); + const estimateFee = await osmosisProvider.estimateFee( + [msg], + GasFeeSpeed.low + ); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); + + it('estimateFee() should return fee estimation with encoding json message using IndexerDataSource', async () => { + const provider = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); + const msg = provider.createMsg({ + from: 'cosmos1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn0cwydm', + to: 'cosmos1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn0cwydm', + amount: 0.000001, + }); + + const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.medium); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); + + it('estimateFee() should return fee estimation with encoding json message using ChainDataSource', async () => { + const provider = new CosmosProvider( + new ChainDataSource(COSMOS_MANIFESTS.osmosis) + ); const msg = provider.createMsg({ from: 'cosmos1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn0cwydm', to: 'cosmos1nvt0fx864yyuyjvpw7eh2uj5zudcfkcn0cwydm', diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 976c414a..68403cbc 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -37,6 +37,10 @@ import { CryptoAssetArgs } from '../../gql/graphql'; import * as manifests from '../../manifests'; import { ChainMsg } from '../../msg'; import { COSMOS_ADDRESS_CHAIN } from '../../manifests'; +import { MsgSwapExactAmountIn } from '../../proto_export/osmosis/gamm/v1beta1/tx'; +import { MsgSwapExactAmountIn as MsgSwapExactAmountInPoolManager } from '../../proto_export/osmosis/poolmanager/v1beta1/tx'; +import { MsgTransfer } from '../../proto_export/ibc/applications/transfer/v1/tx'; +import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; @Injectable() export class ChainDataSource extends DataSource { @@ -174,26 +178,8 @@ export class ChainDataSource extends DataSource { async estimateFee(msgs: ChainMsg[], speed: GasFeeSpeed): Promise { let fromAddress = ''; - const _msgs = msgs.map((m) => { - const messageData = m.toData(); - fromAddress = messageData.from; - return { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.encode({ - fromAddress: messageData.from, - toAddress: messageData.to, - amount: [ - { - denom: this.manifest.denom, - amount: String( - messageData.amount * Math.pow(10, this.manifest.decimals) - ), - }, - ], - }).finish(), - }; - }); - + const feeData: FeeData[] = []; + const gasFeeOptions = await this.gasFeeOptions(); const _feeAmount = msgs.map((m) => { const messageData = m.toData(); if (messageData.feeOptions) { @@ -212,53 +198,148 @@ export class ChainDataSource extends DataSource { }; }); - const account = await this.getAccount(fromAddress); - if (!account) { - return [ - { + for (let index = 0; index < msgs.length; index++) { + const m = msgs[index]; + const messageData = + m.encoding === 'string' ? await m.buildTx() : await m.toData(); + fromAddress = messageData.from; + const _msgs: any[] = []; + if (messageData.msgs?.length) { + messageData.msgs.map((msgTransfer: any) => { + if (msgTransfer.typeUrl === MsgTransfer.typeUrl) { + _msgs.push({ + typeUrl: MsgTransfer.typeUrl, + value: MsgTransfer.encode( + MsgTransfer.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if ( + msgTransfer.typeUrl === MsgSwapExactAmountInPoolManager.typeUrl + ) { + _msgs.push({ + typeUrl: MsgSwapExactAmountInPoolManager.typeUrl, + value: MsgSwapExactAmountInPoolManager.encode( + MsgSwapExactAmountInPoolManager.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl === MsgSwapExactAmountIn.typeUrl) { + _msgs.push({ + typeUrl: MsgSwapExactAmountIn.typeUrl, + value: MsgSwapExactAmountIn.encode( + MsgSwapExactAmountIn.fromPartial(msgTransfer.value) + ).finish(), + }); + } + }); + } else { + const msgsToSend = m.getMsgToSend(); + msgsToSend.map((msgTransfer: any) => { + if (msgTransfer.typeUrl === MsgTransfer.typeUrl) { + _msgs.push({ + typeUrl: MsgTransfer.typeUrl, + value: MsgTransfer.encode( + MsgTransfer.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if ( + msgTransfer.typeUrl === MsgSwapExactAmountInPoolManager.typeUrl + ) { + _msgs.push({ + typeUrl: MsgSwapExactAmountInPoolManager.typeUrl, + value: MsgSwapExactAmountInPoolManager.encode( + MsgSwapExactAmountInPoolManager.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl === MsgSwapExactAmountIn.typeUrl) { + _msgs.push({ + typeUrl: MsgSwapExactAmountIn.typeUrl, + value: MsgSwapExactAmountIn.encode( + MsgSwapExactAmountIn.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl === MsgSend.typeUrl) { + _msgs.push({ + typeUrl: MsgSend.typeUrl, + value: MsgSend.encode( + MsgSend.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl === MsgExecuteContract.typeUrl) { + _msgs.push({ + typeUrl: MsgExecuteContract.typeUrl, + value: MsgExecuteContract.encode( + MsgExecuteContract.fromPartial(msgTransfer.value) + ).finish(), + }); + } + }); + } + + const account = await this.getAccount(fromAddress); + if (!account) { + feeData.push({ gasLimit: 200000, gasPrice: this.manifest.feeGasStep[speed], - }, - ]; - } - const tx = TxRaw.encode({ - bodyBytes: TxBody.encode( - TxBody.fromPartial({ - messages: _msgs, - memo: undefined, - }) - ).finish(), - authInfoBytes: AuthInfo.encode({ - signerInfos: [ - SignerInfo.fromPartial({ - modeInfo: { - single: { - mode: SignMode.SIGN_MODE_LEGACY_AMINO_JSON, - }, - multi: void 0, - }, - sequence: BigInt(account.sequence), - }), - ], - fee: Fee.fromPartial({ - amount: _feeAmount as any, - }), - }).finish(), - signatures: [new Uint8Array(64)], - }).finish(); - const { data } = await this.lcdAxiosClient.post( - '/cosmos/tx/v1beta1/simulate', - { - txBytes: Buffer.from(tx).toString('base64'), + }); + continue; } - ); - return [ - { + let tx; + if (messageData.signDoc?.bodyBytes) { + tx = TxRaw.encode({ + bodyBytes: Uint8Array.from( + Object.values(messageData.signDoc.bodyBytes) + ), + authInfoBytes: Uint8Array.from( + Object.values(messageData.signDoc.authInfoBytes) + ), + signatures: [new Uint8Array(64)], + }).finish(); + } else { + tx = TxRaw.encode({ + bodyBytes: TxBody.encode( + TxBody.fromPartial({ + messages: _msgs, + memo: undefined, + }) + ).finish(), + authInfoBytes: AuthInfo.encode({ + signerInfos: [ + SignerInfo.fromPartial({ + modeInfo: { + single: { + mode: SignMode.SIGN_MODE_LEGACY_AMINO_JSON, + }, + multi: void 0, + }, + sequence: BigInt(account.sequence), + }), + ], + fee: Fee.fromPartial({ + amount: _feeAmount as any, + }), + }).finish(), + signatures: [new Uint8Array(64)], + }).finish(); + } + + const { data } = await this.lcdAxiosClient + .post('/cosmos/tx/v1beta1/simulate', { + txBytes: Buffer.from(tx).toString('base64'), + }) + .catch((e) => { + throw new Error(e?.response?.data?.message ?? 'Error'); + }); + + feeData.push({ gasLimit: Math.ceil(parseInt(data.gas_info.gas_used) * 2), - gasPrice: this.manifest.feeGasStep[speed], - }, - ]; + gasPrice: gasFeeOptions + ? (gasFeeOptions[speed] as number) + : this.manifest.feeGasStep[speed], + }); + } + + return feeData; } async gasFeeOptions(): Promise { From 5996da0b11276e13b2e1674ce376e40e45e0ea49 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:01:07 +0700 Subject: [PATCH 131/176] fix: estimateFee for stargaze NFTs (#338) Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/smooth-meals-drive.md | 5 +++++ .../src/datasource/indexer/indexer.data-source.ts | 9 ++++++++- packages/cosmos/src/msg.ts | 15 +++++++++------ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .changeset/smooth-meals-drive.md diff --git a/.changeset/smooth-meals-drive.md b/.changeset/smooth-meals-drive.md new file mode 100644 index 00000000..9fd6b375 --- /dev/null +++ b/.changeset/smooth-meals-drive.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +fix: estimateFee for stargaze NFTs diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index 4ecd9097..a7e05092 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -24,7 +24,7 @@ import { TxRaw, } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'; -// import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; +import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; import { ChainMsg } from '../../msg'; import * as manifests from '../../manifests'; @@ -221,6 +221,13 @@ export class IndexerDataSource extends DataSource { MsgSend.fromPartial(msgTransfer.value) ).finish(), }); + } else if (msgTransfer.typeUrl === MsgExecuteContract.typeUrl) { + _msgs.push({ + typeUrl: MsgExecuteContract.typeUrl, + value: MsgExecuteContract.encode( + MsgExecuteContract.fromPartial(msgTransfer.value) + ).finish(), + }); } }); } diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 98d7c6d8..45b93beb 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -13,6 +13,7 @@ import BigNumber from 'bignumber.js'; import Long from 'long'; import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; import { StdSignature } from '@cosmjs/amino'; +import { toUtf8 } from '@cosmjs/encoding'; import { MsgTransfer } from './proto_export/ibc/applications/transfer/v1/tx'; import { MessageComposer as MessageComposerIbc } from './proto_export/ibc/applications/transfer/v1/tx.registry'; @@ -272,12 +273,14 @@ export class ChainMsg extends BasMsg { sender: msgData.from, contract: msgData.contractAddress, funds: [], - msg: { - transfer_nft: { - recipient: msgData.to, - token_id: msgData.nftId, - }, - }, + msg: toUtf8( + JSON.stringify({ + transfer_nft: { + recipient: msgData.to, + token_id: msgData.nftId, + }, + }) + ), }, }, ]; From 2e11dae6664734902754c4e5174f9b00cec3af1f Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 27 Aug 2024 10:03:34 +0000 Subject: [PATCH 132/176] Version packages --- .changeset/polite-emus-juggle.md | 5 ----- .changeset/smooth-meals-drive.md | 5 ----- packages/cosmos/CHANGELOG.md | 7 +++++++ packages/cosmos/package.json | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 .changeset/polite-emus-juggle.md delete mode 100644 .changeset/smooth-meals-drive.md diff --git a/.changeset/polite-emus-juggle.md b/.changeset/polite-emus-juggle.md deleted file mode 100644 index e4dd81ba..00000000 --- a/.changeset/polite-emus-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -chore: align fee estimation on ChainDatasource with IndexDatasource diff --git a/.changeset/smooth-meals-drive.md b/.changeset/smooth-meals-drive.md deleted file mode 100644 index 9fd6b375..00000000 --- a/.changeset/smooth-meals-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -fix: estimateFee for stargaze NFTs diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 5c7a5924..5a0233a5 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,12 @@ # @xdefi-tech/chains-cosmos +## 2.0.40 + +### Patch Changes + +- 14b88161: chore: align fee estimation on ChainDatasource with IndexDatasource +- f28122bc: fix: estimateFee for stargaze NFTs + ## 2.0.39 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index e3fc58cc..d77ebe8c 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.39", + "version": "2.0.40", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 996a5a8fec3881a90e1dedabcf4591c9d0c9eb6b Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:32:54 +0700 Subject: [PATCH 133/176] chore: align HW signers & SeedPhrase signer with the PK signer (#321) * chore: align HW signers & SeedPhrase signer with the PK signer * chore: update unit tests & changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/fair-beans-taste.md | 5 + .../cosmos/src/signers/ledger.signer.spec.ts | 7 +- packages/cosmos/src/signers/ledger.signer.ts | 114 ++++++++++++++---- .../src/signers/private-key.signer.spec.ts | 9 +- .../src/signers/seed-phrase.signer.spec.ts | 25 +--- .../cosmos/src/signers/seed-phrase.signer.ts | 112 +++++++++-------- 6 files changed, 159 insertions(+), 113 deletions(-) create mode 100644 .changeset/fair-beans-taste.md diff --git a/.changeset/fair-beans-taste.md b/.changeset/fair-beans-taste.md new file mode 100644 index 00000000..8965162a --- /dev/null +++ b/.changeset/fair-beans-taste.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +chore: align HW signers & SeedPhrase signer with the PK signer diff --git a/packages/cosmos/src/signers/ledger.signer.spec.ts b/packages/cosmos/src/signers/ledger.signer.spec.ts index 04e3f020..8cb68c71 100644 --- a/packages/cosmos/src/signers/ledger.signer.spec.ts +++ b/packages/cosmos/src/signers/ledger.signer.spec.ts @@ -6,7 +6,7 @@ import { makeADR36AminoSignDoc, serializeSignDoc } from '@keplr-wallet/cosmos'; import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { COSMOS_MANIFESTS } from '../manifests'; -import { ChainMsg, MsgBody } from '../msg'; +import { ChainMsg, CosmosSignMode, MsgBody } from '../msg'; import LedgerSigner from './ledger.signer'; jest.mock('@ledgerhq/hw-transport-webhid', () => ({ @@ -173,8 +173,9 @@ describe('cosmos::ledger.signer', () => { }; const signedTx = await signer.signRawTransaction( signDoc, - derivationPath, - 'cosmos' + 'cosmos', + CosmosSignMode.SIGN_AMINO, + derivationPath ); expect(signedTx.signature.pub_key.value).toEqual( 'A92jmyLB+OLC0R2jvEUX+AtGGqafEOdh40V29PCcz6Hu' diff --git a/packages/cosmos/src/signers/ledger.signer.ts b/packages/cosmos/src/signers/ledger.signer.ts index f19668c1..156c8972 100644 --- a/packages/cosmos/src/signers/ledger.signer.ts +++ b/packages/cosmos/src/signers/ledger.signer.ts @@ -1,13 +1,20 @@ import { LedgerSigner as LedgerApp } from '@cosmjs/ledger-amino'; import { stringToPath } from '@cosmjs/crypto'; import Transport from '@ledgerhq/hw-transport'; -import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { MsgEncoding, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; +import { TxRaw, SignDoc, AuthInfo } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SigningStargateClient } from '@cosmjs/stargate'; import { bech32 } from 'bech32'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; -import { AminoSignDoc, ChainMsg } from '../msg'; +import { + AminoSignDoc, + ChainMsg, + CosmosChainType, + CosmosSignMode, + DirectSignDoc, + SignMsgSendResponse, +} from '../msg'; import { STARGATE_CLIENT_OPTIONS } from '../utils'; @SignerDecorator(Signer.SignerType.LEDGER) @@ -37,41 +44,96 @@ export class LedgerSigner extends Signer.Provider { } async sign(msg: ChainMsg, derivation: string): Promise { - if (!derivation.startsWith('m/')) { - derivation = 'm/' + derivation; + const { signMode, raw, signDoc } = await msg.buildTx(); + if (raw) { + if (msg.encoding === MsgEncoding.string) { + signDoc.bodyBytes = Uint8Array.from(Object.values(signDoc.bodyBytes)); + signDoc.authInfoBytes = Uint8Array.from( + Object.values(signDoc.authInfoBytes) + ); + const authInfo = AuthInfo.decode(signDoc.authInfoBytes); + signDoc.authInfoBytes = AuthInfo.encode(authInfo).finish(); + } + const res = await this.signRawTransaction( + signDoc, + msg.provider.manifest.prefix, + signMode, + derivation + ); + msg.sign(res); + return; + } else { + if (!derivation.startsWith('m/')) { + derivation = 'm/' + derivation; + } + + const hdPath = stringToPath(derivation); + const app = new LedgerApp(this.transport as Transport, { + testModeAllowed: true, + hdPaths: [hdPath], + prefix: msg.provider.manifest.prefix, + }); + if (signMode === CosmosSignMode.SIGN_DIRECT) { + const signedTx = await this.signDirect(msg, app); + const txBytes = TxRaw.encode(signedTx).finish(); + const rawTx = Buffer.from(txBytes).toString('base64'); + msg.sign(rawTx); + return; + } + const signedTx = await this.signAmino(msg, app); + msg.sign(signedTx); } + return; + } - const hdPath = stringToPath(derivation); - const app = new LedgerApp(this.transport as Transport, { - testModeAllowed: true, - hdPaths: [hdPath], - prefix: msg.provider.manifest.prefix, - }); - + async signAmino(msg: ChainMsg, app: LedgerApp) { + const txData = await msg.buildTx(); + const [{ address: senderAddress }] = await app.getAccounts(); const client = await SigningStargateClient.connectWithSigner( msg.provider.manifest.rpcURL, app, STARGATE_CLIENT_OPTIONS ); + return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); + } - const txData = await msg.buildTx(); - const [{ address: senderAddress }] = await app.getAccounts(); - const signedTx = await client.sign( - senderAddress, - txData.msgs, - txData.fee, - txData.memo + async signDirect(msg: ChainMsg, app: LedgerApp): Promise { + throw new Error('Ledger Signer not supported SIGN_DIRECT_MODE'); + } + + signRawTransaction( + signDoc: AminoSignDoc | DirectSignDoc, + prefix: string, + signMode: CosmosSignMode, + derivation?: string + ) { + if (signMode === CosmosSignMode.SIGN_DIRECT) { + return this.signDirectRawTransaction( + signDoc as DirectSignDoc, + prefix, + derivation + ); + } + return this.signAminoRawTransaction( + signDoc as AminoSignDoc, + prefix, + derivation ); - const txBytes = TxRaw.encode(signedTx as TxRaw).finish(); - const rawTx = Buffer.from(txBytes).toString('base64'); - msg.sign(rawTx); } - async signRawTransaction( + async signDirectRawTransaction( + signDoc: DirectSignDoc, + prefix: string, + derivation = `m/44'/118'/0'/0/0` + ): Promise { + throw new Error('Ledger Signer not supported SIGN_DIRECT_MODE'); + } + + async signAminoRawTransaction( signDoc: AminoSignDoc, - derivation: string, - prefix: string - ) { + prefix: string, + derivation = `m/44'/118'/0'/0/0` + ): Promise { if (!derivation.startsWith('m/')) { derivation = 'm/' + derivation; } diff --git a/packages/cosmos/src/signers/private-key.signer.spec.ts b/packages/cosmos/src/signers/private-key.signer.spec.ts index cef3abc4..922ad471 100644 --- a/packages/cosmos/src/signers/private-key.signer.spec.ts +++ b/packages/cosmos/src/signers/private-key.signer.spec.ts @@ -112,16 +112,11 @@ describe('private-key.signer', () => { ); }); - it('should sign direct a transaction using a private key', async () => { + it('should sign a transaction using a private key', async () => { await cosmosSigner.sign(message); expect(message.signedTransaction).toBeTruthy(); }); - it('should sign amimo a transaction using a private key', async () => { - await cosmosSigner.sign(message, ''); - expect(message.signedTransaction).toBeTruthy(); - }); - it('should create msg from raw msg and sign it with private key', async () => { const msg = await provider.createMsg( { data: backendSwapTransaction.unsignedStdTx }, @@ -171,7 +166,7 @@ describe('private-key.signer', () => { expect(result).toBe(false); }); - it('Should create msg adn sign it with direct mode', async () => { + it('Should create msg adn sign it', async () => { const chainMsg = provider.createMsg(txInput); const txData = await chainMsg.buildTx(); diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index 85da13cc..da7496a1 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -109,7 +109,7 @@ describe('seed-phrase.signer', () => { ); }); - it('should sign direct a transaction using a seed phrase', async () => { + it('should sign a transaction using a seed phrase', async () => { const originalEncode = TxRaw.encode; TxRaw.encode = jest.fn().mockImplementation(() => { return { finish: jest.fn().mockReturnValue(Uint8Array.from([1, 1, 1])) }; @@ -121,21 +121,6 @@ describe('seed-phrase.signer', () => { TxRaw.encode = originalEncode; }); - it('should sign amino a transaction using a seed phrase', async () => { - const originalEncode = TxRaw.encode; - TxRaw.encode = jest.fn().mockImplementation(() => { - return { finish: jest.fn().mockReturnValue(Uint8Array.from([1, 1, 1])) }; - }); - await signer.sign( - message, - derivations.cosmos, - CosmosChainType.Cosmos, - CosmosSignMode.SIGN_AMINO - ); - expect(message.signedTransaction).toBeTruthy(); - TxRaw.encode = originalEncode; - }); - it('Should sign raw tx with amino mode', async () => { const signDoc = { chain_id: 'cosmoshub-4', @@ -161,7 +146,7 @@ describe('seed-phrase.signer', () => { const signer = new SeedPhraseSigner(mnemonic); const signedTx = await signer.signRawTransaction( signDoc, - provider, + provider.manifest.prefix, CosmosSignMode.SIGN_AMINO ); expect(signedTx.signature.pub_key.value).toEqual( @@ -192,7 +177,7 @@ describe('seed-phrase.signer', () => { const signer = new SeedPhraseSigner(mnemonic); const signedTx = await signer.signRawTransaction( signDoc, - provider, + provider.manifest.prefix, CosmosSignMode.SIGN_DIRECT ); expect(signedTx.signature.pub_key.value).toEqual( @@ -227,7 +212,7 @@ describe('seed-phrase.signer', () => { const signer = new SeedPhraseSigner(mnemonic); const signedTx = await signer.signRawTransaction( signDoc, - provider, + provider.manifest.prefix, CosmosSignMode.SIGN_AMINO ); expect(signedTx.signature.pub_key.value).toEqual( @@ -269,7 +254,7 @@ describe('seed-phrase.signer', () => { }); const signedTx = await signer.signRawTransaction( signDoc, - provider, + provider.manifest.prefix, CosmosSignMode.SIGN_DIRECT ); expect(signedTx.signature.pub_key.value).toEqual( diff --git a/packages/cosmos/src/signers/seed-phrase.signer.ts b/packages/cosmos/src/signers/seed-phrase.signer.ts index 5f52b38a..ae4f9bc9 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.ts @@ -1,7 +1,7 @@ -import { Signer, SignerDecorator } from '@xdefi-tech/chains-core'; +import { MsgEncoding, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; import { Secp256k1HdWallet } from '@cosmjs/launchpad'; import { SigningStargateClient } from '@cosmjs/stargate'; -import { TxRaw, SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { AuthInfo, SignDoc, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { bech32 } from 'bech32'; import { stringToPath, @@ -13,11 +13,9 @@ import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'; -import { CosmosProvider } from '../chain.provider'; import { AminoSignDoc, ChainMsg, - CosmosChainType, CosmosSignMode, DirectSignDoc, SignMsgSendResponse, @@ -69,57 +67,43 @@ export class SeedPhraseSigner extends Signer.Provider { return wallet.address; } - async sign( - msg: ChainMsg, - derivation: string, - chainType?: CosmosChainType, - signMode?: CosmosSignMode - ): Promise { - if (chainType === CosmosChainType.Cosmos || !chainType) { - const signedTx = - signMode === CosmosSignMode.SIGN_DIRECT || !signMode - ? await this.signDirect(msg) - : await this.signAmino(msg); - const txBytes = TxRaw.encode(signedTx as TxRaw).finish(); - const rawTx = Buffer.from(txBytes).toString('base64'); - msg.sign(rawTx); - return; - } else if (chainType === CosmosChainType.Terra) { - const txData = await msg.buildTx(); - const clientOptions: Record = {}; - clientOptions[msg.provider.manifest.chainId] = { - chainID: msg.provider.manifest.chainId, - lcd: msg.provider.manifest.lcdURL, - gasAdjustment: 1.75, - gasPrices: { - uluna: 0.015, - }, - prefix: msg.provider.manifest.prefix, // bech32 prefix, used by the LCD to understand which is the right chain to query - }; - const lcdClient = new LCDClient(clientOptions); - const hdPath = stringToPath(derivation); - const terraWallet = lcdClient.wallet( - new MnemonicKey({ - mnemonic: this._key, - coinType: 330, // optional, default - account: parseInt(pathToString(hdPath).split('/')[3]), // optional, default - index: parseInt(pathToString(hdPath).split('/')[4]), // optional, default - }) + async sign(msg: ChainMsg, derivation: string): Promise { + const { signMode, raw, signDoc } = await msg.buildTx(); + if (raw) { + if (msg.encoding === MsgEncoding.string) { + signDoc.bodyBytes = Uint8Array.from(Object.values(signDoc.bodyBytes)); + signDoc.authInfoBytes = Uint8Array.from( + Object.values(signDoc.authInfoBytes) + ); + const authInfo = AuthInfo.decode(signDoc.authInfoBytes); + signDoc.authInfoBytes = AuthInfo.encode(authInfo).finish(); + } + const res = await this.signRawTransaction( + signDoc, + msg.provider.manifest.prefix, + signMode ); - - const tx = await terraWallet.createAndSignTx({ - msgs: [txData.msgs], - chainID: msg.provider.manifest.chainId, - }); - - msg.sign(Buffer.from(tx.toBytes()).toString('base64')); + msg.sign(res); + return; + } else { + if (signMode === CosmosSignMode.SIGN_DIRECT || !signMode) { + const signedTx = await this.signDirect(msg, derivation); + const txBytes = TxRaw.encode(signedTx as TxRaw).finish(); + const rawTx = Buffer.from(txBytes).toString('base64'); + msg.sign(rawTx); + return; + } + const signedTx = await this.signAmino(msg, derivation); + msg.sign(signedTx); } + return; } - async signDirect(msg: ChainMsg) { + async signDirect(msg: ChainMsg, derivation?: string) { const txData = await msg.buildTx(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(this.key, { prefix: msg.provider.manifest.prefix, + hdPaths: derivation ? [stringToPath(derivation) as any] : undefined, }); const [{ address: senderAddress }] = await wallet.getAccounts(); const client = await SigningStargateClient.connectWithSigner( @@ -130,10 +114,11 @@ export class SeedPhraseSigner extends Signer.Provider { return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); } - async signAmino(msg: ChainMsg) { + async signAmino(msg: ChainMsg, derivation?: string) { const txData = await msg.buildTx(); const wallet = await Secp256k1HdWallet.fromMnemonic(this.key, { prefix: msg.provider.manifest.prefix, + hdPaths: derivation ? [stringToPath(derivation)] : undefined, }); const [{ address: senderAddress }] = await wallet.getAccounts(); const client = await SigningStargateClient.connectWithSigner( @@ -146,10 +131,12 @@ export class SeedPhraseSigner extends Signer.Provider { async signAminoRawTransaction( signDoc: AminoSignDoc, - provider: CosmosProvider + prefix: string, + derivation?: string ): Promise { const wallet = await Secp256k1HdWallet.fromMnemonic(this.key, { - prefix: provider.manifest.prefix, + prefix, + hdPaths: derivation ? [stringToPath(derivation)] : undefined, }); const [{ address: senderAddress }] = await wallet.getAccounts(); return wallet.signAmino(senderAddress, signDoc); @@ -157,10 +144,12 @@ export class SeedPhraseSigner extends Signer.Provider { async signDirectRawTransaction( signDoc: DirectSignDoc, - provider: CosmosProvider + prefix: string, + derivation?: string ): Promise { const wallet = await DirectSecp256k1HdWallet.fromMnemonic(this.key, { - prefix: provider.manifest.prefix, + prefix, + hdPaths: derivation ? [stringToPath(derivation) as any] : undefined, }); const [{ address: senderAddress }] = await wallet.getAccounts(); @@ -177,12 +166,21 @@ export class SeedPhraseSigner extends Signer.Provider { async signRawTransaction( signDoc: AminoSignDoc | DirectSignDoc, - provider: CosmosProvider, - signMode: CosmosSignMode + prefix: string, + signMode: CosmosSignMode, + derivation?: string ): Promise { return signMode === CosmosSignMode.SIGN_AMINO - ? this.signAminoRawTransaction(signDoc as AminoSignDoc, provider) - : this.signDirectRawTransaction(signDoc as DirectSignDoc, provider); + ? this.signAminoRawTransaction( + signDoc as AminoSignDoc, + prefix, + derivation + ) + : this.signDirectRawTransaction( + signDoc as DirectSignDoc, + prefix, + derivation + ); } async verifyMessage( From 1a565c953964c0cc1b65cc9d1219168d662e1a57 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:33:29 +0700 Subject: [PATCH 134/176] feat: fix typescript error (#297) * feat: fix typescript error * chore: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/fair-papayas-carry.md | 9 +++++++ packages/bitcoin/src/chain.provider.ts | 16 ++++++++++--- .../datasource/indexer/indexer.data-source.ts | 2 +- packages/bitcoincash/src/chain.provider.ts | 16 +++++++++++-- packages/dogecoin/src/chain.provider.ts | 16 +++++++++++-- packages/litecoin/src/chain.provider.ts | 16 +++++++++++-- packages/utxo/src/chain.provider.ts | 24 +++++++++++++++++++ 7 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 .changeset/fair-papayas-carry.md diff --git a/.changeset/fair-papayas-carry.md b/.changeset/fair-papayas-carry.md new file mode 100644 index 00000000..2ed02aac --- /dev/null +++ b/.changeset/fair-papayas-carry.md @@ -0,0 +1,9 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-utxo': patch +--- + +feat: fix typescript error with utxo chains diff --git a/packages/bitcoin/src/chain.provider.ts b/packages/bitcoin/src/chain.provider.ts index 63e0e0a3..66b00806 100644 --- a/packages/bitcoin/src/chain.provider.ts +++ b/packages/bitcoin/src/chain.provider.ts @@ -1,22 +1,29 @@ import { Chain, ChainDecorator, + DataSource, MsgEncoding, Transaction, TransactionData, } from '@xdefi-tech/chains-core'; -import { UtxoProvider } from '@xdefi-tech/chains-utxo'; +import { + IUtxoProvider, + UtxoProvider, + UtxoProviderOptions, +} from '@xdefi-tech/chains-utxo'; import * as Bitcoin from 'bitcoinjs-lib'; import { IndexerDataSource } from './datasource'; import { ChainMsg, MsgBody } from './msg'; - @ChainDecorator('BitcoinProvider', { deps: [], providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class BitcoinProvider extends UtxoProvider { +export class BitcoinProvider + extends UtxoProvider + implements IUtxoProvider +{ declare dataSource: IndexerDataSource; static get dataSourceList() { @@ -24,6 +31,9 @@ export class BitcoinProvider extends UtxoProvider { IndexerDataSource: IndexerDataSource, }; } + constructor(dataSource: IndexerDataSource, options?: UtxoProviderOptions) { + super(dataSource, options); + } createMsg(data: MsgBody, encoding: MsgEncoding = MsgEncoding.object) { return new ChainMsg(data, this, encoding); diff --git a/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts b/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts index 9f99077b..d914b418 100644 --- a/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts +++ b/packages/bitcoin/src/datasource/indexer/indexer.data-source.ts @@ -14,7 +14,7 @@ import { TransactionStatus, } from '@xdefi-tech/chains-core'; import * as Bitcoin from 'bitcoinjs-lib'; -import { UTXO, UTXOManifest } from '@xdefi-tech/chains-utxo'; +import { UTXO, type UTXOManifest } from '@xdefi-tech/chains-utxo'; import { utils } from 'ethers'; import { Observable } from 'rxjs'; diff --git a/packages/bitcoincash/src/chain.provider.ts b/packages/bitcoincash/src/chain.provider.ts index 9b923abc..dd60f267 100644 --- a/packages/bitcoincash/src/chain.provider.ts +++ b/packages/bitcoincash/src/chain.provider.ts @@ -5,7 +5,12 @@ import { Transaction, TransactionData, } from '@xdefi-tech/chains-core'; -import { MsgBody, UtxoProvider } from '@xdefi-tech/chains-utxo'; +import { + IUtxoProvider, + MsgBody, + UtxoProvider, + UtxoProviderOptions, +} from '@xdefi-tech/chains-utxo'; import bchaddr from 'bchaddrjs'; import { IndexerDataSource } from './datasource'; @@ -16,9 +21,16 @@ import { ChainMsg } from './msg'; providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class BitcoinCashProvider extends UtxoProvider { +export class BitcoinCashProvider + extends UtxoProvider + implements IUtxoProvider +{ declare dataSource: IndexerDataSource; + constructor(dataSource: IndexerDataSource, options?: UtxoProviderOptions) { + super(dataSource, options); + } + createMsg( data: MsgBody, encoding: MsgEncoding = MsgEncoding.object diff --git a/packages/dogecoin/src/chain.provider.ts b/packages/dogecoin/src/chain.provider.ts index 9db6458d..1cfe5b1c 100644 --- a/packages/dogecoin/src/chain.provider.ts +++ b/packages/dogecoin/src/chain.provider.ts @@ -5,7 +5,12 @@ import { Transaction, TransactionData, } from '@xdefi-tech/chains-core'; -import { MsgBody, UtxoProvider } from '@xdefi-tech/chains-utxo'; +import { + IUtxoProvider, + MsgBody, + UtxoProvider, + type UtxoProviderOptions, +} from '@xdefi-tech/chains-utxo'; import coininfo from 'coininfo'; import * as btc from '@scure/btc-signer'; @@ -17,7 +22,10 @@ import { ChainMsg } from './msg'; providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class DogecoinProvider extends UtxoProvider { +export class DogecoinProvider + extends UtxoProvider + implements IUtxoProvider +{ declare dataSource: IndexerDataSource; createMsg( @@ -27,6 +35,10 @@ export class DogecoinProvider extends UtxoProvider { return new ChainMsg(data, this, encoding); } + constructor(dataSource: IndexerDataSource, options?: UtxoProviderOptions) { + super(dataSource, options); + } + static get dataSourceList() { return { IndexerDataSource: IndexerDataSource, diff --git a/packages/litecoin/src/chain.provider.ts b/packages/litecoin/src/chain.provider.ts index eacd8786..853c6cb2 100644 --- a/packages/litecoin/src/chain.provider.ts +++ b/packages/litecoin/src/chain.provider.ts @@ -5,7 +5,12 @@ import { Transaction, TransactionData, } from '@xdefi-tech/chains-core'; -import { MsgBody, UtxoProvider } from '@xdefi-tech/chains-utxo'; +import { + IUtxoProvider, + MsgBody, + UtxoProvider, + type UtxoProviderOptions, +} from '@xdefi-tech/chains-utxo'; import * as Litecoin from 'bitcoinjs-lib'; import coininfo from 'coininfo'; @@ -17,7 +22,10 @@ import { ChainMsg } from './msg'; providerType: 'UTXO', features: [Chain.ChainFeatures.TOKENS], }) -export class LitecoinProvider extends UtxoProvider { +export class LitecoinProvider + extends UtxoProvider + implements IUtxoProvider +{ declare dataSource: IndexerDataSource; createMsg( @@ -27,6 +35,10 @@ export class LitecoinProvider extends UtxoProvider { return new ChainMsg(data, this, encoding); } + constructor(dataSource: IndexerDataSource, options?: UtxoProviderOptions) { + super(dataSource, options); + } + static get dataSourceList() { return { IndexerDataSource: IndexerDataSource, diff --git a/packages/utxo/src/chain.provider.ts b/packages/utxo/src/chain.provider.ts index 32f36c1b..42d2f711 100644 --- a/packages/utxo/src/chain.provider.ts +++ b/packages/utxo/src/chain.provider.ts @@ -22,6 +22,30 @@ export interface UtxoProviderOptions extends Chain.IOptions { apiKey?: string; } +export interface IUtxoProvider { + getTransactions( + address: string, + afterBlock?: number | string + ): Promise>; + estimateFee(messages: Msg[], speed: GasFeeSpeed): Promise; + getNFTBalance(address: string): Promise; + getBalance(address: string): Promise>; + gasFeeOptions(): Promise; + getNonce(address: string): Promise; + broadcast(messages: Msg[]): Promise; + getTransaction(txHash: string): Promise; + get manifest(): UTXOManifest; + /** + * Scans for UTXOs associated with a given address. This method should be overridden in subclasses + * that handle UTXO-based chains, providing a specific implementation for scanning UTXOs. + * + * @param {string} _address The address for which to scan UTXOs. + * @returns A promise that resolves to the scanned UTXOs. + * @throws {Error} Throws an error if the method is not implemented. + */ + scanUTXOs(_address: string): Promise; +} + export class UtxoProvider< ChainMsg extends Msg = Msg > extends Chain.Provider { From 0724b3982f44a70df2f6be714fa9580af634700c Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 27 Aug 2024 10:35:55 +0000 Subject: [PATCH 135/176] Version packages --- .changeset/fair-beans-taste.md | 5 ----- .changeset/fair-papayas-carry.md | 9 --------- packages/bitcoin/CHANGELOG.md | 8 ++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 ++++++++ packages/bitcoincash/package.json | 2 +- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 ++++++++ packages/dogecoin/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 ++++++++ packages/litecoin/package.json | 2 +- packages/utxo/CHANGELOG.md | 6 ++++++ packages/utxo/package.json | 2 +- 14 files changed, 50 insertions(+), 20 deletions(-) delete mode 100644 .changeset/fair-beans-taste.md delete mode 100644 .changeset/fair-papayas-carry.md diff --git a/.changeset/fair-beans-taste.md b/.changeset/fair-beans-taste.md deleted file mode 100644 index 8965162a..00000000 --- a/.changeset/fair-beans-taste.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -chore: align HW signers & SeedPhrase signer with the PK signer diff --git a/.changeset/fair-papayas-carry.md b/.changeset/fair-papayas-carry.md deleted file mode 100644 index 2ed02aac..00000000 --- a/.changeset/fair-papayas-carry.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-utxo': patch ---- - -feat: fix typescript error with utxo chains diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index b32688fe..81728d95 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.1.1 + +### Patch Changes + +- 6d09e6b7: feat: fix typescript error with utxo chains +- Updated dependencies [6d09e6b7] + - @xdefi-tech/chains-utxo@2.0.13 + ## 2.1.0 ### Minor Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 30cd5e48..b8b8787a 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.1.0", + "version": "2.1.1", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 9e1183c9..12fc1635 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.1.1 + +### Patch Changes + +- 6d09e6b7: feat: fix typescript error with utxo chains +- Updated dependencies [6d09e6b7] + - @xdefi-tech/chains-utxo@2.0.13 + ## 2.1.0 ### Minor Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 26909230..a9293ddd 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.1.0", + "version": "2.1.1", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 5a0233a5..281c9500 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.41 + +### Patch Changes + +- 5c8da390: chore: align HW signers & SeedPhrase signer with the PK signer + ## 2.0.40 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index d77ebe8c..8ec2c422 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.40", + "version": "2.0.41", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 52dc06fb..2207b83a 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.1.1 + +### Patch Changes + +- 6d09e6b7: feat: fix typescript error with utxo chains +- Updated dependencies [6d09e6b7] + - @xdefi-tech/chains-utxo@2.0.13 + ## 2.1.0 ### Minor Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index c8cf66bc..1b0a58e9 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.1.0", + "version": "2.1.1", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 051286cb..0fcd42e4 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.1.1 + +### Patch Changes + +- 6d09e6b7: feat: fix typescript error with utxo chains +- Updated dependencies [6d09e6b7] + - @xdefi-tech/chains-utxo@2.0.13 + ## 2.1.0 ### Minor Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 85e3f12f..3e8f5ca0 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.1.0", + "version": "2.1.1", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index 7c2017f9..98353d5d 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-utxo +## 2.0.13 + +### Patch Changes + +- 6d09e6b7: feat: fix typescript error with utxo chains + ## 2.0.12 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index 1bbf6876..372c0c39 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.12", + "version": "2.0.13", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 36ebf5f8d14728b91ba53d4344b311a53c2b8877 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:42:30 +0700 Subject: [PATCH 136/176] feat: add logic to calculate gasPrice when not provided (#293) * feat: add logic to calculate gasPrice when not provided * feat: add logic to calculate gasPrice when not provided * chore: add changeset --------- Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/breezy-humans-end.md | 6 ++++ packages/cosmos/src/msg.ts | 6 ++-- packages/evm/src/msg.ts | 59 +++++++++++++++++---------------- 3 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 .changeset/breezy-humans-end.md diff --git a/.changeset/breezy-humans-end.md b/.changeset/breezy-humans-end.md new file mode 100644 index 00000000..fdf4d5af --- /dev/null +++ b/.changeset/breezy-humans-end.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-evm': patch +--- + +feat: add logic to calculate gasPrice when not provided diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 45b93beb..e90b32c5 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -414,13 +414,13 @@ export class ChainMsg extends BasMsg { const _msgs = this.getMsgToSend(); const feeOptions = msgData.feeOptions; - if (!msgData.gasLimit && !msgData.gasPrice && this.provider) { + if (!msgData.gasLimit || !msgData.gasPrice) { const [feeEstimation] = await this.provider.estimateFee( [this], GasFeeSpeed.medium ); - msgData.gasLimit = feeEstimation.gasLimit; - msgData.gasPrice = feeEstimation.gasPrice; + msgData.gasLimit = msgData.gasLimit ?? feeEstimation.gasLimit; + msgData.gasPrice = msgData.gasPrice ?? feeEstimation.gasPrice; } const fee = { diff --git a/packages/evm/src/msg.ts b/packages/evm/src/msg.ts index db74b72a..a0a36f42 100644 --- a/packages/evm/src/msg.ts +++ b/packages/evm/src/msg.ts @@ -299,26 +299,35 @@ export class ChainMsg extends BasMsg { } async buildTx(): Promise { - let msgData = this.toData(); + const msgData = this.toData(); + const [feeData] = await this.provider.estimateFee( + [this], + GasFeeSpeed.medium + ); - if (this.provider) { - if (!msgData.gasLimit) { - const [feeData] = await this.provider.estimateFee( - [this], - GasFeeSpeed.medium - ); - msgData = { ...msgData, ...feeData }; - } - if (!msgData.nonce) { - msgData.nonce = await this.provider.getNonce(msgData.from); - } - if (!msgData.chainId) { - msgData.chainId = this.provider.manifest.chainId; - } + if (!msgData.gasLimit) { + msgData.gasLimit = feeData.gasLimit; } - if (!msgData.gasLimit) { - throw new Error('Gas fields are required'); + // If fee info not provided, get legacy gas fee from provider + if (msgData.txType === TransactionType.Legacy && !msgData.gasPrice) { + msgData.gasPrice = feeData.gasPrice ?? feeData.baseFeePerGas; + } + + // If fee info not provided, get EIP1559 gas fee from provider + if ( + msgData.txType !== TransactionType.Legacy && + (!msgData.maxPriorityFeePerGas || !msgData.maxFeePerGas) + ) { + msgData.maxFeePerGas = feeData.maxFeePerGas; + msgData.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; + } + + if (!msgData.nonce) { + msgData.nonce = await this.provider.getNonce(msgData.from); + } + if (!msgData.chainId) { + msgData.chainId = this.provider.manifest.chainId; } if (!msgData.amount) { @@ -334,24 +343,18 @@ export class ChainMsg extends BasMsg { ...(msgData.data && { data: msgData.data }), }; - if ( - msgData.txType !== TransactionType.Legacy && - msgData.maxFeePerGas && - msgData.maxPriorityFeePerGas - ) { + if (msgData.txType !== TransactionType.Legacy) { + if (!msgData.maxFeePerGas || !msgData.maxPriorityFeePerGas) { + throw new Error(`Can't get EIP1559 gas fee`); + } baseTx.maxFeePerGas = utils.toHex(msgData.maxFeePerGas.toString()); baseTx.maxPriorityFeePerGas = utils.toHex( msgData.maxPriorityFeePerGas.toString() ); baseTx.type = 2; } else { - if (msgData.txType === TransactionType.Legacy && !msgData.gasPrice) { - throw new Error( - 'Legacy transactions required gasPrice and gasLimit fields' - ); - } if (!msgData.gasPrice) { - throw new Error(`Invalid gasPrice value: ${msgData.gasPrice}`); + throw new Error(`Can't get legacy gas fee`); } baseTx.gasPrice = utils.toHex(msgData.gasPrice.toString()); } From 3961f03489eb1680df490e7cfac1ee53f2ae6dc8 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 27 Aug 2024 10:44:56 +0000 Subject: [PATCH 137/176] Version packages --- .changeset/breezy-humans-end.md | 6 ------ packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 .changeset/breezy-humans-end.md diff --git a/.changeset/breezy-humans-end.md b/.changeset/breezy-humans-end.md deleted file mode 100644 index fdf4d5af..00000000 --- a/.changeset/breezy-humans-end.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-evm': patch ---- - -feat: add logic to calculate gasPrice when not provided diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 281c9500..e5aec300 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.42 + +### Patch Changes + +- ee444743: feat: add logic to calculate gasPrice when not provided + ## 2.0.41 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 8ec2c422..a4d264a0 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.41", + "version": "2.0.42", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index a681a433..7e3fd254 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.46 + +### Patch Changes + +- ee444743: feat: add logic to calculate gasPrice when not provided + ## 2.0.45 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 83ac45e7..76888741 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.45", + "version": "2.0.46", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From a9cf42dafaa5de435328fef95b3314be65cba1e0 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:16:33 +0100 Subject: [PATCH 138/176] =?UTF-8?q?feat:=20update=20cosmos=20sign=20+=20es?= =?UTF-8?q?timateFee=20to=20automatically=20adapt=20inputs=20=E2=80=A6=20(?= =?UTF-8?q?#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible * feat: add isIBCPayload to static functions; fix: lint --------- Co-authored-by: danilxdefi --- .changeset/olive-peas-shake.md | 5 ++++ packages/cosmos/src/chain.provider.spec.ts | 26 +++++++++++++++++++ packages/cosmos/src/chain.provider.ts | 2 ++ .../src/datasource/chain/chain.data-source.ts | 11 ++++++-- .../datasource/indexer/indexer.data-source.ts | 9 ++++++- packages/cosmos/src/msg.ts | 8 +++++- packages/cosmos/src/signers/ledger.signer.ts | 7 +++-- .../src/signers/seed-phrase.signer.spec.ts | 2 +- .../cosmos/src/signers/seed-phrase.signer.ts | 2 +- packages/cosmos/src/utils.ts | 12 +++++++++ 10 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 .changeset/olive-peas-shake.md diff --git a/.changeset/olive-peas-shake.md b/.changeset/olive-peas-shake.md new file mode 100644 index 00000000..aa057be2 --- /dev/null +++ b/.changeset/olive-peas-shake.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index c525b128..245b460f 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -284,4 +284,30 @@ describe('chain.provider', () => { const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.low); expect(estimateFee[0].gasLimit).toBeTruthy(); }); + + it('estimateGas(): for IBC ', async () => { + const txInput = { + from: 'osmo185zc74a7w2pfxkv6d06t3kdja65tngjgkn6pqg', + addresses: { + cronos: '0x8d8dC7e30407778532052330dBAC3D3186411e0D', + cosmos: 'cosmos185zc74a7w2pfxkv6d06t3kdja65tngjg7gf3k6', + stargaze: 'stars185zc74a7w2pfxkv6d06t3kdja65tngjg257vat', + akash: 'akash185zc74a7w2pfxkv6d06t3kdja65tngjgnnyk0q', + kujira: 'kujira185zc74a7w2pfxkv6d06t3kdja65tngjg0qtfms', + sei: 'sei185zc74a7w2pfxkv6d06t3kdja65tngjgnyc8sm', + stride: 'stride185zc74a7w2pfxkv6d06t3kdja65tngjgarfdzk', + mars: 'mars185zc74a7w2pfxkv6d06t3kdja65tngjgr4sgrp', + osmosis: 'osmo185zc74a7w2pfxkv6d06t3kdja65tngjgkn6pqg', + axelar: 'axelar1qjn7k284m7ym6rxd2v6h7magwtectyxvhlals0', + }, + amountIn: '0.01', + destAssetChain: 'axelar', + sourceAssetDenom: + 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E', + sourceAssetChain: 'osmosis', + }; + const msg = provider.createMsg(txInput); + const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.low); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); }); diff --git a/packages/cosmos/src/chain.provider.ts b/packages/cosmos/src/chain.provider.ts index f94b6819..733a22dc 100644 --- a/packages/cosmos/src/chain.provider.ts +++ b/packages/cosmos/src/chain.provider.ts @@ -37,6 +37,7 @@ import { getIBCDestAsset, getIBCTokenInfo, getIBCTransferRouter, + isIBCPayload, skipAxiosClient, } from './utils'; @@ -319,6 +320,7 @@ export class CosmosProvider extends Chain.Provider { getIBCTransferRouter, createIBCTransferMsg, getIBCDestAsset, + isIBCPayload, }; } diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 68403cbc..880f31d1 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -32,6 +32,7 @@ import { } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing'; import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; +import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; import { CryptoAssetArgs } from '../../gql/graphql'; import * as manifests from '../../manifests'; @@ -40,7 +41,7 @@ import { COSMOS_ADDRESS_CHAIN } from '../../manifests'; import { MsgSwapExactAmountIn } from '../../proto_export/osmosis/gamm/v1beta1/tx'; import { MsgSwapExactAmountIn as MsgSwapExactAmountInPoolManager } from '../../proto_export/osmosis/poolmanager/v1beta1/tx'; import { MsgTransfer } from '../../proto_export/ibc/applications/transfer/v1/tx'; -import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'; +import { isIBCPayload } from '../../utils'; @Injectable() export class ChainDataSource extends DataSource { @@ -200,9 +201,15 @@ export class ChainDataSource extends DataSource { for (let index = 0; index < msgs.length; index++) { const m = msgs[index]; - const messageData = + let messageData = m.encoding === 'string' ? await m.buildTx() : await m.toData(); fromAddress = messageData.from; + if (isIBCPayload(messageData)) { + const iBCTransferMsgs = await m.provider.createIBCTransferMsg( + messageData + ); + messageData = iBCTransferMsgs[0]; + } const _msgs: any[] = []; if (messageData.msgs?.length) { messageData.msgs.map((msgTransfer: any) => { diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index a7e05092..56560b39 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -33,6 +33,7 @@ import { MsgSwapExactAmountIn } from '../../proto_export/osmosis/gamm/v1beta1/tx import { MsgSwapExactAmountIn as MsgSwapExactAmountInPoolManager } from '../../proto_export/osmosis/poolmanager/v1beta1/tx'; import { MsgTransfer } from '../../proto_export/ibc/applications/transfer/v1/tx'; import { MsgSend } from '../../proto_export/cosmos/bank/v1beta1/tx'; +import { isIBCPayload } from '../../utils'; import { getBalance, getFees, getTransactions, getNFTBalance } from './queries'; @@ -157,10 +158,16 @@ export class IndexerDataSource extends DataSource { }); for (let index = 0; index < msgs.length; index++) { const m = msgs[index]; - const messageData = + let messageData = m.encoding === 'string' ? await m.buildTx() : await m.toData(); fromAddress = messageData.from; const _msgs: any[] = []; + if (isIBCPayload(messageData)) { + const iBCTransferMsgs = await m.provider.createIBCTransferMsg( + messageData + ); + messageData = iBCTransferMsgs[0]; + } if (messageData.msgs?.length) { messageData.msgs.map((msgTransfer: any) => { if (msgTransfer.typeUrl === MsgTransfer.typeUrl) { diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index e90b32c5..e8d8e7e6 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -28,6 +28,7 @@ import { MessageComposer as MessageComposerPoolManager } from './proto_export/os import { AminoConverter as AminoConverterGamm } from './proto_export/osmosis/gamm/v1beta1/tx.amino'; import { AminoConverter } from './proto_export/osmosis/poolmanager/v1beta1/tx.amino'; import { MsgSwapExactAmountIn as PoolManagerMsgSwapExactAmountIn } from './proto_export/osmosis/poolmanager/v1beta1/tx'; +import { isIBCPayload } from './utils'; export type MsgBody = { from: string; @@ -307,7 +308,7 @@ export class ChainMsg extends BasMsg { } async buildTx() { - const msgData = this.toData(); + let msgData = this.toData(); let signMode = CosmosSignMode.SIGN_DIRECT; const isAmino = (EncodingTypes: object, key: string): boolean => { return Object.values(EncodingTypes).find( @@ -411,6 +412,11 @@ export class ChainMsg extends BasMsg { }; } + if (isIBCPayload(msgData)) { + const iBCTransferMsgs = await this.provider.createIBCTransferMsg(msgData); + msgData = iBCTransferMsgs[0]; + } + const _msgs = this.getMsgToSend(); const feeOptions = msgData.feeOptions; diff --git a/packages/cosmos/src/signers/ledger.signer.ts b/packages/cosmos/src/signers/ledger.signer.ts index 156c8972..4d7b5fd2 100644 --- a/packages/cosmos/src/signers/ledger.signer.ts +++ b/packages/cosmos/src/signers/ledger.signer.ts @@ -2,7 +2,7 @@ import { LedgerSigner as LedgerApp } from '@cosmjs/ledger-amino'; import { stringToPath } from '@cosmjs/crypto'; import Transport from '@ledgerhq/hw-transport'; import { MsgEncoding, Signer, SignerDecorator } from '@xdefi-tech/chains-core'; -import { TxRaw, SignDoc, AuthInfo } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; +import { TxRaw, AuthInfo } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { SigningStargateClient } from '@cosmjs/stargate'; import { bech32 } from 'bech32'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; @@ -10,7 +10,6 @@ import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { AminoSignDoc, ChainMsg, - CosmosChainType, CosmosSignMode, DirectSignDoc, SignMsgSendResponse, @@ -97,7 +96,7 @@ export class LedgerSigner extends Signer.Provider { return client.sign(senderAddress, txData.msgs, txData.fee, txData.memo); } - async signDirect(msg: ChainMsg, app: LedgerApp): Promise { + async signDirect(_msg: ChainMsg, _app: LedgerApp): Promise { throw new Error('Ledger Signer not supported SIGN_DIRECT_MODE'); } @@ -124,7 +123,7 @@ export class LedgerSigner extends Signer.Provider { async signDirectRawTransaction( signDoc: DirectSignDoc, prefix: string, - derivation = `m/44'/118'/0'/0/0` + _derivation = `m/44'/118'/0'/0/0` ): Promise { throw new Error('Ledger Signer not supported SIGN_DIRECT_MODE'); } diff --git a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts index da7496a1..c4b3982c 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.spec.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.spec.ts @@ -8,7 +8,7 @@ import { makeMultisignedTxBytes } from '@cosmjs/stargate'; import { CosmosProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { COSMOS_MANIFESTS, CosmosHubChains } from '../manifests'; -import { ChainMsg, CosmosChainType, CosmosSignMode, MsgBody } from '../msg'; +import { ChainMsg, CosmosSignMode, MsgBody } from '../msg'; import SeedPhraseSigner from './seed-phrase.signer'; diff --git a/packages/cosmos/src/signers/seed-phrase.signer.ts b/packages/cosmos/src/signers/seed-phrase.signer.ts index ae4f9bc9..6343b873 100644 --- a/packages/cosmos/src/signers/seed-phrase.signer.ts +++ b/packages/cosmos/src/signers/seed-phrase.signer.ts @@ -8,7 +8,7 @@ import { pathToString, } from '@cosmjs/launchpad/node_modules/@cosmjs/crypto'; import { Wallet } from 'ethers'; -import { MnemonicKey, LCDClient } from '@terra-money/feather.js'; +import { MnemonicKey } from '@terra-money/feather.js'; import { encode } from 'bech32-buffer'; import { verifyADR36Amino } from '@keplr-wallet/cosmos'; import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'; diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index 5ac8d6a3..7d5e6521 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -7,6 +7,7 @@ import { Registry } from '@cosmjs/proto-signing/build/registry'; import axios from 'axios'; import { wasmTypes } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/messages'; import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate/build/modules/wasm/aminomessages'; +import { MsgData } from '@xdefi-tech/chains-core'; import { osmosisProtoRegistry, @@ -14,6 +15,7 @@ import { } from './proto_export/osmosis/client'; import { COSMOS_MANIFESTS, CosmosHubChains } from './manifests'; import { MsgBody } from './msg'; +import { IBCPayload } from './chain.provider'; export interface ChainAsset { denom: string; @@ -257,3 +259,13 @@ export const getIBCDestAsset = async ( originalChainId, }; }; + +export const isIBCPayload = (payload: MsgData): payload is IBCPayload => { + return ( + payload.amountIn && + payload.sourceAssetDenom && + payload.sourceAssetChain && + payload.destAssetChain && + payload.addresses + ); +}; From 715a9d6ce1de9c7538ef00ec56db2b42ceaeb632 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 28 Aug 2024 17:19:02 +0000 Subject: [PATCH 139/176] Version packages --- .changeset/olive-peas-shake.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/olive-peas-shake.md diff --git a/.changeset/olive-peas-shake.md b/.changeset/olive-peas-shake.md deleted file mode 100644 index aa057be2..00000000 --- a/.changeset/olive-peas-shake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index e5aec300..5d27f01a 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.43 + +### Patch Changes + +- 0d0096cc: feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible + ## 2.0.42 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index a4d264a0..fe99b8b5 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.42", + "version": "2.0.43", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From fdce99f61247eb96f102e2ca6e0d394f0e05a2dc Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:13:23 +0100 Subject: [PATCH 140/176] Chore/cosmos/auto adapt ibc msg (#342) * feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible * feat: add isIBCPayload to static functions; fix: lint * fix: defaulting sign to MsgSend * fix: array by spreading --------- Co-authored-by: danilxdefi --- .changeset/wet-phones-melt.md | 5 +++++ packages/cosmos/src/msg.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/wet-phones-melt.md diff --git a/.changeset/wet-phones-melt.md b/.changeset/wet-phones-melt.md new file mode 100644 index 00000000..aa057be2 --- /dev/null +++ b/.changeset/wet-phones-melt.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index e8d8e7e6..c8c6365e 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -411,13 +411,13 @@ export class ChainMsg extends BasMsg { value: 0, }; } - + const _msgs = []; if (isIBCPayload(msgData)) { const iBCTransferMsgs = await this.provider.createIBCTransferMsg(msgData); msgData = iBCTransferMsgs[0]; + } else { + _msgs.push(...this.getMsgToSend()); } - - const _msgs = this.getMsgToSend(); const feeOptions = msgData.feeOptions; if (!msgData.gasLimit || !msgData.gasPrice) { From 22a383dab0d9cb3af3ea8b9d897ede6fbfa961fb Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 28 Aug 2024 20:15:53 +0000 Subject: [PATCH 141/176] Version packages --- .changeset/wet-phones-melt.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/wet-phones-melt.md diff --git a/.changeset/wet-phones-melt.md b/.changeset/wet-phones-melt.md deleted file mode 100644 index aa057be2..00000000 --- a/.changeset/wet-phones-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 5d27f01a..6a7640f4 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.44 + +### Patch Changes + +- 0657f2d0: feat: update cosmos sign + estimateFee to automatically adapt inputs to ibc when possible + ## 2.0.43 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index fe99b8b5..8aa65964 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.43", + "version": "2.0.44", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From d11698879566e45ca5411c95a33445daf4cefb1b Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:50:24 +0300 Subject: [PATCH 142/176] fix: buildTx when maxPriorityFeePerGas is 0 (#343) --- .changeset/eleven-tips-flow.md | 5 +++++ packages/evm/src/msg.ts | 22 +++++++++++++------ .../evm/src/signers/private-key.signer.ts | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .changeset/eleven-tips-flow.md diff --git a/.changeset/eleven-tips-flow.md b/.changeset/eleven-tips-flow.md new file mode 100644 index 00000000..0cc296a7 --- /dev/null +++ b/.changeset/eleven-tips-flow.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +fix: buildTx when maxPriorityFeePerGas is 0 diff --git a/packages/evm/src/msg.ts b/packages/evm/src/msg.ts index a0a36f42..40a0749e 100644 --- a/packages/evm/src/msg.ts +++ b/packages/evm/src/msg.ts @@ -344,19 +344,27 @@ export class ChainMsg extends BasMsg { }; if (msgData.txType !== TransactionType.Legacy) { - if (!msgData.maxFeePerGas || !msgData.maxPriorityFeePerGas) { - throw new Error(`Can't get EIP1559 gas fee`); + if ( + isNaN(Number(msgData.maxFeePerGas)) || + isNaN(Number(msgData.maxPriorityFeePerGas)) + ) { + throw new Error( + `Can't get EIP1559 gas fee. maxFeePerGas: ${msgData.maxFeePerGas}, maxPriorityFeePerGas: ${msgData.maxPriorityFeePerGas}` + ); } - baseTx.maxFeePerGas = utils.toHex(msgData.maxFeePerGas.toString()); + + baseTx.maxFeePerGas = utils.toHex(msgData.maxFeePerGas!.toString()); baseTx.maxPriorityFeePerGas = utils.toHex( - msgData.maxPriorityFeePerGas.toString() + msgData.maxPriorityFeePerGas!.toString() ); baseTx.type = 2; } else { - if (!msgData.gasPrice) { - throw new Error(`Can't get legacy gas fee`); + if (isNaN(Number(msgData.gasPrice))) { + throw new Error( + `Can't get legacy gas fee. gasPrice: ${msgData.gasPrice}` + ); } - baseTx.gasPrice = utils.toHex(msgData.gasPrice.toString()); + baseTx.gasPrice = utils.toHex(msgData.gasPrice!.toString()); } const { contractData } = await this.getDataFromContract(); diff --git a/packages/evm/src/signers/private-key.signer.ts b/packages/evm/src/signers/private-key.signer.ts index a4bfe227..80688329 100644 --- a/packages/evm/src/signers/private-key.signer.ts +++ b/packages/evm/src/signers/private-key.signer.ts @@ -22,7 +22,7 @@ export class PrivateKeySigner extends Signer.Provider { async sign( msg: ChainMsg, - _derivation: string, + _derivation?: string, signatureType: SignatureType = SignatureType.Transaction ): Promise { const wallet = new Wallet(this.key); From 286237bf7a25aa365240b87bee7de87ff24b78a5 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 29 Aug 2024 09:52:58 +0000 Subject: [PATCH 143/176] Version packages --- .changeset/eleven-tips-flow.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/eleven-tips-flow.md diff --git a/.changeset/eleven-tips-flow.md b/.changeset/eleven-tips-flow.md deleted file mode 100644 index 0cc296a7..00000000 --- a/.changeset/eleven-tips-flow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -fix: buildTx when maxPriorityFeePerGas is 0 diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 7e3fd254..80ab6e1e 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.47 + +### Patch Changes + +- 81860b9b: fix: buildTx when maxPriorityFeePerGas is 0 + ## 2.0.46 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 76888741..91d194bd 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.46", + "version": "2.0.47", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From abe349232f7616e7ae29c5cbd160e1affa87c249 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:13:21 +0300 Subject: [PATCH 144/176] fix: fee estimation for mayachain chain.datasource (#344) --- .changeset/nervous-buses-melt.md | 5 +++++ packages/thor/src/datasource/chain/chain.data-source.ts | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/nervous-buses-melt.md diff --git a/.changeset/nervous-buses-melt.md b/.changeset/nervous-buses-melt.md new file mode 100644 index 00000000..2e1cb06b --- /dev/null +++ b/.changeset/nervous-buses-melt.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-thor': patch +--- + +fix: fee estimation for mayachain chain.datasource diff --git a/packages/thor/src/datasource/chain/chain.data-source.ts b/packages/thor/src/datasource/chain/chain.data-source.ts index 919630dd..1d371fdf 100644 --- a/packages/thor/src/datasource/chain/chain.data-source.ts +++ b/packages/thor/src/datasource/chain/chain.data-source.ts @@ -190,6 +190,11 @@ export class ChainDataSource extends DataSource { const network = `/${this.manifest.chain.toLowerCase()}/network`; const { data } = await this.rest.get(network); + if (!data.native_outbound_fee_rune) { + result.push(DEFAULT_FEE_DATA); + continue; + } + result.push({ gasLimit: Math.ceil(parseInt(data.native_outbound_fee_rune) * 1.4), gasPrice: this.manifest.feeGasStep[speed], From 0b2d64e426835f5cdd52e0d9c4a6bf3c8b7dad74 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 29 Aug 2024 10:15:51 +0000 Subject: [PATCH 145/176] Version packages --- .changeset/nervous-buses-melt.md | 5 ----- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/nervous-buses-melt.md diff --git a/.changeset/nervous-buses-melt.md b/.changeset/nervous-buses-melt.md deleted file mode 100644 index 2e1cb06b..00000000 --- a/.changeset/nervous-buses-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch ---- - -fix: fee estimation for mayachain chain.datasource diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index e052b57e..921ff8e2 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.1.2 + +### Patch Changes + +- 7237e67c: fix: fee estimation for mayachain chain.datasource + ## 2.1.1 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index ca19c17c..82abedd5 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.1.1", + "version": "2.1.2", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From ae787ac5472596989fa1f8faf80ff0714a64db75 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:47:31 +0300 Subject: [PATCH 146/176] fix: asset.decimals field for indexer data-source (#346) --- .changeset/eleven-pans-beg.md | 5 +++++ .../cosmos/src/datasource/indexer/indexer.data-source.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/eleven-pans-beg.md diff --git a/.changeset/eleven-pans-beg.md b/.changeset/eleven-pans-beg.md new file mode 100644 index 00000000..aa90e233 --- /dev/null +++ b/.changeset/eleven-pans-beg.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +fix: asset.decimals field for indexer data-source diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index 56560b39..82547094 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -86,7 +86,8 @@ export class IndexerDataSource extends DataSource { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion address: asset.contract!, price: asset.price?.amount, - decimals: asset.price?.scalingFactor, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + decimals: asset.decimals!, priceChange: { dayPriceChange: asset.price?.dayPriceChange, }, From 86586d7905a17186bb2ff164fbc6f49c9f0207b2 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 29 Aug 2024 10:49:57 +0000 Subject: [PATCH 147/176] Version packages --- .changeset/eleven-pans-beg.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/eleven-pans-beg.md diff --git a/.changeset/eleven-pans-beg.md b/.changeset/eleven-pans-beg.md deleted file mode 100644 index aa90e233..00000000 --- a/.changeset/eleven-pans-beg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -fix: asset.decimals field for indexer data-source diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 6a7640f4..9ccb4aa8 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.45 + +### Patch Changes + +- 34d81da7: fix: asset.decimals field for indexer data-source + ## 2.0.44 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 8aa65964..404b094b 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.44", + "version": "2.0.45", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 76caa4a88cc0edd5c43f2f78fba0c3c562513258 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:28:06 +0300 Subject: [PATCH 148/176] feat: add xdefi-trace-id to debug gql issues (#345) --- .changeset/little-timers-fail.md | 16 ++++++++++++++ packages/core/src/common/client/gql.client.ts | 22 +++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .changeset/little-timers-fail.md diff --git a/.changeset/little-timers-fail.md b/.changeset/little-timers-fail.md new file mode 100644 index 00000000..34fdfa7c --- /dev/null +++ b/.changeset/little-timers-fail.md @@ -0,0 +1,16 @@ +--- +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-evm': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-utxo': patch +--- + +feat: add xdefi-trace-id to debug gql issues diff --git a/packages/core/src/common/client/gql.client.ts b/packages/core/src/common/client/gql.client.ts index fff82ddc..deaea6ef 100644 --- a/packages/core/src/common/client/gql.client.ts +++ b/packages/core/src/common/client/gql.client.ts @@ -1,6 +1,7 @@ -import { ApolloClient, split } from '@apollo/client/core'; +import { ApolloClient, split, from } from '@apollo/client/core'; import { InMemoryCache } from '@apollo/client/cache'; import { HttpLink } from '@apollo/client/link/http'; +import { onError } from '@apollo/client/link/error'; import { GraphQLWsLink } from '@apollo/client/link/subscriptions'; import { getMainDefinition } from '@apollo/client/utilities'; import { createClient } from 'graphql-ws'; @@ -47,7 +48,24 @@ const cache = new InMemoryCache({ }, }); +const errorLink = onError(({ graphQLErrors, networkError, operation }) => { + if (graphQLErrors) { + for (const err of graphQLErrors) { + /* next step improvement: Check error and send it to sentry with traceId */ + + const traceId = operation.getContext().response.headers.get('xdefi-trace-id'); + // eslint-disable-next-line no-console + console.debug(`[GQL Error] traceId: ${traceId}`, err?.message); + } + } + + if (networkError) { + // eslint-disable-next-line no-console + console.debug(`[GQL Network error]: ${networkError}`); + } +}); + export const gqlClient = new ApolloClient({ - link: splitLink, + link: from([errorLink, splitLink]), cache, }); From 7195c4825b452c6d5fa5f94461f053fb1f0615cc Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 29 Aug 2024 11:30:31 +0000 Subject: [PATCH 149/176] Version packages --- .changeset/little-timers-fail.md | 16 ---------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 9 +++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 9 +++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 9 +++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 9 +++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- packages/utxo/CHANGELOG.md | 8 ++++++++ packages/utxo/package.json | 2 +- 25 files changed, 110 insertions(+), 28 deletions(-) delete mode 100644 .changeset/little-timers-fail.md diff --git a/.changeset/little-timers-fail.md b/.changeset/little-timers-fail.md deleted file mode 100644 index 34fdfa7c..00000000 --- a/.changeset/little-timers-fail.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-evm': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-utxo': patch ---- - -feat: add xdefi-trace-id to debug gql issues diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 55e9d159..850cba34 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.22 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + ## 2.0.21 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index b0430faa..48ee4d09 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.21", + "version": "2.0.22", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 81728d95..01a88cd5 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoin +## 2.1.2 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + - @xdefi-tech/chains-utxo@2.0.14 + ## 2.1.1 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index b8b8787a..44badec2 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.1.1", + "version": "2.1.2", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 12fc1635..f63ecd37 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoincash +## 2.1.2 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + - @xdefi-tech/chains-utxo@2.0.14 + ## 2.1.1 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index a9293ddd..f4d805ac 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.1.1", + "version": "2.1.2", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 78877c3f..1aa80a7d 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.29 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues + ## 2.0.28 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index c255335b..014aa325 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.28", + "version": "2.0.29", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 9ccb4aa8..2fd14e70 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.46 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + ## 2.0.45 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 404b094b..0da00984 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.45", + "version": "2.0.46", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index 2207b83a..c3406f70 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-dogecoin +## 2.1.2 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + - @xdefi-tech/chains-utxo@2.0.14 + ## 2.1.1 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 1b0a58e9..c4be1c8e 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.1.1", + "version": "2.1.2", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index 80ab6e1e..dd763d1f 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.48 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + ## 2.0.47 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 91d194bd..8174e864 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.47", + "version": "2.0.48", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 0fcd42e4..684b5a73 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-litecoin +## 2.1.2 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + - @xdefi-tech/chains-utxo@2.0.14 + ## 2.1.1 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 3e8f5ca0..1a3cebd6 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.1.1", + "version": "2.1.2", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 8acd2746..534943f7 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.1.4 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + ## 2.1.3 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index d0faa8c1..a291c09c 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.1.3", + "version": "2.1.4", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 921ff8e2..72e66acf 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.1.3 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + ## 2.1.2 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 82abedd5..e093c49f 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.1.2", + "version": "2.1.3", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 28f2eb42..0df571a0 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.33 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + ## 2.0.32 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index a8cfa80f..d3cb1619 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.32", + "version": "2.0.33", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index 98353d5d..9f00abfc 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-utxo +## 2.0.14 + +### Patch Changes + +- 44d3e999: feat: add xdefi-trace-id to debug gql issues +- Updated dependencies [44d3e999] + - @xdefi-tech/chains-core@2.0.29 + ## 2.0.13 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index 372c0c39..84cfd748 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.13", + "version": "2.0.14", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 929198d4a2327ea42fac0c76561f4cbbb564ed84 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Fri, 30 Aug 2024 19:56:19 +0100 Subject: [PATCH 150/176] fix: added MsgExecuteContract plus sanitiseMsg util (#349) * fix: added MsgExecuteContract plus sanitiseMsg util * chore: bump --- .changeset/funny-keys-impress.md | 5 + packages/cosmos/src/chain.provider.spec.ts | 134 +++++++++++++++++- .../datasource/indexer/indexer.data-source.ts | 17 ++- packages/cosmos/src/utils.ts | 15 ++ 4 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 .changeset/funny-keys-impress.md diff --git a/.changeset/funny-keys-impress.md b/.changeset/funny-keys-impress.md new file mode 100644 index 00000000..233aafdb --- /dev/null +++ b/.changeset/funny-keys-impress.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +added MsgExecuteContract and sanitiseMsg diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index 245b460f..eb278066 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -16,7 +16,7 @@ describe('chain.provider', () => { beforeEach(() => { provider = new CosmosProvider( - new IndexerDataSource(COSMOS_MANIFESTS.cosmos) + new IndexerDataSource(COSMOS_MANIFESTS.axelar) ); }); @@ -310,4 +310,136 @@ describe('chain.provider', () => { const estimateFee = await provider.estimateFee([msg], GasFeeSpeed.low); expect(estimateFee[0].gasLimit).toBeTruthy(); }); + it('test sanitiseMsg with tx from routing API', async () => { + const data = { + chainId: 'osmosis-1', + signer: 'osmo1lzmdpu0vkav73wx2tv3qgyfmcansf8f7hd9vxt', + signDoc: { + chain_id: 'osmosis-1', + account_number: '856691', + sequence: '11', + fee: { amount: [{ denom: 'uosmo', amount: 20000 }], gas: 500000 }, + msgs: [ + { + '@type': '/cosmos.bank.v1beta1.MsgSend', + amount: [{ amount: '15', denom: 'UION' }], + fromAddress: 'osmo1lzmdpu0vkav73wx2tv3qgyfmcansf8f7hd9vxt', + toAddress: 'osmo13djgqp5mmxvcgsr3ykt2pd8c5l4vr5gzz7pyqj', + }, + { + '@type': '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + routes: [ + { poolId: '1013', tokenOutDenom: 'uosmo' }, + { + poolId: '1086', + tokenOutDenom: + 'ibc/71F11BC0AF8E526B80E44172EBA9D3F0A8E03950BB882325435691EBC9450B1D', + }, + ], + sender: 'osmo1lzmdpu0vkav73wx2tv3qgyfmcansf8f7hd9vxt', + tokenIn: { amount: '4985', denom: 'UION' }, + tokenOutMinAmount: '2896449', + }, + ], + memo: '', + }, + signOptions: { preferNoSetFee: false }, + }; + const osmosis = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); + const msg = osmosis.createMsg( + { data: JSON.stringify(data) }, + MsgEncoding.string + ); + const estimateFee = await osmosis.estimateFee([msg], GasFeeSpeed.high); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); + it('test with msg containing MsgExecuteContract', async () => { + const data = { + chainId: 'osmosis-1', + signer: 'osmo1lzmdpu0vkav73wx2tv3qgyfmcansf8f7hd9vxt', + signDoc: { + chain_id: 'osmosis-1', + account_number: '856691', + sequence: '12', + fee: { amount: [{ denom: 'uosmo', amount: 20000 }], gas: 500000 }, + msgs: [ + { + typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract', + value: { + sender: 'osmo1lzmdpu0vkav73wx2tv3qgyfmcansf8f7hd9vxt', + contract: + 'osmo15jw7xccxaxk30lf4xgag8f7aeg53pgkh74e39rv00xfnymldjaas2fk627', + msg: [ + 123, 34, 115, 119, 97, 112, 95, 119, 105, 116, 104, 95, 97, 99, + 116, 105, 111, 110, 34, 58, 32, 123, 34, 115, 119, 97, 112, 95, + 109, 115, 103, 34, 58, 32, 123, 34, 116, 111, 107, 101, 110, 95, + 111, 117, 116, 95, 109, 105, 110, 95, 97, 109, 111, 117, 110, + 116, 34, 58, 32, 34, 49, 50, 50, 48, 49, 53, 34, 44, 32, 34, + 112, 97, 116, 104, 34, 58, 32, 91, 123, 34, 112, 111, 111, 108, + 95, 105, 100, 34, 58, 32, 34, 49, 49, 49, 52, 34, 44, 32, 34, + 116, 111, 107, 101, 110, 95, 111, 117, 116, 95, 100, 101, 110, + 111, 109, 34, 58, 32, 34, 117, 111, 115, 109, 111, 34, 125, 44, + 32, 123, 34, 112, 111, 111, 108, 95, 105, 100, 34, 58, 32, 34, + 49, 34, 44, 32, 34, 116, 111, 107, 101, 110, 95, 111, 117, 116, + 95, 100, 101, 110, 111, 109, 34, 58, 32, 34, 105, 98, 99, 47, + 50, 55, 51, 57, 52, 70, 66, 48, 57, 50, 68, 50, 69, 67, 67, 68, + 53, 54, 49, 50, 51, 67, 55, 52, 70, 51, 54, 69, 52, 67, 49, 70, + 57, 50, 54, 48, 48, 49, 67, 69, 65, 68, 65, 57, 67, 65, 57, 55, + 69, 65, 54, 50, 50, 66, 50, 53, 70, 52, 49, 69, 53, 69, 66, 50, + 34, 125, 93, 125, 44, 32, 34, 97, 102, 116, 101, 114, 95, 115, + 119, 97, 112, 95, 97, 99, 116, 105, 111, 110, 34, 58, 32, 123, + 34, 105, 98, 99, 95, 116, 114, 97, 110, 115, 102, 101, 114, 34, + 58, 32, 123, 34, 114, 101, 99, 101, 105, 118, 101, 114, 34, 58, + 32, 34, 99, 111, 115, 109, 111, 115, 49, 108, 122, 109, 100, + 112, 117, 48, 118, 107, 97, 118, 55, 51, 119, 120, 50, 116, 118, + 51, 113, 103, 121, 102, 109, 99, 97, 110, 115, 102, 56, 102, 55, + 108, 107, 107, 117, 115, 101, 34, 44, 32, 34, 99, 104, 97, 110, + 110, 101, 108, 34, 58, 32, 34, 99, 104, 97, 110, 110, 101, 108, + 45, 48, 34, 125, 125, 44, 32, 34, 108, 111, 99, 97, 108, 95, + 102, 97, 108, 108, 98, 97, 99, 107, 95, 97, 100, 100, 114, 101, + 115, 115, 34, 58, 32, 34, 111, 115, 109, 111, 49, 108, 122, 109, + 100, 112, 117, 48, 118, 107, 97, 118, 55, 51, 119, 120, 50, 116, + 118, 51, 113, 103, 121, 102, 109, 99, 97, 110, 115, 102, 56, + 102, 55, 104, 100, 57, 118, 120, 116, 34, 125, 125, + ], + funds: [ + { + denom: + 'ibc/71F11BC0AF8E526B80E44172EBA9D3F0A8E03950BB882325435691EBC9450B1D', + amount: '1994000', + }, + ], + }, + }, + { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: { + amount: [ + { + amount: '6000', + denom: + 'ibc/71F11BC0AF8E526B80E44172EBA9D3F0A8E03950BB882325435691EBC9450B1D', + }, + ], + fromAddress: 'osmo1lzmdpu0vkav73wx2tv3qgyfmcansf8f7hd9vxt', + toAddress: 'osmo13djgqp5mmxvcgsr3ykt2pd8c5l4vr5gzz7pyqj', + }, + }, + ], + memo: '', + }, + signOptions: { preferNoSetFee: false }, + }; + const osmosis = new CosmosProvider( + new IndexerDataSource(COSMOS_MANIFESTS.osmosis) + ); + const msg = osmosis.createMsg( + { data: JSON.stringify(data) }, + MsgEncoding.string + ); + const estimateFee = await osmosis.estimateFee([msg], GasFeeSpeed.high); + expect(estimateFee[0].gasLimit).toBeTruthy(); + }); }); diff --git a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts index 82547094..42c1ea96 100644 --- a/packages/cosmos/src/datasource/indexer/indexer.data-source.ts +++ b/packages/cosmos/src/datasource/indexer/indexer.data-source.ts @@ -33,7 +33,7 @@ import { MsgSwapExactAmountIn } from '../../proto_export/osmosis/gamm/v1beta1/tx import { MsgSwapExactAmountIn as MsgSwapExactAmountInPoolManager } from '../../proto_export/osmosis/poolmanager/v1beta1/tx'; import { MsgTransfer } from '../../proto_export/ibc/applications/transfer/v1/tx'; import { MsgSend } from '../../proto_export/cosmos/bank/v1beta1/tx'; -import { isIBCPayload } from '../../utils'; +import { isIBCPayload, sanitiseMsg } from '../../utils'; import { getBalance, getFees, getTransactions, getNFTBalance } from './queries'; @@ -171,6 +171,7 @@ export class IndexerDataSource extends DataSource { } if (messageData.msgs?.length) { messageData.msgs.map((msgTransfer: any) => { + msgTransfer.value = sanitiseMsg(msgTransfer.value); if (msgTransfer.typeUrl === MsgTransfer.typeUrl) { _msgs.push({ typeUrl: MsgTransfer.typeUrl, @@ -194,6 +195,20 @@ export class IndexerDataSource extends DataSource { MsgSwapExactAmountIn.fromPartial(msgTransfer.value) ).finish(), }); + } else if (msgTransfer.typeUrl === MsgSend.typeUrl) { + _msgs.push({ + typeUrl: MsgSend.typeUrl, + value: MsgSend.encode( + MsgSend.fromPartial(msgTransfer.value) + ).finish(), + }); + } else if (msgTransfer.typeUrl === MsgExecuteContract.typeUrl) { + _msgs.push({ + typeUrl: MsgExecuteContract.typeUrl, + value: MsgExecuteContract.encode( + MsgExecuteContract.fromPartial(msgTransfer.value) + ).finish(), + }); } }); } else { diff --git a/packages/cosmos/src/utils.ts b/packages/cosmos/src/utils.ts index 7d5e6521..b411c69b 100644 --- a/packages/cosmos/src/utils.ts +++ b/packages/cosmos/src/utils.ts @@ -269,3 +269,18 @@ export const isIBCPayload = (payload: MsgData): payload is IBCPayload => { payload.addresses ); }; + +// this is required as routing is sometimes returning a denom which is in uppercase which is causing the balance not to be found +export const sanitiseMsg = (msg: any) => { + if (Array.isArray(msg.amount)) { + msg.amount = msg.amount.map((amount: { amount: string; denom: string }) => { + if (amount.denom && !amount.denom.includes('ibc')) + amount.denom = amount.denom.toLowerCase(); + return amount; + }); + } + if (msg?.tokenIn?.denom && !msg.tokenIn.denom.includes('ibc')) { + msg.tokenIn.denom = msg.tokenIn.denom.toLowerCase(); + } + return msg; +}; From 25ae802271d43c34955f64e1fa176e6346aa7205 Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 30 Aug 2024 18:58:45 +0000 Subject: [PATCH 151/176] Version packages --- .changeset/funny-keys-impress.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/funny-keys-impress.md diff --git a/.changeset/funny-keys-impress.md b/.changeset/funny-keys-impress.md deleted file mode 100644 index 233aafdb..00000000 --- a/.changeset/funny-keys-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -added MsgExecuteContract and sanitiseMsg diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 2fd14e70..0fd85ab8 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.47 + +### Patch Changes + +- be72f6c7: added MsgExecuteContract and sanitiseMsg + ## 2.0.46 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 0da00984..ba5fd3a2 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.46", + "version": "2.0.47", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From cdd6f8c0f4fbeadb5c8c2009ecfeff53502e82c0 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:11:48 +0300 Subject: [PATCH 152/176] fix: add getAccountResource to base datasource to use it in FallbackDataSource (#351) --- .changeset/fair-windows-train.md | 16 ++++++++++++++++ .../core/src/core/datasource/base.data-source.ts | 4 ++++ .../src/core/datasource/fallback.data-source.ts | 11 +++++++++++ 3 files changed, 31 insertions(+) create mode 100644 .changeset/fair-windows-train.md diff --git a/.changeset/fair-windows-train.md b/.changeset/fair-windows-train.md new file mode 100644 index 00000000..7c136cd1 --- /dev/null +++ b/.changeset/fair-windows-train.md @@ -0,0 +1,16 @@ +--- +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-evm': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-tron': patch +'@xdefi-tech/chains-utxo': patch +--- + +Fix: add getAccountResource to base datasource to use it in FallbackDataSource diff --git a/packages/core/src/core/datasource/base.data-source.ts b/packages/core/src/core/datasource/base.data-source.ts index 8c613a63..15b1df09 100644 --- a/packages/core/src/core/datasource/base.data-source.ts +++ b/packages/core/src/core/datasource/base.data-source.ts @@ -95,4 +95,8 @@ export abstract class DataSource { public async getTransaction(_txHash: string): Promise { throw new Error('Method not implemented.'); } + + public async getAccountResource(_address: string): Promise { + throw new Error('Method not implemented.'); + } } diff --git a/packages/core/src/core/datasource/fallback.data-source.ts b/packages/core/src/core/datasource/fallback.data-source.ts index e7a6af40..ce650915 100644 --- a/packages/core/src/core/datasource/fallback.data-source.ts +++ b/packages/core/src/core/datasource/fallback.data-source.ts @@ -121,4 +121,15 @@ export class FallbackDataSource extends DataSource { get name(): string { return `${this.constructor.name},${this.providers.map((provider) => provider.name).join(',')}`; } + + async getAccountResource(address: string) { + try { + if (this.getProvider().getAccountResource) { + return await this.getProvider().getAccountResource(address); + } + } catch (err) { + this.attempts++; + throw err; + } + } } From 283f22553d92eee9300cb4f2c6109617c99bfd02 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 3 Sep 2024 08:14:21 +0000 Subject: [PATCH 153/176] Version packages --- .changeset/fair-windows-train.md | 16 ---------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 9 +++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 9 +++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 9 +++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 9 +++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 8 ++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/tron/CHANGELOG.md | 8 ++++++++ packages/tron/package.json | 2 +- packages/utxo/CHANGELOG.md | 8 ++++++++ packages/utxo/package.json | 2 +- 25 files changed, 110 insertions(+), 28 deletions(-) delete mode 100644 .changeset/fair-windows-train.md diff --git a/.changeset/fair-windows-train.md b/.changeset/fair-windows-train.md deleted file mode 100644 index 7c136cd1..00000000 --- a/.changeset/fair-windows-train.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-evm': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-tron': patch -'@xdefi-tech/chains-utxo': patch ---- - -Fix: add getAccountResource to base datasource to use it in FallbackDataSource diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 850cba34..5e38c89a 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.23 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + ## 2.0.22 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index 48ee4d09..c2ae5ae9 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.22", + "version": "2.0.23", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 01a88cd5..89cce859 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoin +## 2.1.3 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + - @xdefi-tech/chains-utxo@2.0.15 + ## 2.1.2 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 44badec2..5f62f79d 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.1.2", + "version": "2.1.3", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index f63ecd37..91603f95 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-bitcoincash +## 2.1.3 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + - @xdefi-tech/chains-utxo@2.0.15 + ## 2.1.2 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index f4d805ac..1e6f028e 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.1.2", + "version": "2.1.3", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 1aa80a7d..ea83d55a 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.30 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource + ## 2.0.29 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 014aa325..63c3885a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.29", + "version": "2.0.30", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 0fd85ab8..59b9cdd1 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.48 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + ## 2.0.47 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index ba5fd3a2..f695c658 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.47", + "version": "2.0.48", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index c3406f70..f8019e47 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-dogecoin +## 2.1.3 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + - @xdefi-tech/chains-utxo@2.0.15 + ## 2.1.2 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index c4be1c8e..ef0eb1a4 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.1.2", + "version": "2.1.3", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index dd763d1f..a4e2446f 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.49 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + ## 2.0.48 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 8174e864..6200bfbf 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.48", + "version": "2.0.49", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 684b5a73..201ee6b2 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-litecoin +## 2.1.3 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + - @xdefi-tech/chains-utxo@2.0.15 + ## 2.1.2 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 1a3cebd6..bd3a072d 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.1.2", + "version": "2.1.3", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 534943f7..b16cfb28 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-solana +## 2.1.5 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + ## 2.1.4 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index a291c09c..aa954f5c 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.1.4", + "version": "2.1.5", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 72e66acf..de6a0cba 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.1.4 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + ## 2.1.3 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index e093c49f..5137a7f0 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.1.3", + "version": "2.1.4", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 0df571a0..9089e47f 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-tron +## 2.0.34 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + ## 2.0.33 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index d3cb1619..30cda569 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.33", + "version": "2.0.34", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index 9f00abfc..ad41f358 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-utxo +## 2.0.15 + +### Patch Changes + +- 1b543aef: Fix: add getAccountResource to base datasource to use it in FallbackDataSource +- Updated dependencies [1b543aef] + - @xdefi-tech/chains-core@2.0.30 + ## 2.0.14 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index 84cfd748..f96c193f 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.14", + "version": "2.0.15", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 9e834a3b7a422e95b8ca2b39d47b32380661ac78 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:51:19 +0300 Subject: [PATCH 154/176] fix: return null for getFee method (#352) --- .changeset/fuzzy-crews-add.md | 6 ++++++ packages/cosmos/src/msg.ts | 6 +++--- packages/thor/src/msg.ts | 10 +++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .changeset/fuzzy-crews-add.md diff --git a/.changeset/fuzzy-crews-add.md b/.changeset/fuzzy-crews-add.md new file mode 100644 index 00000000..0c364cbe --- /dev/null +++ b/.changeset/fuzzy-crews-add.md @@ -0,0 +1,6 @@ +--- +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-thor': patch +--- + +Fix: return null for getFee method diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index c8c6365e..0698b31a 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -488,14 +488,14 @@ export class ChainMsg extends BasMsg { feeEstimation, feeOptions.gasFee.denom ); - if (!feeAbstractionEstimation.gasPrice) { + if (isNaN(Number(feeAbstractionEstimation.gasPrice))) { throw new Error('Cannot calculate fee abstraction'); } estimation.fee = new BigNumber( feeAbstractionEstimation.gasLimit.toString() ) .multipliedBy(feeOptions.gasAdjustment) - .multipliedBy(feeAbstractionEstimation.gasPrice.toString()) + .multipliedBy(feeAbstractionEstimation.gasPrice!.toString()) .toFixed(0); } else { estimation.fee = new BigNumber(feeEstimation.gasLimit.toString()) @@ -504,7 +504,7 @@ export class ChainMsg extends BasMsg { .toString(); } } - } else if (data.gasLimit && data.gasPrice) { + } else if (!isNaN(Number(data.gasPrice)) && !isNaN(Number(data.gasLimit))) { estimation.fee = new BigNumber(data.gasLimit) .multipliedBy(feeOptions?.gasAdjustment ?? 1) .multipliedBy(data.gasPrice) diff --git a/packages/thor/src/msg.ts b/packages/thor/src/msg.ts index 43cac076..bdcb6bc5 100644 --- a/packages/thor/src/msg.ts +++ b/packages/thor/src/msg.ts @@ -186,13 +186,17 @@ export class ChainMsg extends BasMsg { [this], speed || GasFeeSpeed.medium ); - if (feeEstimation.gasPrice && feeEstimation.gasLimit) { + if ( + !isNaN(Number(feeEstimation.gasPrice)) && + !isNaN(Number(feeEstimation.gasLimit)) + ) { estimation.fee = new BigNumber(feeEstimation.gasLimit.toString()) - .multipliedBy(feeEstimation.gasPrice.toString()) + .multipliedBy(feeEstimation.gasPrice!.toString()) .dividedBy(10 ** this.provider.manifest.decimals) .toString(); } - } else if (data.gasLimit && data.gasPrice) { + } + if (!isNaN(Number(data.gasPrice)) && !isNaN(Number(data.gasLimit))) { estimation.fee = new BigNumber(data.gasLimit) .multipliedBy(data.gasPrice) .dividedBy(10 ** this.provider.manifest.decimals) From 2ce82000acd03d2552f8e57f9275570b2e9791e2 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 3 Sep 2024 08:53:46 +0000 Subject: [PATCH 155/176] Version packages --- .changeset/fuzzy-crews-add.md | 6 ------ packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 .changeset/fuzzy-crews-add.md diff --git a/.changeset/fuzzy-crews-add.md b/.changeset/fuzzy-crews-add.md deleted file mode 100644 index 0c364cbe..00000000 --- a/.changeset/fuzzy-crews-add.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-thor': patch ---- - -Fix: return null for getFee method diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 59b9cdd1..51e0f6e8 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.49 + +### Patch Changes + +- f72964cd: Fix: return null for getFee method + ## 2.0.48 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index f695c658..7a03a12e 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.48", + "version": "2.0.49", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index de6a0cba..bf5fe23a 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.1.5 + +### Patch Changes + +- f72964cd: Fix: return null for getFee method + ## 2.1.4 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 5137a7f0..d6382dae 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.1.4", + "version": "2.1.5", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 439760a14d7c3d8a71d82b986676ece3e6b5da4a Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Tue, 3 Sep 2024 12:37:43 +0300 Subject: [PATCH 156/176] feat: add dataSourceList to tron provider (#353) --- .changeset/afraid-islands-dance.md | 5 +++++ packages/tron/src/chain.provider.ts | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/afraid-islands-dance.md diff --git a/.changeset/afraid-islands-dance.md b/.changeset/afraid-islands-dance.md new file mode 100644 index 00000000..2f0dbc44 --- /dev/null +++ b/.changeset/afraid-islands-dance.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-tron': patch +--- + +Feat: add dataSourceList to provider diff --git a/packages/tron/src/chain.provider.ts b/packages/tron/src/chain.provider.ts index 7b379808..5695f6e6 100644 --- a/packages/tron/src/chain.provider.ts +++ b/packages/tron/src/chain.provider.ts @@ -260,4 +260,11 @@ export class TronProvider extends Chain.Provider { return obj; }, []); } + + static get dataSourceList() { + return { + ChainDataSource: ChainDataSource, + IndexerDataSource: IndexerDataSource, + }; + } } From 0ada12ec64d7a4b409e66e1bbf46ba339f5222f2 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 3 Sep 2024 09:40:14 +0000 Subject: [PATCH 157/176] Version packages --- .changeset/afraid-islands-dance.md | 5 ----- packages/tron/CHANGELOG.md | 6 ++++++ packages/tron/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/afraid-islands-dance.md diff --git a/.changeset/afraid-islands-dance.md b/.changeset/afraid-islands-dance.md deleted file mode 100644 index 2f0dbc44..00000000 --- a/.changeset/afraid-islands-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-tron': patch ---- - -Feat: add dataSourceList to provider diff --git a/packages/tron/CHANGELOG.md b/packages/tron/CHANGELOG.md index 9089e47f..9695202b 100644 --- a/packages/tron/CHANGELOG.md +++ b/packages/tron/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-tron +## 2.0.35 + +### Patch Changes + +- 59e58ce9: Feat: add dataSourceList to provider + ## 2.0.34 ### Patch Changes diff --git a/packages/tron/package.json b/packages/tron/package.json index 30cda569..412ec9bb 100644 --- a/packages/tron/package.json +++ b/packages/tron/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-tron", - "version": "2.0.34", + "version": "2.0.35", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 27d8af32d31f2b84d90f4129e4a93ff9e262f669 Mon Sep 17 00:00:00 2001 From: Liam McAweeney <59666496+liammcaweeney@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:27:59 +0100 Subject: [PATCH 158/176] Version packages (#354) Co-authored-by: cicd --- .changeset/brown-keys-exercise.md | 5 +++++ packages/cosmos/src/manifests.ts | 4 ++-- packages/cosmos/src/msg.ts | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/brown-keys-exercise.md diff --git a/.changeset/brown-keys-exercise.md b/.changeset/brown-keys-exercise.md new file mode 100644 index 00000000..30ddb9a5 --- /dev/null +++ b/.changeset/brown-keys-exercise.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +fix mars gasFeeStep diff --git a/packages/cosmos/src/manifests.ts b/packages/cosmos/src/manifests.ts index a745eb50..0fe56b6c 100644 --- a/packages/cosmos/src/manifests.ts +++ b/packages/cosmos/src/manifests.ts @@ -270,8 +270,8 @@ export const COSMOS_MANIFESTS: { decimals: 6, prefix: 'mars', feeGasStep: { - high: 0, - medium: 0, + high: 0.01, + medium: 0.01, low: 0.01, }, maxGapAmount: 0, diff --git a/packages/cosmos/src/msg.ts b/packages/cosmos/src/msg.ts index 0698b31a..a01011ff 100644 --- a/packages/cosmos/src/msg.ts +++ b/packages/cosmos/src/msg.ts @@ -426,7 +426,8 @@ export class ChainMsg extends BasMsg { GasFeeSpeed.medium ); msgData.gasLimit = msgData.gasLimit ?? feeEstimation.gasLimit; - msgData.gasPrice = msgData.gasPrice ?? feeEstimation.gasPrice; + if (!msgData?.gasPrice || msgData?.gasPrice <= 0) + msgData.gasPrice = feeEstimation.gasPrice; } const fee = { From 49804bda7fdb1a1e537a72fd05b5d8cf056483b5 Mon Sep 17 00:00:00 2001 From: cicd Date: Tue, 3 Sep 2024 13:30:27 +0000 Subject: [PATCH 159/176] Version packages --- .changeset/brown-keys-exercise.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/brown-keys-exercise.md diff --git a/.changeset/brown-keys-exercise.md b/.changeset/brown-keys-exercise.md deleted file mode 100644 index 30ddb9a5..00000000 --- a/.changeset/brown-keys-exercise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -fix mars gasFeeStep diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 51e0f6e8..facfdb34 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.50 + +### Patch Changes + +- a09cc88b: fix mars gasFeeStep + ## 2.0.49 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 7a03a12e..6a27932a 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.49", + "version": "2.0.50", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 4856cfed466e2a78f751a6a2780cf1acbf28bbdb Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:20:00 +0300 Subject: [PATCH 160/176] feat: add updated demo app (#356) --- .../react/components/balances.component.tsx | 136 +- .../chains/binance/provider.container.tsx | 92 + .../chains/binance/transfer.component.tsx | 174 ++ .../chains/bitcoin/provider.container.tsx | 92 + .../chains/bitcoin/transfer.component.tsx | 161 ++ .../chains/bitcoincash/provider.container.tsx | 92 + .../chains/bitcoincash/transfer.component.tsx | 161 ++ .../chains/cosmos/provider.container.tsx | 92 + .../chains/cosmos/transfer.component.tsx | 192 ++ .../chains/dogecoin/provider.container.tsx | 92 + .../chains/dogecoin/transfer.component.tsx | 161 ++ .../chains/evm/provider.container.tsx | 92 + .../chains/evm/transfer.component.tsx | 186 ++ .../chains/litecoin/provider.container.tsx | 92 + .../chains/litecoin/transfer.component.tsx | 161 ++ .../chains/solana/provider.container.tsx | 92 + .../chains/solana/transfer.component.tsx | 176 ++ .../chains/thor/provider.container.tsx | 92 + .../chains/thor/transfer.component.tsx | 178 ++ .../chains/tron/provider.container.tsx | 92 + .../chains/tron/transfer.component.tsx | 161 ++ .../containers/how-to.container.tsx | 37 + .../components/transactions.component.tsx | 97 +- examples/react/constants/registry.ts | 1877 +++++++++++++++++ examples/react/context/chains.context.ts | 213 +- examples/react/package.json | 16 +- examples/react/pages/index.tsx | 305 ++- yarn.lock | 401 +++- 28 files changed, 5248 insertions(+), 465 deletions(-) create mode 100644 examples/react/components/chains/binance/provider.container.tsx create mode 100644 examples/react/components/chains/binance/transfer.component.tsx create mode 100644 examples/react/components/chains/bitcoin/provider.container.tsx create mode 100644 examples/react/components/chains/bitcoin/transfer.component.tsx create mode 100644 examples/react/components/chains/bitcoincash/provider.container.tsx create mode 100644 examples/react/components/chains/bitcoincash/transfer.component.tsx create mode 100644 examples/react/components/chains/cosmos/provider.container.tsx create mode 100644 examples/react/components/chains/cosmos/transfer.component.tsx create mode 100644 examples/react/components/chains/dogecoin/provider.container.tsx create mode 100644 examples/react/components/chains/dogecoin/transfer.component.tsx create mode 100644 examples/react/components/chains/evm/provider.container.tsx create mode 100644 examples/react/components/chains/evm/transfer.component.tsx create mode 100644 examples/react/components/chains/litecoin/provider.container.tsx create mode 100644 examples/react/components/chains/litecoin/transfer.component.tsx create mode 100644 examples/react/components/chains/solana/provider.container.tsx create mode 100644 examples/react/components/chains/solana/transfer.component.tsx create mode 100644 examples/react/components/chains/thor/provider.container.tsx create mode 100644 examples/react/components/chains/thor/transfer.component.tsx create mode 100644 examples/react/components/chains/tron/provider.container.tsx create mode 100644 examples/react/components/chains/tron/transfer.component.tsx create mode 100644 examples/react/components/containers/how-to.container.tsx create mode 100644 examples/react/constants/registry.ts diff --git a/examples/react/components/balances.component.tsx b/examples/react/components/balances.component.tsx index 0c1c7483..2f2e43bb 100644 --- a/examples/react/components/balances.component.tsx +++ b/examples/react/components/balances.component.tsx @@ -3,43 +3,31 @@ import { Box, Typography, Button, - Divider, List, ListItemAvatar, ListItem, ListItemText, } from '@mui/material'; import { Coin, Chain } from '@xdefi-tech/chains-core'; -import { isEmpty } from 'lodash'; +import HowToContainer from './containers/how-to.container'; export interface IBalancesComponent { provider: Chain.Provider; address: string; tokenList: string[]; + children?: React.ReactNode; } const BalancesComponent = (props: IBalancesComponent) => { const [balances, setBalances] = useState([]); const [balanceError, setBalanceError] = useState(null); const [balanceLoader, setBalanceLoader] = useState(false); - const [subscription, setSubscription] = useState(null); const [lastUpdate, setLastUpdate] = useState(null); - useEffect(() => { - handleUnsubscribe(); - }, [props.address, props.provider, props.tokenList]); useEffect(() => { setBalanceError(null); }, [props.address]); - const handleUnsubscribe = useCallback(() => { - if (subscription) { - subscription.unsubscribe(); - setSubscription(null); - } - setBalanceError(null); - }, [subscription]); - const handleBalanceClick = useCallback(async () => { try { setBalanceLoader(true); @@ -63,32 +51,9 @@ const BalancesComponent = (props: IBalancesComponent) => { } }, [props.address, props.provider, props.tokenList]); - const handleStreamingClick = useCallback(async () => { - try { - if (subscription) { - handleUnsubscribe(); - return; - } - if (isEmpty(balances)) { - await handleBalanceClick(); - } - const balanceResponse = await props.provider.getBalance(props.address); - const balanceObserver = await balanceResponse.getObserver(); - setSubscription( - balanceObserver.subscribe((data) => { - // todo create and update subs list - console.log('subscription data', data); - }) - ); - } catch (err) { - setBalanceError(err.message); - setSubscription(null); - } - }, [balances, subscription, props.address, props.provider]); - return ( - Balances + Balances - {balanceError && {balanceError}} - {lastUpdate && ( - - {lastUpdate.toDateString()} {lastUpdate.toTimeString()} - - )} + {balances.length > 0 && ( + <> + {lastUpdate && ( + + {lastUpdate.toDateString()} {lastUpdate.toTimeString()} + + )} - - {balances.map((coin: Coin) => { - const priceInUsd = coin.asset.price - ? `${coin.amount.multipliedBy(coin.asset.price).toFixed(2)}$` - : 'N/A'; - return ( - - - {coin.asset.symbol} - - {coin.asset.symbol} - - - ); - })} - + + {balances.map((coin: Coin) => { + const priceInUsd = coin.asset.price + ? `${coin.amount.multipliedBy(coin.asset.price).toFixed(2)}$` + : 'N/A'; + return ( + + + {coin.asset.symbol} + + {coin.asset.symbol} + + + ); + })} + + + )} - + {props.children} ); }; diff --git a/examples/react/components/chains/binance/provider.container.tsx b/examples/react/components/chains/binance/provider.container.tsx new file mode 100644 index 00000000..69f20780 --- /dev/null +++ b/examples/react/components/chains/binance/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const BinanceProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new BinanceProvider( + new BinanceProvider.dataSourceList.IndexerDataSource(BINANCE_MANIFEST) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new BinanceProvider( + new BinanceProvider.dataSourceList.IndexerDataSource(BINANCE_MANIFEST) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default BinanceProviderContainer; diff --git a/examples/react/components/chains/binance/transfer.component.tsx b/examples/react/components/chains/binance/transfer.component.tsx new file mode 100644 index 00000000..852b6e99 --- /dev/null +++ b/examples/react/components/chains/binance/transfer.component.tsx @@ -0,0 +1,174 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.01'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [denom, setDenom] = React.useState('bnb'); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + denom: denom, + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals, denom]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Denom + + + + + Derivation + + + + + {`import { BinanceProvider, BINANCE_MANIFEST } from '@xdefi-tech/chains-binance'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-binance/dist/signers/web'; + +const provider = new BinanceProvider( + new BinanceProvider.dataSourceList.IndexerDataSource(BINANCE_MANIFEST) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + denom: '${denom}', + ${decimals && `decimals: '${decimals}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/bitcoin/provider.container.tsx b/examples/react/components/chains/bitcoin/provider.container.tsx new file mode 100644 index 00000000..b06acc14 --- /dev/null +++ b/examples/react/components/chains/bitcoin/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const BitcoinProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new BitcoinProvider( + new BitcoinProvider.dataSourceList.IndexerDataSource(BITCOIN_MANIFEST) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new BitcoinProvider( + new BitcoinProvider.dataSourceList.IndexerDataSource(BITCOIN_MANIFEST) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default BitcoinProviderContainer; diff --git a/examples/react/components/chains/bitcoin/transfer.component.tsx b/examples/react/components/chains/bitcoin/transfer.component.tsx new file mode 100644 index 00000000..c6254813 --- /dev/null +++ b/examples/react/components/chains/bitcoin/transfer.component.tsx @@ -0,0 +1,161 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Derivation + + + + + {`import { BitcoinProvider, BITCOIN_MANIFEST } from '@xdefi-tech/chains-bitcoin'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-bitcoin/dist/signers/web'; + +const provider = new BitcoinProvider( + new BitcoinProvider.dataSourceList.IndexerDataSource(BITCOIN_MANIFEST) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/bitcoincash/provider.container.tsx b/examples/react/components/chains/bitcoincash/provider.container.tsx new file mode 100644 index 00000000..65298ef8 --- /dev/null +++ b/examples/react/components/chains/bitcoincash/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const BitcoinCashProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new BitcoinCashProvider( + new BitcoinCashProvider.dataSourceList.IndexerDataSource(BITCOINCASH_MANIFEST) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new BitcoinCashProvider( + new BitcoinCashProvider.dataSourceList.IndexerDataSource(BITCOINCASH_MANIFEST) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default BitcoinCashProviderContainer; diff --git a/examples/react/components/chains/bitcoincash/transfer.component.tsx b/examples/react/components/chains/bitcoincash/transfer.component.tsx new file mode 100644 index 00000000..ee7ca969 --- /dev/null +++ b/examples/react/components/chains/bitcoincash/transfer.component.tsx @@ -0,0 +1,161 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.01'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Derivation + + + + + {`import { BitcoinCashProvider, BITCOINCASH_MANIFEST } from '@xdefi-tech/chains-bitcoincash'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-bitcoincash/dist/signers/web'; + +const provider = new BitcoinCashProvider( + new BitcoinCashProvider.dataSourceList.IndexerDataSource(BITCOINCASH_MANIFEST) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/cosmos/provider.container.tsx b/examples/react/components/chains/cosmos/provider.container.tsx new file mode 100644 index 00000000..ffc8f43c --- /dev/null +++ b/examples/react/components/chains/cosmos/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const CosmosProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new CosmosProvider( + new CosmosProvider.dataSourceList.IndexerDataSource(COSMOS_MANIFESTS.${provider.manifest.chain}) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new CosmosProvider( + new CosmosProvider.dataSourceList.IndexerDataSource(COSMOS_MANIFESTS.${provider.manifest.chain}) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default CosmosProviderContainer; diff --git a/examples/react/components/chains/cosmos/transfer.component.tsx b/examples/react/components/chains/cosmos/transfer.component.tsx new file mode 100644 index 00000000..3f41e0c0 --- /dev/null +++ b/examples/react/components/chains/cosmos/transfer.component.tsx @@ -0,0 +1,192 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [contractAddress, setContractAddress] = React.useState(''); + const [denom, setDenom] = React.useState( + props.provider.manifest.denom + ); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + ...(contractAddress && { contractAddress }), + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals, contractAddress]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Denom + + + + + + Contract address + + + + + + Derivation + + + + + {`import { CosmosProvider, COSMOS_MANIFESTS } from '@xdefi-tech/chains-cosmos'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-cosmos/dist/signers/web'; + +const provider = new CosmosProvider( + new CosmosProvider.dataSourceList.IndexerDataSource(COSMOS_MANIFESTS.${ + props.provider.manifest.chain + }) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} + ${denom && `decimals: '${denom}',`} + ${contractAddress && `contractAddress: '${contractAddress}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/dogecoin/provider.container.tsx b/examples/react/components/chains/dogecoin/provider.container.tsx new file mode 100644 index 00000000..927a8579 --- /dev/null +++ b/examples/react/components/chains/dogecoin/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const DogecoinProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new DogecoinProvider( + new DogecoinProvider.dataSourceList.IndexerDataSource(DOGECOIN_MANIFEST) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new DogecoinProvider( + new DogecoinProvider.dataSourceList.IndexerDataSource(DOGECOIN_MANIFEST) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default DogecoinProviderContainer; diff --git a/examples/react/components/chains/dogecoin/transfer.component.tsx b/examples/react/components/chains/dogecoin/transfer.component.tsx new file mode 100644 index 00000000..5d2fd6ab --- /dev/null +++ b/examples/react/components/chains/dogecoin/transfer.component.tsx @@ -0,0 +1,161 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Derivation + + + + + {`import { DogecoinProvider, DOGECOIN_MANIFEST } from '@xdefi-tech/chains-dogecoin'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-dogecoin/dist/signers/web'; + +const provider = new DogecoinProvider( + new DogecoinProvider.dataSourceList.IndexerDataSource(DOGECOIN_MANIFEST) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/evm/provider.container.tsx b/examples/react/components/chains/evm/provider.container.tsx new file mode 100644 index 00000000..b24e14dc --- /dev/null +++ b/examples/react/components/chains/evm/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const EvmProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new EvmProvider( + new EvmProvider.dataSourceList.IndexerDataSource(EVM_MANIFESTS.${provider.manifest.chain}) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new EvmProvider( + new EvmProvider.dataSourceList.IndexerDataSource(EVM_MANIFESTS.${provider.manifest.chain}) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default EvmProviderContainer; diff --git a/examples/react/components/chains/evm/transfer.component.tsx b/examples/react/components/chains/evm/transfer.component.tsx new file mode 100644 index 00000000..57ff08a9 --- /dev/null +++ b/examples/react/components/chains/evm/transfer.component.tsx @@ -0,0 +1,186 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; +import { TokenType } from '@xdefi-tech/chains-evm'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [contractAddress, setContractAddress] = React.useState(''); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + ...(contractAddress && { + contractAddress, + tokenType: TokenType.ERC20, + }), + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals, contractAddress]); + + return ( + + Transfer (native + ERC20) + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + + Contract address + + + + + + Derivation + + + + + {`import { EvmProvider, EVM_MANIFESTS } from '@xdefi-tech/chains-evm'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-evm/dist/signers/web'; + +const provider = new EvmProvider( + new EvmProvider.dataSourceList.IndexerDataSource(EVM_MANIFESTS.${ + props.provider.manifest.chain + }) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} + ${ + contractAddress && + `contractAddress: '${contractAddress}', + tokenType: 'ERC20',` + } +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/litecoin/provider.container.tsx b/examples/react/components/chains/litecoin/provider.container.tsx new file mode 100644 index 00000000..2e19f5c7 --- /dev/null +++ b/examples/react/components/chains/litecoin/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const LitecoinProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new LitecoinProvider( + new LitecoinProvider.dataSourceList.IndexerDataSource(LITECOIN_MANIFEST) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new LitecoinProvider( + new LitecoinProvider.dataSourceList.IndexerDataSource(LITECOIN_MANIFEST) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default LitecoinProviderContainer; diff --git a/examples/react/components/chains/litecoin/transfer.component.tsx b/examples/react/components/chains/litecoin/transfer.component.tsx new file mode 100644 index 00000000..b3392ae2 --- /dev/null +++ b/examples/react/components/chains/litecoin/transfer.component.tsx @@ -0,0 +1,161 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Derivation + + + + + {`import { LitecoinProvider, LITECOIN_MANIFEST } from '@xdefi-tech/chains-litecoin'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-litecoin/dist/signers/web'; + +const provider = new LitecoinProvider( + new LitecoinProvider.dataSourceList.IndexerDataSource(LITECOIN_MANIFEST) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/solana/provider.container.tsx b/examples/react/components/chains/solana/provider.container.tsx new file mode 100644 index 00000000..c22d18ac --- /dev/null +++ b/examples/react/components/chains/solana/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const SolanaProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new SolanaProvider( + new SolanaProvider.dataSourceList.IndexerDataSource(SOLANA_MANIFEST) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new SolanaProvider( + new SolanaProvider.dataSourceList.IndexerDataSource(SOLANA_MANIFEST) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default SolanaProviderContainer; diff --git a/examples/react/components/chains/solana/transfer.component.tsx b/examples/react/components/chains/solana/transfer.component.tsx new file mode 100644 index 00000000..9c8dd8d1 --- /dev/null +++ b/examples/react/components/chains/solana/transfer.component.tsx @@ -0,0 +1,176 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [contractAddress, setContractAddress] = React.useState(''); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + ...(contractAddress && { contractAddress }), + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals, contractAddress]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + + Contract address + + + + + + Derivation + + + + + {`import { SolanaProvider, SOLANA_MANIFEST } from '@xdefi-tech/chains-solana'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-solana/dist/signers/web'; + +const provider = new SolanaProvider( + new SolanaProvider.dataSourceList.IndexerDataSource(SOLANA_MANIFEST) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} + ${contractAddress && `contractAddress: '${contractAddress}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/thor/provider.container.tsx b/examples/react/components/chains/thor/provider.container.tsx new file mode 100644 index 00000000..0cc7bf82 --- /dev/null +++ b/examples/react/components/chains/thor/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const ThorProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new ThorProvider( + new ThorProvider.dataSourceList.IndexerDataSource(THORCHAIN_MANIFESTS.${provider.manifest.chain}) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new ThorProvider( + new ThorProvider.dataSourceList.IndexerDataSource(THORCHAIN_MANIFESTS.${provider.manifest.chain}) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default ThorProviderContainer; diff --git a/examples/react/components/chains/thor/transfer.component.tsx b/examples/react/components/chains/thor/transfer.component.tsx new file mode 100644 index 00000000..c493cace --- /dev/null +++ b/examples/react/components/chains/thor/transfer.component.tsx @@ -0,0 +1,178 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [denom, setDenom] = React.useState( + props.provider.manifest.denom + ); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + ...(denom && { denom }), + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals, denom]); + + return ( + + Transfer (MsgSend) + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Denom + + + + + Derivation + + + + + {`import { ThorProvider, THORCHAIN_MANIFESTS } from '@xdefi-tech/chains-thor'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-thor/dist/signers/web'; + +const provider = new ThorProvider( + new ThorProvider.dataSourceList.IndexerDataSource(THORCHAIN_MANIFESTS.${ + props.provider.manifest.chain + }) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} + ${denom && `denom: '${denom}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/chains/tron/provider.container.tsx b/examples/react/components/chains/tron/provider.container.tsx new file mode 100644 index 00000000..e5e86810 --- /dev/null +++ b/examples/react/components/chains/tron/provider.container.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material'; + +import { ChainsContext } from '../../../context/chains.context'; +import BalancesComponent from '../../balances.component'; +import TransactionsComponent from '../../transactions.component'; + +import { registry } from '../../../constants/registry'; +import TransferComponent from './transfer.component'; + +export interface IProviderContainer { + seedPhrase: string; + providerId: string; +} + +const TronProviderContainer = (props: IProviderContainer) => { + const chains = React.useContext(ChainsContext); + const provider = React.useMemo(() => { + return chains.getProviderById(props.providerId); + }, []); + const signer = React.useMemo(() => { + return new (provider.getSigners()[0])(props.seedPhrase, provider.manifest); + }, [provider]); + const registryManifest = React.useMemo(() => { + const item = registry.find((item) => item.id === props.providerId); + if (!item) { + console.log('Provider not found', props.providerId); + } + return item; + }, []); + + const [address, setAddress] = React.useState(''); + React.useEffect(() => { + const getAddress = async () => { + setAddress( + await signer.getAddress( + registryManifest.derivation[0].path, + provider.manifest.prefix + ) + ); + }; + getAddress(); + }, []); + + const handleAddressChange = React.useCallback( + (event: React.ChangeEvent) => { + setAddress(event.target.value); + }, + [] + ); + + return ( + + + Address + + + + + {`const provider = new TronProvider( + new TronProvider.dataSourceList.IndexerDataSource(TRON_MANIFEST) +); +const balanceResponse = await provider.getBalance('${address}'); +const balanceData = await balanceResponse.getData(); +console.log(balanceData);`} + + + + {`const provider = new TronProvider( + new TronProvider.dataSourceList.IndexerDataSource(TRON_MANIFEST) +); +const transactionsResponse = await provider.getTransactions('${address}'); +const transactionsData = await transactionsResponse.getData(); +console.log(transactionsData);`} + + + + + ); +}; + +export default TronProviderContainer; diff --git a/examples/react/components/chains/tron/transfer.component.tsx b/examples/react/components/chains/tron/transfer.component.tsx new file mode 100644 index 00000000..263e784f --- /dev/null +++ b/examples/react/components/chains/tron/transfer.component.tsx @@ -0,0 +1,161 @@ +import React from 'react'; +import { + Box, + FormControl, + OutlinedInput, + InputLabel, + Typography, + Button, +} from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface ITransferComponent { + address: string; + provider: any; + signer: any; + derivation: string; +} + +const TransferComponent = (props: ITransferComponent) => { + /* Collect data */ + const [fromAddress, setFromAddress] = React.useState(props.address); + const [toAddress, setToAddress] = React.useState(props.address); + const [amount, setAmount] = React.useState('0.1'); + const [decimals, setDecimals] = React.useState( + props.provider.manifest.decimals + ); + const [derivation, setDerivation] = React.useState(props.derivation); + + React.useEffect(() => { + setFromAddress(props.address); + setToAddress(props.address); + }, [props.address]); + + React.useEffect(() => { + setDerivation(props.derivation); + }, [props.derivation]); + + const handleInputChange = React.useCallback( + (func: any) => (event) => { + setTxLoading(false); + setTxError(null); + func(event.target.value); + }, + [] + ); + + /* Send transaction flow */ + const [txHash, setTxHash] = React.useState(''); + const [txLoading, setTxLoading] = React.useState(false); + const [txError, setTxError] = React.useState(null); + + const handleSendTransaction = React.useCallback(async () => { + try { + setTxLoading(true); + const msg = props.provider.createMsg({ + from: fromAddress, + to: toAddress, + amount, + decimals, + }); + await props.signer.sign(msg, props.derivation); + const [tx] = await props.provider.broadcast([msg]); + setTxHash(tx.data.hash); + setTxLoading(false); + } catch (err) { + console.error(err); + setTxError(err.message); + setTxLoading(false); + } + }, [fromAddress, toAddress, amount, decimals]); + + return ( + + Transfer + + + From Address + + + + + To Address + + + + + Amount + + + + + Decimals + + + + + Derivation + + + + + {`import { TronProvider, TRON_MANIFEST } from '@xdefi-tech/chains-tron'; +import { SeedPhraseSigner } from '@xdefi-tech/chains-tron/dist/signers/web'; + +const provider = new TronProvider( + new TronProvider.dataSourceList.IndexerDataSource(TRON_MANIFEST) +); +const signer = new SeedPhraseSigner('YOUR_SEED_PHRASE'); +const msg = provider.createMsg({ + from: '${fromAddress}', + to: '${toAddress}', + amount: '${amount}', + ${decimals && `decimals: '${decimals}',`} +}); +await signer.sign(msg, "${derivation}"); +console.log(msg.signedTransaction); // signed transaction +const [tx] = await provider.broadcast([msg]); +console.log(tx.data.hash); // transaction hash`} + + {txError && {txError}} + {txHash && Transaction hash: {txHash}} + + + + ); +}; + +export default TransferComponent; diff --git a/examples/react/components/containers/how-to.container.tsx b/examples/react/components/containers/how-to.container.tsx new file mode 100644 index 00000000..13188bee --- /dev/null +++ b/examples/react/components/containers/how-to.container.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { Box, Collapse } from '@mui/material'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { dracula } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; + +export interface IHowTo { + title: string; + children: React.ReactNode; +} + +const HowTo = (props: IHowTo) => { + const [show, setShow] = React.useState(false); + const handleClick = React.useCallback(() => { + setShow((prev) => !prev); + }, []); + + return ( + + + How to {props.title} + + + + + {props.children} + + + + ); +}; + +export default HowTo; diff --git a/examples/react/components/transactions.component.tsx b/examples/react/components/transactions.component.tsx index a7d0596a..59dd4567 100644 --- a/examples/react/components/transactions.component.tsx +++ b/examples/react/components/transactions.component.tsx @@ -1,19 +1,15 @@ import React, { useState, useCallback, useEffect } from 'react'; -import { - Box, - Typography, - Button, - Divider, - List, - ListItem, - ListItemText, -} from '@mui/material'; +import { Box, Typography, Button, List, ListItem } from '@mui/material'; import { Chain, Transaction } from '@xdefi-tech/chains-core'; +import HowToContainer from './containers/how-to.container'; + export interface ITransactionsComponent { provider: Chain.Provider; address: string; + children?: React.ReactNode; } + const TransactionsComponent = (props: ITransactionsComponent) => { const [transactions, setTransactions] = useState([]); const [transactionsError, setTransactionsError] = useState( @@ -43,8 +39,8 @@ const TransactionsComponent = (props: ITransactionsComponent) => { }, [props.address, props.provider]); return ( - - Transactions + + Transactions + - - - - - + {seedPhrase && ( + + + {providerList.map((provider) => ( + + ))} + + + {/* The thing what you're probably looking for */} + {selectedProvider && renderProvider()} + + + )}
); }; diff --git a/yarn.lock b/yarn.lock index 25c10ef6..c8d3cde0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1646,7 +1646,7 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.1", "@babel/runtime@^7.20.13", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.4", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.1", "@babel/runtime@^7.20.13", "@babel/runtime@^7.23.4", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.23.9" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz" integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw== @@ -1660,6 +1660,13 @@ dependencies: regenerator-runtime "^0.14.0" +"@babel/runtime@^7.3.1": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e" + integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.0.0", "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.23.9": version "7.23.9" resolved "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz" @@ -3513,6 +3520,33 @@ find-up "^5.0.0" js-yaml "^4.1.0" +"@floating-ui/core@^1.6.0": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.4.tgz#0140cf5091c8dee602bff9da5ab330840ff91df6" + integrity sha512-a4IowK4QkXl4SCWTGUR0INAfEOX3wtsYw3rKK5InQEHMGObkR8Xk44qYQD9P4r6HHw0iIfK6GUKECmY8sTkqRA== + dependencies: + "@floating-ui/utils" "^0.2.4" + +"@floating-ui/dom@^1.0.0": + version "1.6.7" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.7.tgz#85d22f731fcc5b209db504478fb1df5116a83015" + integrity sha512-wmVfPG5o2xnKDU4jx/m4w5qva9FWHcnZ8BvzEe90D/RpwsJaTAVYPEPdQ8sbr/N8zZTAHlZUTQdqg8ZUbzHmng== + dependencies: + "@floating-ui/core" "^1.6.0" + "@floating-ui/utils" "^0.2.4" + +"@floating-ui/react-dom@^2.0.8": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.1.1.tgz#cca58b6b04fc92b4c39288252e285e0422291fb0" + integrity sha512-4h84MJt3CHrtG18mGsXuLCHMrug49d7DFkU0RMIyshRveBeyV2hmV/pDaF2Uxtu8kgq5r46llp5E5FQiR0K2Yg== + dependencies: + "@floating-ui/dom" "^1.0.0" + +"@floating-ui/utils@^0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.4.tgz#1d459cee5031893a08a0e064c406ad2130cced7c" + integrity sha512-dWO2pw8hhi+WrXq1YJy2yCuWoL20PddgGaqTgVe4cOS9Q6qklXCiA1tJEqX6BEwRNSCP84/afac9hd4MS+zEUA== + "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz" @@ -4528,7 +4562,7 @@ big-integer "^1.6.48" utility-types "^3.10.0" -"@ledgerhq/cryptoassets@13.0.0", "@ledgerhq/cryptoassets@^13.0.0": +"@ledgerhq/cryptoassets@13.0.0": version "13.0.0" resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-13.0.0.tgz#c300884830399750ca6b23edfb4cb0d4a39459f5" integrity sha512-Gvy3YQqOZpNtQ6/TTPJRUp4Qba/SmGtHGOeeIYTaF2y94W2x2hyf/dtttOc2nwyp6ARggkqr6VZyMAzgnP7fyQ== @@ -4537,6 +4571,15 @@ bs58check "^2.1.2" invariant "2" +"@ledgerhq/cryptoassets@^13.0.0", "@ledgerhq/cryptoassets@^13.2.0": + version "13.2.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-13.2.0.tgz#e89d24f82e59c3e6f87c7d22106a50370cd2e7e3" + integrity sha512-/u2T2IY7bDoN+DHAdXRa1PtzIMbIYwSV9Zw3w9kJKXu3gt5lx+oGCXwsj5rzYq3MxnfxQ+GSh4UEslLXQgYcRg== + dependencies: + axios "^1.6.0" + bs58check "^2.1.2" + invariant "2" + "@ledgerhq/devices@^5.51.1": version "5.51.1" resolved "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.51.1.tgz" @@ -4567,14 +4610,24 @@ rxjs "^7.8.1" semver "^7.3.5" +"@ledgerhq/devices@^8.4.1": + version "8.4.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-8.4.1.tgz#ab47c188ef9156f6b81c37c4ef2f2aeec97c19bf" + integrity sha512-Mbjzqlcj4Q2StxEmaYEb5wv6sK5Sk26L4xs0BC9io/AyvpXNTDAp67tryB/klNcvd+WwZPcPdYYvlNzfQ0WTUA== + dependencies: + "@ledgerhq/errors" "^6.18.0" + "@ledgerhq/logs" "^6.12.0" + rxjs "^7.8.1" + semver "^7.3.5" + "@ledgerhq/domain-service@^1.1.21": - version "1.1.21" - resolved "https://registry.yarnpkg.com/@ledgerhq/domain-service/-/domain-service-1.1.21.tgz#c8f1be996890687318e698eebf008f281f521296" - integrity sha512-/2CPZYXQV2GQS/XkjUQwbfHBlteLDEFUpfMX0YvwriJ5hOmu//sl1Zgc+/FZ2hDQwpFQBCBCbvqreqeyHIVawA== + version "1.2.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/domain-service/-/domain-service-1.2.2.tgz#430eca781e1f276748ab72a2b95e45641c6b3628" + integrity sha512-t5Nzi9ZKPAhGHdYwRJ/4ugKO9QCTDFgrx66evQ3sI+yDQyrP09e0Yxxr68JDlMp5IdhSObQrxaMIr4mBn4gr8w== dependencies: - "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/errors" "^6.18.0" "@ledgerhq/logs" "^6.12.0" - "@ledgerhq/types-live" "^6.47.0" + "@ledgerhq/types-live" "^6.49.0" axios "^1.3.4" eip55 "^2.1.1" react "^18.2.0" @@ -4595,13 +4648,18 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.16.4.tgz#a38baffe8b096d9fff3ad839cadb55704c8d8e7b" integrity sha512-M57yFaLYSN+fZCX0E0zUqOmrV6eipK+s5RhijHoUNlHUqrsvUz7iRQgpd5gRgHB5VkIjav7KdaZjKiWGcHovaQ== +"@ledgerhq/errors@^6.18.0": + version "6.18.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.18.0.tgz#d55d6a57430d7a86532a9033ce0b45103264c620" + integrity sha512-L3jQWAGyooxRDk/MRlW2v4Ji9+kloBtdmz9wBkHaj2j0n+05rweJSV3GHw9oye1BYMbVFqFffmT4H3hlXlCasw== + "@ledgerhq/evm-tools@^1.0.19": - version "1.0.19" - resolved "https://registry.yarnpkg.com/@ledgerhq/evm-tools/-/evm-tools-1.0.19.tgz#6e202253ee587d431644423f0ee0e03546457a4b" - integrity sha512-Xt0lj5PRPpErWSNsq3MJXpUj3ME+TUt+EDxdTydTYAQSYT7Ai11jYhFUzY8QPud/sT6gWo+PGo4vbfps0jU19A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/evm-tools/-/evm-tools-1.1.2.tgz#d0cffa9053cdb1d8cdaf3aae2cc42654e0dbf74b" + integrity sha512-QVVa50233g14hZQsNhM8zU6j0bScwP/JAZYMcR+fGpHd+VpfAZ0LJb0E0Hs79SIuRpM7uRV1R2LT3a7RPpiuhQ== dependencies: - "@ledgerhq/cryptoassets" "^13.0.0" - "@ledgerhq/live-env" "^2.0.2" + "@ledgerhq/cryptoassets" "^13.2.0" + "@ledgerhq/live-env" "^2.1.0" axios "^1.6.5" crypto-js "4.2.0" ethers "5.7.2" @@ -4668,11 +4726,11 @@ rxjs "^7.8.1" "@ledgerhq/hw-transport-mocker@^6.28.6": - version "6.28.6" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.6.tgz#820ff1abe490a1abbf3925f53526f846ee0f470d" - integrity sha512-JDO2kqMOTRCQWNZr1KVlyX1AqE6WBzHjJDS3FnSI8Z/Bj2KSc2/1H/4lW6+Ap64yLtlmOW3GchdafFmLgYAgqw== + version "6.29.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.29.1.tgz#805dccd5f43e8a66120ae63dffefeec9ebf06f8b" + integrity sha512-NmQ1Z4Swq6YjIi99kAxtnsi3nDLjlRSn3Kb4G9nJZkM49RPoG0XsYNxpYhUoRj+5RPrXO4h8wFUkNQ6yHcmYvw== dependencies: - "@ledgerhq/hw-transport" "^6.30.6" + "@ledgerhq/hw-transport" "^6.31.1" "@ledgerhq/logs" "^6.12.0" rxjs "^7.8.1" @@ -4771,10 +4829,20 @@ "@ledgerhq/errors" "^5.50.0" events "^3.3.0" -"@ledgerhq/live-env@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-env/-/live-env-2.0.2.tgz#d9fdc1fb55ace9ad1b725a576796abb6bbe00064" - integrity sha512-kRHzLUPiIvJm1elfYmGBHPfqJEknqrAQrOYqagufLLip5/GDyeBQVOVdTJQoTra8VsxVRxilsRNGDiB+h8lwLQ== +"@ledgerhq/hw-transport@^6.31.1": + version "6.31.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.31.1.tgz#fb462c5455fc6c1e8300c216cc52df6f3fb88565" + integrity sha512-0hVcrqUOM7AYV/JEq8yoeBiXLjpWrentgYt8MC3n+iNFfpORU/SUprcbu0s884IHzj+a8mx0JCZp9y7uPSLlzg== + dependencies: + "@ledgerhq/devices" "^8.4.1" + "@ledgerhq/errors" "^6.18.0" + "@ledgerhq/logs" "^6.12.0" + events "^3.3.0" + +"@ledgerhq/live-env@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-env/-/live-env-2.1.0.tgz#5fe3032dc686c8c41089ef563b042b4c8a7cc54c" + integrity sha512-nL2vGczDt7fqK1pxZ5pIZ6EXT5QIpFL6tDp6Z+/XaT2oQPqDyooBfBgFvfWSgTlgyPMnp1nvFjdKt+GYUJpWSg== dependencies: rxjs "^7.8.1" utility-types "^3.10.0" @@ -4789,10 +4857,10 @@ resolved "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.12.0.tgz" integrity sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA== -"@ledgerhq/types-live@^6.47.0": - version "6.47.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/types-live/-/types-live-6.47.0.tgz#1582594fc8d940355630471ae5485b25235627b0" - integrity sha512-81R+/qOq+AFMA90LcCfIs3Q3g3taXQWrdLaSvCs/YiG2BeZnXIOnRx6FcbGX25W+LQNSyqYRhYJePAgAeuMiBQ== +"@ledgerhq/types-live@^6.47.0", "@ledgerhq/types-live@^6.49.0": + version "6.49.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/types-live/-/types-live-6.49.0.tgz#5d6108bf15f4636c3feb4933fa6e1c184bed3391" + integrity sha512-n4Qa1n1fbYO51nRfbZC14CkHyFFbdHbg4JiJVEWB2TbmU1a9BP49S4mSCcWiJcgwZTVfcI0GP2hNFBqU24GBbw== dependencies: bignumber.js "^9.1.2" rxjs "^7.8.1" @@ -4857,85 +4925,91 @@ bn.js "^5.2.0" debug "^4.3.4" -"@mui/base@5.0.0-alpha.119": - version "5.0.0-alpha.119" - resolved "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.119.tgz" - integrity sha512-XA5zhlYfXi67u613eIF0xRmktkatx6ERy3h+PwrMN5IcWFbgiL1guz8VpdXON+GWb8+G7B8t5oqTFIaCqaSAeA== +"@mui/base@5.0.0-beta.40": + version "5.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-beta.40.tgz#1f8a782f1fbf3f84a961e954c8176b187de3dae2" + integrity sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ== dependencies: - "@babel/runtime" "^7.21.0" - "@emotion/is-prop-valid" "^1.2.0" - "@mui/types" "^7.2.3" - "@mui/utils" "^5.11.11" - "@popperjs/core" "^2.11.6" - clsx "^1.2.1" + "@babel/runtime" "^7.23.9" + "@floating-ui/react-dom" "^2.0.8" + "@mui/types" "^7.2.14" + "@mui/utils" "^5.15.14" + "@popperjs/core" "^2.11.8" + clsx "^2.1.0" prop-types "^15.8.1" - react-is "^18.2.0" -"@mui/core-downloads-tracker@^5.11.12": - version "5.15.7" - resolved "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.7.tgz" - integrity sha512-AuF+Wo2Mp/edaO6vJnWjg+gj4tzEz5ChMZnAQpc22DXpSvM8ddgGcZvM7D7F99pIBoSv8ub+Iz0viL+yuGVmhg== - -"@mui/material@5.11.12": - version "5.11.12" - resolved "https://registry.npmjs.org/@mui/material/-/material-5.11.12.tgz" - integrity sha512-M6BiIeJjySeEzWeiFJQ9pIjJy6mx5mHPWeMT99wjQdAmA2GxCQhE9A0fh6jQP4jMmYzxhOIhjsGcp0vSdpseXg== - dependencies: - "@babel/runtime" "^7.21.0" - "@mui/base" "5.0.0-alpha.119" - "@mui/core-downloads-tracker" "^5.11.12" - "@mui/system" "^5.11.12" - "@mui/types" "^7.2.3" - "@mui/utils" "^5.11.12" - "@types/react-transition-group" "^4.4.5" - clsx "^1.2.1" - csstype "^3.1.1" +"@mui/core-downloads-tracker@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.16.0.tgz#50153c698e321793c83a0283d8d7a9dc5d43858a" + integrity sha512-8SLffXYPRVpcZx5QzxNE8fytTqzp+IuU3deZbQWg/vSaTlDpR5YVrQ4qQtXTi5cRdhOufV5INylmwlKK+//nPw== + +"@mui/icons-material@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.16.0.tgz#5269fda922fe5e6db3577ec497e8b987195606ef" + integrity sha512-6ISoOhkp9w5gD0PEW9JklrcbyARDkFWNTBdwXZ1Oy5IGlyu9B0zG0hnUIe4H17IaF1Vgj6C8VI+v4tkSdK0veg== + dependencies: + "@babel/runtime" "^7.23.9" + +"@mui/material@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.16.0.tgz#2ef4f52ae773574fc0a681f25705f376f5cd13f7" + integrity sha512-DbR1NckTLpjt9Zut9EGQ70th86HfN0BYQgyYro6aXQrNfjzSwe3BJS1AyBQ5mJ7TdL6YVRqohfukxj9JlqZZUg== + dependencies: + "@babel/runtime" "^7.23.9" + "@mui/base" "5.0.0-beta.40" + "@mui/core-downloads-tracker" "^5.16.0" + "@mui/system" "^5.16.0" + "@mui/types" "^7.2.14" + "@mui/utils" "^5.16.0" + "@types/react-transition-group" "^4.4.10" + clsx "^2.1.0" + csstype "^3.1.3" prop-types "^15.8.1" react-is "^18.2.0" react-transition-group "^4.4.5" -"@mui/private-theming@^5.15.7": - version "5.15.7" - resolved "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.7.tgz" - integrity sha512-bcEeeXm7GyQCQvN9dwo8htGv8/6tP05p0i02Z7GXm5EoDPlBcqTNGugsjNLoGq6B0SsdyanjJGw0Jw00o1yAOA== +"@mui/private-theming@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@mui/private-theming/-/private-theming-5.16.0.tgz#c1abfd3e0d9c95459048240ef4209dc7f25dc949" + integrity sha512-sYpubkO1MZOnxNyVOClrPNOTs0MfuRVVnAvCeMaOaXt6GimgQbnUcshYv2pSr6PFj+Mqzdff/FYOBceK8u5QgA== dependencies: "@babel/runtime" "^7.23.9" - "@mui/utils" "^5.15.7" + "@mui/utils" "^5.16.0" prop-types "^15.8.1" -"@mui/styled-engine@^5.15.7": - version "5.15.7" - resolved "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.15.7.tgz" - integrity sha512-ixSdslOjK1kzdGcxqj7O3d14By/LPQ7EWknsViQ8RaeT863EAQemS+zvUJDTcOpkfJh6q6gPnYMIb2TJCs9eWA== +"@mui/styled-engine@^5.15.14": + version "5.15.14" + resolved "https://registry.yarnpkg.com/@mui/styled-engine/-/styled-engine-5.15.14.tgz#168b154c4327fa4ccc1933a498331d53f61c0de2" + integrity sha512-RILkuVD8gY6PvjZjqnWhz8fu68dVkqhM5+jYWfB5yhlSQKg+2rHkmEwm75XIeAqI3qwOndK6zELK5H6Zxn4NHw== dependencies: "@babel/runtime" "^7.23.9" "@emotion/cache" "^11.11.0" - csstype "^3.1.2" + csstype "^3.1.3" prop-types "^15.8.1" -"@mui/system@^5.11.12": - version "5.15.7" - resolved "https://registry.npmjs.org/@mui/system/-/system-5.15.7.tgz" - integrity sha512-9alZ4/dLxsTwUOdqakgzxiL5YW6ntqj0CfzWImgWnBMTZhgGcPsbYpBLniNkkk7/jptma4/bykWXHwju/ls/pg== +"@mui/system@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@mui/system/-/system-5.16.0.tgz#e5b4cfbdfbc0ee9859f6b168e8b07d750303b7a0" + integrity sha512-9YbkC2m3+pNumAvubYv+ijLtog6puJ0fJ6rYfzfLCM47pWrw3m+30nXNM8zMgDaKL6vpfWJcCXm+LPaWBpy7sw== dependencies: "@babel/runtime" "^7.23.9" - "@mui/private-theming" "^5.15.7" - "@mui/styled-engine" "^5.15.7" - "@mui/types" "^7.2.13" - "@mui/utils" "^5.15.7" + "@mui/private-theming" "^5.16.0" + "@mui/styled-engine" "^5.15.14" + "@mui/types" "^7.2.14" + "@mui/utils" "^5.16.0" clsx "^2.1.0" - csstype "^3.1.2" + csstype "^3.1.3" prop-types "^15.8.1" -"@mui/types@^7.2.13", "@mui/types@^7.2.3": - version "7.2.13" - resolved "https://registry.npmjs.org/@mui/types/-/types-7.2.13.tgz" - integrity sha512-qP9OgacN62s+l8rdDhSFRe05HWtLLJ5TGclC9I1+tQngbssu0m2dmFZs+Px53AcOs9fD7TbYd4gc9AXzVqO/+g== +"@mui/types@^7.2.14": + version "7.2.14" + resolved "https://registry.yarnpkg.com/@mui/types/-/types-7.2.14.tgz#8a02ac129b70f3d82f2f9b76ded2c8d48e3fc8c9" + integrity sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ== -"@mui/utils@^5.11.11", "@mui/utils@^5.11.12", "@mui/utils@^5.15.7": - version "5.15.7" - resolved "https://registry.npmjs.org/@mui/utils/-/utils-5.15.7.tgz" - integrity sha512-8qhsxQRNV6aEOjjSk6YQIYJxkF5klhj8oG1FEEU4z6HV78TjNqRxMP08QGcdsibEbez+nihAaz6vu83b4XqbAg== +"@mui/utils@^5.15.14", "@mui/utils@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@mui/utils/-/utils-5.16.0.tgz#3963127d9a619c251e5be1aef9adab0e89d3e7df" + integrity sha512-kLLi5J1xY+mwtUlMb8Ubdxf4qFAA1+U7WPBvjM/qQ4CIwLCohNb0sHo1oYPufjSIH/Z9+dhVxD7dJlfGjd1AVA== dependencies: "@babel/runtime" "^7.23.9" "@types/prop-types" "^15.7.11" @@ -5231,9 +5305,9 @@ resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.24.tgz" integrity sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ== -"@popperjs/core@^2.11.6": +"@popperjs/core@^2.11.8": version "2.11.8" - resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": @@ -6384,6 +6458,13 @@ dependencies: "@types/node" "*" +"@types/hast@^2.0.0": + version "2.3.10" + resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.10.tgz#5c9d9e0b304bbb8879b857225c5ebab2d81d7643" + integrity sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw== + dependencies: + "@types/unist" "^2" + "@types/is-ci@^3.0.0": version "3.0.4" resolved "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.4.tgz" @@ -6560,9 +6641,9 @@ dependencies: "@types/react" "*" -"@types/react-transition-group@^4.4.5": +"@types/react-transition-group@^4.4.10": version "4.4.10" - resolved "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz" + resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.10.tgz#6ee71127bdab1f18f11ad8fb3322c6da27c327ac" integrity sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q== dependencies: "@types/react" "*" @@ -6619,6 +6700,11 @@ dependencies: "@types/node" "*" +"@types/unist@^2": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc" + integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA== + "@types/uuid@9.0.1": version "9.0.1" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.1.tgz#98586dc36aee8dacc98cc396dbca8d0429647aa6" @@ -8799,6 +8885,21 @@ char-regex@^2.0.0: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-2.0.1.tgz#6dafdb25f9d3349914079f010ba8d0e6ff9cd01e" integrity sha512-oSvEeo6ZUD7NepqAat3RqoucZ5SeqLJgOvVIwkafu6IP3V0pO38s/ypdVUmDDK6qIIHNlYHJAKX9E7R7HoKElw== +character-entities-legacy@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" + integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== + +character-entities@^1.0.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" + integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw== + +character-reference-invalid@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" + integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== + chardet@^0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" @@ -8954,11 +9055,6 @@ clone@^2.1.2: resolved "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz" integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== -clsx@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz" - integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== - clsx@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz" @@ -9050,6 +9146,11 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" +comma-separated-tokens@^1.0.0: + version "1.0.8" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" + integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== + command-exists@^1.2.4, command-exists@^1.2.8: version "1.2.9" resolved "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz" @@ -9383,7 +9484,7 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" -csstype@^3.0.2, csstype@^3.1.1, csstype@^3.1.2: +csstype@^3.0.2, csstype@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz" integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== @@ -11194,6 +11295,13 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fault@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" + integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== + dependencies: + format "^0.2.0" + fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz" @@ -11452,6 +11560,11 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +format@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" + integrity sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww== + freeport-async@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/freeport-async/-/freeport-async-2.0.0.tgz" @@ -12016,6 +12129,22 @@ hasown@^2.0.1, hasown@^2.0.2: dependencies: function-bind "^1.1.2" +hast-util-parse-selector@^2.0.0: + version "2.2.5" + resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" + integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ== + +hastscript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" + integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w== + dependencies: + "@types/hast" "^2.0.0" + comma-separated-tokens "^1.0.0" + hast-util-parse-selector "^2.0.0" + property-information "^5.0.0" + space-separated-tokens "^1.0.0" + hdkey@2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/hdkey/-/hdkey-2.1.0.tgz" @@ -12061,6 +12190,11 @@ hermes-profile-transformer@^0.0.6: dependencies: source-map "^0.7.3" +highlight.js@^10.4.1, highlight.js@~10.7.0: + version "10.7.3" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" + integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== + hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" @@ -12412,6 +12546,19 @@ is-absolute@^1.0.0: is-relative "^1.0.0" is-windows "^1.0.1" +is-alphabetical@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" + integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== + +is-alphanumerical@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf" + integrity sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A== + dependencies: + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-arguments@^1.0.4: version "1.1.1" resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz" @@ -12500,6 +12647,11 @@ is-date-object@^1.0.1, is-date-object@^1.0.5: dependencies: has-tostringtag "^1.0.0" +is-decimal@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" + integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== + is-directory@^0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz" @@ -12570,6 +12722,11 @@ is-glob@^2.0.0: dependencies: is-extglob "^1.0.0" +is-hexadecimal@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" + integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== + is-interactive@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz" @@ -14047,6 +14204,14 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" +lowlight@^1.17.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.20.0.tgz#ddb197d33462ad0d93bf19d17b6c301aa3941888" + integrity sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw== + dependencies: + fault "^1.0.0" + highlight.js "~10.7.0" + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz" @@ -15539,6 +15704,18 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.6: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" +parse-entities@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" + integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-filepath@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz" @@ -15884,6 +16061,16 @@ pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" +prismjs@^1.27.0: + version "1.29.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.29.0.tgz#f113555a8fa9b57c35e637bba27509dcf802dd12" + integrity sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q== + +prismjs@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" + integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" @@ -15935,6 +16122,13 @@ prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +property-information@^5.0.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" + integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== + dependencies: + xtend "^4.0.0" + protobufjs@7.2.4: version "7.2.4" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz" @@ -16310,6 +16504,17 @@ react-shallow-renderer@^16.15.0: object-assign "^4.1.1" react-is "^16.12.0 || ^17.0.0 || ^18.0.0" +react-syntax-highlighter@^15.5.0: + version "15.5.0" + resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz#4b3eccc2325fa2ec8eff1e2d6c18fa4a9e07ab20" + integrity sha512-+zq2myprEnQmH5yw6Gqc8lD55QHnpKaU8TOcFeC/Lg/MQSs8UknEA0JC4nTZGFAXC2J2Hyj/ijJ7NlabyPi2gg== + dependencies: + "@babel/runtime" "^7.3.1" + highlight.js "^10.4.1" + lowlight "^1.17.0" + prismjs "^1.27.0" + refractor "^3.6.0" + react-textarea-autosize@^8.3.2: version "8.5.3" resolved "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.5.3.tgz" @@ -16447,6 +16652,15 @@ reflect.getprototypeof@^1.0.4: globalthis "^1.0.3" which-builtin-type "^1.1.3" +refractor@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.6.0.tgz#ac318f5a0715ead790fcfb0c71f4dd83d977935a" + integrity sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA== + dependencies: + hastscript "^6.0.0" + parse-entities "^2.0.0" + prismjs "~1.27.0" + regenerate-unicode-properties@^10.1.0: version "10.1.1" resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz" @@ -17500,6 +17714,11 @@ sourcemap-codec@^1.4.8: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== +space-separated-tokens@^1.0.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" + integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== + spawndamnit@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz" From 1f4349e4ec430fd7b18d45ed82fa20d55323a285 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:30:07 +0300 Subject: [PATCH 161/176] fix: update buildTx to avoid can't get EIP1559 gas fee error (#355) * fix: update buildTx to avoid can't get EIP1559 gas fee error * fix: get gas fees for non eip1559 fee chains --- .changeset/big-numbers-own.md | 5 +++++ packages/evm/src/msg.ts | 39 +++++++++-------------------------- 2 files changed, 15 insertions(+), 29 deletions(-) create mode 100644 .changeset/big-numbers-own.md diff --git a/.changeset/big-numbers-own.md b/.changeset/big-numbers-own.md new file mode 100644 index 00000000..8f442bed --- /dev/null +++ b/.changeset/big-numbers-own.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +Fix: update buildTx to avoid can't get EIP1559 gas fee error diff --git a/packages/evm/src/msg.ts b/packages/evm/src/msg.ts index 40a0749e..10881289 100644 --- a/packages/evm/src/msg.ts +++ b/packages/evm/src/msg.ts @@ -243,8 +243,8 @@ export class ChainMsg extends BasMsg { } if ( - this.data.txType !== TransactionType.Legacy && - feeOptions.maxFeePerGas + !isNaN(Number(feeOptions.maxFeePerGas)) && + !isNaN(Number(feeOptions.maxPriorityFeePerGas)) ) { const baseFeePerGas = new BigNumber(feeOptions.baseFeePerGas); const priorityFee = new BigNumber(feeOptions.maxPriorityFeePerGas); @@ -261,10 +261,7 @@ export class ChainMsg extends BasMsg { 'ether' ) .toString(); - } else { - if (!feeOptions.gasPrice) { - return estimation; - } + } else if (!isNaN(Number(feeOptions.gasPrice))) { const gasPrice = new BigNumber(feeOptions.gasPrice); const gasFee = gasPrice.multipliedBy(feeOptions.gasLimit); @@ -309,16 +306,11 @@ export class ChainMsg extends BasMsg { msgData.gasLimit = feeData.gasLimit; } - // If fee info not provided, get legacy gas fee from provider - if (msgData.txType === TransactionType.Legacy && !msgData.gasPrice) { - msgData.gasPrice = feeData.gasPrice ?? feeData.baseFeePerGas; + if (!msgData.gasPrice) { + msgData.gasPrice = feeData.gasPrice; } - // If fee info not provided, get EIP1559 gas fee from provider - if ( - msgData.txType !== TransactionType.Legacy && - (!msgData.maxPriorityFeePerGas || !msgData.maxFeePerGas) - ) { + if (!msgData.maxPriorityFeePerGas || !msgData.maxFeePerGas) { msgData.maxFeePerGas = feeData.maxFeePerGas; msgData.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; } @@ -343,27 +335,16 @@ export class ChainMsg extends BasMsg { ...(msgData.data && { data: msgData.data }), }; - if (msgData.txType !== TransactionType.Legacy) { - if ( - isNaN(Number(msgData.maxFeePerGas)) || - isNaN(Number(msgData.maxPriorityFeePerGas)) - ) { - throw new Error( - `Can't get EIP1559 gas fee. maxFeePerGas: ${msgData.maxFeePerGas}, maxPriorityFeePerGas: ${msgData.maxPriorityFeePerGas}` - ); - } - + if ( + !isNaN(Number(msgData.maxFeePerGas)) && + !isNaN(Number(msgData.maxPriorityFeePerGas)) + ) { baseTx.maxFeePerGas = utils.toHex(msgData.maxFeePerGas!.toString()); baseTx.maxPriorityFeePerGas = utils.toHex( msgData.maxPriorityFeePerGas!.toString() ); baseTx.type = 2; } else { - if (isNaN(Number(msgData.gasPrice))) { - throw new Error( - `Can't get legacy gas fee. gasPrice: ${msgData.gasPrice}` - ); - } baseTx.gasPrice = utils.toHex(msgData.gasPrice!.toString()); } From dbe31d59f557841e1271fc70bdcff3edfeefb97f Mon Sep 17 00:00:00 2001 From: cicd Date: Fri, 6 Sep 2024 07:33:05 +0000 Subject: [PATCH 162/176] Version packages --- .changeset/big-numbers-own.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/big-numbers-own.md diff --git a/.changeset/big-numbers-own.md b/.changeset/big-numbers-own.md deleted file mode 100644 index 8f442bed..00000000 --- a/.changeset/big-numbers-own.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -Fix: update buildTx to avoid can't get EIP1559 gas fee error diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index a4e2446f..af1b01d4 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.50 + +### Patch Changes + +- 3b68fabe: Fix: update buildTx to avoid can't get EIP1559 gas fee error + ## 2.0.49 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 6200bfbf..b7aca9fb 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.49", + "version": "2.0.50", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 65d7382236aca68307bc69364c580fdf357f33b9 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Mon, 9 Sep 2024 22:47:55 +0700 Subject: [PATCH 163/176] chore: Pass preflight settings from params for Solana chain (#347) * chore: Pass preflight settings from params for Solana chain * fix: use preflightCommitment for broadcast tx --------- Co-authored-by: sotatek-tyler-nguyen4 Co-authored-by: danilxdefi --- .changeset/chatty-weeks-live.md | 5 +++++ packages/solana/src/chain.provider.ts | 3 ++- packages/solana/src/msg.ts | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/chatty-weeks-live.md diff --git a/.changeset/chatty-weeks-live.md b/.changeset/chatty-weeks-live.md new file mode 100644 index 00000000..7baae316 --- /dev/null +++ b/.changeset/chatty-weeks-live.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-solana': patch +--- + +feat: pass preflight settings from params for Solana chain diff --git a/packages/solana/src/chain.provider.ts b/packages/solana/src/chain.provider.ts index 72264b54..da4b54fa 100644 --- a/packages/solana/src/chain.provider.ts +++ b/packages/solana/src/chain.provider.ts @@ -96,7 +96,8 @@ export class SolanaProvider extends Chain.Provider { const hash = await this.rpcProvider.sendRawTransaction( Buffer.from(serializeTx), { - skipPreflight: true, + skipPreflight: msg.data.skipPreflight ?? true, + preflightCommitment: msg.data.preflightCommitment ?? 'finalized', maxRetries: 2, } ); diff --git a/packages/solana/src/msg.ts b/packages/solana/src/msg.ts index 07952ed1..3c0f04b4 100644 --- a/packages/solana/src/msg.ts +++ b/packages/solana/src/msg.ts @@ -15,6 +15,7 @@ import { Transaction as SolanaTransaction, TransactionInstruction, VersionedTransaction, + Commitment, } from '@solana/web3.js'; import { createAssociatedTokenAccountInstruction, @@ -42,6 +43,8 @@ export interface MsgBody { memo?: string; data?: string; // for swaps when encoded is base64a priorityFeeAmount?: number; + skipPreflight?: boolean; + preflightCommitment?: Commitment; } export interface TxBody { From 31382e3bb3b83ec3fbf1b342665f3ff5b411933b Mon Sep 17 00:00:00 2001 From: cicd Date: Mon, 9 Sep 2024 15:50:48 +0000 Subject: [PATCH 164/176] Version packages --- .changeset/chatty-weeks-live.md | 5 ----- packages/solana/CHANGELOG.md | 6 ++++++ packages/solana/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/chatty-weeks-live.md diff --git a/.changeset/chatty-weeks-live.md b/.changeset/chatty-weeks-live.md deleted file mode 100644 index 7baae316..00000000 --- a/.changeset/chatty-weeks-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-solana': patch ---- - -feat: pass preflight settings from params for Solana chain diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index b16cfb28..9030c1b3 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-solana +## 2.1.6 + +### Patch Changes + +- 6503b295: feat: pass preflight settings from params for Solana chain + ## 2.1.5 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index aa954f5c..9289efed 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.1.5", + "version": "2.1.6", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From cc2301b72b9dad0f9f5bdc476e21b4fe6f28b199 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:54:29 +0300 Subject: [PATCH 165/176] fix: add memo to utxo chains using @scure/btc-signer (#360) * fix: add memo to utxo chains using @scure/btc-signer * fix: types & tests --- .changeset/curly-penguins-unite.md | 9 +++ packages/bitcoin/package.json | 2 +- packages/bitcoin/src/msg.ts | 60 +++++++++++++------ .../src/signers/private-key.signer.spec.ts | 2 +- .../bitcoin/src/signers/private-key.signer.ts | 12 +++- .../src/signers/seed-phrase.signer.spec.ts | 2 +- .../bitcoin/src/signers/seed-phrase.signer.ts | 12 +++- packages/bitcoincash/package.json | 2 +- packages/dogecoin/package.json | 2 +- packages/dogecoin/src/msg.ts | 26 +++++--- .../src/signers/private-key.signer.ts | 12 +++- .../src/signers/seed-phrase.signer.ts | 12 +++- .../src/signers/trezor.signer.spec.ts | 2 +- packages/litecoin/package.json | 2 +- packages/litecoin/src/msg.ts | 26 +++++--- .../src/signers/private-key.signer.ts | 12 +++- .../src/signers/seed-phrase.signer.ts | 12 +++- packages/utxo/src/index.ts | 1 + packages/utxo/src/msg.ts | 25 +++++--- packages/utxo/src/utils.ts | 5 ++ yarn.lock | 17 ++++++ 21 files changed, 197 insertions(+), 58 deletions(-) create mode 100644 .changeset/curly-penguins-unite.md create mode 100644 packages/utxo/src/utils.ts diff --git a/.changeset/curly-penguins-unite.md b/.changeset/curly-penguins-unite.md new file mode 100644 index 00000000..d752489a --- /dev/null +++ b/.changeset/curly-penguins-unite.md @@ -0,0 +1,9 @@ +--- +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-utxo': patch +--- + +Fix: add memo to utxo chains using @scure/btc-signer diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 5f62f79d..c5987d26 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -32,7 +32,7 @@ "@noble/curves": "1.3.0", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", - "@scure/btc-signer": "1.2.1", + "@scure/btc-signer": "1.3.2", "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", diff --git a/packages/bitcoin/src/msg.ts b/packages/bitcoin/src/msg.ts index 021b84b4..e1eec733 100644 --- a/packages/bitcoin/src/msg.ts +++ b/packages/bitcoin/src/msg.ts @@ -5,14 +5,14 @@ import { MsgEncoding, NumberIsh, } from '@xdefi-tech/chains-core'; -import { UTXO } from '@xdefi-tech/chains-utxo'; +import { UTXO, stringToHex } from '@xdefi-tech/chains-utxo'; import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; -import isEmpty from 'lodash/isEmpty'; import { utils as ethersUtils } from 'ethers'; import utils from 'coinselect/utils'; import sortBy from 'lodash/sortBy'; +import { hexToBytes } from '@noble/hashes/utils'; import type { BitcoinProvider } from './chain.provider'; import { NfTv3 } from './gql'; @@ -32,10 +32,10 @@ export interface TxBody { to: string; from: string; inputs: UTXO[]; - outputs: { address?: string; script?: Buffer; value: number }[]; + outputs: { address?: string; script?: Buffer | Uint8Array; value: number }[]; utxos: UTXO[]; fee: string; - compiledMemo?: '' | Buffer; + compiledMemo?: string | Uint8Array; } export class ChainMsg extends BaseMsg { @@ -244,14 +244,14 @@ export class ChainMsg extends BaseMsg { } private createTargetOutputs( - compiledMemo: Buffer | undefined, + compiledMemo: Uint8Array | undefined, feeToSendOrdinals: number ) { const msgData = this.toData(); const targetOutputs: { address?: string; value: number; - script?: Buffer; + script?: Buffer | Uint8Array; }[] = []; const valueToSend = new BigNumber(msgData.amount?.toString()) .multipliedBy(10 ** (msgData.decimals || this.provider.manifest.decimals)) @@ -279,14 +279,17 @@ export class ChainMsg extends BaseMsg { ordinalOutputUtxos: { address?: string; value: number }[], feeRate: number, dustThreshold: number, - compiledMemo: Buffer | undefined + compiledMemo: Uint8Array | undefined ): TxBody { const msgData = this.toData(); const finalInputs = inputs ? [...ordinalInputUtxos, ...inputs] : ordinalInputUtxos; - const finalOutputs: { address?: string; value: number; script?: Buffer }[] = - []; + const finalOutputs: { + address?: string; + value: number; + script?: Buffer | Uint8Array; + }[] = []; const valueToSend = new BigNumber(msgData.amount?.toString()) .multipliedBy(10 ** (msgData.decimals || this.provider.manifest.decimals)) @@ -343,7 +346,11 @@ export class ChainMsg extends BaseMsg { } private handleSingleInput( - finalOutputs: { address?: string; value: number; script?: Buffer }[], + finalOutputs: { + address?: string; + value: number; + script?: Buffer | Uint8Array; + }[], ordinalOutputUtxos: { address?: string; value: number }[], dustThreshold: number ) { @@ -379,7 +386,11 @@ export class ChainMsg extends BaseMsg { } private adjustOutputsForFee( - finalOutputs: { address?: string; value: number; script?: Buffer }[], + finalOutputs: { + address?: string; + value: number; + script?: Buffer | Uint8Array; + }[], totalFee: number, dustThreshold: number ) { @@ -397,10 +408,14 @@ export class ChainMsg extends BaseMsg { private createTxBody( inputs: UTXO[], - outputs: { address?: string; value: number; script?: Buffer }[], + outputs: { + address?: string; + value: number; + script?: Buffer | Uint8Array; + }[], utxos: UTXO[], fee: string, - compiledMemo: Buffer | undefined + compiledMemo: Uint8Array | undefined ): TxBody { const msgData = this.toData(); return { @@ -441,17 +456,24 @@ export class ChainMsg extends BaseMsg { * Current method in used to compile a bitcoinjs-lib script. Bitcoin scripts are used to define the conditions * under which funds can be spent in a Bitcoin transaction. Mark a transaction output as unspendable * @param {string | Uint8Array} memo - * @returns {Buffer} OP_RETURN compiled script + * @returns {Uint8Array} OP_RETURN compiled script */ - public compileMemo(memo: string | Uint8Array) { - let formattedMemo: Buffer; + public compileMemo(memo: string | Uint8Array): Uint8Array { + let formattedMemo: Uint8Array; if (typeof memo === 'string') { - formattedMemo = Buffer.from(memo, 'utf8'); + const bytesMemo = hexToBytes(stringToHex(memo)); + formattedMemo = Uint8Array.from([ + UTXOLib.opcodes.OP_RETURN, + bytesMemo.length, + ...bytesMemo, + ]); } else { - formattedMemo = Buffer.from(memo); + formattedMemo = memo; } - return UTXOLib.script.compile([UTXOLib.opcodes.OP_RETURN, formattedMemo]); + if (formattedMemo.length > 80) throw new Error('Memo is too long'); + + return formattedMemo; } async getFee(speed?: GasFeeSpeed): Promise { diff --git a/packages/bitcoin/src/signers/private-key.signer.spec.ts b/packages/bitcoin/src/signers/private-key.signer.spec.ts index a653f219..f599083e 100644 --- a/packages/bitcoin/src/signers/private-key.signer.spec.ts +++ b/packages/bitcoin/src/signers/private-key.signer.spec.ts @@ -93,7 +93,7 @@ describe('private-key.signer', () => { await signer.sign(message); expect(message.signedTransaction).toEqual( - '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5398050000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022004721285e2f3a5f7a4c248a0cfc49f33d6dc6d583845bc44118551353dfdd50b022036341ed7d0708f4736826b5a35c032cac12056bd41280a28f79bf882cab7525a012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' + '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a530000000000000000066a047465737498050000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a530247304402205867a1f3301c27ec8bd311dfed940f030fa6700b19b4b14c841153bc086a6b2d0220724fac48d0680bab9ac836c01a34ab951aa4ce42b51edd337f46ea47f73052e6012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' ); }); diff --git a/packages/bitcoin/src/signers/private-key.signer.ts b/packages/bitcoin/src/signers/private-key.signer.ts index c17707c4..794153e4 100644 --- a/packages/bitcoin/src/signers/private-key.signer.ts +++ b/packages/bitcoin/src/signers/private-key.signer.ts @@ -29,7 +29,9 @@ export class PrivateKeySigner extends Signer.Provider { async sign(message: ChainMsg, _derivation?: string) { const { inputs, outputs, from } = await message.buildTx(); - const txP2WPKH = new btc.Transaction(); + const txP2WPKH = new btc.Transaction({ + allowUnknownOutputs: true, + }); for (const input of inputs) { txP2WPKH.addInput({ txid: input.hash, @@ -41,6 +43,14 @@ export class PrivateKeySigner extends Signer.Provider { }); } for (const output of outputs) { + // OP_RETURN always has value 0 + if (output.value === 0) { + txP2WPKH.addOutput({ + script: output.script, + amount: BigInt(0), + }); + continue; + } if (!output.address) { output.address = from; } diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts index b450ccfc..91eff978 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.spec.ts @@ -97,7 +97,7 @@ describe('seed-phrase.signer', () => { await signer.sign(message, derivation); expect(message.signedTransaction).toEqual( - '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5300000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5398050000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a5302473044022004721285e2f3a5f7a4c248a0cfc49f33d6dc6d583845bc44118551353dfdd50b022036341ed7d0708f4736826b5a35c032cac12056bd41280a28f79bf882cab7525a012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' + '02000000000101fb6aad3e2d000e2cde07debec31a907cc4f7420cc7ad36e7eed3261b1d16b7e40000000000ffffffff0364000000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a530000000000000000066a047465737498050000000000001600144e209aaf99f4b08cb5b583f4e87b546b00ea5a530247304402205867a1f3301c27ec8bd311dfed940f030fa6700b19b4b14c841153bc086a6b2d0220724fac48d0680bab9ac836c01a34ab951aa4ce42b51edd337f46ea47f73052e6012103e389368c5d8bd73599616a574d9b74bf77cb5aee13692e5a3855a7fd2b945f9200000000' ); }); diff --git a/packages/bitcoin/src/signers/seed-phrase.signer.ts b/packages/bitcoin/src/signers/seed-phrase.signer.ts index 7c1359d7..8ab2c3ee 100644 --- a/packages/bitcoin/src/signers/seed-phrase.signer.ts +++ b/packages/bitcoin/src/signers/seed-phrase.signer.ts @@ -36,7 +36,9 @@ export class SeedPhraseSigner extends Signer.Provider { async sign(message: ChainMsg, derivation: string) { const { inputs, outputs, from } = await message.buildTx(); - const txP2WPKH = new btc.Transaction(); + const txP2WPKH = new btc.Transaction({ + allowUnknownOutputs: true, + }); for (const input of inputs) { txP2WPKH.addInput({ txid: input.hash, @@ -48,6 +50,14 @@ export class SeedPhraseSigner extends Signer.Provider { }); } for (const output of outputs) { + // OP_RETURN always has value 0 + if (output.value === 0) { + txP2WPKH.addOutput({ + script: output.script, + amount: BigInt(0), + }); + continue; + } if (!output.address) { output.address = from; } diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 1e6f028e..8b413335 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -33,7 +33,7 @@ "@psf/bitcoincashjs-lib": "4.0.3", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", - "@scure/btc-signer": "1.2.1", + "@scure/btc-signer": "1.3.2", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index ef0eb1a4..757e8c2f 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -32,7 +32,7 @@ "@noble/curves": "1.3.0", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", - "@scure/btc-signer": "1.2.1", + "@scure/btc-signer": "1.3.2", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", diff --git a/packages/dogecoin/src/msg.ts b/packages/dogecoin/src/msg.ts index 8ef23564..725753b8 100644 --- a/packages/dogecoin/src/msg.ts +++ b/packages/dogecoin/src/msg.ts @@ -9,7 +9,8 @@ import { import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; -import { UTXO } from '@xdefi-tech/chains-utxo'; +import { UTXO, stringToHex } from '@xdefi-tech/chains-utxo'; +import { hexToBytes } from '@noble/hashes/utils'; import type { DogecoinProvider } from './chain.provider'; @@ -26,10 +27,10 @@ export interface TxBody { to: string; from: string; inputs: UTXO[]; - outputs: { address?: string; script?: Buffer; value: number }[]; + outputs: { address?: string; script?: Buffer | Uint8Array; value: number }[]; utxos: UTXO[]; fee: string; - compiledMemo?: '' | Buffer; + compiledMemo?: string | Uint8Array; } export const MINIMUM_DOGECOIN_FEE = 40000; @@ -101,17 +102,24 @@ export class ChainMsg extends BaseMsg { * Current method in used to compile a bitcoinjs-lib script. Bitcoin scripts are used to define the conditions * under which funds can be spent in a Bitcoin transaction. Mark a transaction output as unspendable * @param {string | Uint8Array} memo - * @returns {Buffer} OP_RETURN compiled script + * @returns {Uint8Array} OP_RETURN compiled script */ - public compileMemo(memo: string | Uint8Array) { - let formattedMemo: Buffer; + public compileMemo(memo: string | Uint8Array): Uint8Array { + let formattedMemo: Uint8Array; if (typeof memo === 'string') { - formattedMemo = Buffer.from(memo, 'utf8'); + const bytesMemo = hexToBytes(stringToHex(memo)); + formattedMemo = Uint8Array.from([ + UTXOLib.opcodes.OP_RETURN, + bytesMemo.length, + ...bytesMemo, + ]); } else { - formattedMemo = Buffer.from(memo); + formattedMemo = memo; } - return UTXOLib.script.compile([UTXOLib.opcodes.OP_RETURN, formattedMemo]); + if (formattedMemo.length > 80) throw new Error('Memo is too long'); + + return formattedMemo; } async getFee(speed?: GasFeeSpeed): Promise { diff --git a/packages/dogecoin/src/signers/private-key.signer.ts b/packages/dogecoin/src/signers/private-key.signer.ts index b95e653f..9a77ff2a 100644 --- a/packages/dogecoin/src/signers/private-key.signer.ts +++ b/packages/dogecoin/src/signers/private-key.signer.ts @@ -33,7 +33,9 @@ export class PrivateKeySigner extends Signer.Provider { async sign(message: ChainMsg) { const { inputs, outputs, from } = await message.buildTx(); const network = coininfo.dogecoin.main.toBitcoinJS(); - const psbt = new btc.Transaction(); + const psbt = new btc.Transaction({ + allowUnknownOutputs: true, + }); for (const utxo of inputs) { psbt.addInput({ @@ -44,6 +46,14 @@ export class PrivateKeySigner extends Signer.Provider { } for (const output of outputs) { + // OP_RETURN always has value 0 + if (output.value === 0) { + psbt.addOutput({ + script: output.script, + amount: BigInt(0), + }); + continue; + } if (!output.address) { output.address = from; } diff --git a/packages/dogecoin/src/signers/seed-phrase.signer.ts b/packages/dogecoin/src/signers/seed-phrase.signer.ts index be0d5f4a..13e05a88 100644 --- a/packages/dogecoin/src/signers/seed-phrase.signer.ts +++ b/packages/dogecoin/src/signers/seed-phrase.signer.ts @@ -39,7 +39,9 @@ export class SeedPhraseSigner extends Signer.Provider { async sign(message: ChainMsg, derivation: string) { const { inputs, outputs, from } = await message.buildTx(); const network = coininfo.dogecoin.main.toBitcoinJS(); - const psbt = new btc.Transaction(); + const psbt = new btc.Transaction({ + allowUnknownOutputs: true, + }); for (const utxo of inputs) { psbt.addInput({ @@ -50,6 +52,14 @@ export class SeedPhraseSigner extends Signer.Provider { } for (const output of outputs) { + // OP_RETURN always has value 0 + if (output.value === 0) { + psbt.addOutput({ + script: output.script, + amount: BigInt(0), + }); + continue; + } if (!output.address) { output.address = from; } diff --git a/packages/dogecoin/src/signers/trezor.signer.spec.ts b/packages/dogecoin/src/signers/trezor.signer.spec.ts index b27b26f7..d6aaba78 100644 --- a/packages/dogecoin/src/signers/trezor.signer.spec.ts +++ b/packages/dogecoin/src/signers/trezor.signer.spec.ts @@ -5,8 +5,8 @@ import { Success, parseConnectSettings, } from '@trezor/connect-web'; -import { ChainMsg, MsgBody } from '@xdefi-tech/chains-utxo'; +import { ChainMsg, MsgBody } from '../msg'; import { DogecoinProvider } from '../chain.provider'; import { IndexerDataSource } from '../datasource'; import { DOGECOIN_MANIFEST } from '../manifests'; diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index bd3a072d..ee1b3bec 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -32,7 +32,7 @@ "@noble/curves": "1.3.0", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", - "@scure/btc-signer": "1.2.1", + "@scure/btc-signer": "1.3.2", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", diff --git a/packages/litecoin/src/msg.ts b/packages/litecoin/src/msg.ts index 5e0f59ad..43bbe986 100644 --- a/packages/litecoin/src/msg.ts +++ b/packages/litecoin/src/msg.ts @@ -9,7 +9,8 @@ import { import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; -import { UTXO } from '@xdefi-tech/chains-utxo'; +import { UTXO, stringToHex } from '@xdefi-tech/chains-utxo'; +import { hexToBytes } from '@noble/hashes/utils'; import type { LitecoinProvider } from './chain.provider'; @@ -26,10 +27,10 @@ export interface TxBody { to: string; from: string; inputs: UTXO[]; - outputs: { address?: string; script?: Buffer; value: number }[]; + outputs: { address?: string; script?: Buffer | Uint8Array; value: number }[]; utxos: UTXO[]; fee: string; - compiledMemo?: '' | Buffer; + compiledMemo?: string | Uint8Array; } export class ChainMsg extends BaseMsg { @@ -97,17 +98,24 @@ export class ChainMsg extends BaseMsg { * Current method in used to compile a bitcoinjs-lib script. Bitcoin scripts are used to define the conditions * under which funds can be spent in a Bitcoin transaction. Mark a transaction output as unspendable * @param {string | Uint8Array} memo - * @returns {Buffer} OP_RETURN compiled script + * @returns {Uint8Array} OP_RETURN compiled script */ - public compileMemo(memo: string | Uint8Array) { - let formattedMemo: Buffer; + public compileMemo(memo: string | Uint8Array): Uint8Array { + let formattedMemo: Uint8Array; if (typeof memo === 'string') { - formattedMemo = Buffer.from(memo, 'utf8'); + const bytesMemo = hexToBytes(stringToHex(memo)); + formattedMemo = Uint8Array.from([ + UTXOLib.opcodes.OP_RETURN, + bytesMemo.length, + ...bytesMemo, + ]); } else { - formattedMemo = Buffer.from(memo); + formattedMemo = memo; } - return UTXOLib.script.compile([UTXOLib.opcodes.OP_RETURN, formattedMemo]); + if (formattedMemo.length > 80) throw new Error('Memo is too long'); + + return formattedMemo; } async getFee(speed?: GasFeeSpeed): Promise { diff --git a/packages/litecoin/src/signers/private-key.signer.ts b/packages/litecoin/src/signers/private-key.signer.ts index 7f30bbf9..0cd18018 100644 --- a/packages/litecoin/src/signers/private-key.signer.ts +++ b/packages/litecoin/src/signers/private-key.signer.ts @@ -33,7 +33,9 @@ export class PrivateKeySigner extends Signer.Provider { async sign(message: ChainMsg) { const { inputs, outputs, from } = await message.buildTx(); const network = coininfo.litecoin.main.toBitcoinJS(); - const psbt = new btc.Transaction(); + const psbt = new btc.Transaction({ + allowUnknownOutputs: true, + }); for (const utxo of inputs) { psbt.addInput({ @@ -44,6 +46,14 @@ export class PrivateKeySigner extends Signer.Provider { } for (const output of outputs) { + // OP_RETURN always has value 0 + if (output.value === 0) { + psbt.addOutput({ + script: output.script, + amount: BigInt(0), + }); + continue; + } if (!output.address) { output.address = from; } diff --git a/packages/litecoin/src/signers/seed-phrase.signer.ts b/packages/litecoin/src/signers/seed-phrase.signer.ts index ca43ef60..bcedcd2f 100644 --- a/packages/litecoin/src/signers/seed-phrase.signer.ts +++ b/packages/litecoin/src/signers/seed-phrase.signer.ts @@ -39,7 +39,9 @@ export class SeedPhraseSigner extends Signer.Provider { async sign(message: ChainMsg, derivation: string) { const { inputs, outputs, from } = await message.buildTx(); const network = coininfo.litecoin.main.toBitcoinJS(); - const psbt = new btc.Transaction(); + const psbt = new btc.Transaction({ + allowUnknownOutputs: true, + }); for (const utxo of inputs) { psbt.addInput({ @@ -50,6 +52,14 @@ export class SeedPhraseSigner extends Signer.Provider { } for (const output of outputs) { + // OP_RETURN always has value 0 + if (output.value === 0) { + psbt.addOutput({ + script: output.script, + amount: BigInt(0), + }); + continue; + } if (!output.address) { output.address = from; } diff --git a/packages/utxo/src/index.ts b/packages/utxo/src/index.ts index 756d0331..ac444d96 100644 --- a/packages/utxo/src/index.ts +++ b/packages/utxo/src/index.ts @@ -2,3 +2,4 @@ export * from './chain.provider'; export * from './data-provider'; export * from './msg'; export * from './manifests'; +export * from './utils'; diff --git a/packages/utxo/src/msg.ts b/packages/utxo/src/msg.ts index 8c212c58..62a9cef5 100644 --- a/packages/utxo/src/msg.ts +++ b/packages/utxo/src/msg.ts @@ -9,9 +9,11 @@ import { import BigNumber from 'bignumber.js'; import accumulative from 'coinselect/accumulative'; import * as UTXOLib from 'bitcoinjs-lib'; +import { hexToBytes } from '@noble/hashes/utils'; import type { UtxoProvider } from './chain.provider'; import { UTXO } from './data-provider/utxo/utxo.data-provider'; +import { stringToHex } from './utils'; export interface MsgBody { amount: NumberIsh; @@ -27,10 +29,10 @@ export interface TxBody { to: string; from: string; inputs: UTXO[]; - outputs: { address?: string; script?: Buffer; value: number }[]; + outputs: { address?: string; script?: Buffer | Uint8Array; value: number }[]; utxos: UTXO[]; fee: string; - compiledMemo?: '' | Buffer; + compiledMemo?: string | Uint8Array; } export class ChainMsg extends BaseMsg { @@ -98,17 +100,24 @@ export class ChainMsg extends BaseMsg { * Current method in used to compile a bitcoinjs-lib script. Bitcoin scripts are used to define the conditions * under which funds can be spent in a Bitcoin transaction. Mark a transaction output as unspendable * @param {string | Uint8Array} memo - * @returns {Buffer} OP_RETURN compiled script + * @returns {Uint8Array} OP_RETURN compiled script */ - public compileMemo(memo: string | Uint8Array) { - let formattedMemo: Buffer; + public compileMemo(memo: string | Uint8Array): Uint8Array { + let formattedMemo: Uint8Array; if (typeof memo === 'string') { - formattedMemo = Buffer.from(memo, 'utf8'); + const bytesMemo = hexToBytes(stringToHex(memo)); + formattedMemo = Uint8Array.from([ + UTXOLib.opcodes.OP_RETURN, + bytesMemo.length, + ...bytesMemo, + ]); } else { - formattedMemo = Buffer.from(memo); + formattedMemo = memo; } - return UTXOLib.script.compile([UTXOLib.opcodes.OP_RETURN, formattedMemo]); + if (formattedMemo.length > 80) throw new Error('Memo is too long'); + + return formattedMemo; } async getFee(speed?: GasFeeSpeed): Promise { diff --git a/packages/utxo/src/utils.ts b/packages/utxo/src/utils.ts new file mode 100644 index 00000000..ad89907d --- /dev/null +++ b/packages/utxo/src/utils.ts @@ -0,0 +1,5 @@ +export const stringToHex = (str: string) => { + return [...str] + .map((char) => char.charCodeAt(0).toString(16).padStart(2, '0')) + .join(''); +}; diff --git a/yarn.lock b/yarn.lock index c8d3cde0..2aa5e2d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5682,6 +5682,16 @@ "@scure/base" "~1.1.5" micro-packed "~0.5.1" +"@scure/btc-signer@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@scure/btc-signer/-/btc-signer-1.3.2.tgz#56cf02a2e318097b1e4f531fac8ef114bdf4ddc8" + integrity sha512-BmcQHvxaaShKwgbFC0vDk0xzqbMhNtNmgXm6u7cz07FNtGsVItUuHow6NbgHmc+oJSBZJRym5dz8+Uu0JoEJhQ== + dependencies: + "@noble/curves" "~1.4.0" + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + micro-packed "~0.6.2" + "@segment/loosely-validate-event@^2.0.0": version "2.0.0" resolved "https://registry.npmjs.org/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz" @@ -14787,6 +14797,13 @@ micro-packed@~0.5.1: dependencies: "@scure/base" "~1.1.5" +micro-packed@~0.6.2: + version "0.6.3" + resolved "https://registry.yarnpkg.com/micro-packed/-/micro-packed-0.6.3.tgz#125e36bcfd4aa03dbdb31c81cda3bfea84367ae0" + integrity sha512-VmVkyc7lIzAq/XCPFuLc/CwQ7Ehs5XDK3IwqsZHiBIDttAI9Gs7go6Lv4lNRuAIKrGKcRTtthFKUNyHS0S4wJQ== + dependencies: + "@scure/base" "~1.1.5" + micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: version "4.0.5" resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz" From c3dca3e643152508b22aed5a16388344072c74d0 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 11 Sep 2024 07:57:23 +0000 Subject: [PATCH 166/176] Version packages --- .changeset/curly-penguins-unite.md | 9 ------ packages/bitcoin/CHANGELOG.md | 8 +++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 8 +++++ packages/bitcoincash/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 8 +++++ packages/dogecoin/package.json | 2 +- packages/litecoin/CHANGELOG.md | 8 +++++ packages/litecoin/package.json | 2 +- packages/utxo/CHANGELOG.md | 6 ++++ packages/utxo/package.json | 2 +- yarn.lock | 50 +++++++++++++++++------------- 12 files changed, 72 insertions(+), 35 deletions(-) delete mode 100644 .changeset/curly-penguins-unite.md diff --git a/.changeset/curly-penguins-unite.md b/.changeset/curly-penguins-unite.md deleted file mode 100644 index d752489a..00000000 --- a/.changeset/curly-penguins-unite.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-utxo': patch ---- - -Fix: add memo to utxo chains using @scure/btc-signer diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 89cce859..0ea26dc0 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoin +## 2.1.4 + +### Patch Changes + +- 72238c5a: Fix: add memo to utxo chains using @scure/btc-signer +- Updated dependencies [72238c5a] + - @xdefi-tech/chains-utxo@2.0.16 + ## 2.1.3 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index c5987d26..e036ab52 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.1.3", + "version": "2.1.4", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 91603f95..25b33a27 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-bitcoincash +## 2.1.4 + +### Patch Changes + +- 72238c5a: Fix: add memo to utxo chains using @scure/btc-signer +- Updated dependencies [72238c5a] + - @xdefi-tech/chains-utxo@2.0.16 + ## 2.1.3 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 8b413335..1656c62e 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.1.3", + "version": "2.1.4", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index f8019e47..af77c4c7 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-dogecoin +## 2.1.4 + +### Patch Changes + +- 72238c5a: Fix: add memo to utxo chains using @scure/btc-signer +- Updated dependencies [72238c5a] + - @xdefi-tech/chains-utxo@2.0.16 + ## 2.1.3 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 757e8c2f..bf46554b 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.1.3", + "version": "2.1.4", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index 201ee6b2..d6bd8593 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-litecoin +## 2.1.4 + +### Patch Changes + +- 72238c5a: Fix: add memo to utxo chains using @scure/btc-signer +- Updated dependencies [72238c5a] + - @xdefi-tech/chains-utxo@2.0.16 + ## 2.1.3 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index ee1b3bec..257e95fe 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.1.3", + "version": "2.1.4", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index ad41f358..dd1af3d3 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-utxo +## 2.0.16 + +### Patch Changes + +- 72238c5a: Fix: add memo to utxo chains using @scure/btc-signer + ## 2.0.15 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index f96c193f..116f9669 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.15", + "version": "2.0.16", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/yarn.lock b/yarn.lock index 2aa5e2d9..1138594f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5133,7 +5133,7 @@ resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@1.3.3", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.2", "@noble/hashes@~1.3.2", "@noble/hashes@~1.3.3": +"@noble/hashes@1.3.3", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.2", "@noble/hashes@~1.3.2": version "1.3.3" resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== @@ -5672,16 +5672,6 @@ "@noble/hashes" "~1.4.0" "@scure/base" "~1.1.6" -"@scure/btc-signer@1.2.1": - version "1.2.1" - resolved "https://registry.npmjs.org/@scure/btc-signer/-/btc-signer-1.2.1.tgz" - integrity sha512-/Zle18/aWhYDBuBeXGDGJTdo0/LKpQhU8ETBJeWABCQkbk0QHCFCinidTiz9hdQFfh0HtasPGq5p6EodVCfEew== - dependencies: - "@noble/curves" "~1.3.0" - "@noble/hashes" "~1.3.3" - "@scure/base" "~1.1.5" - micro-packed "~0.5.1" - "@scure/btc-signer@1.3.2": version "1.3.2" resolved "https://registry.yarnpkg.com/@scure/btc-signer/-/btc-signer-1.3.2.tgz#56cf02a2e318097b1e4f531fac8ef114bdf4ddc8" @@ -14790,13 +14780,6 @@ metro@0.73.10: ws "^7.5.1" yargs "^17.5.1" -micro-packed@~0.5.1: - version "0.5.2" - resolved "https://registry.npmjs.org/micro-packed/-/micro-packed-0.5.2.tgz" - integrity sha512-l8sgdeDNz4KMFdEyk2o0qt+GfmzGZH7sV5+XcHRyBS8LQLCHh/7LYlFlQ5k+axqz7hgANsn8SqzDxRe7O2DIIg== - dependencies: - "@scure/base" "~1.1.5" - micro-packed@~0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/micro-packed/-/micro-packed-0.6.3.tgz#125e36bcfd4aa03dbdb31c81cda3bfea84367ae0" @@ -17899,7 +17882,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17917,6 +17900,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -18018,7 +18010,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -18039,6 +18031,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -19746,7 +19745,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -19764,6 +19763,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From 4ad6b5b0136f44b086b73c992a0946ca51d81821 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 <166351995+sotatek-tyler-nguyen4@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:59:54 +0700 Subject: [PATCH 167/176] feat: return balance of native token on custom cosmos chains (#357) Co-authored-by: sotatek-tyler-nguyen4 --- .changeset/sour-starfishes-drum.md | 5 +++++ packages/cosmos/src/chain.provider.spec.ts | 7 +++++-- packages/cosmos/src/datasource/chain/chain.data-source.ts | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/sour-starfishes-drum.md diff --git a/.changeset/sour-starfishes-drum.md b/.changeset/sour-starfishes-drum.md new file mode 100644 index 00000000..4f3935d3 --- /dev/null +++ b/.changeset/sour-starfishes-drum.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-cosmos': patch +--- + +feat: return balance of native token on custom cosmos chains diff --git a/packages/cosmos/src/chain.provider.spec.ts b/packages/cosmos/src/chain.provider.spec.ts index eb278066..9eda3ded 100644 --- a/packages/cosmos/src/chain.provider.spec.ts +++ b/packages/cosmos/src/chain.provider.spec.ts @@ -118,6 +118,7 @@ describe('chain.provider', () => { expect(balanceData[0].asset.symbol).toEqual('ATOM'); expect(balanceData[0].asset.price).toEqual('443.21'); expect(balanceData[0].asset.priceChange.dayPriceChange).toEqual('-1'); + mockedGetBalance.mockRestore(); }); it('estimateFee() should return fee estimation with encoding string message using IndexerDataSource', async () => { @@ -221,7 +222,8 @@ describe('chain.provider', () => { const balance = await provider.getBalance( 'cro1g5rjj3dsdxnmxz4ydvhxem6hddqs2hgw5wem0f' ); - expect(await balance.getData()).toBeTruthy(); + const balanceData = await balance.getData(); + expect(balanceData.some((data) => data.asset.native === true)).toBe(true); }); it('getBalance() on mars chain', async () => { @@ -231,7 +233,8 @@ describe('chain.provider', () => { const balance = await provider.getBalance( 'mars1km3nehyxu92vu2whjqhuqkmljvcd4nwvnxz8yt' ); - expect(await balance.getData()).toBeTruthy(); + const balanceData = await balance.getData(); + expect(balanceData.some((data) => data.asset.native === true)).toBe(true); }); }); diff --git a/packages/cosmos/src/datasource/chain/chain.data-source.ts b/packages/cosmos/src/datasource/chain/chain.data-source.ts index 880f31d1..fa1871dd 100644 --- a/packages/cosmos/src/datasource/chain/chain.data-source.ts +++ b/packages/cosmos/src/datasource/chain/chain.data-source.ts @@ -79,6 +79,12 @@ export class ChainDataSource extends DataSource { ); const balances = response.data.balances as CosmosCoin[]; + if (!balances.some((b) => b.denom === this.manifest.denom)) { + balances.unshift({ + denom: this.manifest.denom, + amount: '0', + }); + } const chain = COSMOS_ADDRESS_CHAIN[ this.manifest.chain as keyof typeof COSMOS_ADDRESS_CHAIN From fbf647474ac1c480db5415a23397d0cfc7d26779 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 11 Sep 2024 13:02:49 +0000 Subject: [PATCH 168/176] Version packages --- .changeset/sour-starfishes-drum.md | 5 ----- packages/cosmos/CHANGELOG.md | 6 ++++++ packages/cosmos/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/sour-starfishes-drum.md diff --git a/.changeset/sour-starfishes-drum.md b/.changeset/sour-starfishes-drum.md deleted file mode 100644 index 4f3935d3..00000000 --- a/.changeset/sour-starfishes-drum.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -feat: return balance of native token on custom cosmos chains diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index facfdb34..91dd1672 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-cosmos +## 2.0.51 + +### Patch Changes + +- b80c98c0: feat: return balance of native token on custom cosmos chains + ## 2.0.50 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 6a27932a..1cde0361 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.50", + "version": "2.0.51", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", From 844b9421174b1a7b8e78502f0fe74b69d55b35f5 Mon Sep 17 00:00:00 2001 From: danilxdefi <109511564+danilxdefi@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:53:24 +0300 Subject: [PATCH 169/176] fix: add maxPriorityFeePerGas default value to 1 gwei (#363) --- .changeset/wise-rats-notice.md | 5 ++++ packages/evm/src/constants.ts | 2 ++ .../src/datasource/chain/chain.data-source.ts | 27 ++++++++++--------- .../datasource/indexer/indexer.data-source.ts | 8 +++--- packages/evm/src/utils/get-fees.ts | 4 +-- packages/evm/src/utils/parser.ts | 6 +++-- 6 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 .changeset/wise-rats-notice.md diff --git a/.changeset/wise-rats-notice.md b/.changeset/wise-rats-notice.md new file mode 100644 index 00000000..360d2efc --- /dev/null +++ b/.changeset/wise-rats-notice.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-evm': patch +--- + +Fix: add maxPriorityFeePerGas default value to 1 gwei diff --git a/packages/evm/src/constants.ts b/packages/evm/src/constants.ts index 23574883..60d7b11f 100644 --- a/packages/evm/src/constants.ts +++ b/packages/evm/src/constants.ts @@ -8,3 +8,5 @@ export const FACTOR_ESTIMATE = 1.5; // estimate factor for gas limit export const MULTICALL3_CONTRACT_ADDRESS = '0xcA11bde05977b3631167028862bE2a173976CA11'; + +export const gwei = 10 ** 9; diff --git a/packages/evm/src/datasource/chain/chain.data-source.ts b/packages/evm/src/datasource/chain/chain.data-source.ts index 724c26fb..dd94da54 100644 --- a/packages/evm/src/datasource/chain/chain.data-source.ts +++ b/packages/evm/src/datasource/chain/chain.data-source.ts @@ -333,10 +333,11 @@ export class ChainDataSource extends DataSource { .multipliedBy(this.manifest.feeGasStep.high) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), - priorityFeePerGas: new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) - .multipliedBy(this.manifest.feeGasStep.high) - .integerValue(BigNumber.ROUND_CEIL) - .toNumber(), + priorityFeePerGas: + new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.high) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber() || 1, }, [GasFeeSpeed.medium]: { baseFeePerGas: new BigNumber( @@ -349,10 +350,11 @@ export class ChainDataSource extends DataSource { .multipliedBy(this.manifest.feeGasStep.medium) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), - priorityFeePerGas: new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) - .multipliedBy(this.manifest.feeGasStep.medium) - .integerValue(BigNumber.ROUND_CEIL) - .toNumber(), + priorityFeePerGas: + new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.medium) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber() || 1, }, [GasFeeSpeed.low]: { baseFeePerGas: new BigNumber( @@ -365,10 +367,11 @@ export class ChainDataSource extends DataSource { .multipliedBy(this.manifest.feeGasStep.low) .integerValue(BigNumber.ROUND_CEIL) .toNumber(), - priorityFeePerGas: new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) - .multipliedBy(this.manifest.feeGasStep.low) - .integerValue(BigNumber.ROUND_CEIL) - .toNumber(), + priorityFeePerGas: + new BigNumber(formatFixed(fee.maxPriorityFeePerGas)) + .multipliedBy(this.manifest.feeGasStep.low) + .integerValue(BigNumber.ROUND_CEIL) + .toNumber() || 1, }, }; } diff --git a/packages/evm/src/datasource/indexer/indexer.data-source.ts b/packages/evm/src/datasource/indexer/indexer.data-source.ts index cab26880..b7da8151 100644 --- a/packages/evm/src/datasource/indexer/indexer.data-source.ts +++ b/packages/evm/src/datasource/indexer/indexer.data-source.ts @@ -328,17 +328,19 @@ export class IndexerDataSource extends DataSource { } else if (typeof fee.high === 'object') { result = {} as EIP1559FeeOptions; result[GasFeeSpeed.high] = { - priorityFeePerGas: parseGwei(fee.high.priorityFeePerGas).toNumber(), + priorityFeePerGas: + parseGwei(fee.high.priorityFeePerGas).toNumber() || 1, maxFeePerGas: parseGwei(fee.high.maxFeePerGas).toNumber(), baseFeePerGas: parseGwei(fee.high.baseFeePerGas).toNumber(), } as EIP1559Fee; result[GasFeeSpeed.medium] = { - priorityFeePerGas: parseGwei(fee.medium.priorityFeePerGas).toNumber(), + priorityFeePerGas: + parseGwei(fee.medium.priorityFeePerGas).toNumber() || 1, maxFeePerGas: parseGwei(fee.medium.maxFeePerGas).toNumber(), baseFeePerGas: parseGwei(fee.medium.baseFeePerGas).toNumber(), } as EIP1559Fee; result[GasFeeSpeed.low] = { - priorityFeePerGas: parseGwei(fee.low.priorityFeePerGas).toNumber(), + priorityFeePerGas: parseGwei(fee.low.priorityFeePerGas).toNumber() || 1, maxFeePerGas: parseGwei(fee.low.maxFeePerGas).toNumber(), baseFeePerGas: parseGwei(fee.low.baseFeePerGas).toNumber(), } as EIP1559Fee; diff --git a/packages/evm/src/utils/get-fees.ts b/packages/evm/src/utils/get-fees.ts index cc2fb004..ecf28001 100644 --- a/packages/evm/src/utils/get-fees.ts +++ b/packages/evm/src/utils/get-fees.ts @@ -3,7 +3,7 @@ import { FeeData, GasFeeSpeed } from '@xdefi-tech/chains-core'; import BigNumber from 'bignumber.js'; import { EVMChains } from '../manifests'; -import { DEFAULT_CONTRACT_FEE } from '../constants'; +import { DEFAULT_CONTRACT_FEE, gwei } from '../constants'; import { ChainMsg } from '../msg'; import { RestEstimateGasRequest } from '../types'; @@ -22,8 +22,6 @@ export interface FeeMultipliers { high: number; } -const gwei = 10 ** 9; - export const getGasLimitFromRPC = async ( msg: ChainMsg, rest?: Axios diff --git a/packages/evm/src/utils/parser.ts b/packages/evm/src/utils/parser.ts index 7c2a5130..e29df855 100644 --- a/packages/evm/src/utils/parser.ts +++ b/packages/evm/src/utils/parser.ts @@ -2,6 +2,8 @@ import { NumberIsh } from '@xdefi-tech/chains-core'; import { ethers } from 'ethers'; import BigNumber from 'bignumber.js'; +import { gwei } from '../constants'; + export const parseGwei = (n: NumberIsh): BigNumber => { let num = null; // parseInt mandatory to cut off decimals @@ -16,8 +18,8 @@ export const parseGwei = (n: NumberIsh): BigNumber => { num = parseInt(n.toString(), 10); break; case typeof n === 'number': - num = parseInt(((n as number) * 100).toString()); - num = num / 100; + num = parseInt(((n as number) * gwei).toString()); + num = num / gwei; break; default: throw new Error('Invalid NumberIsh value'); From c3b1e7ca36a36908268cb404a3129f854372afc2 Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 11 Sep 2024 15:56:19 +0000 Subject: [PATCH 170/176] Version packages --- .changeset/wise-rats-notice.md | 5 ----- packages/evm/CHANGELOG.md | 6 ++++++ packages/evm/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/wise-rats-notice.md diff --git a/.changeset/wise-rats-notice.md b/.changeset/wise-rats-notice.md deleted file mode 100644 index 360d2efc..00000000 --- a/.changeset/wise-rats-notice.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-evm': patch ---- - -Fix: add maxPriorityFeePerGas default value to 1 gwei diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index af1b01d4..edd5140f 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-evm +## 2.0.51 + +### Patch Changes + +- 69686372: Fix: add maxPriorityFeePerGas default value to 1 gwei + ## 2.0.50 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index b7aca9fb..93375b46 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.50", + "version": "2.0.51", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From 3bdb4669d4ae4e82dba02af63868746a7114eb2b Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Wed, 11 Sep 2024 19:37:23 -0400 Subject: [PATCH 171/176] fix: include missing dependencies to fix externals (#364) --- .changeset/hip-hornets-admire.md | 16 +++++++ packages/binance/package.json | 1 + packages/bitcoin/package.json | 4 ++ packages/bitcoincash/package.json | 2 + packages/core/package.json | 2 + packages/cosmos/package.json | 5 +++ packages/dogecoin/package.json | 3 ++ packages/evm/package.json | 3 ++ packages/litecoin/package.json | 3 ++ packages/solana/package.json | 2 + packages/thor/package.json | 1 + packages/utxo/package.json | 1 + .../eslint-config-custom/index.js | 19 +++++--- yarn.lock | 43 ++++--------------- 14 files changed, 65 insertions(+), 40 deletions(-) create mode 100644 .changeset/hip-hornets-admire.md diff --git a/.changeset/hip-hornets-admire.md b/.changeset/hip-hornets-admire.md new file mode 100644 index 00000000..5cf85564 --- /dev/null +++ b/.changeset/hip-hornets-admire.md @@ -0,0 +1,16 @@ +--- +'eslint-config-custom': patch +'@xdefi-tech/chains-bitcoincash': patch +'@xdefi-tech/chains-dogecoin': patch +'@xdefi-tech/chains-litecoin': patch +'@xdefi-tech/chains-binance': patch +'@xdefi-tech/chains-bitcoin': patch +'@xdefi-tech/chains-cosmos': patch +'@xdefi-tech/chains-solana': patch +'@xdefi-tech/chains-core': patch +'@xdefi-tech/chains-thor': patch +'@xdefi-tech/chains-utxo': patch +'@xdefi-tech/chains-evm': patch +--- + +Fix external dependencies included in bundles diff --git a/packages/binance/package.json b/packages/binance/package.json index c2ae5ae9..ea66000c 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -29,6 +29,7 @@ "@binance-chain/javascript-sdk": "4.2.2", "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", + "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", "axios": "1.4.0", "bignumber.js": "9.1.2", diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index e036ab52..dc955b1d 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -30,6 +30,7 @@ "@ledgerhq/hw-transport-mocker": "6.28.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", + "@noble/hashes": "1.3.3", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.3.2", @@ -41,7 +42,10 @@ "bitcoinjs-lib": "5.2.0", "coininfo": "^5.2.1", "coinselect": "3.1.13", + "ethers": "5.6.4", "eslint-config-custom": "*", + "graphql-tag": "2.12.6", + "lodash": "4.17.21", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", "rxjs": "7.8.0", diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 1656c62e..67edde17 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -34,6 +34,7 @@ "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.3.2", + "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", @@ -44,6 +45,7 @@ "coinkey": "3.0.0", "coinselect": "3.1.13", "eslint-config-custom": "*", + "ethers": "5.6.4", "hdkey": "2.1.0", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", diff --git a/packages/core/package.json b/packages/core/package.json index 63c3885a..e9c65843 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -42,6 +42,7 @@ "@trezor/connect-web": "9.1.4", "bignumber.js": "9.1.2", "graphql": "16.6.0", + "graphql-tag": "2.12.6", "graphql-ws": "5.11.1", "inversify": "6.0.1", "lodash": "4.17.21", @@ -52,6 +53,7 @@ "sha256": "0.2.0", "typescript": "4.8.3", "uuid": "9.0.0", + "varuint-bitcoin": "1.1.2", "ws": "8.8.1" }, "scripts": { diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 1cde0361..fd1d666c 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -31,6 +31,7 @@ "@cosmjs/amino": "0.32.3", "@cosmjs/cosmwasm-stargate": "0.32.3", "@cosmjs/encoding": "0.32.3", + "@cosmjs/crypto": "0.32.3", "@cosmjs/launchpad": "0.27.1", "@cosmjs/ledger-amino": "0.32.3", "@cosmjs/proto-signing": "0.32.3", @@ -39,6 +40,7 @@ "@cosmology/lcd": "^0.13.4", "@cosmos-client/core": "0.47.1", "@keplr-wallet/cosmos": "0.12.82", + "@keplr-wallet/crypto": "0.12.82", "@ledgerhq/hw-transport": "6.30.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@tanstack/react-query": "^5.51.1", @@ -49,9 +51,12 @@ "bech32": "2.0.0", "bech32-buffer": "0.2.1", "bignumber.js": "9.1.2", + "cosmjs-types": "0.9.0", "crypto-browserify": "3.12.0", "ethers": "5.6.4", + "graphql-tag": "2.12.6", "lodash": "4.17.21", + "long": "5.2.3", "os-browserify": "0.3.0", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index bf46554b..2c6e2dce 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -30,6 +30,8 @@ "@ledgerhq/hw-transport-mocker": "6.28.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", + "@noble/hashes": "1.3.3", + "@trezor/connect-web": "9.1.4", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.3.2", @@ -40,6 +42,7 @@ "bitcoinjs-lib": "5.2.0", "coininfo": "5.2.1", "coinselect": "3.1.13", + "ethers": "5.6.4", "eslint-config-custom": "*", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", diff --git a/packages/evm/package.json b/packages/evm/package.json index 93375b46..5c95d873 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -28,15 +28,18 @@ "typescript": "4.8.3" }, "dependencies": { + "@ethersproject/bignumber": "5.7.0", "@ledgerhq/cryptoassets": "13.0.0", "@ledgerhq/hw-app-eth": "6.36.1", "@ledgerhq/hw-transport": "6.30.6", "@ledgerhq/hw-transport-webhid": "6.28.6", "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", + "axios": "1.3.4", "bignumber.js": "9.1.2", "eth-crypto": "2.6.0", "ethers": "5.6.4", + "graphql-tag": "2.12.6", "lodash": "4.17.21", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 257e95fe..0a7db028 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -30,9 +30,11 @@ "@ledgerhq/hw-transport-mocker": "6.28.3", "@ledgerhq/hw-transport-webhid": "6.28.3", "@noble/curves": "1.3.0", + "@noble/hashes": "1.3.3", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", "@scure/btc-signer": "1.3.2", + "@trezor/connect-web": "9.1.4", "@xdefi-tech/chains-core": "*", "@xdefi-tech/chains-utxo": "*", "axios": "1.3.4", @@ -41,6 +43,7 @@ "coininfo": "5.2.1", "coinselect": "3.1.13", "ecpair": "2.1.0", + "ethers": "5.6.4", "eslint-config-custom": "*", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", diff --git a/packages/solana/package.json b/packages/solana/package.json index 9289efed..12a9bfa2 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -36,10 +36,12 @@ "@solana/spl-token": "0.4.6", "@solana/web3.js": "1.91.8", "@xdefi-tech/chains-core": "*", + "axios": "1.3.4", "bignumber.js": "9.1.2", "bs58": "5.0.0", "ed25519-hd-key": "1.3.0", "eslint-config-custom": "*", + "graphql-tag": "2.12.6", "lodash": "4.17.21", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", diff --git a/packages/thor/package.json b/packages/thor/package.json index d6382dae..85924955 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -42,6 +42,7 @@ "crypto-browserify": "3.12.0", "lodash": "4.17.21", "long": "5.2.3", + "protobufjs": "7.2.4", "reflect-metadata": "0.1.13", "rimraf": "4.4.0", "rxjs": "7.8.0", diff --git a/packages/utxo/package.json b/packages/utxo/package.json index 116f9669..180803ce 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -25,6 +25,7 @@ "typescript": "4.8.3" }, "dependencies": { + "@noble/hashes": "1.3.3", "@xdefi-tech/chains-core": "*", "axios": "1.3.4", "bignumber.js": "9.1.2", diff --git a/utility-packages/eslint-config-custom/index.js b/utility-packages/eslint-config-custom/index.js index 66928a80..9fb694fd 100644 --- a/utility-packages/eslint-config-custom/index.js +++ b/utility-packages/eslint-config-custom/index.js @@ -4,7 +4,13 @@ module.exports = { ecmaVersion: 2020, sourceType: 'module', }, - ignorePatterns: ['node_modules/**/*', 'dist/**/*', 'coverage/**/*', '.next/**/*', '.turbo/**/*'], + ignorePatterns: [ + 'node_modules/**/*', + 'dist/**/*', + 'coverage/**/*', + '.next/**/*', + '.turbo/**/*', + ], plugins: ['@typescript-eslint', 'import'], extends: [ 'turbo', @@ -20,10 +26,10 @@ module.exports = { 'prettier/prettier': [ 'error', { - 'singleQuote': true, - 'tabWidth': 2, - 'semi': true - } + singleQuote: true, + tabWidth: 2, + semi: true, + }, ], '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/interface-name-prefix': 'off', @@ -55,8 +61,9 @@ module.exports = { 'newlines-between': 'always', }, ], + 'import/no-extraneous-dependencies': 'error', '@typescript-eslint/prefer-enum-initializers': 'error', 'no-console': ['error', { allow: ['warn', 'error'] }], 'no-debugger': 'error', }, -} +}; diff --git a/yarn.lock b/yarn.lock index 1138594f..82e0dbc9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2046,7 +2046,7 @@ ripemd160 "^2.0.2" sha.js "^2.4.11" -"@cosmjs/crypto@^0.32.3": +"@cosmjs/crypto@0.32.3", "@cosmjs/crypto@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.3.tgz#787f8e659709678722068ee1ddf379f65051a25e" integrity sha512-niQOWJHUtlJm2GG4F00yGT7sGPKxfUwz+2qQ30uO/E3p58gOusTcH2qjiJNVxb8vScYJhFYFqpm/OA/mVqoUGQ== @@ -7759,7 +7759,7 @@ axe-core@=4.7.0: axios@1.3.4: version "1.3.4" - resolved "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.4.tgz#f5760cefd9cfb51fd2481acf88c05f67c4523024" integrity sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ== dependencies: follow-redirects "^1.15.0" @@ -7786,7 +7786,7 @@ axios@1.6.0: axios@1.6.1: version "1.6.1" - resolved "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.1.tgz#76550d644bf0a2d469a01f9244db6753208397d7" integrity sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g== dependencies: follow-redirects "^1.15.0" @@ -9341,7 +9341,7 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmjs-types@^0.9.0: +cosmjs-types@0.9.0, cosmjs-types@^0.9.0: version "0.9.0" resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.9.0.tgz" integrity sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ== @@ -10959,7 +10959,7 @@ ethers@5.7.2: ethers@6.9.0: version "6.9.0" - resolved "https://registry.npmjs.org/ethers/-/ethers-6.9.0.tgz" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.9.0.tgz#a4534bdcdfde306aee94ef32f3d5c70d7e33fcb9" integrity sha512-pmfNyQzc2mseLe91FnT2vmNaTt8dDzhxZ/xItAV7uGsF4dI4ek2ufMu3rAkgQETL/TIs0GS5A+U05g9QyWnv3Q== dependencies: "@adraffy/ens-normalize" "1.10.0" @@ -11998,7 +11998,7 @@ graphql-request@^6.0.0: "@graphql-typed-document-node/core" "^3.2.0" cross-fetch "^3.1.5" -graphql-tag@^2.10.1, graphql-tag@^2.11.0, graphql-tag@^2.12.6: +graphql-tag@2.12.6, graphql-tag@^2.10.1, graphql-tag@^2.11.0, graphql-tag@^2.12.6: version "2.12.6" resolved "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz" integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== @@ -17882,7 +17882,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17900,15 +17900,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -18010,7 +18001,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -18031,13 +18022,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -19745,7 +19729,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -19763,15 +19747,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From 6fdbb23f9c3d56f99b0ddca239d111d29428784f Mon Sep 17 00:00:00 2001 From: cicd Date: Wed, 11 Sep 2024 23:40:19 +0000 Subject: [PATCH 172/176] Version packages --- .changeset/hip-hornets-admire.md | 16 ---------------- packages/binance/CHANGELOG.md | 8 ++++++++ packages/binance/package.json | 2 +- packages/bitcoin/CHANGELOG.md | 10 ++++++++++ packages/bitcoin/package.json | 2 +- packages/bitcoincash/CHANGELOG.md | 10 ++++++++++ packages/bitcoincash/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/cosmos/CHANGELOG.md | 8 ++++++++ packages/cosmos/package.json | 2 +- packages/dogecoin/CHANGELOG.md | 10 ++++++++++ packages/dogecoin/package.json | 2 +- packages/evm/CHANGELOG.md | 8 ++++++++ packages/evm/package.json | 2 +- packages/litecoin/CHANGELOG.md | 10 ++++++++++ packages/litecoin/package.json | 2 +- packages/solana/CHANGELOG.md | 9 +++++++++ packages/solana/package.json | 2 +- packages/thor/CHANGELOG.md | 8 ++++++++ packages/thor/package.json | 2 +- packages/utxo/CHANGELOG.md | 9 +++++++++ packages/utxo/package.json | 2 +- .../eslint-config-custom/CHANGELOG.md | 6 ++++++ .../eslint-config-custom/package.json | 2 +- 25 files changed, 114 insertions(+), 28 deletions(-) delete mode 100644 .changeset/hip-hornets-admire.md diff --git a/.changeset/hip-hornets-admire.md b/.changeset/hip-hornets-admire.md deleted file mode 100644 index 5cf85564..00000000 --- a/.changeset/hip-hornets-admire.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'eslint-config-custom': patch -'@xdefi-tech/chains-bitcoincash': patch -'@xdefi-tech/chains-dogecoin': patch -'@xdefi-tech/chains-litecoin': patch -'@xdefi-tech/chains-binance': patch -'@xdefi-tech/chains-bitcoin': patch -'@xdefi-tech/chains-cosmos': patch -'@xdefi-tech/chains-solana': patch -'@xdefi-tech/chains-core': patch -'@xdefi-tech/chains-thor': patch -'@xdefi-tech/chains-utxo': patch -'@xdefi-tech/chains-evm': patch ---- - -Fix external dependencies included in bundles diff --git a/packages/binance/CHANGELOG.md b/packages/binance/CHANGELOG.md index 5e38c89a..6ec1c69d 100644 --- a/packages/binance/CHANGELOG.md +++ b/packages/binance/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-binance +## 2.0.24 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - @xdefi-tech/chains-core@2.0.31 + ## 2.0.23 ### Patch Changes diff --git a/packages/binance/package.json b/packages/binance/package.json index ea66000c..110a91a2 100644 --- a/packages/binance/package.json +++ b/packages/binance/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-binance", - "version": "2.0.23", + "version": "2.0.24", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoin/CHANGELOG.md b/packages/bitcoin/CHANGELOG.md index 0ea26dc0..9f179909 100644 --- a/packages/bitcoin/CHANGELOG.md +++ b/packages/bitcoin/CHANGELOG.md @@ -1,5 +1,15 @@ # @xdefi-tech/chains-bitcoin +## 2.1.5 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - eslint-config-custom@1.0.3 + - @xdefi-tech/chains-core@2.0.31 + - @xdefi-tech/chains-utxo@2.0.17 + ## 2.1.4 ### Patch Changes diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index dc955b1d..2bfa3ef6 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoin", - "version": "2.1.4", + "version": "2.1.5", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/bitcoincash/CHANGELOG.md b/packages/bitcoincash/CHANGELOG.md index 25b33a27..4b6020b1 100644 --- a/packages/bitcoincash/CHANGELOG.md +++ b/packages/bitcoincash/CHANGELOG.md @@ -1,5 +1,15 @@ # @xdefi-tech/chains-bitcoincash +## 2.1.5 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - eslint-config-custom@1.0.3 + - @xdefi-tech/chains-core@2.0.31 + - @xdefi-tech/chains-utxo@2.0.17 + ## 2.1.4 ### Patch Changes diff --git a/packages/bitcoincash/package.json b/packages/bitcoincash/package.json index 67edde17..fd1a08d3 100644 --- a/packages/bitcoincash/package.json +++ b/packages/bitcoincash/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-bitcoincash", - "version": "2.1.4", + "version": "2.1.5", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index ea83d55a..8c5d67fe 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-core +## 2.0.31 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles + ## 2.0.30 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index e9c65843..aef7ed14 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-core", - "version": "2.0.30", + "version": "2.0.31", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/cosmos/CHANGELOG.md b/packages/cosmos/CHANGELOG.md index 91dd1672..6ac9d2e1 100644 --- a/packages/cosmos/CHANGELOG.md +++ b/packages/cosmos/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-cosmos +## 2.0.52 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - @xdefi-tech/chains-core@2.0.31 + ## 2.0.51 ### Patch Changes diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index fd1d666c..bdd93132 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-cosmos", - "version": "2.0.51", + "version": "2.0.52", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/dogecoin/CHANGELOG.md b/packages/dogecoin/CHANGELOG.md index af77c4c7..b566df9d 100644 --- a/packages/dogecoin/CHANGELOG.md +++ b/packages/dogecoin/CHANGELOG.md @@ -1,5 +1,15 @@ # @xdefi-tech/chains-dogecoin +## 2.1.5 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - eslint-config-custom@1.0.3 + - @xdefi-tech/chains-core@2.0.31 + - @xdefi-tech/chains-utxo@2.0.17 + ## 2.1.4 ### Patch Changes diff --git a/packages/dogecoin/package.json b/packages/dogecoin/package.json index 2c6e2dce..c16fc328 100644 --- a/packages/dogecoin/package.json +++ b/packages/dogecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-dogecoin", - "version": "2.1.4", + "version": "2.1.5", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index edd5140f..0db57b53 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-evm +## 2.0.52 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - @xdefi-tech/chains-core@2.0.31 + ## 2.0.51 ### Patch Changes diff --git a/packages/evm/package.json b/packages/evm/package.json index 5c95d873..6e444bdf 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-evm", - "version": "2.0.51", + "version": "2.0.52", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/litecoin/CHANGELOG.md b/packages/litecoin/CHANGELOG.md index d6bd8593..6eaaa06d 100644 --- a/packages/litecoin/CHANGELOG.md +++ b/packages/litecoin/CHANGELOG.md @@ -1,5 +1,15 @@ # @xdefi-tech/chains-litecoin +## 2.1.5 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - eslint-config-custom@1.0.3 + - @xdefi-tech/chains-core@2.0.31 + - @xdefi-tech/chains-utxo@2.0.17 + ## 2.1.4 ### Patch Changes diff --git a/packages/litecoin/package.json b/packages/litecoin/package.json index 0a7db028..ff1b7ea2 100644 --- a/packages/litecoin/package.json +++ b/packages/litecoin/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-litecoin", - "version": "2.1.4", + "version": "2.1.5", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/solana/CHANGELOG.md b/packages/solana/CHANGELOG.md index 9030c1b3..7a062886 100644 --- a/packages/solana/CHANGELOG.md +++ b/packages/solana/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-solana +## 2.1.7 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - eslint-config-custom@1.0.3 + - @xdefi-tech/chains-core@2.0.31 + ## 2.1.6 ### Patch Changes diff --git a/packages/solana/package.json b/packages/solana/package.json index 12a9bfa2..f72fdcc8 100644 --- a/packages/solana/package.json +++ b/packages/solana/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-solana", - "version": "2.1.6", + "version": "2.1.7", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index bf5fe23a..1a43b603 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,13 @@ # @xdefi-tech/chains-thor +## 2.1.6 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - @xdefi-tech/chains-core@2.0.31 + ## 2.1.5 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index 85924955..d55640b9 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.1.5", + "version": "2.1.6", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/packages/utxo/CHANGELOG.md b/packages/utxo/CHANGELOG.md index dd1af3d3..56f12ff1 100644 --- a/packages/utxo/CHANGELOG.md +++ b/packages/utxo/CHANGELOG.md @@ -1,5 +1,14 @@ # @xdefi-tech/chains-utxo +## 2.0.17 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles +- Updated dependencies [4d6446e2] + - eslint-config-custom@1.0.3 + - @xdefi-tech/chains-core@2.0.31 + ## 2.0.16 ### Patch Changes diff --git a/packages/utxo/package.json b/packages/utxo/package.json index 180803ce..62978686 100644 --- a/packages/utxo/package.json +++ b/packages/utxo/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-utxo", - "version": "2.0.16", + "version": "2.0.17", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", diff --git a/utility-packages/eslint-config-custom/CHANGELOG.md b/utility-packages/eslint-config-custom/CHANGELOG.md index 26349c64..226470ce 100644 --- a/utility-packages/eslint-config-custom/CHANGELOG.md +++ b/utility-packages/eslint-config-custom/CHANGELOG.md @@ -1,5 +1,11 @@ # eslint-config-custom +## 1.0.3 + +### Patch Changes + +- 4d6446e2: Fix external dependencies included in bundles + ## 1.0.2 ### Patch Changes diff --git a/utility-packages/eslint-config-custom/package.json b/utility-packages/eslint-config-custom/package.json index 59d600f9..efa01eb9 100644 --- a/utility-packages/eslint-config-custom/package.json +++ b/utility-packages/eslint-config-custom/package.json @@ -2,7 +2,7 @@ "name": "eslint-config-custom", "private": true, "main": "index.js", - "version": "1.0.2", + "version": "1.0.3", "dependencies": { "@typescript-eslint/eslint-plugin": "5.54.1", "@typescript-eslint/parser": "5.54.1", From 5819436c2dd1844d10a5edc7f6ceded48b548795 Mon Sep 17 00:00:00 2001 From: dp <25910069+davidp94@users.noreply.github.com> Date: Thu, 12 Sep 2024 11:14:40 +0300 Subject: [PATCH 173/176] feat(thor): rename chain id after hard fork (#367) * feat(thor): rename chain id after hard fork * fix: test cases, add changeset --------- Co-authored-by: danilxdefi --- .changeset/yellow-gifts-kneel.md | 5 +++++ examples/react/constants/registry.ts | 2 +- packages/thor/README.md | 4 ++-- packages/thor/src/chain.provider.spec.ts | 4 ++-- packages/thor/src/manifests.ts | 2 +- packages/thor/src/msg.spec.ts | 10 +++++----- packages/thor/src/signers/private-key.signer.spec.ts | 2 +- packages/thor/src/signers/seed-phrase.signer.spec.ts | 2 +- packages/thor/src/utils.ts | 4 ++-- 9 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 .changeset/yellow-gifts-kneel.md diff --git a/.changeset/yellow-gifts-kneel.md b/.changeset/yellow-gifts-kneel.md new file mode 100644 index 00000000..9bacdbd7 --- /dev/null +++ b/.changeset/yellow-gifts-kneel.md @@ -0,0 +1,5 @@ +--- +'@xdefi-tech/chains-thor': patch +--- + +Feat: update thorchain chain id to thorchain-1 diff --git a/examples/react/constants/registry.ts b/examples/react/constants/registry.ts index 49feaf36..edf2bc74 100644 --- a/examples/react/constants/registry.ts +++ b/examples/react/constants/registry.ts @@ -753,7 +753,7 @@ export const registry = [ { id: 'thorchain', name: 'THORChain', - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', blockchain: 'Thorchain', icon: 'https://static.xdefi.services/icons/network/thorchain.svg', nativeCoins: [ diff --git a/packages/thor/README.md b/packages/thor/README.md index 5cc3951e..f6ac31ea 100644 --- a/packages/thor/README.md +++ b/packages/thor/README.md @@ -7,7 +7,7 @@ const thorManifest = { rpcURL: 'https://rpc-proxy.xdefi.services/thornode', chainSymbol: 'RUNE', blockExplorerURL: 'https://viewblock.io/thorchain', - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', chain: 'thorchain', denom: 'rune', prefix: 'thor', @@ -25,7 +25,7 @@ const thorManifest = { - `rpcURL`: The URL of the remote procedure call (RPC) server used to interact with the Thor blockchain. - `chainSymbol`: The symbol or ticker representing the Thor cryptocurrency, which is "RUNE". - `blockExplorerURL`: The URL of the block explorer for the Thor blockchain network. Block explorers allow users to view details about blocks, transactions, addresses, and other blockchain-related data. -- `chainId`: The unique identifier for the Thor blockchain. In this example, it's set to 'thorchain-mainnet-v1'. +- `chainId`: The unique identifier for the Thor blockchain. In this example, it's set to 'thorchain-1'. - `chain`: The name of the blockchain network. If you are using IndexerDataSource, it must be obtained from the [registry](https://github.com/XDeFi-tech/xdefi-registry/blob/main/chains.json). - `decimals`: The number of decimal places supported by the native currency of the Thor blockchain. In this example, it's set to 6. - `feeGasStep`: An object specifying the gas steps for different fee levels (high, medium, and low) used for transactions on the Thor blockchain network. In this example, all fee levels are set to 1. diff --git a/packages/thor/src/chain.provider.spec.ts b/packages/thor/src/chain.provider.spec.ts index 9f2ce844..b8aca9bf 100644 --- a/packages/thor/src/chain.provider.spec.ts +++ b/packages/thor/src/chain.provider.spec.ts @@ -156,7 +156,7 @@ describe('chain.provider', () => { jest.fn().mockImplementation(async () => [ { asset: { - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', name: 'Thor', symbol: 'RUNE', icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/thorchain/info/logo.png', @@ -175,7 +175,7 @@ describe('chain.provider', () => { jest.fn().mockImplementation(async () => [ { asset: { - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', name: 'Thor', symbol: 'RUNE', icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/thorchain/info/logo.png', diff --git a/packages/thor/src/manifests.ts b/packages/thor/src/manifests.ts index b642fb06..74696aa0 100644 --- a/packages/thor/src/manifests.ts +++ b/packages/thor/src/manifests.ts @@ -15,7 +15,7 @@ export const THORCHAIN_MANIFESTS: { nodeURL: 'https://rpc-proxy.xdefi.services/thornode', chainSymbol: 'RUNE', blockExplorerURL: 'https://viewblock.io/thorchain', - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', chain: 'thorchain', denom: 'rune', prefix: 'thor', diff --git a/packages/thor/src/msg.spec.ts b/packages/thor/src/msg.spec.ts index dfb4c6c2..60db450c 100644 --- a/packages/thor/src/msg.spec.ts +++ b/packages/thor/src/msg.spec.ts @@ -15,7 +15,7 @@ describe('msg', () => { Promise.resolve([ { asset: { - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', name: 'Thor', symbol: 'RUNE', icon: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/thorchain/info/logo.png', @@ -28,7 +28,7 @@ describe('msg', () => { }, { asset: { - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', name: 'BLZ', symbol: 'BLZ', icon: null, @@ -66,7 +66,7 @@ describe('msg', () => { nodeURL: 'https://rpc-proxy.xdefi.services/thornode', chainSymbol: 'RUNE', blockExplorerURL: 'https://viewblock.io/thorchain', - chainId: 'thorchain-mainnet-v1', + chainId: 'thorchain-1', chain: 'thorchain', denom: 'rune', prefix: 'thor', @@ -103,7 +103,7 @@ describe('msg', () => { expect(response.to).toEqual('thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l'); expect(response.decimals).toEqual(8); expect(response.value).toEqual(100); // 0.000001 * 10^8 - expect(response.chainId).toEqual('thorchain-mainnet-v1'); + expect(response.chainId).toEqual('thorchain-1'); expect(response.denom).toEqual('rune'); }); @@ -130,7 +130,7 @@ describe('msg', () => { expect(response.to).toEqual('thor1cg5ws99z3p2lx76f54hmuffrk2n223vzyus73l'); expect(response.decimals).toEqual(8); expect(response.value).toEqual(100); // 0.000001 * 10^8 - expect(response.chainId).toEqual('thorchain-mainnet-v1'); + expect(response.chainId).toEqual('thorchain-1'); expect(response.denom).toEqual('BLZ'); }); diff --git a/packages/thor/src/signers/private-key.signer.spec.ts b/packages/thor/src/signers/private-key.signer.spec.ts index 05282150..20e15eb2 100644 --- a/packages/thor/src/signers/private-key.signer.spec.ts +++ b/packages/thor/src/signers/private-key.signer.spec.ts @@ -70,7 +70,7 @@ describe('private-key.signer', () => { await signer.sign(messages.thorchain); expect(messages.thorchain.signedTransaction).toEqual( - 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJYClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIEEMCaDBpARKIPDEXsG3U3PH+TtNqy3/qEC/a71PoAsvuAl1vZcigQBcWXF85nWL4gluaTGFJRhJQroBDWwlB4ftwB2LlKEA==' + 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJYClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIEEMCaDBpAIIoLCZv1bKeHIZWNiwi+R90t0jv7eVCmBgNJ9Kjmhxh14m76WabZ9r7X/39b7/+J1/TRhWSL22E45HnxyLrVug==' ); }); diff --git a/packages/thor/src/signers/seed-phrase.signer.spec.ts b/packages/thor/src/signers/seed-phrase.signer.spec.ts index 995b1c03..62905d9b 100644 --- a/packages/thor/src/signers/seed-phrase.signer.spec.ts +++ b/packages/thor/src/signers/seed-phrase.signer.spec.ts @@ -61,7 +61,7 @@ describe('seed-phrase.signer', () => { await signer.sign(messages.thorchain, derivation); expect(messages.thorchain.signedTransaction).toEqual( - 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJjClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIPCgkKBHJ1bmUSATAQwJoMGkCcsjR8tN2XlDJIN6WBlTtcvoqP3wNNEX5icxtynFY+hReK41XbLWqDiihvzBkpyikDBz6jyvCoWXdCY9A07hYx' + 'Ck0KSwoOL3R5cGVzLk1zZ1NlbmQSOQoUwijoFKKIVfN7SaVvviUjsqalRYISFMIo6BSiiFXze0mlb74lI7KmpUWCGgsKBHJ1bmUSAzEwMBJjClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED8LlkeE7S/gZp4aIxPpkXW0X8Lq/XknCOOPCr8C7q/UcSBAoCCAEYABIPCgkKBHJ1bmUSATAQwJoMGkCf3T7Io+N6pehOobxD6uCKvsJIsfeMksP9J7QKN0f6JXDXubGvM5X3AclfeT+ALuqtkEn/FzzqVIj6Urdkzsqp' ); }); diff --git a/packages/thor/src/utils.ts b/packages/thor/src/utils.ts index 8a86388e..fe0ec60d 100644 --- a/packages/thor/src/utils.ts +++ b/packages/thor/src/utils.ts @@ -38,7 +38,7 @@ export const assetFromString = (s: string): common.IAsset | null => { */ export const getThorChainID = async ( rpcUrl: string, - defaultChainId = 'thorchain-mainnet-v1' + defaultChainId = 'thorchain-1' ): Promise => { try { const restAxiosInstance = axios.create({ @@ -48,7 +48,7 @@ export const getThorChainID = async ( return data?.result?.network; } catch (err) { console.error( - 'Error while getting thor chain id, returning "thorchain-mainnet-v1" by default.' + 'Error while getting thor chain id, returning "thorchain-1" by default.' ); console.error(err); return defaultChainId; From 2281ac3015dc8f3f82dddeaafc0ba2b6c0b601c0 Mon Sep 17 00:00:00 2001 From: cicd Date: Thu, 12 Sep 2024 08:17:37 +0000 Subject: [PATCH 174/176] Version packages --- .changeset/yellow-gifts-kneel.md | 5 ----- packages/thor/CHANGELOG.md | 6 ++++++ packages/thor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/yellow-gifts-kneel.md diff --git a/.changeset/yellow-gifts-kneel.md b/.changeset/yellow-gifts-kneel.md deleted file mode 100644 index 9bacdbd7..00000000 --- a/.changeset/yellow-gifts-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-thor': patch ---- - -Feat: update thorchain chain id to thorchain-1 diff --git a/packages/thor/CHANGELOG.md b/packages/thor/CHANGELOG.md index 1a43b603..f5bfd682 100644 --- a/packages/thor/CHANGELOG.md +++ b/packages/thor/CHANGELOG.md @@ -1,5 +1,11 @@ # @xdefi-tech/chains-thor +## 2.1.7 + +### Patch Changes + +- be076b8b: Feat: update thorchain chain id to thorchain-1 + ## 2.1.6 ### Patch Changes diff --git a/packages/thor/package.json b/packages/thor/package.json index d55640b9..87cb6233 100644 --- a/packages/thor/package.json +++ b/packages/thor/package.json @@ -1,6 +1,6 @@ { "name": "@xdefi-tech/chains-thor", - "version": "2.1.6", + "version": "2.1.7", "main": "./dist/index.js", "types": "./dist/index.d.ts", "repository": "https://github.com/XDeFi-tech/chains/", From bed92096c1eb7dce4199ab39b6443d5cf2ed9b63 Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 Date: Thu, 12 Sep 2024 16:17:13 +0700 Subject: [PATCH 175/176] chore: update yarn.lock --- yarn.lock | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 82e0dbc9..b6be4e06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5138,6 +5138,11 @@ resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== +"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@noble/hashes@1.5.0", "@noble/hashes@^1.4.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" @@ -6091,6 +6096,18 @@ dependencies: tslib "^2.4.0" +"@tanstack/query-core@5.55.4": + version "5.55.4" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.55.4.tgz#21ef6c6505bf108570f1c18f5f3b90efc8b1c2d6" + integrity sha512-uoRqNnRfzOH4OMIoxj8E2+Us89UIGXfau981qYJWsNMkFS1GXR4UIyzUTVGq4N7SDLHgFPpo6IOazqUV5gkMZA== + +"@tanstack/react-query@^5.51.1": + version "5.55.4" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.55.4.tgz#4c8f54a05704e9f9a9ffc77a6dfa79b5a33f9905" + integrity sha512-e3uX5XkLD9oTV66/VsVpkYz3Ds/ps/Yk+V5d89xthAbtNIKKBEm4FdNb9yISFzGEGezUzVO68qmfmiSrtScvsg== + dependencies: + "@tanstack/query-core" "5.55.4" + "@terra-money/feather.js@2.1.0-beta.3": version "2.1.0-beta.3" resolved "https://registry.npmjs.org/@terra-money/feather.js/-/feather.js-2.1.0-beta.3.tgz" @@ -17882,7 +17899,7 @@ string-length@^5.0.1: char-regex "^2.0.0" strip-ansi "^7.0.1" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17900,6 +17917,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -18001,7 +18027,7 @@ stringify-object@~0.1.7: resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-0.1.8.tgz" integrity sha512-wud/ZQEJjTrbwG3x8aD4OnPoo1Tb/AYXazI4CMEerAjLhWCou3OYhyBzoqRXbDVGC6/XDuAZxIWjVOv7nzjq+g== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -18022,6 +18048,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" @@ -19729,7 +19762,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -19747,6 +19780,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From 412bf3e3fec1f0d42127ad194973b32e65ee8a0c Mon Sep 17 00:00:00 2001 From: sotatek-tyler-nguyen4 Date: Thu, 12 Sep 2024 17:07:33 +0700 Subject: [PATCH 176/176] chore: remove changeset file --- .changeset/rude-planets-explode.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/rude-planets-explode.md diff --git a/.changeset/rude-planets-explode.md b/.changeset/rude-planets-explode.md deleted file mode 100644 index afc58c8c..00000000 --- a/.changeset/rude-planets-explode.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xdefi-tech/chains-cosmos': patch ---- - -Feat: add osmojs lib and types/converters in esm