From 38b774aff4f6a4e5c3abddad95d9f52bba1e541a Mon Sep 17 00:00:00 2001 From: Eliascm17 Date: Wed, 15 Feb 2023 16:06:12 -0700 Subject: [PATCH 1/6] Get swap program compiling --- swap/.gitignore | 7 + swap/.prettierignore | 8 + swap/Anchor.toml | 16 + swap/Cargo.lock | 2544 +++++++++++++++++ swap/Cargo.toml | 15 + swap/client/Cargo.toml | 18 + swap/client/src/main.rs | 248 ++ swap/client/src/utils.rs | 71 + swap/crates/whirlpool/Cargo.toml | 18 + swap/crates/whirlpool/idl.json | 1923 +++++++++++++ swap/crates/whirlpool/src/lib.rs | 21 + swap/crates/whirlpool/src/utils.rs | 60 + swap/expanded.txt | 0 swap/migrations/deploy.ts | 12 + swap/package.json | 19 + swap/programs/swap/Cargo.toml | 26 + swap/programs/swap/Xargo.toml | 2 + swap/programs/swap/expanded.txt | 1681 +++++++++++ swap/programs/swap/src/id.rs | 3 + swap/programs/swap/src/instructions/mod.rs | 3 + .../src/instructions/orca_whirlpool_swap.rs | 319 +++ swap/programs/swap/src/lib.rs | 21 + swap/tests/swap.ts | 16 + swap/tsconfig.json | 10 + swap/yarn.lock | 1189 ++++++++ 25 files changed, 8250 insertions(+) create mode 100644 swap/.gitignore create mode 100644 swap/.prettierignore create mode 100644 swap/Anchor.toml create mode 100644 swap/Cargo.lock create mode 100644 swap/Cargo.toml create mode 100644 swap/client/Cargo.toml create mode 100644 swap/client/src/main.rs create mode 100644 swap/client/src/utils.rs create mode 100644 swap/crates/whirlpool/Cargo.toml create mode 100644 swap/crates/whirlpool/idl.json create mode 100644 swap/crates/whirlpool/src/lib.rs create mode 100644 swap/crates/whirlpool/src/utils.rs create mode 100644 swap/expanded.txt create mode 100644 swap/migrations/deploy.ts create mode 100644 swap/package.json create mode 100644 swap/programs/swap/Cargo.toml create mode 100644 swap/programs/swap/Xargo.toml create mode 100644 swap/programs/swap/expanded.txt create mode 100644 swap/programs/swap/src/id.rs create mode 100644 swap/programs/swap/src/instructions/mod.rs create mode 100644 swap/programs/swap/src/instructions/orca_whirlpool_swap.rs create mode 100644 swap/programs/swap/src/lib.rs create mode 100644 swap/tests/swap.ts create mode 100644 swap/tsconfig.json create mode 100644 swap/yarn.lock diff --git a/swap/.gitignore b/swap/.gitignore new file mode 100644 index 0000000..d243ecc --- /dev/null +++ b/swap/.gitignore @@ -0,0 +1,7 @@ + +.anchor +.DS_Store +target +**/*.rs.bk +node_modules +test-ledger diff --git a/swap/.prettierignore b/swap/.prettierignore new file mode 100644 index 0000000..c1a0b75 --- /dev/null +++ b/swap/.prettierignore @@ -0,0 +1,8 @@ + +.anchor +.DS_Store +target +node_modules +dist +build +test-ledger diff --git a/swap/Anchor.toml b/swap/Anchor.toml new file mode 100644 index 0000000..f8a50f1 --- /dev/null +++ b/swap/Anchor.toml @@ -0,0 +1,16 @@ +[features] +seeds = false +skip-lint = false + +[programs.mainnet] +swap = "EhvuQpALKdUiziJcmmioe9QyQwB913nqvNB8rZasA6SA" + +[registry] +url = "https://api.apr.dev" + +[provider] +cluster = "mainnet" +wallet = "~/.config/solana/id.json" + +[scripts] +test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" diff --git a/swap/Cargo.lock b/swap/Cargo.lock new file mode 100644 index 0000000..6054266 --- /dev/null +++ b/swap/Cargo.lock @@ -0,0 +1,2544 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" +dependencies = [ + "aead", + "aes", + "cipher 0.3.0", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.8", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "anchor-attribute-access-control" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "regex", + "syn", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3bcd731f21048a032be27c7791701120e44f3f6371358fc4261a7f716283d29" +dependencies = [ + "anchor-syn", + "anyhow", + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" +dependencies = [ + "anchor-syn", + "proc-macro2", + "syn", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-interface" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6700a6f5c888a9c33fe8afc0c64fd8575fa28d05446037306d0f96102ae4480" +dependencies = [ + "anchor-syn", + "anyhow", + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-attribute-state" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "anchor-gen" +version = "0.3.1" +source = "git+https://github.com/eliascm17/anchor-gen#c6a56c18d09c8beafe3745cbc4424bdf1c7d8313" +dependencies = [ + "anchor-generate-cpi-crate", + "anchor-generate-cpi-interface", +] + +[[package]] +name = "anchor-generate-cpi-crate" +version = "0.3.1" +source = "git+https://github.com/eliascm17/anchor-gen#c6a56c18d09c8beafe3745cbc4424bdf1c7d8313" +dependencies = [ + "anchor-idl", + "syn", +] + +[[package]] +name = "anchor-generate-cpi-interface" +version = "0.3.1" +source = "git+https://github.com/eliascm17/anchor-gen#c6a56c18d09c8beafe3745cbc4424bdf1c7d8313" +dependencies = [ + "anchor-idl", + "darling", + "syn", +] + +[[package]] +name = "anchor-idl" +version = "0.3.1" +source = "git+https://github.com/eliascm17/anchor-gen#c6a56c18d09c8beafe3745cbc4424bdf1c7d8313" +dependencies = [ + "anchor-syn", + "darling", + "heck 0.4.1", + "proc-macro2", + "quote", + "serde_json", + "syn", +] + +[[package]] +name = "anchor-lang" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "662ceafe667448ee4199a4be2ee83b6bb76da28566eee5cea05f96ab38255af8" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-interface", + "anchor-attribute-program", + "anchor-attribute-state", + "anchor-derive-accounts", + "arrayref", + "base64 0.13.1", + "bincode", + "borsh", + "bytemuck", + "solana-program", + "thiserror", +] + +[[package]] +name = "anchor-spl" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f32390ce8356f54c0f0245ea156f8190717e37285b8bf4f406a613dc4b954cde" +dependencies = [ + "anchor-lang", + "solana-program", + "spl-associated-token-account", + "spl-token", +] + +[[package]] +name = "anchor-syn" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0418bcb5daac3b8cb1b60d8fdb1d468ca36f5509f31fb51179326fae1028fdcc" +dependencies = [ + "anyhow", + "bs58 0.3.1", + "heck 0.3.3", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "serde", + "serde_json", + "sha2 0.9.9", + "syn", + "thiserror", +] + +[[package]] +name = "anyhow" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" + +[[package]] +name = "ark-bn254" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea691771ebbb28aea556c044e2e5c5227398d840cee0c34d4d20fa8eb2689e8c" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std", + "digest 0.9.0", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array-bytes" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "blake3" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.6", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bs58" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cipher" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clockwork-cron" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec00fac13ba4c45201f7bcbfd44df23b659521ef765de9d31d14a1194d028cce" +dependencies = [ + "chrono", + "nom", + "once_cell", +] + +[[package]] +name = "clockwork-network-program" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358aa1fb9a328d355cababfabb5ca69134a8bc703d355fe2979442441e30d6b7" +dependencies = [ + "anchor-lang", + "anchor-spl", + "clockwork-utils", +] + +[[package]] +name = "clockwork-sdk" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7179555c8031a72efc4018a5120280076e4bbe640b9d063615353c3393f6787f" +dependencies = [ + "anchor-lang", + "chrono", + "clockwork-thread-program", + "nom", + "once_cell", +] + +[[package]] +name = "clockwork-thread-program" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d8201d1680a1540e157a0a9f3cb84d9cc9a25ad66fcb9328c6f94b2fe14175" +dependencies = [ + "anchor-lang", + "chrono", + "clockwork-cron", + "clockwork-network-program", + "clockwork-utils", + "static-pubkey", + "version", +] + +[[package]] +name = "clockwork-utils" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26a6168b2af3007a81363951be00237defe4152e77e407d96f365f5de1a6dd37" +dependencies = [ + "anchor-lang", + "base64 0.13.1", + "static-pubkey", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "constant_time_eq" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.7.1", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher 0.3.0", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derivation-path" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek-bip32" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" +dependencies = [ + "derivation-path", + "ed25519-dalek", + "hmac 0.12.1", + "sha2 0.10.6", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d829733185c1ca374f17e52b762f24f535ec625d2cc1f070e34c8a9068f341b" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e" +dependencies = [ + "proc-macro-crate 1.3.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "version_check", + "yansi", +] + +[[package]] +name = "qstring" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "quote" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.16", +] + +[[package]] +name = "rustversion" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d904179146de381af4c93d3af6ca4984b3152db687dacb9c3c35e86f39809c" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +dependencies = [ + "digest 0.10.6", + "keccak", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "solana-frozen-abi" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f7051cccdf891ac2603cdd295eb651529fe2b678b6b3af60b82dec9a9b3b06" +dependencies = [ + "ahash", + "blake3", + "block-buffer 0.9.0", + "bs58 0.4.0", + "bv", + "byteorder", + "cc", + "either", + "generic-array", + "getrandom 0.1.16", + "hashbrown 0.12.3", + "im", + "lazy_static", + "log", + "memmap2", + "once_cell", + "rand_core 0.6.4", + "rustc_version 0.4.0", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "solana-frozen-abi-macro", + "subtle", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06395428329810ade1d2518a7e75d8a6f02d01fe548aabb60ff1ba6a2eaebbe5" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn", +] + +[[package]] +name = "solana-logger" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170714ca3612e4df75f57c2c14c8ab74654b3b66f668986aeed456cedcf24446" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + +[[package]] +name = "solana-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ae9f0fa7db3a4e90fa0df2723ac8cbc042e579cf109cd0380bc5a8c88bed924" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "array-bytes", + "base64 0.13.1", + "bincode", + "bitflags", + "blake3", + "borsh", + "borsh-derive", + "bs58 0.4.0", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.8", + "itertools", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "log", + "memoffset 0.8.0", + "num-bigint", + "num-derive", + "num-traits", + "parking_lot", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version 0.4.0", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "sha3 0.10.6", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk-macro", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-sdk" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbefda9f9bda78fd9d91ae21c38d9693e94d5979838fb69b70c6addb8dab953f" +dependencies = [ + "assert_matches", + "base64 0.13.1", + "bincode", + "bitflags", + "borsh", + "bs58 0.4.0", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.6", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive", + "num-traits", + "num_enum", + "pbkdf2 0.11.0", + "qstring", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version 0.4.0", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "serde_with", + "sha2 0.10.6", + "sha3 0.10.6", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-logger", + "solana-program", + "solana-sdk-macro", + "thiserror", + "uriparse", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f809319358d5da7c3a0ac08ebf4d87b21170d928dbb7260254e8f3061f7f9e0e" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a290aa32014e007b03f952d5b784433d95636c65a3fb08d19dc5658a450941c" +dependencies = [ + "aes-gcm-siv", + "arrayref", + "base64 0.13.1", + "bincode", + "bytemuck", + "byteorder", + "cipher 0.4.3", + "curve25519-dalek", + "getrandom 0.1.16", + "itertools", + "lazy_static", + "merlin", + "num-derive", + "num-traits", + "rand 0.7.3", + "serde", + "serde_json", + "sha3 0.9.1", + "solana-program", + "solana-sdk", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "spl-associated-token-account" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc000f0fdf1f12f99d77d398137c1751345b18c88258ce0f99b7872cf6c9bd6" +dependencies = [ + "assert_matches", + "borsh", + "num-derive", + "num-traits", + "solana-program", + "spl-token", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "spl-memo" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-token" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e85e168a785e82564160dcb87b2a8e04cee9bfd1f4d488c729d53d6a4bd300d" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0edb869dbe159b018f17fb9bfa67118c30f232d7f54a73742bc96794dff77ed8" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "solana-zk-token-sdk", + "spl-memo", + "spl-token", + "thiserror", +] + +[[package]] +name = "static-pubkey" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0547d5945c93f55e1b18bf2a67d1a3d0548561f2687645b22c1c1d4fbb9a8e90" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "swap" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "anchor-spl", + "clockwork-sdk", + "whirlpool", +] + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" + +[[package]] +name = "toml_edit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b" +dependencies = [ + "indexmap", + "nom8", + "toml_datetime", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "version" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a449064fee414fcc201356a3e6c1510f6c8829ed28bb06b91c54ebe208ce065" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "web-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whirlpool" +version = "0.1.0" +dependencies = [ + "anchor-gen", + "anchor-lang", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] diff --git a/swap/Cargo.toml b/swap/Cargo.toml new file mode 100644 index 0000000..425bde6 --- /dev/null +++ b/swap/Cargo.toml @@ -0,0 +1,15 @@ +[workspace] +members = [ + "programs/*", + "crates/*", + # "client" +] + +[profile.release] +overflow-checks = true +lto = "fat" +codegen-units = 1 +[profile.release.build-override] +opt-level = 3 +incremental = false +codegen-units = 1 diff --git a/swap/client/Cargo.toml b/swap/client/Cargo.toml new file mode 100644 index 0000000..9603ada --- /dev/null +++ b/swap/client/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "stateless-swap-client" +version = "0.1.0" +edition = "2021" + +[features] +delete = [] + +[dependencies] +swap = { path = "../programs/swap", features = ["no-entrypoint"], version = "0.1.0" } +anchor-lang = "0.26.0" +anchor-spl = "0.26.0" +solana-sdk = "1.14.12" +solana-cli-config = "1.14.12" +spl-associated-token-account = "1.1.2" +clockwork-client = "1.4.2" +whirlpool = { path = "../crates/whirlpool" } +bytemuck = "1.13.0" \ No newline at end of file diff --git a/swap/client/src/main.rs b/swap/client/src/main.rs new file mode 100644 index 0000000..910213e --- /dev/null +++ b/swap/client/src/main.rs @@ -0,0 +1,248 @@ +use whirlpool::utils::get_tick_array_pubkeys; + +mod utils; + +use { + anchor_lang::{prelude::*, system_program, InstructionData}, + anchor_spl::{ + associated_token::get_associated_token_address, + token::{self}, + }, + clockwork_client::{ + thread::{ + state::Thread, + { + instruction::{thread_create, thread_delete}, + state::Trigger, + }, + }, + Client, ClientResult, + }, + solana_sdk::{instruction::Instruction, system_instruction::transfer}, + spl_associated_token_account::instruction::create_associated_token_account, + std::str::FromStr, + utils::*, +}; + +fn main() -> ClientResult<()> { + let client = default_client(); + + let bonk_usdc_whirlpool = WhirlpoolParams { + whirlpool: Pubkey::from_str("8QaXeHBrShJTdtN1rWCccBxpSVvKksQ2PCu5nufb2zbk").unwrap(), + token_mint_a: Pubkey::from_str("DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263").unwrap(), // BONK + token_mint_b: Pubkey::from_str("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v").unwrap(), // USDC + oracle: Pubkey::from_str("4QqfXtmcMfHAQstgVuhDqY1UyHzyiBfwMrz7Jbgt8aQL").unwrap(), + }; + + #[cfg(not(feature = "delete"))] + dca_create(&client, &bonk_usdc_whirlpool, "BONK_USDC_WP_DCA".into())?; + + #[cfg(feature = "delete")] + swap_delete(&client, "BONK_USDC_WP_DCA".into())?; + + Ok(()) +} + +fn dca_create( + client: &Client, + whirlpool_params: &WhirlpoolParams, + swap_thread_id: String, +) -> ClientResult<()> { + let swap_thread_pubkey = Thread::pubkey(client.payer_pubkey(), swap_thread_id.clone()); + + // BONK vaults + let authority_a_vault_pubkey = + get_associated_token_address(&client.payer_pubkey(), &whirlpool_params.token_mint_a); + + let swap_thread_a_vault_pubkey = + get_associated_token_address(&swap_thread_pubkey, &whirlpool_params.token_mint_a); + + // USDC vaults + let authority_b_vault_pubkey = + get_associated_token_address(&client.payer_pubkey(), &whirlpool_params.token_mint_b); + + let swap_thread_b_vault_pubkey = + get_associated_token_address(&swap_thread_pubkey, &whirlpool_params.token_mint_b); + + let token_acc_pubkeys = vec![ + ( + &authority_a_vault_pubkey, + &whirlpool_params.token_mint_a, + client.payer_pubkey(), + ), + ( + &authority_b_vault_pubkey, + &whirlpool_params.token_mint_b, + client.payer_pubkey(), + ), + ( + &swap_thread_a_vault_pubkey, + &whirlpool_params.token_mint_a, + swap_thread_pubkey, + ), + ( + &swap_thread_b_vault_pubkey, + &whirlpool_params.token_mint_b, + swap_thread_pubkey, + ), + ]; + + let mut init_ata_ixs = vec![]; + + // create init ATA ix if it doesn't already exist + for (ata, mint, owner) in token_acc_pubkeys { + match client.get_account_data(&ata) { + Ok(_data) => {} + Err(_) => { + init_ata_ixs.push(create_associated_token_account( + &client.payer_pubkey(), + &owner, + mint, + &token::ID, + )); + } + } + } + + let mut whirlpool_data: &[u8] = &client + .get_account_data(&whirlpool_params.whirlpool) + .unwrap(); + let whirlpool_state = + whirlpool::state::Whirlpool::try_deserialize(&mut whirlpool_data).unwrap(); + + let orca_whirlpool_swap_data = swap::instruction::OrcaWhirlpoolSwap { + amount: 10_000_000_000, + a_to_b: true, + }; + + let tick_array = get_tick_array_pubkeys( + whirlpool_state.tick_current_index, + whirlpool_state.tick_spacing, + orca_whirlpool_swap_data.a_to_b, + &whirlpool::ID, + &whirlpool_params.whirlpool, + ); + + // create thread to transfer & swap + let thread_create_swap_ix = thread_create( + client.payer_pubkey(), + swap_thread_id, + Instruction { + program_id: swap::ID, + accounts: [ + swap::accounts::OrcaWhirlpoolSwap { + a_mint: whirlpool_state.token_mint_a, + b_mint: whirlpool_state.token_mint_b, + authority_a_vault: authority_a_vault_pubkey, + authority_b_vault: authority_b_vault_pubkey, + swap_thread: swap_thread_pubkey, + swap_thread_a_vault: swap_thread_a_vault_pubkey, + swap_thread_b_vault: swap_thread_b_vault_pubkey, + oracle: whirlpool_params.oracle, + system_program: system_program::ID, + token_program: token::ID, + whirlpool: whirlpool_params.whirlpool, + orca_whirlpool_program: whirlpool::ID, + whirlpool_token_a_vault: whirlpool_state.token_vault_a, + whirlpool_token_b_vault: whirlpool_state.token_vault_b, + } + .to_account_metas(Some(true)), + // REMAINING ACCOUNTS + vec![ + AccountMeta::new(tick_array[0], false), + AccountMeta::new(tick_array[1], false), + AccountMeta::new(tick_array[2], false), + ], + ] + .concat(), + data: orca_whirlpool_swap_data.data(), + } + .into(), + client.payer_pubkey(), + swap_thread_pubkey, + Trigger::Cron { + schedule: "*/15 * * * * *".into(), + skippable: true, + }, + ); + + let fund_swap_thread_ix = transfer(&client.payer_pubkey(), &swap_thread_pubkey, 100000000); + + let approve_token_delegation_ix = anchor_spl::token::spl_token::instruction::approve( + &token::ID, + if orca_whirlpool_swap_data.a_to_b { + &authority_a_vault_pubkey + } else { + &authority_b_vault_pubkey + }, + &swap_thread_pubkey, + &client.payer_pubkey(), + &[&client.payer_pubkey()], + u64::MAX, + ) + .unwrap(); + + { + print_explorer_link(swap_thread_pubkey, "swap thread 📂".into())?; + print_explorer_link( + swap_thread_a_vault_pubkey, + "swap thread mint A vault 💰 (BONK)".into(), + )?; + print_explorer_link( + authority_a_vault_pubkey, + "authority mint A vault 💰 (BONK)".into(), + )?; + print_explorer_link( + swap_thread_b_vault_pubkey, + "swap thread mint B vault 💰 (USDC)".into(), + )?; + print_explorer_link( + authority_b_vault_pubkey, + "authority mint B vault 💰 (USDC)".into(), + )?; + print_explorer_link( + whirlpool_params.token_mint_a, + "whirlpool token A mint 🪙 ".into(), + )?; + print_explorer_link( + whirlpool_params.token_mint_b, + "whirlpool token B mint 🪙 ".into(), + )?; + } + + sign_send_and_confirm_tx( + &client, + [ + vec![ + thread_create_swap_ix, + fund_swap_thread_ix, + approve_token_delegation_ix, + ], + init_ata_ixs, + ] + .concat(), + Some(vec![client.payer()]), + "stateless swap thread create, fund, approve, init ATAs".to_string(), + )?; + + Ok(()) +} + +pub fn swap_delete(client: &Client, swap_thread_id: String) -> ClientResult<()> { + let swap_thread_pubkey = Thread::pubkey(client.payer_pubkey(), swap_thread_id.clone()); + + let swap_thread_delete_ix = thread_delete( + client.payer_pubkey(), + client.payer_pubkey(), + swap_thread_pubkey, + ); + + sign_send_and_confirm_tx( + &client, + [swap_thread_delete_ix].to_vec(), + None, + "dca delete".to_string(), + )?; + + Ok(()) +} diff --git a/swap/client/src/utils.rs b/swap/client/src/utils.rs new file mode 100644 index 0000000..012438c --- /dev/null +++ b/swap/client/src/utils.rs @@ -0,0 +1,71 @@ +use { + anchor_lang::prelude::*, + clockwork_client::{Client, ClientResult}, + solana_sdk::{ + instruction::Instruction, + signature::{read_keypair_file, Keypair}, + transaction::Transaction, + }, +}; + +pub fn sign_send_and_confirm_tx( + client: &Client, + ix: Vec, + signers: Option>, + label: String, +) -> ClientResult<()> { + let mut tx; + + match signers { + Some(signer_keypairs) => { + tx = Transaction::new_signed_with_payer( + &ix, + Some(&client.payer_pubkey()), + &signer_keypairs, + client.get_latest_blockhash().unwrap(), + ); + } + None => { + tx = Transaction::new_with_payer(&ix, Some(&client.payer_pubkey())); + } + } + + tx.sign(&[client.payer()], client.latest_blockhash().unwrap()); + + // Send and confirm initialize tx + match client.send_and_confirm_transaction(&tx) { + Ok(sig) => println!("{} tx: ✅ https://explorer.solana.com/tx/{}", label, sig), + Err(err) => println!("{} tx: ❌ {:#?}", label, err), + } + Ok(()) +} + +pub fn default_client() -> Client { + #[cfg(not(feature = "localnet"))] + let host = "https://api.mainnet-beta.solana.com"; + #[cfg(feature = "localnet")] + let host = "http://localhost:8899"; + + let config_file = solana_cli_config::CONFIG_FILE.as_ref().unwrap().as_str(); + let config = solana_cli_config::Config::load(config_file).unwrap(); + let payer = read_keypair_file(&config.keypair_path).unwrap(); + Client::new(payer, host.into()) +} + +pub fn print_explorer_link(address: Pubkey, label: String) -> ClientResult<()> { + println!( + "{}: https://explorer.solana.com/address/{}", + label.to_string(), + address, + ); + + Ok(()) +} + +#[derive(Debug)] +pub struct WhirlpoolParams { + pub whirlpool: Pubkey, + pub token_mint_a: Pubkey, + pub token_mint_b: Pubkey, + pub oracle: Pubkey, +} diff --git a/swap/crates/whirlpool/Cargo.toml b/swap/crates/whirlpool/Cargo.toml new file mode 100644 index 0000000..1702581 --- /dev/null +++ b/swap/crates/whirlpool/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "whirlpool" +version = "0.1.0" +edition = "2021" + +[features] +default = ["cpi"] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +cpi = ["no-entrypoint"] + +[dependencies] +# anchor-lang = { path = "/Users/eliasmoreno/work/Eliascm17/anchor/lang" } +anchor-lang = "0.26.0" +# anchor-gen = { path = "/Users/eliasmoreno/work/Eliascm17/anchor-gen/crates/anchor-gen", features = ["compat-program-result"] } +# bytemuck = "1.13.0" +anchor-gen = { git = "https://github.com/eliascm17/anchor-gen", version = "^0.3.1", features = ["compat-program-result"] } diff --git a/swap/crates/whirlpool/idl.json b/swap/crates/whirlpool/idl.json new file mode 100644 index 0000000..e5fec86 --- /dev/null +++ b/swap/crates/whirlpool/idl.json @@ -0,0 +1,1923 @@ +{ + "version": "0.1.0", + "name": "whirlpool", + "instructions": [ + { + "name": "initializeConfig", + "docs": [ + "Initializes a WhirlpoolsConfig account that hosts info & authorities", + "required to govern a set of Whirlpools.", + "", + "### Parameters", + "- `fee_authority` - Authority authorized to initialize fee-tiers and set customs fees.", + "- `collect_protocol_fees_authority` - Authority authorized to collect protocol fees.", + "- `reward_emissions_super_authority` - Authority authorized to set reward authorities in pools." + ], + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializePool", + "docs": [ + "Initializes a Whirlpool account.", + "Fee rate is set to the default values on the config and supplied fee_tier.", + "", + "### Parameters", + "- `bumps` - The bump value when deriving the PDA of the Whirlpool address.", + "- `tick_spacing` - The desired tick spacing for this pool.", + "- `initial_sqrt_price` - The desired initial sqrt-price for this pool", + "", + "#### Special Errors", + "`InvalidTokenMintOrder` - The order of mints have to be ordered by", + "`SqrtPriceOutOfBounds` - provided initial_sqrt_price is not between 2^-64 to 2^64", + "" + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": true + }, + { + "name": "feeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "WhirlpoolBumps" + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initialSqrtPrice", + "type": "u128" + } + ] + }, + { + "name": "initializeTickArray", + "docs": [ + "Initializes a tick_array account to represent a tick-range in a Whirlpool.", + "", + "### Parameters", + "- `start_tick_index` - The starting tick index for this tick-array.", + "Has to be a multiple of TickArray size & the tick spacing of this pool.", + "", + "#### Special Errors", + "- `InvalidStartTick` - if the provided start tick is out of bounds or is not a multiple of", + "TICK_ARRAY_SIZE * tick spacing." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tickArray", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "startTickIndex", + "type": "i32" + } + ] + }, + { + "name": "initializeFeeTier", + "docs": [ + "Initializes a fee_tier account usable by Whirlpools in a WhirlpoolConfig space.", + "", + "### Authority", + "- \"fee_authority\" - Set authority in the WhirlpoolConfig", + "", + "### Parameters", + "- `tick_spacing` - The tick-spacing that this fee-tier suggests the default_fee_rate for.", + "- `default_fee_rate` - The default fee rate that a pool will use if the pool uses this", + "fee tier during initialization.", + "", + "#### Special Errors", + "- `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE." + ], + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializeReward", + "docs": [ + "Initialize reward for a Whirlpool. A pool can only support up to a set number of rewards.", + "", + "### Authority", + "- \"reward_authority\" - assigned authority by the reward_super_authority for the specified", + "reward-index in this Whirlpool", + "", + "### Parameters", + "- `reward_index` - The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS)", + "", + "#### Special Errors", + "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized", + "index in this pool, or exceeds NUM_REWARDS, or", + "all reward slots for this pool has been initialized." + ], + "accounts": [ + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissions", + "docs": [ + "Set the reward emissions for a reward in a Whirlpool.", + "", + "### Authority", + "- \"reward_authority\" - assigned authority by the reward_super_authority for the specified", + "reward-index in this Whirlpool", + "", + "### Parameters", + "- `reward_index` - The reward index (0 <= index <= NUM_REWARDS) that we'd like to modify.", + "- `emissions_per_second_x64` - The amount of rewards emitted in this pool.", + "", + "#### Special Errors", + "- `RewardVaultAmountInsufficient` - The amount of rewards in the reward vault cannot emit", + "more than a day of desired emissions.", + "- `InvalidTimestamp` - Provided timestamp is not in order with the previous timestamp.", + "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized", + "index in this pool, or exceeds NUM_REWARDS, or", + "all reward slots for this pool has been initialized." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + } + ] + }, + { + "name": "openPosition", + "docs": [ + "Open a position in a Whirlpool. A unique token will be minted to represent the position", + "in the users wallet. The position will start off with 0 liquidity.", + "", + "### Parameters", + "- `tick_lower_index` - The tick specifying the lower end of the position range.", + "- `tick_upper_index` - The tick specifying the upper end of the position range.", + "", + "#### Special Errors", + "- `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of", + "the tick-spacing in this pool." + ], + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "openPositionWithMetadata", + "docs": [ + "Open a position in a Whirlpool. A unique token will be minted to represent the position", + "in the users wallet. Additional Metaplex metadata is appended to identify the token.", + "The position will start off with 0 liquidity.", + "", + "### Parameters", + "- `tick_lower_index` - The tick specifying the lower end of the position range.", + "- `tick_upper_index` - The tick specifying the upper end of the position range.", + "", + "#### Special Errors", + "- `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of", + "the tick-spacing in this pool." + ], + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionMetadataAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "https://github.com/metaplex-foundation/metaplex-program-library/blob/master/token-metadata/program/src/utils.rs#L873" + ] + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataUpdateAuth", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionWithMetadataBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "increaseLiquidity", + "docs": [ + "Add liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards.", + "", + "### Authority", + "- `position_authority` - authority that owns the token corresponding to this desired position.", + "", + "### Parameters", + "- `liquidity_amount` - The total amount of Liquidity the user is willing to deposit.", + "- `token_max_a` - The maximum amount of tokenA the user is willing to deposit.", + "- `token_max_b` - The maximum amount of tokenB the user is willing to deposit.", + "", + "#### Special Errors", + "- `LiquidityZero` - Provided liquidity amount is zero.", + "- `LiquidityTooHigh` - Provided liquidity exceeds u128::max.", + "- `TokenMaxExceeded` - The required token to perform this operation exceeds the user defined amount." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMaxA", + "type": "u64" + }, + { + "name": "tokenMaxB", + "type": "u64" + } + ] + }, + { + "name": "decreaseLiquidity", + "docs": [ + "Withdraw liquidity from a position in the Whirlpool. This call also updates the position's accrued fees and rewards.", + "", + "### Authority", + "- `position_authority` - authority that owns the token corresponding to this desired position.", + "", + "### Parameters", + "- `liquidity_amount` - The total amount of Liquidity the user desires to withdraw.", + "- `token_min_a` - The minimum amount of tokenA the user is willing to withdraw.", + "- `token_min_b` - The minimum amount of tokenB the user is willing to withdraw.", + "", + "#### Special Errors", + "- `LiquidityZero` - Provided liquidity amount is zero.", + "- `LiquidityTooHigh` - Provided liquidity exceeds u128::max.", + "- `TokenMinSubceeded` - The required token to perform this operation subceeds the user defined amount." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMinA", + "type": "u64" + }, + { + "name": "tokenMinB", + "type": "u64" + } + ] + }, + { + "name": "updateFeesAndRewards", + "docs": [ + "Update the accrued fees and rewards for a position.", + "", + "#### Special Errors", + "- `TickNotFound` - Provided tick array account does not contain the tick for this position.", + "- `LiquidityZero` - Position has zero liquidity and therefore already has the most updated fees and reward values." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": false, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectFees", + "docs": [ + "Collect fees accrued for this position.", + "", + "### Authority", + "- `position_authority` - authority that owns the token corresponding to this desired position." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectReward", + "docs": [ + "Collect rewards accrued for this position.", + "", + "### Authority", + "- `position_authority` - authority that owns the token corresponding to this desired position." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardOwnerAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "collectProtocolFees", + "docs": [ + "Collect the protocol fees accrued in this Whirlpool", + "", + "### Authority", + "- `collect_protocol_fees_authority` - assigned authority in the WhirlpoolConfig that can collect protocol fees" + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "swap", + "docs": [ + "Perform a swap in this Whirlpool", + "", + "### Authority", + "- \"token_authority\" - The authority to withdraw tokens from the input token account.", + "", + "### Parameters", + "- `amount` - The amount of input or output token to swap from (depending on exact_input).", + "- `other_amount_threshold` - The maximum/minimum of input/output token to swap into (depending on exact_input).", + "- `sqrt_price_limit` - The maximum/minimum price the swap will swap to.", + "- `exact_input` - Specifies the token the parameter `amount`represents. If true, the amount represents the input token of the swap.", + "- `a_to_b` - The direction of the swap. True if swapping from A to B. False if swapping from B to A.", + "", + "#### Special Errors", + "- `ZeroTradableAmount` - User provided parameter `amount` is 0.", + "- `InvalidSqrtPriceLimitDirection` - User provided parameter `sqrt_price_limit` does not match the direction of the trade.", + "- `SqrtPriceOutOfBounds` - User provided parameter `sqrt_price_limit` is over Whirlppool's max/min bounds for sqrt-price.", + "- `InvalidTickArraySequence` - User provided tick-arrays are not in sequential order required to proceed in this trade direction.", + "- `TickArraySequenceInvalidIndex` - The swap loop attempted to access an invalid array index during the query of the next initialized tick.", + "- `TickArrayIndexOutofBounds` - The swap loop attempted to access an invalid array index during tick crossing.", + "- `LiquidityOverflow` - Liquidity value overflowed 128bits during tick crossing.", + "- `InvalidTickSpacing` - The swap pool was initialized with tick-spacing of 0." + ], + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimit", + "type": "u128" + }, + { + "name": "amountSpecifiedIsInput", + "type": "bool" + }, + { + "name": "aToB", + "type": "bool" + } + ] + }, + { + "name": "closePosition", + "docs": [ + "Close a position in a Whirlpool. Burns the position token in the owner's wallet.", + "", + "### Authority", + "- \"position_authority\" - The authority that owns the position token.", + "", + "#### Special Errors", + "- `ClosePositionNotEmpty` - The provided position account is not empty." + ], + "accounts": [ + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setDefaultFeeRate", + "docs": [ + "Set the default_fee_rate for a FeeTier", + "Only the current fee authority has permission to invoke this instruction.", + "", + "### Authority", + "- \"fee_authority\" - Set authority in the WhirlpoolConfig", + "", + "### Parameters", + "- `default_fee_rate` - The default fee rate that a pool will use if the pool uses this", + "fee tier during initialization.", + "", + "#### Special Errors", + "- `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE." + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setDefaultProtocolFeeRate", + "docs": [ + "Sets the default protocol fee rate for a WhirlpoolConfig", + "Protocol fee rate is represented as a basis point.", + "Only the current fee authority has permission to invoke this instruction.", + "", + "### Authority", + "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig", + "", + "### Parameters", + "- `default_protocol_fee_rate` - Rate that is referenced during the initialization of a Whirlpool using this config.", + "", + "#### Special Errors", + "- `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE." + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeRate", + "docs": [ + "Sets the fee rate for a Whirlpool.", + "Fee rate is represented as hundredths of a basis point.", + "Only the current fee authority has permission to invoke this instruction.", + "", + "### Authority", + "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig", + "", + "### Parameters", + "- `fee_rate` - The rate that the pool will use to calculate fees going onwards.", + "", + "#### Special Errors", + "- `FeeRateMaxExceeded` - If the provided fee_rate exceeds MAX_FEE_RATE." + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "feeRate", + "type": "u16" + } + ] + }, + { + "name": "setProtocolFeeRate", + "docs": [ + "Sets the protocol fee rate for a Whirlpool.", + "Protocol fee rate is represented as a basis point.", + "Only the current fee authority has permission to invoke this instruction.", + "", + "### Authority", + "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig", + "", + "### Parameters", + "- `protocol_fee_rate` - The rate that the pool will use to calculate protocol fees going onwards.", + "", + "#### Special Errors", + "- `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE." + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "protocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeAuthority", + "docs": [ + "Sets the fee authority for a WhirlpoolConfig.", + "The fee authority can set the fee & protocol fee rate for individual pools or", + "set the default fee rate for newly minted pools.", + "Only the current fee authority has permission to invoke this instruction.", + "", + "### Authority", + "- \"fee_authority\" - Set authority that can modify pool fees in the WhirlpoolConfig" + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newFeeAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setCollectProtocolFeesAuthority", + "docs": [ + "Sets the fee authority to collect protocol fees for a WhirlpoolConfig.", + "Only the current collect protocol fee authority has permission to invoke this instruction.", + "", + "### Authority", + "- \"fee_authority\" - Set authority that can collect protocol fees in the WhirlpoolConfig" + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newCollectProtocolFeesAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setRewardAuthority", + "docs": [ + "Set the whirlpool reward authority at the provided `reward_index`.", + "Only the current reward authority for this reward index has permission to invoke this instruction.", + "", + "### Authority", + "- \"reward_authority\" - Set authority that can control reward emission for this particular reward.", + "", + "#### Special Errors", + "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized", + "index in this pool, or exceeds NUM_REWARDS, or", + "all reward slots for this pool has been initialized." + ], + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardAuthorityBySuperAuthority", + "docs": [ + "Set the whirlpool reward authority at the provided `reward_index`.", + "Only the current reward super authority has permission to invoke this instruction.", + "", + "### Authority", + "- \"reward_authority\" - Set authority that can control reward emission for this particular reward.", + "", + "#### Special Errors", + "- `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized", + "index in this pool, or exceeds NUM_REWARDS, or", + "all reward slots for this pool has been initialized." + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissionsSuperAuthority", + "docs": [ + "Set the whirlpool reward super authority for a WhirlpoolConfig", + "Only the current reward super authority has permission to invoke this instruction.", + "This instruction will not change the authority on any `WhirlpoolRewardInfo` whirlpool rewards.", + "", + "### Authority", + "- \"reward_emissions_super_authority\" - Set authority that can control reward authorities for all pools in this config space." + ], + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "WhirlpoolsConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "FeeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "Position", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey" + }, + { + "name": "positionMint", + "type": "publicKey" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "feeGrowthCheckpointA", + "type": "u128" + }, + { + "name": "feeOwedA", + "type": "u64" + }, + { + "name": "feeGrowthCheckpointB", + "type": "u128" + }, + { + "name": "feeOwedB", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "PositionRewardInfo" + }, + 3 + ] + } + } + ] + } + }, + { + "name": "TickArray", + "type": { + "kind": "struct", + "fields": [ + { + "name": "startTickIndex", + "type": "i32" + }, + { + "name": "ticks", + "type": { + "array": [ + { + "defined": "Tick" + }, + 88 + ] + } + }, + { + "name": "whirlpool", + "type": "publicKey" + } + ] + } + }, + { + "name": "Whirlpool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "whirlpoolBump", + "type": { + "array": ["u8", 1] + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "tickSpacingSeed", + "type": { + "array": ["u8", 2] + } + }, + { + "name": "feeRate", + "type": "u16" + }, + { + "name": "protocolFeeRate", + "type": "u16" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "sqrtPrice", + "type": "u128" + }, + { + "name": "tickCurrentIndex", + "type": "i32" + }, + { + "name": "protocolFeeOwedA", + "type": "u64" + }, + { + "name": "protocolFeeOwedB", + "type": "u64" + }, + { + "name": "tokenMintA", + "type": "publicKey" + }, + { + "name": "tokenVaultA", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalA", + "type": "u128" + }, + { + "name": "tokenMintB", + "type": "publicKey" + }, + { + "name": "tokenVaultB", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalB", + "type": "u128" + }, + { + "name": "rewardLastUpdatedTimestamp", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "WhirlpoolRewardInfo" + }, + 3 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "OpenPositionBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + } + ] + } + }, + { + "name": "OpenPositionWithMetadataBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + }, + { + "name": "metadataBump", + "type": "u8" + } + ] + } + }, + { + "name": "PositionRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "growthInsideCheckpoint", + "type": "u128" + }, + { + "name": "amountOwed", + "type": "u64" + } + ] + } + }, + { + "name": "Tick", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "type": "bool" + }, + { + "name": "liquidityNet", + "type": "i128" + }, + { + "name": "liquidityGross", + "type": "u128" + }, + { + "name": "feeGrowthOutsideA", + "type": "u128" + }, + { + "name": "feeGrowthOutsideB", + "type": "u128" + }, + { + "name": "rewardGrowthsOutside", + "type": { + "array": ["u128", 3] + } + } + ] + } + }, + { + "name": "WhirlpoolRewardInfo", + "docs": [ + "Stores the state relevant for tracking liquidity mining rewards at the `Whirlpool` level.", + "These values are used in conjunction with `PositionRewardInfo`, `Tick.reward_growths_outside`,", + "and `Whirlpool.reward_last_updated_timestamp` to determine how many rewards are earned by open", + "positions." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "docs": ["Reward token mint."], + "type": "publicKey" + }, + { + "name": "vault", + "docs": ["Reward vault token account."], + "type": "publicKey" + }, + { + "name": "authority", + "docs": [ + "Authority account that has permission to initialize the reward and set emissions." + ], + "type": "publicKey" + }, + { + "name": "emissionsPerSecondX64", + "docs": [ + "Q64.64 number that indicates how many tokens per second are earned per unit of liquidity." + ], + "type": "u128" + }, + { + "name": "growthGlobalX64", + "docs": [ + "Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward", + "emissions were turned on." + ], + "type": "u128" + } + ] + } + }, + { + "name": "WhirlpoolBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolBump", + "type": "u8" + } + ] + } + }, + { + "name": "ErrorCode", + "type": { + "kind": "enum", + "variants": [ + { + "name": "InvalidEnum" + }, + { + "name": "InvalidStartTick" + }, + { + "name": "TickArrayExistInPool" + }, + { + "name": "TickArrayIndexOutofBounds" + }, + { + "name": "InvalidTickSpacing" + }, + { + "name": "ClosePositionNotEmpty" + }, + { + "name": "DivideByZero" + }, + { + "name": "NumberCastError" + }, + { + "name": "NumberDownCastError" + }, + { + "name": "TickNotFound" + }, + { + "name": "InvalidTickIndex" + }, + { + "name": "SqrtPriceOutOfBounds" + }, + { + "name": "LiquidityZero" + }, + { + "name": "LiquidityTooHigh" + }, + { + "name": "LiquidityOverflow" + }, + { + "name": "LiquidityUnderflow" + }, + { + "name": "LiquidityNetError" + }, + { + "name": "TokenMaxExceeded" + }, + { + "name": "TokenMinSubceeded" + }, + { + "name": "MissingOrInvalidDelegate" + }, + { + "name": "InvalidPositionTokenAmount" + }, + { + "name": "InvalidTimestampConversion" + }, + { + "name": "InvalidTimestamp" + }, + { + "name": "InvalidTickArraySequence" + }, + { + "name": "InvalidTokenMintOrder" + }, + { + "name": "RewardNotInitialized" + }, + { + "name": "InvalidRewardIndex" + }, + { + "name": "RewardVaultAmountInsufficient" + }, + { + "name": "FeeRateMaxExceeded" + }, + { + "name": "ProtocolFeeRateMaxExceeded" + }, + { + "name": "MultiplicationShiftRightOverflow" + }, + { + "name": "MulDivOverflow" + }, + { + "name": "MulDivInvalidInput" + }, + { + "name": "MultiplicationOverflow" + }, + { + "name": "InvalidSqrtPriceLimitDirection" + }, + { + "name": "ZeroTradableAmount" + }, + { + "name": "AmountOutBelowMinimum" + }, + { + "name": "AmountInAboveMaximum" + }, + { + "name": "TickArraySequenceInvalidIndex" + }, + { + "name": "AmountCalcOverflow" + }, + { + "name": "AmountRemainingOverflow" + } + ] + } + }, + { + "name": "CurrIndex", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Below" + }, + { + "name": "Inside" + }, + { + "name": "Above" + } + ] + } + }, + { + "name": "TickLabel", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Upper" + }, + { + "name": "Lower" + } + ] + } + }, + { + "name": "Direction", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Left" + }, + { + "name": "Right" + } + ] + } + } + ] +} diff --git a/swap/crates/whirlpool/src/lib.rs b/swap/crates/whirlpool/src/lib.rs new file mode 100644 index 0000000..2177d9c --- /dev/null +++ b/swap/crates/whirlpool/src/lib.rs @@ -0,0 +1,21 @@ +pub mod utils; + +use anchor_lang::solana_program::entrypoint::ProgramResult; + +anchor_gen::generate_cpi_interface!( + idl_path = "idl.json", + zero_copy(TickArray, Tick), + packed(TickArray, Tick) +); + +impl Default for state::TickArray { + fn default() -> Self { + Self { + start_tick_index: Default::default(), + ticks: [Default::default(); 88], + whirlpool: Default::default(), + } + } +} + +anchor_lang::prelude::declare_id!("whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"); diff --git a/swap/crates/whirlpool/src/utils.rs b/swap/crates/whirlpool/src/utils.rs new file mode 100644 index 0000000..5f6da34 --- /dev/null +++ b/swap/crates/whirlpool/src/utils.rs @@ -0,0 +1,60 @@ +use anchor_lang::prelude::Pubkey; + +pub const MAX_TICK_INDEX: i32 = 443636; +pub const MIN_TICK_INDEX: i32 = -443636; +pub const TICK_ARRAY_SIZE: i32 = 88; + +pub fn get_tick_array_pubkeys( + tick_current_index: i32, + tick_spacing: u16, + a_to_b: bool, + program_id: &Pubkey, + whirlpool_pubkey: &Pubkey, +) -> [Pubkey; 3] { + let mut offset = 0; + let mut pubkeys: [Pubkey; 3] = Default::default(); + + for i in 0..pubkeys.len() { + let start_tick_index = get_start_tick_index(tick_current_index, tick_spacing, offset); + let tick_array_pubkey = + get_tick_array_pubkey(program_id, whirlpool_pubkey, start_tick_index); + pubkeys[i] = tick_array_pubkey; + offset = if a_to_b { offset - 1 } else { offset + 1 }; + } + + pubkeys +} + +fn get_start_tick_index(tick_current_index: i32, tick_spacing: u16, offset: i32) -> i32 { + let ticks_in_array = TICK_ARRAY_SIZE * tick_spacing as i32; + let real_index = div_floor(tick_current_index, ticks_in_array); + let start_tick_index = (real_index + offset) * ticks_in_array; + + assert!(MIN_TICK_INDEX <= start_tick_index); + assert!(start_tick_index + ticks_in_array <= MAX_TICK_INDEX); + start_tick_index +} + +fn get_tick_array_pubkey( + program_id: &Pubkey, + whirlpool_pubkey: &Pubkey, + start_tick_index: i32, +) -> Pubkey { + Pubkey::find_program_address( + &[ + b"tick_array", + whirlpool_pubkey.as_ref(), + start_tick_index.to_string().as_bytes(), + ], + program_id, + ) + .0 +} + +fn div_floor(a: i32, b: i32) -> i32 { + if a < 0 && a % b != 0 { + a / b - 1 + } else { + a / b + } +} diff --git a/swap/expanded.txt b/swap/expanded.txt new file mode 100644 index 0000000..e69de29 diff --git a/swap/migrations/deploy.ts b/swap/migrations/deploy.ts new file mode 100644 index 0000000..5e3df0d --- /dev/null +++ b/swap/migrations/deploy.ts @@ -0,0 +1,12 @@ +// Migrations are an early feature. Currently, they're nothing more than this +// single deploy script that's invoked from the CLI, injecting a provider +// configured from the workspace's Anchor.toml. + +const anchor = require("@project-serum/anchor"); + +module.exports = async function (provider) { + // Configure client to use the provider. + anchor.setProvider(provider); + + // Add your deploy script here. +}; diff --git a/swap/package.json b/swap/package.json new file mode 100644 index 0000000..12ad64a --- /dev/null +++ b/swap/package.json @@ -0,0 +1,19 @@ +{ + "scripts": { + "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", + "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check" + }, + "dependencies": { + "@project-serum/anchor": "^0.25.0" + }, + "devDependencies": { + "chai": "^4.3.4", + "mocha": "^9.0.3", + "ts-mocha": "^10.0.0", + "@types/bn.js": "^5.1.0", + "@types/chai": "^4.3.0", + "@types/mocha": "^9.0.0", + "typescript": "^4.3.5", + "prettier": "^2.6.2" + } +} diff --git a/swap/programs/swap/Cargo.toml b/swap/programs/swap/Cargo.toml new file mode 100644 index 0000000..696c6f9 --- /dev/null +++ b/swap/programs/swap/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "swap" +version = "0.1.0" +description = "Created with Anchor" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "swap" + +[features] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +cpi = ["no-entrypoint"] +default = [] + +[dependencies] +anchor-lang = "0.26.0" +# anchor-lang = { git = "https://github.com/eliascm17/anchor", version = "0.26.0" } +# anchor-lang = { path = "../../../../../Eliascm17/anchor/lang" } +# anchor-spl = { path = "../../../../../Eliascm17/anchor/spl" } +anchor-spl = "0.26.0" +# clockwork-sdk = { path = "/Users/eliasmoreno/work/clockwork-xyz/clockwork/sdk" } +clockwork-sdk = "1.4.2" +whirlpool = { path = "../../crates/whirlpool" } diff --git a/swap/programs/swap/Xargo.toml b/swap/programs/swap/Xargo.toml new file mode 100644 index 0000000..475fb71 --- /dev/null +++ b/swap/programs/swap/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/swap/programs/swap/expanded.txt b/swap/programs/swap/expanded.txt new file mode 100644 index 0000000..706750f --- /dev/null +++ b/swap/programs/swap/expanded.txt @@ -0,0 +1,1681 @@ +#![feature(prelude_import)] +#[prelude_import] +use std::prelude::rust_2021::*; +#[macro_use] +extern crate std; +pub mod id { + use anchor_lang::prelude::*; + /// The static program ID + pub static ID: anchor_lang::solana_program::pubkey::Pubkey = anchor_lang::solana_program::pubkey::Pubkey::new_from_array([ + 203u8, + 164u8, + 28u8, + 135u8, + 0u8, + 1u8, + 232u8, + 149u8, + 203u8, + 191u8, + 21u8, + 105u8, + 222u8, + 161u8, + 224u8, + 212u8, + 2u8, + 117u8, + 139u8, + 164u8, + 173u8, + 157u8, + 1u8, + 135u8, + 10u8, + 213u8, + 82u8, + 19u8, + 233u8, + 239u8, + 187u8, + 15u8, + ]); + /// Confirms that a given pubkey is equivalent to the program ID + pub fn check_id(id: &anchor_lang::solana_program::pubkey::Pubkey) -> bool { + id == &ID + } + /// Returns the program ID + pub fn id() -> anchor_lang::solana_program::pubkey::Pubkey { + ID + } +} +mod instructions { + pub mod orca_whirlpool_swap { + use { + anchor_lang::{prelude::*, solana_program::system_program, InstructionData}, + anchor_spl::token::{transfer, Mint, Token, TokenAccount, Transfer}, + clockwork_sdk::state::{Thread, ThreadAccount, ThreadResponse}, + whirlpool::utils::get_tick_array_pubkeys, + }; + #[instruction(amount:u64, a_to_b:bool)] + pub struct OrcaWhirlpoolSwap<'info> { + /// CHECK: + pub a_mint: Box>, + /// CHECK: + pub b_mint: Box>, + #[account( + mut, + associated_token::mint = a_mint, + associated_token::authority = swap_thread.authority + )] + pub authority_a_vault: Box>, + #[account( + mut, + associated_token::mint = b_mint, + associated_token::authority = swap_thread.authority + )] + pub authority_b_vault: Box>, + #[account( + mut, + associated_token::authority = swap_thread, + associated_token::mint = a_mint, + )] + pub swap_thread_a_vault: Box>, + #[account( + mut, + associated_token::authority = swap_thread, + associated_token::mint = b_mint, + )] + pub swap_thread_b_vault: Box>, + #[account( + signer, + address = swap_thread.pubkey(), + constraint = swap_thread.authority = = authority_a_vault.owner + )] + pub swap_thread: Box>, + /// CHECK: + pub oracle: AccountInfo<'info>, + /// CHECK: + pub orca_whirlpool_program: AccountInfo<'info>, + #[account(address = system_program::ID)] + pub system_program: Program<'info, System>, + #[account(address = anchor_spl::token::ID)] + pub token_program: Program<'info, Token>, + /// CHECK: + #[account(mut)] + pub whirlpool: AccountInfo<'info>, + /// CHECK: + #[account(mut)] + pub whirlpool_token_a_vault: AccountInfo<'info>, + /// CHECK: + #[account(mut)] + pub whirlpool_token_b_vault: AccountInfo<'info>, + } + #[automatically_derived] + impl<'info> anchor_lang::Accounts<'info> for OrcaWhirlpoolSwap<'info> + where + 'info: 'info, + { + #[inline(never)] + fn try_accounts( + program_id: &anchor_lang::solana_program::pubkey::Pubkey, + accounts: &mut &[anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >], + ix_data: &[u8], + __bumps: &mut std::collections::BTreeMap, + __reallocs: &mut std::collections::BTreeSet< + anchor_lang::solana_program::pubkey::Pubkey, + >, + ) -> anchor_lang::Result { + let mut ix_data = ix_data; + struct __Args { + amount: u64, + a_to_b: bool, + } + impl borsh::ser::BorshSerialize for __Args + where + u64: borsh::ser::BorshSerialize, + bool: borsh::ser::BorshSerialize, + { + fn serialize( + &self, + writer: &mut W, + ) -> ::core::result::Result<(), borsh::maybestd::io::Error> { + borsh::BorshSerialize::serialize(&self.amount, writer)?; + borsh::BorshSerialize::serialize(&self.a_to_b, writer)?; + Ok(()) + } + } + impl borsh::de::BorshDeserialize for __Args + where + u64: borsh::BorshDeserialize, + bool: borsh::BorshDeserialize, + { + fn deserialize( + buf: &mut &[u8], + ) -> ::core::result::Result { + Ok(Self { + amount: borsh::BorshDeserialize::deserialize(buf)?, + a_to_b: borsh::BorshDeserialize::deserialize(buf)?, + }) + } + } + let __Args { amount, a_to_b } = __Args::deserialize(&mut ix_data) + .map_err(|_| { + anchor_lang::error::ErrorCode::InstructionDidNotDeserialize + })?; + let a_mint: Box> = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("a_mint"))?; + let b_mint: Box> = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("b_mint"))?; + let authority_a_vault: Box< + anchor_lang::accounts::account::Account, + > = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("authority_a_vault"))?; + let authority_b_vault: Box< + anchor_lang::accounts::account::Account, + > = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("authority_b_vault"))?; + let swap_thread_a_vault: Box< + anchor_lang::accounts::account::Account, + > = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("swap_thread_a_vault"))?; + let swap_thread_b_vault: Box< + anchor_lang::accounts::account::Account, + > = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("swap_thread_b_vault"))?; + let swap_thread: Box> = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("swap_thread"))?; + let oracle: AccountInfo = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("oracle"))?; + let orca_whirlpool_program: AccountInfo = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("orca_whirlpool_program"))?; + let system_program: anchor_lang::accounts::program::Program = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("system_program"))?; + let token_program: anchor_lang::accounts::program::Program = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("token_program"))?; + let whirlpool: AccountInfo = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("whirlpool"))?; + let whirlpool_token_a_vault: AccountInfo = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("whirlpool_token_a_vault"))?; + let whirlpool_token_b_vault: AccountInfo = anchor_lang::Accounts::try_accounts( + program_id, + accounts, + ix_data, + __bumps, + __reallocs, + ) + .map_err(|e| e.with_account_name("whirlpool_token_b_vault"))?; + { + let my_owner = authority_a_vault.owner; + let wallet_address = swap_thread.authority.key(); + if my_owner != wallet_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintTokenOwner, + ) + .with_account_name("authority_a_vault") + .with_pubkeys((my_owner, wallet_address)), + ); + } + let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( + &wallet_address, + &a_mint.key(), + ); + let my_key = authority_a_vault.key(); + if my_key != __associated_token_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintAssociated, + ) + .with_account_name("authority_a_vault") + .with_pubkeys((my_key, __associated_token_address)), + ); + } + } + if !authority_a_vault.to_account_info().is_writable { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintMut, + ) + .with_account_name("authority_a_vault"), + ); + } + { + let my_owner = authority_b_vault.owner; + let wallet_address = swap_thread.authority.key(); + if my_owner != wallet_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintTokenOwner, + ) + .with_account_name("authority_b_vault") + .with_pubkeys((my_owner, wallet_address)), + ); + } + let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( + &wallet_address, + &b_mint.key(), + ); + let my_key = authority_b_vault.key(); + if my_key != __associated_token_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintAssociated, + ) + .with_account_name("authority_b_vault") + .with_pubkeys((my_key, __associated_token_address)), + ); + } + } + if !authority_b_vault.to_account_info().is_writable { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintMut, + ) + .with_account_name("authority_b_vault"), + ); + } + { + let my_owner = swap_thread_a_vault.owner; + let wallet_address = swap_thread.key(); + if my_owner != wallet_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintTokenOwner, + ) + .with_account_name("swap_thread_a_vault") + .with_pubkeys((my_owner, wallet_address)), + ); + } + let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( + &wallet_address, + &a_mint.key(), + ); + let my_key = swap_thread_a_vault.key(); + if my_key != __associated_token_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintAssociated, + ) + .with_account_name("swap_thread_a_vault") + .with_pubkeys((my_key, __associated_token_address)), + ); + } + } + if !swap_thread_a_vault.to_account_info().is_writable { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintMut, + ) + .with_account_name("swap_thread_a_vault"), + ); + } + { + let my_owner = swap_thread_b_vault.owner; + let wallet_address = swap_thread.key(); + if my_owner != wallet_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintTokenOwner, + ) + .with_account_name("swap_thread_b_vault") + .with_pubkeys((my_owner, wallet_address)), + ); + } + let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( + &wallet_address, + &b_mint.key(), + ); + let my_key = swap_thread_b_vault.key(); + if my_key != __associated_token_address { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintAssociated, + ) + .with_account_name("swap_thread_b_vault") + .with_pubkeys((my_key, __associated_token_address)), + ); + } + } + if !swap_thread_b_vault.to_account_info().is_writable { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintMut, + ) + .with_account_name("swap_thread_b_vault"), + ); + } + if !swap_thread.to_account_info().is_signer { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintSigner, + ) + .with_account_name("swap_thread"), + ); + } + if !(swap_thread.authority == authority_a_vault.owner) { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintRaw, + ) + .with_account_name("swap_thread"), + ); + } + { + let actual = swap_thread.key(); + let expected = swap_thread.pubkey(); + if actual != expected { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintAddress, + ) + .with_account_name("swap_thread") + .with_pubkeys((actual, expected)), + ); + } + } + { + let actual = system_program.key(); + let expected = system_program::ID; + if actual != expected { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintAddress, + ) + .with_account_name("system_program") + .with_pubkeys((actual, expected)), + ); + } + } + { + let actual = token_program.key(); + let expected = anchor_spl::token::ID; + if actual != expected { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintAddress, + ) + .with_account_name("token_program") + .with_pubkeys((actual, expected)), + ); + } + } + if !whirlpool.to_account_info().is_writable { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintMut, + ) + .with_account_name("whirlpool"), + ); + } + if !whirlpool_token_a_vault.to_account_info().is_writable { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintMut, + ) + .with_account_name("whirlpool_token_a_vault"), + ); + } + if !whirlpool_token_b_vault.to_account_info().is_writable { + return Err( + anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintMut, + ) + .with_account_name("whirlpool_token_b_vault"), + ); + } + Ok(OrcaWhirlpoolSwap { + a_mint, + b_mint, + authority_a_vault, + authority_b_vault, + swap_thread_a_vault, + swap_thread_b_vault, + swap_thread, + oracle, + orca_whirlpool_program, + system_program, + token_program, + whirlpool, + whirlpool_token_a_vault, + whirlpool_token_b_vault, + }) + } + } + #[automatically_derived] + impl<'info> anchor_lang::ToAccountInfos<'info> for OrcaWhirlpoolSwap<'info> + where + 'info: 'info, + { + fn to_account_infos( + &self, + ) -> Vec> { + let mut account_infos = ::alloc::vec::Vec::new(); + account_infos.extend(self.a_mint.to_account_infos()); + account_infos.extend(self.b_mint.to_account_infos()); + account_infos.extend(self.authority_a_vault.to_account_infos()); + account_infos.extend(self.authority_b_vault.to_account_infos()); + account_infos.extend(self.swap_thread_a_vault.to_account_infos()); + account_infos.extend(self.swap_thread_b_vault.to_account_infos()); + account_infos.extend(self.swap_thread.to_account_infos()); + account_infos.extend(self.oracle.to_account_infos()); + account_infos.extend(self.orca_whirlpool_program.to_account_infos()); + account_infos.extend(self.system_program.to_account_infos()); + account_infos.extend(self.token_program.to_account_infos()); + account_infos.extend(self.whirlpool.to_account_infos()); + account_infos.extend(self.whirlpool_token_a_vault.to_account_infos()); + account_infos.extend(self.whirlpool_token_b_vault.to_account_infos()); + account_infos + } + } + #[automatically_derived] + impl<'info> anchor_lang::ToAccountMetas for OrcaWhirlpoolSwap<'info> { + fn to_account_metas( + &self, + is_signer: Option, + ) -> Vec { + let mut account_metas = ::alloc::vec::Vec::new(); + account_metas.extend(self.a_mint.to_account_metas(None)); + account_metas.extend(self.b_mint.to_account_metas(None)); + account_metas.extend(self.authority_a_vault.to_account_metas(None)); + account_metas.extend(self.authority_b_vault.to_account_metas(None)); + account_metas.extend(self.swap_thread_a_vault.to_account_metas(None)); + account_metas.extend(self.swap_thread_b_vault.to_account_metas(None)); + account_metas.extend(self.swap_thread.to_account_metas(Some(true))); + account_metas.extend(self.oracle.to_account_metas(None)); + account_metas.extend(self.orca_whirlpool_program.to_account_metas(None)); + account_metas.extend(self.system_program.to_account_metas(None)); + account_metas.extend(self.token_program.to_account_metas(None)); + account_metas.extend(self.whirlpool.to_account_metas(None)); + account_metas + .extend(self.whirlpool_token_a_vault.to_account_metas(None)); + account_metas + .extend(self.whirlpool_token_b_vault.to_account_metas(None)); + account_metas + } + } + #[automatically_derived] + impl<'info> anchor_lang::AccountsExit<'info> for OrcaWhirlpoolSwap<'info> + where + 'info: 'info, + { + fn exit( + &self, + program_id: &anchor_lang::solana_program::pubkey::Pubkey, + ) -> anchor_lang::Result<()> { + anchor_lang::AccountsExit::exit(&self.authority_a_vault, program_id) + .map_err(|e| e.with_account_name("authority_a_vault"))?; + anchor_lang::AccountsExit::exit(&self.authority_b_vault, program_id) + .map_err(|e| e.with_account_name("authority_b_vault"))?; + anchor_lang::AccountsExit::exit(&self.swap_thread_a_vault, program_id) + .map_err(|e| e.with_account_name("swap_thread_a_vault"))?; + anchor_lang::AccountsExit::exit(&self.swap_thread_b_vault, program_id) + .map_err(|e| e.with_account_name("swap_thread_b_vault"))?; + anchor_lang::AccountsExit::exit(&self.whirlpool, program_id) + .map_err(|e| e.with_account_name("whirlpool"))?; + anchor_lang::AccountsExit::exit( + &self.whirlpool_token_a_vault, + program_id, + ) + .map_err(|e| e.with_account_name("whirlpool_token_a_vault"))?; + anchor_lang::AccountsExit::exit( + &self.whirlpool_token_b_vault, + program_id, + ) + .map_err(|e| e.with_account_name("whirlpool_token_b_vault"))?; + Ok(()) + } + } + /// An internal, Anchor generated module. This is used (as an + /// implementation detail), to generate a struct for a given + /// `#[derive(Accounts)]` implementation, where each field is a Pubkey, + /// instead of an `AccountInfo`. This is useful for clients that want + /// to generate a list of accounts, without explicitly knowing the + /// order all the fields should be in. + /// + /// To access the struct in this module, one should use the sibling + /// `accounts` module (also generated), which re-exports this. + pub(crate) mod __client_accounts_orca_whirlpool_swap { + use super::*; + use anchor_lang::prelude::borsh; + /// Generated client accounts for [`OrcaWhirlpoolSwap`]. + pub struct OrcaWhirlpoolSwap { + pub a_mint: anchor_lang::solana_program::pubkey::Pubkey, + pub b_mint: anchor_lang::solana_program::pubkey::Pubkey, + pub authority_a_vault: anchor_lang::solana_program::pubkey::Pubkey, + pub authority_b_vault: anchor_lang::solana_program::pubkey::Pubkey, + pub swap_thread_a_vault: anchor_lang::solana_program::pubkey::Pubkey, + pub swap_thread_b_vault: anchor_lang::solana_program::pubkey::Pubkey, + pub swap_thread: anchor_lang::solana_program::pubkey::Pubkey, + pub oracle: anchor_lang::solana_program::pubkey::Pubkey, + pub orca_whirlpool_program: anchor_lang::solana_program::pubkey::Pubkey, + pub system_program: anchor_lang::solana_program::pubkey::Pubkey, + pub token_program: anchor_lang::solana_program::pubkey::Pubkey, + pub whirlpool: anchor_lang::solana_program::pubkey::Pubkey, + pub whirlpool_token_a_vault: anchor_lang::solana_program::pubkey::Pubkey, + pub whirlpool_token_b_vault: anchor_lang::solana_program::pubkey::Pubkey, + } + impl borsh::ser::BorshSerialize for OrcaWhirlpoolSwap + where + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, + { + fn serialize( + &self, + writer: &mut W, + ) -> ::core::result::Result<(), borsh::maybestd::io::Error> { + borsh::BorshSerialize::serialize(&self.a_mint, writer)?; + borsh::BorshSerialize::serialize(&self.b_mint, writer)?; + borsh::BorshSerialize::serialize(&self.authority_a_vault, writer)?; + borsh::BorshSerialize::serialize(&self.authority_b_vault, writer)?; + borsh::BorshSerialize::serialize(&self.swap_thread_a_vault, writer)?; + borsh::BorshSerialize::serialize(&self.swap_thread_b_vault, writer)?; + borsh::BorshSerialize::serialize(&self.swap_thread, writer)?; + borsh::BorshSerialize::serialize(&self.oracle, writer)?; + borsh::BorshSerialize::serialize( + &self.orca_whirlpool_program, + writer, + )?; + borsh::BorshSerialize::serialize(&self.system_program, writer)?; + borsh::BorshSerialize::serialize(&self.token_program, writer)?; + borsh::BorshSerialize::serialize(&self.whirlpool, writer)?; + borsh::BorshSerialize::serialize( + &self.whirlpool_token_a_vault, + writer, + )?; + borsh::BorshSerialize::serialize( + &self.whirlpool_token_b_vault, + writer, + )?; + Ok(()) + } + } + #[automatically_derived] + impl anchor_lang::ToAccountMetas for OrcaWhirlpoolSwap { + fn to_account_metas( + &self, + is_signer: Option, + ) -> Vec { + let mut account_metas = ::alloc::vec::Vec::new(); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + self.a_mint, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + self.b_mint, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + self.authority_a_vault, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + self.authority_b_vault, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + self.swap_thread_a_vault, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + self.swap_thread_b_vault, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + self.swap_thread, + true, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + self.oracle, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + self.orca_whirlpool_program, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + self.whirlpool, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + self.whirlpool_token_a_vault, + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + self.whirlpool_token_b_vault, + false, + ), + ); + account_metas + } + } + } + /// An internal, Anchor generated module. This is used (as an + /// implementation detail), to generate a CPI struct for a given + /// `#[derive(Accounts)]` implementation, where each field is an + /// AccountInfo. + /// + /// To access the struct in this module, one should use the sibling + /// [`cpi::accounts`] module (also generated), which re-exports this. + pub(crate) mod __cpi_client_accounts_orca_whirlpool_swap { + use super::*; + /// Generated CPI struct of the accounts for [`OrcaWhirlpoolSwap`]. + pub struct OrcaWhirlpoolSwap<'info> { + pub a_mint: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub b_mint: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub authority_a_vault: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub authority_b_vault: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub swap_thread_a_vault: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub swap_thread_b_vault: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub swap_thread: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub oracle: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub orca_whirlpool_program: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub system_program: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub token_program: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub whirlpool: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub whirlpool_token_a_vault: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + pub whirlpool_token_b_vault: anchor_lang::solana_program::account_info::AccountInfo< + 'info, + >, + } + #[automatically_derived] + impl<'info> anchor_lang::ToAccountMetas for OrcaWhirlpoolSwap<'info> { + fn to_account_metas( + &self, + is_signer: Option, + ) -> Vec { + let mut account_metas = ::alloc::vec::Vec::new(); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + anchor_lang::Key::key(&self.a_mint), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + anchor_lang::Key::key(&self.b_mint), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + anchor_lang::Key::key(&self.authority_a_vault), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + anchor_lang::Key::key(&self.authority_b_vault), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + anchor_lang::Key::key(&self.swap_thread_a_vault), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + anchor_lang::Key::key(&self.swap_thread_b_vault), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + anchor_lang::Key::key(&self.swap_thread), + true, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + anchor_lang::Key::key(&self.oracle), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + anchor_lang::Key::key(&self.orca_whirlpool_program), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + anchor_lang::Key::key(&self.system_program), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + anchor_lang::Key::key(&self.token_program), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + anchor_lang::Key::key(&self.whirlpool), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + anchor_lang::Key::key(&self.whirlpool_token_a_vault), + false, + ), + ); + account_metas + .push( + anchor_lang::solana_program::instruction::AccountMeta::new( + anchor_lang::Key::key(&self.whirlpool_token_b_vault), + false, + ), + ); + account_metas + } + } + #[automatically_derived] + impl<'info> anchor_lang::ToAccountInfos<'info> for OrcaWhirlpoolSwap<'info> { + fn to_account_infos( + &self, + ) -> Vec> { + let mut account_infos = ::alloc::vec::Vec::new(); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos(&self.a_mint), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos(&self.b_mint), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.authority_a_vault, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.authority_b_vault, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.swap_thread_a_vault, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.swap_thread_b_vault, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.swap_thread, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos(&self.oracle), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.orca_whirlpool_program, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.system_program, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.token_program, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.whirlpool, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.whirlpool_token_a_vault, + ), + ); + account_infos + .extend( + anchor_lang::ToAccountInfos::to_account_infos( + &self.whirlpool_token_b_vault, + ), + ); + account_infos + } + } + } + pub fn handler<'info>( + ctx: Context<'_, '_, '_, 'info, OrcaWhirlpoolSwap<'info>>, + amount: u64, + a_to_b: bool, + ) -> Result { + let authority_a_vault = &mut ctx.accounts.authority_a_vault; + let authority_b_vault = &mut ctx.accounts.authority_b_vault; + let swap_thread_a_vault = &mut ctx.accounts.swap_thread_a_vault; + let swap_thread_b_vault = &mut ctx.accounts.swap_thread_b_vault; + let swap_thread = &ctx.accounts.swap_thread; + let oracle = &ctx.accounts.oracle; + let orca_whirlpool_program = &ctx.accounts.orca_whirlpool_program; + let token_program = &ctx.accounts.token_program; + let whirlpool = &mut ctx.accounts.whirlpool; + let whirlpool_token_a_vault = &mut ctx.accounts.whirlpool_token_a_vault; + let whirlpool_token_b_vault = &mut ctx.accounts.whirlpool_token_b_vault; + let tick_array0 = ctx.remaining_accounts.get(0).unwrap(); + let tick_array1 = ctx.remaining_accounts.get(1).unwrap(); + let tick_array2 = ctx.remaining_accounts.get(2).unwrap(); + let whirlpool_data = whirlpool.try_borrow_data().unwrap().to_owned(); + let whirlpool_state = whirlpool::state::Whirlpool::try_deserialize( + &mut whirlpool_data.as_slice(), + ) + .unwrap(); + let tick_array_pubkeys = get_tick_array_pubkeys( + whirlpool_state.tick_current_index, + whirlpool_state.tick_spacing, + a_to_b, + &whirlpool::ID, + &whirlpool.key(), + ); + transfer( + CpiContext::new( + token_program.to_account_info(), + Transfer { + from: if a_to_b { + authority_a_vault.to_account_info() + } else { + authority_b_vault.to_account_info() + }, + to: if a_to_b { + swap_thread_a_vault.to_account_info() + } else { + swap_thread_b_vault.to_account_info() + }, + authority: swap_thread.to_account_info(), + }, + ), + amount, + )?; + whirlpool::cpi::swap( + CpiContext::new( + orca_whirlpool_program.to_account_info(), + whirlpool::cpi::accounts::Swap { + token_program: token_program.to_account_info(), + token_authority: swap_thread.to_account_info(), + whirlpool: whirlpool.to_account_info(), + token_owner_account_a: swap_thread_a_vault.to_account_info(), + token_vault_a: whirlpool_token_a_vault.to_account_info(), + token_owner_account_b: swap_thread_b_vault.to_account_info(), + token_vault_b: whirlpool_token_b_vault.to_account_info(), + tick_array0: tick_array0.to_account_info(), + tick_array1: tick_array1.to_account_info(), + tick_array2: tick_array2.to_account_info(), + oracle: oracle.to_account_info(), + }, + ), + amount, + 0, + whirlpool_state.sqrt_price, + false, + a_to_b, + )?; + if a_to_b { + swap_thread_b_vault.reload()? + } else { + swap_thread_a_vault.reload()? + } + transfer( + CpiContext::new( + token_program.to_account_info(), + Transfer { + from: if a_to_b { + swap_thread_b_vault.to_account_info() + } else { + swap_thread_a_vault.to_account_info() + }, + to: if a_to_b { + authority_b_vault.to_account_info() + } else { + authority_a_vault.to_account_info() + }, + authority: swap_thread.to_account_info(), + }, + ), + swap_thread_b_vault.amount, + )?; + Ok(ThreadResponse { + kickoff_instruction: Some(clockwork_sdk::state::InstructionData { + program_id: crate::ID, + accounts: [ + crate::accounts::OrcaWhirlpoolSwap { + a_mint: ctx.accounts.a_mint.key(), + b_mint: ctx.accounts.b_mint.key(), + authority_a_vault: ctx.accounts.authority_a_vault.key(), + authority_b_vault: ctx.accounts.authority_b_vault.key(), + swap_thread: ctx.accounts.swap_thread.key(), + swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), + swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), + oracle: ctx.accounts.oracle.key(), + system_program: ctx.accounts.system_program.key(), + token_program: ctx.accounts.token_program.key(), + whirlpool: ctx.accounts.whirlpool.key(), + orca_whirlpool_program: whirlpool::ID, + whirlpool_token_a_vault: whirlpool_state.token_vault_a, + whirlpool_token_b_vault: whirlpool_state.token_vault_b, + } + .to_account_metas(Some(true)), + tick_array_pubkeys + .iter() + .map(|pk| AccountMeta::new(*pk, false)) + .collect::>(), + ] + .concat(), + data: crate::instruction::OrcaWhirlpoolSwap { + amount: 10_000_000_000, + a_to_b: true, + } + .data(), + }), + next_instruction: None, + }) + } + } + pub use orca_whirlpool_swap::*; +} +pub use id::ID; +use anchor_lang::prelude::*; +use instructions::*; +use self::swap::*; +/// The Anchor codegen exposes a programming model where a user defines +/// a set of methods inside of a `#[program]` module in a way similar +/// to writing RPC request handlers. The macro then generates a bunch of +/// code wrapping these user defined methods into something that can be +/// executed on Solana. +/// +/// These methods fall into one of three categories, each of which +/// can be considered a different "namespace" of the program. +/// +/// 1) Global methods - regular methods inside of the `#[program]`. +/// 2) State methods - associated methods inside a `#[state]` struct. +/// 3) Interface methods - methods inside a strait struct's +/// implementation of an `#[interface]` trait. +/// +/// Care must be taken by the codegen to prevent collisions between +/// methods in these different namespaces. For this reason, Anchor uses +/// a variant of sighash to perform method dispatch, rather than +/// something like a simple enum variant discriminator. +/// +/// The execution flow of the generated code can be roughly outlined: +/// +/// * Start program via the entrypoint. +/// * Strip method identifier off the first 8 bytes of the instruction +/// data and invoke the identified method. The method identifier +/// is a variant of sighash. See docs.rs for `anchor_lang` for details. +/// * If the method identifier is an IDL identifier, execute the IDL +/// instructions, which are a special set of hardcoded instructions +/// baked into every Anchor program. Then exit. +/// * Otherwise, the method identifier is for a user defined +/// instruction, i.e., one of the methods in the user defined +/// `#[program]` module. Perform method dispatch, i.e., execute the +/// big match statement mapping method identifier to method handler +/// wrapper. +/// * Run the method handler wrapper. This wraps the code the user +/// actually wrote, deserializing the accounts, constructing the +/// context, invoking the user's code, and finally running the exit +/// routine, which typically persists account changes. +/// +/// The `entry` function here, defines the standard entry to a Solana +/// program, where execution begins. +pub fn entry( + program_id: &Pubkey, + accounts: &[AccountInfo], + data: &[u8], +) -> anchor_lang::solana_program::entrypoint::ProgramResult { + try_entry(program_id, accounts, data) + .map_err(|e| { + e.log(); + e.into() + }) +} +fn try_entry( + program_id: &Pubkey, + accounts: &[AccountInfo], + data: &[u8], +) -> anchor_lang::Result<()> { + if *program_id != ID { + return Err(anchor_lang::error::ErrorCode::DeclaredProgramIdMismatch.into()); + } + if data.len() < 8 { + return Err(anchor_lang::error::ErrorCode::InstructionMissing.into()); + } + dispatch(program_id, accounts, data) +} +/// Module representing the program. +pub mod program { + use super::*; + /// Type representing the program. + pub struct Swap; + #[automatically_derived] + impl ::core::clone::Clone for Swap { + #[inline] + fn clone(&self) -> Swap { + Swap + } + } + impl anchor_lang::Id for Swap { + fn id() -> Pubkey { + ID + } + } +} +/// Performs method dispatch. +/// +/// Each method in an anchor program is uniquely defined by a namespace +/// and a rust identifier (i.e., the name given to the method). These +/// two pieces can be combined to creater a method identifier, +/// specifically, Anchor uses +/// +/// Sha256(":")[..8], +/// +/// where the namespace can be one of three types. 1) "global" for a +/// regular instruction, 2) "state" for a state struct instruction +/// handler and 3) a trait namespace (used in combination with the +/// `#[interface]` attribute), which is defined by the trait name, e.. +/// `MyTrait`. +/// +/// With this 8 byte identifier, Anchor performs method dispatch, +/// matching the given 8 byte identifier to the associated method +/// handler, which leads to user defined code being eventually invoked. +fn dispatch( + program_id: &Pubkey, + accounts: &[AccountInfo], + data: &[u8], +) -> anchor_lang::Result<()> { + let mut ix_data: &[u8] = data; + let sighash: [u8; 8] = { + let mut sighash: [u8; 8] = [0; 8]; + sighash.copy_from_slice(&ix_data[..8]); + ix_data = &ix_data[8..]; + sighash + }; + if true { + if sighash == anchor_lang::idl::IDL_IX_TAG.to_le_bytes() { + return __private::__idl::__idl_dispatch(program_id, accounts, &ix_data); + } + } + use anchor_lang::Discriminator; + match sighash { + instruction::OrcaWhirlpoolSwap::DISCRIMINATOR => { + __private::__global::orca_whirlpool_swap(program_id, accounts, ix_data) + } + _ => Err(anchor_lang::error::ErrorCode::InstructionFallbackNotFound.into()), + } +} +/// Create a private module to not clutter the program's namespace. +/// Defines an entrypoint for each individual instruction handler +/// wrapper. +mod __private { + use super::*; + /// __idl mod defines handlers for injected Anchor IDL instructions. + pub mod __idl { + use super::*; + #[inline(never)] + #[cfg(not(feature = "no-idl"))] + pub fn __idl_dispatch( + program_id: &Pubkey, + accounts: &[AccountInfo], + idl_ix_data: &[u8], + ) -> anchor_lang::Result<()> { + let mut accounts = accounts; + let mut data: &[u8] = idl_ix_data; + let ix = anchor_lang::idl::IdlInstruction::deserialize(&mut data) + .map_err(|_| { + anchor_lang::error::ErrorCode::InstructionDidNotDeserialize + })?; + match ix { + anchor_lang::idl::IdlInstruction::Create { data_len } => { + let mut bumps = std::collections::BTreeMap::new(); + let mut reallocs = std::collections::BTreeSet::new(); + let mut accounts = anchor_lang::idl::IdlCreateAccounts::try_accounts( + program_id, + &mut accounts, + &[], + &mut bumps, + &mut reallocs, + )?; + __idl_create_account(program_id, &mut accounts, data_len)?; + accounts.exit(program_id)?; + } + anchor_lang::idl::IdlInstruction::CreateBuffer => { + let mut bumps = std::collections::BTreeMap::new(); + let mut reallocs = std::collections::BTreeSet::new(); + let mut accounts = anchor_lang::idl::IdlCreateBuffer::try_accounts( + program_id, + &mut accounts, + &[], + &mut bumps, + &mut reallocs, + )?; + __idl_create_buffer(program_id, &mut accounts)?; + accounts.exit(program_id)?; + } + anchor_lang::idl::IdlInstruction::Write { data } => { + let mut bumps = std::collections::BTreeMap::new(); + let mut reallocs = std::collections::BTreeSet::new(); + let mut accounts = anchor_lang::idl::IdlAccounts::try_accounts( + program_id, + &mut accounts, + &[], + &mut bumps, + &mut reallocs, + )?; + __idl_write(program_id, &mut accounts, data)?; + accounts.exit(program_id)?; + } + anchor_lang::idl::IdlInstruction::SetAuthority { new_authority } => { + let mut bumps = std::collections::BTreeMap::new(); + let mut reallocs = std::collections::BTreeSet::new(); + let mut accounts = anchor_lang::idl::IdlAccounts::try_accounts( + program_id, + &mut accounts, + &[], + &mut bumps, + &mut reallocs, + )?; + __idl_set_authority(program_id, &mut accounts, new_authority)?; + accounts.exit(program_id)?; + } + anchor_lang::idl::IdlInstruction::SetBuffer => { + let mut bumps = std::collections::BTreeMap::new(); + let mut reallocs = std::collections::BTreeSet::new(); + let mut accounts = anchor_lang::idl::IdlSetBuffer::try_accounts( + program_id, + &mut accounts, + &[], + &mut bumps, + &mut reallocs, + )?; + __idl_set_buffer(program_id, &mut accounts)?; + accounts.exit(program_id)?; + } + } + Ok(()) + } + #[inline(never)] + pub fn __idl_create_account( + program_id: &Pubkey, + accounts: &mut anchor_lang::idl::IdlCreateAccounts, + data_len: u64, + ) -> anchor_lang::Result<()> { + ::solana_program::log::sol_log("Instruction: IdlCreateAccount"); + if program_id != accounts.program.key { + return Err( + anchor_lang::error::ErrorCode::IdlInstructionInvalidProgram.into(), + ); + } + let from = accounts.from.key; + let (base, nonce) = Pubkey::find_program_address(&[], program_id); + let seed = anchor_lang::idl::IdlAccount::seed(); + let owner = accounts.program.key; + let to = Pubkey::create_with_seed(&base, seed, owner).unwrap(); + let space = 8 + 32 + 4 + data_len as usize; + let rent = Rent::get()?; + let lamports = rent.minimum_balance(space); + let seeds = &[&[nonce][..]]; + let ix = anchor_lang::solana_program::system_instruction::create_account_with_seed( + from, + &to, + &base, + seed, + lamports, + space as u64, + owner, + ); + anchor_lang::solana_program::program::invoke_signed( + &ix, + &[ + accounts.from.clone(), + accounts.to.clone(), + accounts.base.clone(), + accounts.system_program.clone(), + ], + &[seeds], + )?; + let mut idl_account = { + let mut account_data = accounts.to.try_borrow_data()?; + let mut account_data_slice: &[u8] = &account_data; + anchor_lang::idl::IdlAccount::try_deserialize_unchecked( + &mut account_data_slice, + )? + }; + idl_account.authority = *accounts.from.key; + let mut data = accounts.to.try_borrow_mut_data()?; + let dst: &mut [u8] = &mut data; + let mut cursor = std::io::Cursor::new(dst); + idl_account.try_serialize(&mut cursor)?; + Ok(()) + } + #[inline(never)] + pub fn __idl_create_buffer( + program_id: &Pubkey, + accounts: &mut anchor_lang::idl::IdlCreateBuffer, + ) -> anchor_lang::Result<()> { + ::solana_program::log::sol_log("Instruction: IdlCreateBuffer"); + let mut buffer = &mut accounts.buffer; + buffer.authority = *accounts.authority.key; + Ok(()) + } + #[inline(never)] + pub fn __idl_write( + program_id: &Pubkey, + accounts: &mut anchor_lang::idl::IdlAccounts, + idl_data: Vec, + ) -> anchor_lang::Result<()> { + ::solana_program::log::sol_log("Instruction: IdlWrite"); + let mut idl = &mut accounts.idl; + idl.data.extend(idl_data); + Ok(()) + } + #[inline(never)] + pub fn __idl_set_authority( + program_id: &Pubkey, + accounts: &mut anchor_lang::idl::IdlAccounts, + new_authority: Pubkey, + ) -> anchor_lang::Result<()> { + ::solana_program::log::sol_log("Instruction: IdlSetAuthority"); + accounts.idl.authority = new_authority; + Ok(()) + } + #[inline(never)] + pub fn __idl_set_buffer( + program_id: &Pubkey, + accounts: &mut anchor_lang::idl::IdlSetBuffer, + ) -> anchor_lang::Result<()> { + ::solana_program::log::sol_log("Instruction: IdlSetBuffer"); + accounts.idl.data = accounts.buffer.data.clone(); + Ok(()) + } + } + /// __state mod defines wrapped handlers for state instructions. + pub mod __state { + use super::*; + } + /// __interface mod defines wrapped handlers for `#[interface]` trait + /// implementations. + pub mod __interface { + use super::*; + } + /// __global mod defines wrapped handlers for global instructions. + pub mod __global { + use super::*; + #[inline(never)] + pub fn orca_whirlpool_swap( + program_id: &Pubkey, + accounts: &[AccountInfo], + ix_data: &[u8], + ) -> anchor_lang::Result<()> { + ::solana_program::log::sol_log("Instruction: OrcaWhirlpoolSwap"); + let ix = instruction::OrcaWhirlpoolSwap::deserialize(&mut &ix_data[..]) + .map_err(|_| { + anchor_lang::error::ErrorCode::InstructionDidNotDeserialize + })?; + let instruction::OrcaWhirlpoolSwap { amount, a_to_b } = ix; + let mut __bumps = std::collections::BTreeMap::new(); + let mut __reallocs = std::collections::BTreeSet::new(); + let mut remaining_accounts: &[AccountInfo] = accounts; + let mut accounts = OrcaWhirlpoolSwap::try_accounts( + program_id, + &mut remaining_accounts, + ix_data, + &mut __bumps, + &mut __reallocs, + )?; + let result = swap::orca_whirlpool_swap( + anchor_lang::context::Context::new( + program_id, + &mut accounts, + remaining_accounts, + __bumps, + ), + amount, + a_to_b, + )?; + anchor_lang::solana_program::program::set_return_data( + &result.try_to_vec().unwrap(), + ); + accounts.exit(program_id) + } + } +} +pub mod swap { + use super::*; + pub fn orca_whirlpool_swap<'info>( + ctx: Context<'_, '_, '_, 'info, OrcaWhirlpoolSwap<'info>>, + amount: u64, + a_to_b: bool, + ) -> Result { + orca_whirlpool_swap::handler(ctx, amount, a_to_b) + } +} +/// An Anchor generated module containing the program's set of +/// instructions, where each method handler in the `#[program]` mod is +/// associated with a struct defining the input arguments to the +/// method. These should be used directly, when one wants to serialize +/// Anchor instruction data, for example, when speciying +/// instructions on a client. +pub mod instruction { + use super::*; + /// Instruction struct definitions for `#[state]` methods. + pub mod state { + use super::*; + } + /// Instruction. + pub struct OrcaWhirlpoolSwap { + pub amount: u64, + pub a_to_b: bool, + } + impl borsh::ser::BorshSerialize for OrcaWhirlpoolSwap + where + u64: borsh::ser::BorshSerialize, + bool: borsh::ser::BorshSerialize, + { + fn serialize( + &self, + writer: &mut W, + ) -> ::core::result::Result<(), borsh::maybestd::io::Error> { + borsh::BorshSerialize::serialize(&self.amount, writer)?; + borsh::BorshSerialize::serialize(&self.a_to_b, writer)?; + Ok(()) + } + } + impl borsh::de::BorshDeserialize for OrcaWhirlpoolSwap + where + u64: borsh::BorshDeserialize, + bool: borsh::BorshDeserialize, + { + fn deserialize( + buf: &mut &[u8], + ) -> ::core::result::Result { + Ok(Self { + amount: borsh::BorshDeserialize::deserialize(buf)?, + a_to_b: borsh::BorshDeserialize::deserialize(buf)?, + }) + } + } + impl anchor_lang::Discriminator for OrcaWhirlpoolSwap { + const DISCRIMINATOR: [u8; 8] = [79, 43, 112, 12, 131, 182, 81, 216]; + } + impl anchor_lang::InstructionData for OrcaWhirlpoolSwap {} + impl anchor_lang::Owner for OrcaWhirlpoolSwap { + fn owner() -> Pubkey { + ID + } + } +} +#[cfg(feature = "cpi")] +pub mod cpi { + use super::*; + use std::marker::PhantomData; + pub mod state { + use super::*; + } + pub struct Return { + phantom: std::marker::PhantomData, + } + impl Return { + pub fn get(&self) -> T { + let (_key, data) = anchor_lang::solana_program::program::get_return_data() + .unwrap(); + T::try_from_slice(&data).unwrap() + } + } + pub fn orca_whirlpool_swap<'a, 'b, 'c, 'info>( + ctx: anchor_lang::context::CpiContext< + 'a, + 'b, + 'c, + 'info, + crate::cpi::accounts::OrcaWhirlpoolSwap<'info>, + >, + amount: u64, + a_to_b: bool, + ) -> anchor_lang::Result> { + let ix = { + let ix = instruction::OrcaWhirlpoolSwap { + amount, + a_to_b, + }; + let mut ix_data = AnchorSerialize::try_to_vec(&ix) + .map_err(|_| anchor_lang::error::ErrorCode::InstructionDidNotSerialize)?; + let mut data = [79, 43, 112, 12, 131, 182, 81, 216].to_vec(); + data.append(&mut ix_data); + let accounts = ctx.to_account_metas(None); + anchor_lang::solana_program::instruction::Instruction { + program_id: crate::ID, + accounts, + data, + } + }; + let mut acc_infos = ctx.to_account_infos(); + anchor_lang::solana_program::program::invoke_signed( + &ix, + &acc_infos, + ctx.signer_seeds, + ) + .map_or_else( + |e| Err(Into::into(e)), + |_| { + Ok(crate::cpi::Return:: { + phantom: crate::cpi::PhantomData, + }) + }, + ) + } + /// An Anchor generated module, providing a set of structs + /// mirroring the structs deriving `Accounts`, where each field is + /// an `AccountInfo`. This is useful for CPI. + pub mod accounts { + pub use crate::__cpi_client_accounts_orca_whirlpool_swap::*; + } +} +/// An Anchor generated module, providing a set of structs +/// mirroring the structs deriving `Accounts`, where each field is +/// a `Pubkey`. This is useful for specifying accounts for a client. +pub mod accounts { + pub use crate::__client_accounts_orca_whirlpool_swap::*; +} diff --git a/swap/programs/swap/src/id.rs b/swap/programs/swap/src/id.rs new file mode 100644 index 0000000..a567fcb --- /dev/null +++ b/swap/programs/swap/src/id.rs @@ -0,0 +1,3 @@ +use anchor_lang::prelude::*; + +declare_id!("EhvuQpALKdUiziJcmmioe9QyQwB913nqvNB8rZasA6SA"); diff --git a/swap/programs/swap/src/instructions/mod.rs b/swap/programs/swap/src/instructions/mod.rs new file mode 100644 index 0000000..08e8df4 --- /dev/null +++ b/swap/programs/swap/src/instructions/mod.rs @@ -0,0 +1,3 @@ +pub mod orca_whirlpool_swap; + +pub use orca_whirlpool_swap::*; diff --git a/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs b/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs new file mode 100644 index 0000000..ab16edf --- /dev/null +++ b/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs @@ -0,0 +1,319 @@ +use anchor_lang::solana_program::instruction::Instruction; + +use { + anchor_lang::{prelude::*, solana_program::system_program, InstructionData}, + anchor_spl::token::{transfer, Mint, Token, TokenAccount, Transfer}, + clockwork_sdk::state::{Thread, ThreadAccount, ThreadResponse}, + whirlpool::utils::get_tick_array_pubkeys, +}; + +#[derive(Accounts)] +#[instruction(amount: u64, a_to_b: bool)] +pub struct OrcaWhirlpoolSwap<'info> { + /// CHECK: + pub a_mint: Box>, + + /// CHECK: + pub b_mint: Box>, + + #[account( + mut, + associated_token::mint = a_mint, + associated_token::authority = swap_thread.authority + )] + pub authority_a_vault: Box>, + + #[account( + mut, + associated_token::mint = b_mint, + associated_token::authority = swap_thread.authority + )] + pub authority_b_vault: Box>, + + #[account( + mut, + associated_token::authority = swap_thread, + associated_token::mint = a_mint, + )] + pub swap_thread_a_vault: Box>, + + #[account( + mut, + associated_token::authority = swap_thread, + associated_token::mint = b_mint, + )] + pub swap_thread_b_vault: Box>, + + #[account( + signer, + address = swap_thread.pubkey(), + constraint = swap_thread.authority == authority_a_vault.owner + )] + pub swap_thread: Box>, + + /// CHECK: + pub oracle: AccountInfo<'info>, + + /// CHECK: + pub orca_whirlpool_program: AccountInfo<'info>, + + #[account(address = system_program::ID)] + pub system_program: Program<'info, System>, + + #[account(address = anchor_spl::token::ID)] + pub token_program: Program<'info, Token>, + + /// CHECK: + #[account(mut)] + pub whirlpool: AccountInfo<'info>, + + /// CHECK: + #[account(mut)] + pub whirlpool_token_a_vault: AccountInfo<'info>, + + /// CHECK: + #[account(mut)] + pub whirlpool_token_b_vault: AccountInfo<'info>, +} + +pub fn handler<'info>( + ctx: Context<'_, '_, '_, 'info, OrcaWhirlpoolSwap<'info>>, + amount: u64, + a_to_b: bool, +) -> Result { + // get accounts + let authority_a_vault = &mut ctx.accounts.authority_a_vault; + let authority_b_vault = &mut ctx.accounts.authority_b_vault; + let swap_thread_a_vault = &mut ctx.accounts.swap_thread_a_vault; + let swap_thread_b_vault = &mut ctx.accounts.swap_thread_b_vault; + let swap_thread = &ctx.accounts.swap_thread; + let oracle = &ctx.accounts.oracle; + let orca_whirlpool_program = &ctx.accounts.orca_whirlpool_program; + let token_program = &ctx.accounts.token_program; + let whirlpool = &mut ctx.accounts.whirlpool; + let whirlpool_token_a_vault = &mut ctx.accounts.whirlpool_token_a_vault; + let whirlpool_token_b_vault = &mut ctx.accounts.whirlpool_token_b_vault; + + // get remaining accounts + let tick_array0 = ctx.remaining_accounts.get(0).unwrap(); + let tick_array1 = ctx.remaining_accounts.get(1).unwrap(); + let tick_array2 = ctx.remaining_accounts.get(2).unwrap(); + + let whirlpool_data = whirlpool.try_borrow_data().unwrap().to_owned(); + let whirlpool_state = + whirlpool::state::Whirlpool::try_deserialize(&mut whirlpool_data.as_slice()).unwrap(); + + // get tick array pubkeys + let tick_array_pubkeys = get_tick_array_pubkeys( + whirlpool_state.tick_current_index, + whirlpool_state.tick_spacing, + a_to_b, + &whirlpool::ID, + &whirlpool.key(), + ); + + // transfer swap amount from authority to swap_thread ata + transfer( + CpiContext::new( + token_program.to_account_info(), + Transfer { + from: if a_to_b { + authority_a_vault.to_account_info() + } else { + authority_b_vault.to_account_info() + }, + to: if a_to_b { + swap_thread_a_vault.to_account_info() + } else { + swap_thread_b_vault.to_account_info() + }, + authority: swap_thread.to_account_info(), + }, + ), + amount, + )?; + + whirlpool::cpi::swap( + CpiContext::new( + orca_whirlpool_program.to_account_info(), + whirlpool::cpi::accounts::Swap { + token_program: token_program.to_account_info(), + token_authority: swap_thread.to_account_info(), + whirlpool: whirlpool.to_account_info(), + token_owner_account_a: swap_thread_a_vault.to_account_info(), + token_vault_a: whirlpool_token_a_vault.to_account_info(), + token_owner_account_b: swap_thread_b_vault.to_account_info(), + token_vault_b: whirlpool_token_b_vault.to_account_info(), + tick_array0: tick_array0.to_account_info(), + tick_array1: tick_array1.to_account_info(), + tick_array2: tick_array2.to_account_info(), + oracle: oracle.to_account_info(), + }, + ), + amount, + 0, + whirlpool_state.sqrt_price, + false, + a_to_b, + )?; + + // reload account after swap + if a_to_b { + swap_thread_b_vault.reload()? + } else { + swap_thread_a_vault.reload()? + } + + // settle funds back to user + transfer( + CpiContext::new( + token_program.to_account_info(), + Transfer { + from: if a_to_b { + swap_thread_b_vault.to_account_info() + } else { + swap_thread_a_vault.to_account_info() + }, + to: if a_to_b { + authority_b_vault.to_account_info() + } else { + authority_a_vault.to_account_info() + }, + authority: swap_thread.to_account_info(), + }, + ), + swap_thread_b_vault.amount, + )?; + + Ok(ThreadResponse { + kickoff_instruction: Some( + Instruction { + program_id: crate::ID, + accounts: [ + crate::accounts::OrcaWhirlpoolSwap { + a_mint: ctx.accounts.a_mint.key(), + b_mint: ctx.accounts.b_mint.key(), + authority_a_vault: ctx.accounts.authority_a_vault.key(), + authority_b_vault: ctx.accounts.authority_b_vault.key(), + swap_thread: ctx.accounts.swap_thread.key(), + swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), + swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), + oracle: ctx.accounts.oracle.key(), + system_program: ctx.accounts.system_program.key(), + token_program: ctx.accounts.token_program.key(), + whirlpool: ctx.accounts.whirlpool.key(), + orca_whirlpool_program: whirlpool::ID, + whirlpool_token_a_vault: whirlpool_state.token_vault_a, + whirlpool_token_b_vault: whirlpool_state.token_vault_b, + } + .to_account_metas(Some(true)), + // REMAINING ACCOUNTS + tick_array_pubkeys + .iter() + .map(|pk| AccountMeta::new_readonly(*pk, false)) + .collect::>(), + ] + .concat(), + data: crate::instruction::OrcaWhirlpoolSwap { + amount: 10_000_000_000, + a_to_b: true, + } + .data(), + } + .into(), + ), + next_instruction: None, + }) +} + +// #[inline(always)] +// fn to_account_metas_datas( +// context: &Context, +// ) -> Vec { +// let mut account_metas = Vec::with_capacity(14); +// account_metas.push(AccountMetaData::new_readonly( +// context.accounts.a_mint.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new_readonly( +// context.accounts.b_mint.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new( +// context.accounts.authority_a_vault.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new( +// context.accounts.authority_b_vault.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new( +// context.accounts.swap_thread_a_vault.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new( +// context.accounts.swap_thread_b_vault.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new_readonly( +// context.accounts.swap_thread.key(), +// true, +// )); +// account_metas.push(AccountMetaData::new_readonly( +// context.accounts.oracle.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new_readonly( +// context.accounts.orca_whirlpool_program.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new_readonly( +// context.accounts.system_program.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new_readonly( +// context.accounts.token_program.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new(whirlpool::ID, false)); +// account_metas.push(AccountMetaData::new( +// context.accounts.whirlpool_token_a_vault.key(), +// false, +// )); +// account_metas.push(AccountMetaData::new( +// context.accounts.whirlpool_token_b_vault.key(), +// false, +// )); +// account_metas +// } + +// The sighash of a named instruction in an Anchor program. +// fn anchor_sighash(name: &str, mut data: Vec) -> Vec { +// let preimage = format!("{}:{}", "global", name); +// let mut sighash = [0u8; 8]; +// sighash.copy_from_slice( +// &anchor_lang::solana_program::hash::hash(preimage.as_bytes()).to_bytes()[..8], +// ); +// let mut d = sighash.to_vec(); +// d.append(&mut data); +// d +// } + +// crate::accounts::OrcaWhirlpoolSwap { +// a_mint: ctx.accounts.a_mint.key(), +// b_mint: ctx.accounts.b_mint.key(), +// authority_a_vault: ctx.accounts.authority_a_vault.key(), +// authority_b_vault: ctx.accounts.authority_b_vault.key(), +// swap_thread: ctx.accounts.swap_thread.key(), +// swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), +// swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), +// oracle: ctx.accounts.oracle.key(), +// system_program: ctx.accounts.system_program.key(), +// token_program: ctx.accounts.token_program.key(), +// whirlpool: ctx.accounts.whirlpool.key(), +// orca_whirlpool_program: whirlpool::ID, +// whirlpool_token_a_vault: whirlpool_state.token_vault_a, +// whirlpool_token_b_vault: whirlpool_state.token_vault_b, +// } +// .to_account_metas(Some(true)), +// REMAINING ACCOUNTS diff --git a/swap/programs/swap/src/lib.rs b/swap/programs/swap/src/lib.rs new file mode 100644 index 0000000..98d6715 --- /dev/null +++ b/swap/programs/swap/src/lib.rs @@ -0,0 +1,21 @@ +pub mod id; + +mod instructions; + +pub use id::ID; + +use anchor_lang::prelude::*; +use instructions::*; + +#[program] +pub mod swap { + use super::*; + + pub fn orca_whirlpool_swap<'info>( + ctx: Context<'_, '_, '_, 'info, OrcaWhirlpoolSwap<'info>>, + amount: u64, + a_to_b: bool, + ) -> Result { + orca_whirlpool_swap::handler(ctx, amount, a_to_b) + } +} diff --git a/swap/tests/swap.ts b/swap/tests/swap.ts new file mode 100644 index 0000000..8832abc --- /dev/null +++ b/swap/tests/swap.ts @@ -0,0 +1,16 @@ +import * as anchor from "@project-serum/anchor"; +import { Program } from "@project-serum/anchor"; +import { Swap } from "../target/types/swap"; + +describe("swap", () => { + // Configure the client to use the local cluster. + anchor.setProvider(anchor.AnchorProvider.env()); + + const program = anchor.workspace.Swap as Program; + + it("Is initialized!", async () => { + // Add your test here. + const tx = await program.methods.initialize().rpc(); + console.log("Your transaction signature", tx); + }); +}); diff --git a/swap/tsconfig.json b/swap/tsconfig.json new file mode 100644 index 0000000..cd5d2e3 --- /dev/null +++ b/swap/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": ["mocha", "chai"], + "typeRoots": ["./node_modules/@types"], + "lib": ["es2015"], + "module": "commonjs", + "target": "es6", + "esModuleInterop": true + } +} diff --git a/swap/yarn.lock b/swap/yarn.lock new file mode 100644 index 0000000..425ec0b --- /dev/null +++ b/swap/yarn.lock @@ -0,0 +1,1189 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b" + integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== + dependencies: + regenerator-runtime "^0.13.11" + +"@noble/ed25519@^1.7.0": + version "1.7.3" + resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123" + integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== + +"@noble/hashes@^1.1.2": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + +"@noble/secp256k1@^1.6.3": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + +"@project-serum/anchor@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.25.0.tgz#88ee4843336005cf5a64c80636ce626f0996f503" + integrity sha512-E6A5Y/ijqpfMJ5psJvbw0kVTzLZFUcOFgs6eSM2M2iWE1lVRF18T6hWZVNl6zqZsoz98jgnNHtVGJMs+ds9A7A== + dependencies: + "@project-serum/borsh" "^0.2.5" + "@solana/web3.js" "^1.36.0" + base64-js "^1.5.1" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^5.3.1" + cross-fetch "^3.1.5" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + js-sha256 "^0.9.0" + pako "^2.0.3" + snake-case "^3.0.4" + superstruct "^0.15.4" + toml "^3.0.0" + +"@project-serum/borsh@^0.2.5": + version "0.2.5" + resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.5.tgz#6059287aa624ecebbfc0edd35e4c28ff987d8663" + integrity sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q== + dependencies: + bn.js "^5.1.2" + buffer-layout "^1.2.0" + +"@solana/buffer-layout@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz#b996235eaec15b1e0b5092a8ed6028df77fa6c15" + integrity sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA== + dependencies: + buffer "~6.0.3" + +"@solana/web3.js@^1.36.0": + version "1.73.2" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.73.2.tgz#4b30cd402b35733dae3a7d0b638be26a7742b395" + integrity sha512-9WACF8W4Nstj7xiDw3Oom22QmrhBh0VyZyZ7JvvG3gOxLWLlX3hvm5nPVJOGcCE/9fFavBbCUb5A6CIuvMGdoA== + dependencies: + "@babel/runtime" "^7.12.5" + "@noble/ed25519" "^1.7.0" + "@noble/hashes" "^1.1.2" + "@noble/secp256k1" "^1.6.3" + "@solana/buffer-layout" "^4.0.0" + agentkeepalive "^4.2.1" + bigint-buffer "^1.1.5" + bn.js "^5.0.0" + borsh "^0.7.0" + bs58 "^4.0.1" + buffer "6.0.1" + fast-stable-stringify "^1.0.0" + jayson "^3.4.4" + node-fetch "2" + rpc-websockets "^7.5.0" + superstruct "^0.14.2" + +"@types/bn.js@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + +"@types/chai@^4.3.0": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.4.tgz#e913e8175db8307d78b4e8fa690408ba6b65dee4" + integrity sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw== + +"@types/connect@^3.4.33": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/mocha@^9.0.0": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== + +"@types/node@*": + version "18.13.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.13.0.tgz#0400d1e6ce87e9d3032c19eb6c58205b0d3f7850" + integrity sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg== + +"@types/node@^12.12.54": + version "12.20.55" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" + integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== + +"@types/ws@^7.4.4": + version "7.4.7" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" + integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== + dependencies: + "@types/node" "*" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +agentkeepalive@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717" + integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA== + dependencies: + debug "^4.1.0" + depd "^1.1.2" + humanize-ms "^1.2.1" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1, base64-js@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bigint-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" + integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA== + dependencies: + bindings "^1.3.0" + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bn.js@^5.0.0, bn.js@^5.1.2, bn.js@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +borsh@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" + integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA== + dependencies: + bn.js "^5.2.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +bs58@^4.0.0, bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +buffer-from@^1.0.0, buffer-from@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-layout@^1.2.0, buffer-layout@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" + integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== + +buffer@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" + integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bufferutil@^4.0.1: + version "4.0.7" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" + integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== + dependencies: + node-gyp-build "^4.3.0" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +chai@^4.3.4: + version "4.3.7" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" + integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^4.1.2" + get-func-name "^2.0.0" + loupe "^2.3.1" + pathval "^1.1.1" + type-detect "^4.0.5" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== + +chokidar@3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +cliui@^7.0.2: + version "7.0.4" + 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" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +cross-fetch@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== + dependencies: + node-fetch "2.6.7" + +crypto-hash@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" + integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== + +debug@4.3.3: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + dependencies: + ms "2.1.2" + +debug@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + +delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + +depd@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ== + dependencies: + es6-promise "^4.0.3" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eventemitter3@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +eyes@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ== + +fast-stable-stringify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" + integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag== + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== + dependencies: + ms "^2.0.0" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-binary-path@~2.1.0: + version "2.1.0" + 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" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +jayson@^3.4.4: + version "3.7.0" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.7.0.tgz#b735b12d06d348639ae8230d7a1e2916cb078f25" + integrity sha512-tfy39KJMrrXJ+mFcMpxwBvFDetS8LAID93+rycFglIQM4kl3uNR3W4lBLE/FFhsoUCEox5Dt2adVpDm/XtebbQ== + 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" + lodash "^4.17.20" + uuid "^8.3.2" + ws "^7.4.5" + +js-sha256@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +json5@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.20: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +loupe@^2.3.1: + version "2.3.6" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" + integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== + dependencies: + get-func-name "^2.0.0" + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +minimatch@4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" + integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^3.0.4: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp@^0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mocha@^9.0.3: + version "9.2.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" + integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.3" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "4.2.1" + ms "2.1.3" + nanoid "3.3.1" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.2.0" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.0.0: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" + integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-fetch@2: + version "2.6.9" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" + integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + +node-gyp-build@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" + integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +pako@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +prettier@^2.6.2: + version "2.8.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3" + integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +rpc-websockets@^7.5.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.0.tgz#bbeb87572e66703ff151e50af1658f98098e2748" + integrity sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ== + dependencies: + "@babel/runtime" "^7.17.2" + eventemitter3 "^4.0.7" + uuid "^8.3.2" + ws "^8.5.0" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +source-map-support@^0.5.6: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + 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" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +superstruct@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" + integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== + +superstruct@^0.15.4: + version "0.15.5" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" + integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toml@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +ts-mocha@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-10.0.0.tgz#41a8d099ac90dbbc64b06976c5025ffaebc53cb9" + integrity sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw== + dependencies: + ts-node "7.0.1" + optionalDependencies: + tsconfig-paths "^3.5.0" + +ts-node@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" + integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== + dependencies: + arrify "^1.0.0" + buffer-from "^1.1.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.6" + yn "^2.0.0" + +tsconfig-paths@^3.5.0: + version "3.14.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" + integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.6" + strip-bom "^3.0.0" + +tslib@^2.0.3: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +typescript@^4.3.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +utf-8-validate@^5.0.2: + version "5.0.10" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2" + integrity sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== + dependencies: + node-gyp-build "^4.3.0" + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +workerpool@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" + integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@^7.4.5: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +ws@^8.5.0: + version "8.12.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.12.1.tgz#c51e583d79140b5e42e39be48c934131942d4a8f" + integrity sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" + integrity sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 5d3c304cd0aa20e6bdf4c07b2c9c9f8393af51b1 Mon Sep 17 00:00:00 2001 From: Eliascm17 Date: Thu, 16 Feb 2023 15:02:19 -0700 Subject: [PATCH 2/6] stateless orca whirlpool swap --- .DS_Store | Bin 8196 -> 8196 bytes orca_whirlpool_dca/Cargo.toml | 1 + swap/Cargo.lock | 2663 +++++++++++++++-- swap/Cargo.toml | 9 +- swap/client/src/main.rs | 4 +- swap/crates/whirlpool/Cargo.toml | 3 - swap/programs/swap/Cargo.toml | 4 - swap/programs/swap/expanded.txt | 1681 ----------- .../src/instructions/orca_whirlpool_swap.rs | 113 +- 9 files changed, 2382 insertions(+), 2096 deletions(-) delete mode 100644 swap/programs/swap/expanded.txt diff --git a/.DS_Store b/.DS_Store index 06b06de9fea9a71a467ec38206a93539f845afc5..a75469810aa91b366211edc042b9c8d305203087 100644 GIT binary patch delta 86 zcmZp1XmOa}&&aniU^hP_-{b=V>YI%PF0*p7FcdSCGbAz;Oy&?df#7ZaE~?JBnO)*P IJ{2mA03JsdSO5S3 delta 44 ucmZp1XmOa}&&abeU^hP_&*TFF>YI%PF0*caFDAh_vEk)rc8UKm&NBdJY7q_q diff --git a/orca_whirlpool_dca/Cargo.toml b/orca_whirlpool_dca/Cargo.toml index b5a20f8..9e6eb8c 100644 --- a/orca_whirlpool_dca/Cargo.toml +++ b/orca_whirlpool_dca/Cargo.toml @@ -9,6 +9,7 @@ members = [ overflow-checks = true lto = "fat" codegen-units = 1 + [profile.release.build-override] opt-level = 3 incremental = false diff --git a/swap/Cargo.lock b/swap/Cargo.lock index 6054266..ee05e44 100644 --- a/swap/Cargo.lock +++ b/swap/Cargo.lock @@ -2,6 +2,22 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aead" version = "0.4.3" @@ -58,122 +74,128 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "anchor-attribute-access-control" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", "anyhow", - "proc-macro2", - "quote", + "proc-macro2 1.0.51", + "quote 1.0.23", "regex", - "syn", + "syn 1.0.107", ] [[package]] name = "anchor-attribute-account" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bcd731f21048a032be27c7791701120e44f3f6371358fc4261a7f716283d29" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", "anyhow", "bs58 0.4.0", - "proc-macro2", - "quote", + "proc-macro2 1.0.51", + "quote 1.0.23", "rustversion", - "syn", + "syn 1.0.107", ] [[package]] name = "anchor-attribute-constant" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", - "proc-macro2", - "syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", + "proc-macro2 1.0.51", + "syn 1.0.107", ] [[package]] name = "anchor-attribute-error" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", - "proc-macro2", - "quote", - "syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "anchor-attribute-event" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", "anyhow", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "anchor-attribute-interface" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6700a6f5c888a9c33fe8afc0c64fd8575fa28d05446037306d0f96102ae4480" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", "anyhow", "heck 0.3.3", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "anchor-attribute-program" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", "anyhow", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "anchor-attribute-state" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", "anyhow", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "anchor-derive-accounts" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity)", "anyhow", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -191,7 +213,7 @@ version = "0.3.1" source = "git+https://github.com/eliascm17/anchor-gen#c6a56c18d09c8beafe3745cbc4424bdf1c7d8313" dependencies = [ "anchor-idl", - "syn", + "syn 1.0.107", ] [[package]] @@ -201,7 +223,7 @@ source = "git+https://github.com/eliascm17/anchor-gen#c6a56c18d09c8beafe3745cbc4 dependencies = [ "anchor-idl", "darling", - "syn", + "syn 1.0.107", ] [[package]] @@ -209,20 +231,19 @@ name = "anchor-idl" version = "0.3.1" source = "git+https://github.com/eliascm17/anchor-gen#c6a56c18d09c8beafe3745cbc4424bdf1c7d8313" dependencies = [ - "anchor-syn", + "anchor-syn 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)", "darling", "heck 0.4.1", - "proc-macro2", - "quote", + "proc-macro2 1.0.51", + "quote 1.0.23", "serde_json", - "syn", + "syn 1.0.107", ] [[package]] name = "anchor-lang" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662ceafe667448ee4199a4be2ee83b6bb76da28566eee5cea05f96ab38255af8" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -245,8 +266,7 @@ dependencies = [ [[package]] name = "anchor-spl" version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32390ce8356f54c0f0245ea156f8190717e37285b8bf4f406a613dc4b954cde" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ "anchor-lang", "solana-program", @@ -263,130 +283,148 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2", + "proc-macro2 1.0.51", "proc-macro2-diagnostics", - "quote", + "quote 1.0.23", "serde", "serde_json", "sha2 0.9.9", - "syn", + "syn 1.0.107", "thiserror", ] [[package]] -name = "anyhow" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +name = "anchor-syn" +version = "0.26.0" +source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" +dependencies = [ + "anyhow", + "bs58 0.3.1", + "heck 0.3.3", + "proc-macro2 1.0.51", + "proc-macro2-diagnostics", + "quote 1.0.23", + "serde", + "serde_json", + "sha2 0.9.9", + "syn 1.0.107", + "thiserror", +] [[package]] -name = "ark-bn254" -version = "0.3.0" +name = "android_system_properties" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea691771ebbb28aea556c044e2e5c5227398d840cee0c34d4d20fa8eb2689e8c" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", + "libc", ] [[package]] -name = "ark-ec" -version = "0.3.0" +name = "ansi_term" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", - "derivative", - "num-traits", - "zeroize", + "winapi", ] [[package]] -name = "ark-ff" -version = "0.3.0" +name = "anyhow" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" -dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", - "derivative", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.3.3", - "zeroize", -] +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" [[package]] -name = "ark-ff-asm" -version = "0.3.0" +name = "arrayref" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" -dependencies = [ - "quote", - "syn", -] +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] -name = "ark-ff-macros" -version = "0.3.0" +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "asn1-rs" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +checksum = "cf6690c370453db30743b373a60ba498fc0d6d83b11f4abfd87a84a075db5dd4" dependencies = [ - "num-bigint", + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", "num-traits", - "quote", - "syn", + "rusticata-macros", + "thiserror", + "time 0.3.18", ] [[package]] -name = "ark-serialize" -version = "0.3.0" +name = "asn1-rs-derive" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "ark-std", - "digest 0.9.0", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", + "synstructure", ] [[package]] -name = "ark-std" -version = "0.3.0" +name = "asn1-rs-impl" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "num-traits", - "rand 0.8.5", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] -name = "array-bytes" -version = "1.4.1" +name = "assert_matches" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] -name = "arrayref" -version = "0.3.6" +name = "async-compression" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] [[package]] -name = "arrayvec" -version = "0.7.2" +name = "async-mutex" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] [[package]] -name = "assert_matches" -version = "1.5.0" +name = "async-trait" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] [[package]] name = "atty" @@ -417,6 +455,18 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + [[package]] name = "bincode" version = "1.3.3" @@ -499,8 +549,8 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2", - "syn", + "proc-macro2 1.0.51", + "syn 1.0.107", ] [[package]] @@ -509,9 +559,9 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -520,9 +570,30 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", ] [[package]] @@ -568,9 +639,9 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -579,6 +650,22 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "caps" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" +dependencies = [ + "libc", + "thiserror", +] + [[package]] name = "cc" version = "1.0.79" @@ -600,8 +687,14 @@ version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ + "iana-time-zone", + "js-sys", "num-integer", "num-traits", + "serde", + "time 0.1.45", + "wasm-bindgen", + "winapi", ] [[package]] @@ -623,6 +716,75 @@ dependencies = [ "inout", ] +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "atty", + "bitflags", + "clap_lex", + "indexmap", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap 0.16.0", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clockwork-client" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d8d7ae5aa361c17cb3d58b80f2143bb784031413f6a8f8978903696f5d486" +dependencies = [ + "anchor-lang", + "anchor-spl", + "bincode", + "borsh", + "clockwork-network-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clockwork-thread-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clockwork-utils 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clockwork-webhook-program", + "solana-client", + "solana-sdk", + "spl-associated-token-account", + "thiserror", +] + +[[package]] +name = "clockwork-cron" +version = "1.4.2" +dependencies = [ + "chrono", + "nom", + "once_cell", +] + [[package]] name = "clockwork-cron" version = "1.4.2" @@ -634,6 +796,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "clockwork-network-program" +version = "1.4.2" +dependencies = [ + "anchor-lang", + "anchor-spl", + "clockwork-utils 1.4.2", +] + [[package]] name = "clockwork-network-program" version = "1.4.2" @@ -642,22 +813,33 @@ checksum = "358aa1fb9a328d355cababfabb5ca69134a8bc703d355fe2979442441e30d6b7" dependencies = [ "anchor-lang", "anchor-spl", - "clockwork-utils", + "clockwork-utils 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "clockwork-sdk" version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7179555c8031a72efc4018a5120280076e4bbe640b9d063615353c3393f6787f" dependencies = [ "anchor-lang", "chrono", - "clockwork-thread-program", + "clockwork-thread-program 1.4.2", "nom", "once_cell", ] +[[package]] +name = "clockwork-thread-program" +version = "1.4.2" +dependencies = [ + "anchor-lang", + "chrono", + "clockwork-cron 1.4.2", + "clockwork-network-program 1.4.2", + "clockwork-utils 1.4.2", + "static-pubkey", + "version", +] + [[package]] name = "clockwork-thread-program" version = "1.4.2" @@ -666,13 +848,22 @@ checksum = "00d8201d1680a1540e157a0a9f3cb84d9cc9a25ad66fcb9328c6f94b2fe14175" dependencies = [ "anchor-lang", "chrono", - "clockwork-cron", - "clockwork-network-program", - "clockwork-utils", + "clockwork-cron 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clockwork-network-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clockwork-utils 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "static-pubkey", "version", ] +[[package]] +name = "clockwork-utils" +version = "1.4.2" +dependencies = [ + "anchor-lang", + "base64 0.13.1", + "static-pubkey", +] + [[package]] name = "clockwork-utils" version = "1.4.2" @@ -684,6 +875,39 @@ dependencies = [ "static-pubkey", ] +[[package]] +name = "clockwork-webhook-program" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f198bfb4e8e6fb1d7320d65fd603d0a41045cf31d8e8261f0b4a3d5cedf39" +dependencies = [ + "anchor-lang", + "clockwork-network-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "console" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.42.0", +] + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -704,12 +928,34 @@ dependencies = [ "web-sys", ] +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + [[package]] name = "constant_time_eq" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + [[package]] name = "cpufeatures" version = "0.2.5" @@ -719,6 +965,15 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -812,7 +1067,51 @@ dependencies = [ ] [[package]] -name = "darling" +name = "cxx" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2 1.0.51", + "quote 1.0.23", + "scratch", + "syn 1.0.107", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "darling" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" @@ -829,10 +1128,10 @@ checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" dependencies = [ "fnv", "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "strsim 0.10.0", + "syn 1.0.107", ] [[package]] @@ -842,8 +1141,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", - "quote", - "syn", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "data-encoding" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "der-parser" +version = "8.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint 0.4.3", + "num-traits", + "rusticata-macros", ] [[package]] @@ -853,14 +1181,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" [[package]] -name = "derivative" -version = "2.2.0" +name = "dialoguer" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "af3c796f3b0b408d9fd581611b47fa850821fcb84aa640b83a3c1a5be2d691f2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "console", + "shell-words", + "tempfile", + "zeroize", ] [[package]] @@ -883,6 +1212,67 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "dlopen" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +dependencies = [ + "dlopen_derive", + "lazy_static", + "libc", + "winapi", +] + +[[package]] +name = "dlopen_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +dependencies = [ + "libc", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "eager" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" + [[package]] name = "ed25519" version = "1.5.3" @@ -924,6 +1314,53 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-iterator" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2953d1df47ac0eb70086ccabf0275aa8da8591a28bd358ee2b52bd9f9e3ff9e9" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "enum_dispatch" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f36e95862220b211a6e2aa5eca09b4fa391b13cd52ceb8035a24bf65a79de2" +dependencies = [ + "once_cell", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "env_logger" version = "0.9.3" @@ -937,18 +1374,150 @@ dependencies = [ "termcolor", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "feature-probe" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" + +[[package]] +name = "futures-executor" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" + +[[package]] +name = "futures-macro" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "futures-sink" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" + +[[package]] +name = "futures-task" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" + +[[package]] +name = "futures-util" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.6" @@ -960,6 +1529,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -986,6 +1565,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -1037,6 +1635,12 @@ dependencies = [ "libc", ] +[[package]] +name = "histogram" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" + [[package]] name = "hmac" version = "0.8.1" @@ -1067,18 +1671,123 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[package]] +name = "hyper" +version = "0.14.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "im" version = "15.1.0" @@ -1105,6 +1814,18 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indicatif" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +dependencies = [ + "console", + "lazy_static", + "number_prefix", + "regex", +] + [[package]] name = "inout" version = "0.1.3" @@ -1114,6 +1835,21 @@ dependencies = [ "generic-array", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" + [[package]] name = "itertools" version = "0.10.5" @@ -1148,8 +1884,23 @@ dependencies = [ ] [[package]] -name = "keccak" -version = "0.1.3" +name = "jsonrpc-core" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +dependencies = [ + "futures", + "futures-executor", + "futures-util", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "keccak" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" dependencies = [ @@ -1168,6 +1919,16 @@ version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "libsecp256k1" version = "0.6.0" @@ -1216,6 +1977,21 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "lock_api" version = "0.4.9" @@ -1252,18 +2028,18 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.7.1" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg", ] [[package]] name = "memoffset" -version = "0.8.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] @@ -1280,12 +2056,51 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + [[package]] name = "nom" version = "7.1.3" @@ -1305,6 +2120,31 @@ dependencies = [ "memchr", ] +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.3" @@ -1316,15 +2156,25 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + [[package]] name = "num-derive" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -1337,6 +2187,29 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint 0.2.6", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -1372,9 +2245,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e" dependencies = [ "proc-macro-crate 1.3.0", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", ] [[package]] @@ -1389,6 +2277,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + [[package]] name = "parking_lot" version = "0.12.1" @@ -1409,15 +2309,9 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - [[package]] name = "pbkdf2" version = "0.4.0" @@ -1436,6 +2330,15 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + [[package]] name = "percent-encoding" version = "2.2.0" @@ -1443,15 +2346,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] -name = "pest" -version = "2.5.5" +name = "percentage" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +dependencies = [ + "num", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" dependencies = [ - "thiserror", - "ucd-trie", + "der", + "spki", + "zeroize", ] +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + [[package]] name = "polyval" version = "0.5.3" @@ -1489,6 +2420,15 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + [[package]] name = "proc-macro2" version = "1.0.51" @@ -1504,9 +2444,9 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", "version_check", "yansi", ] @@ -1520,13 +2460,75 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "quinn" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b435e71d9bfa0d8889927231970c51fb89c58fa63bffcab117c9c7a41e5ef8f" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "fxhash", + "quinn-proto", + "quinn-udp", + "rustls", + "thiserror", + "tokio", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-proto" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fce546b9688f767a57530652488420d419a8b1f44a478b451c3d1ab6d992a55" +dependencies = [ + "bytes", + "fxhash", + "rand 0.8.5", + "ring", + "rustls", + "rustls-native-certs", + "rustls-pemfile 0.2.1", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-udp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07946277141531aea269befd949ed16b2c85a780ba1043244eda0969e538e54" +dependencies = [ + "futures-util", + "libc", + "quinn-proto", + "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + [[package]] name = "quote" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.51", ] [[package]] @@ -1548,6 +2550,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ + "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", ] @@ -1630,6 +2633,18 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring", + "time 0.3.18", + "yasna", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -1639,6 +2654,17 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.8", + "redox_syscall", + "thiserror", +] + [[package]] name = "regex" version = "1.7.1" @@ -1657,82 +2683,231 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.3.3" +name = "remove_dir_all" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "semver 0.11.0", + "winapi", ] [[package]] -name = "rustc_version" -version = "0.4.0" +name = "reqwest" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" dependencies = [ - "semver 1.0.16", + "async-compression", + "base64 0.21.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile 1.0.2", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", ] [[package]] -name = "rustversion" -version = "1.0.11" +name = "ring" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] [[package]] -name = "ryu" -version = "1.0.12" +name = "rpassword" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" +dependencies = [ + "libc", + "serde", + "serde_json", + "winapi", +] [[package]] -name = "scopeguard" +name = "rustc-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "semver" -version = "0.11.0" +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver-parser", + "semver", ] [[package]] -name = "semver" -version = "1.0.16" +name = "rusticata-macros" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] [[package]] -name = "semver-parser" -version = "0.10.2" +name = "rustls" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ - "pest", + "log", + "ring", + "sct", + "webpki", ] [[package]] -name = "serde" -version = "1.0.152" +name = "rustls-native-certs" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ - "serde_derive", + "openssl-probe", + "rustls-pemfile 1.0.2", + "schannel", + "security-framework", ] [[package]] -name = "serde_bytes" +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", +] + +[[package]] +name = "rustversion" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" + +[[package]] +name = "serde" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" @@ -1746,9 +2921,9 @@ version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -1763,25 +2938,38 @@ dependencies = [ ] [[package]] -name = "serde_with" -version = "2.2.0" +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d904179146de381af4c93d3af6ca4984b3152db687dacb9c3c35e86f39809c" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ + "form_urlencoded", + "itoa", + "ryu", "serde", - "serde_with_macros", ] [[package]] -name = "serde_with_macros" -version = "2.2.0" +name = "serde_yaml" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", + "indexmap", + "ryu", + "serde", + "yaml-rust", +] + +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", ] [[package]] @@ -1830,6 +3018,21 @@ dependencies = [ "keccak", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "1.6.4" @@ -1846,17 +3049,208 @@ dependencies = [ "typenum", ] +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "solana-account-decoder" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b34f8342ffa6180a3368e51b933abf0ef09dc8333b4a41b76bb3085e530608c" +dependencies = [ + "Inflector", + "base64 0.13.1", + "bincode", + "bs58 0.4.0", + "bv", + "lazy_static", + "serde", + "serde_derive", + "serde_json", + "solana-address-lookup-table-program", + "solana-config-program", + "solana-sdk", + "solana-vote-program", + "spl-token", + "spl-token-2022", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-address-lookup-table-program" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15112ecf013f15e53d5a50fd413f93b47343a5b911f96ee143ffab2f497eff66" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-clap-utils" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "223a78a2945a50fc49ce4ec58e079aa6c2f33fdf29387bffab224a9f51908714" +dependencies = [ + "chrono", + "clap 2.34.0", + "rpassword", + "solana-perf", + "solana-remote-wallet", + "solana-sdk", + "thiserror", + "tiny-bip39", + "uriparse", + "url", +] + +[[package]] +name = "solana-cli-config" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917eb35225a067b87ab797f454e553aea34dcc4ed495b1e9413a5a7de35194a0" +dependencies = [ + "dirs-next", + "lazy_static", + "serde", + "serde_derive", + "serde_yaml", + "solana-clap-utils", + "solana-sdk", + "url", +] + +[[package]] +name = "solana-client" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a396056359554ef0882be7f9cf4eb6942df761055cd8f7771a04bcd78e40fe" +dependencies = [ + "async-mutex", + "async-trait", + "base64 0.13.1", + "bincode", + "bs58 0.4.0", + "bytes", + "clap 2.34.0", + "crossbeam-channel", + "enum_dispatch", + "futures", + "futures-util", + "indexmap", + "indicatif", + "itertools", + "jsonrpc-core", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rayon", + "reqwest", + "rustls", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-clap-utils", + "solana-faucet", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "spl-token-2022", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-config-program" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388bc028b037da5752bd2e6910afe8007232ddc58eb2c7a2523f1c6d818abe90" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-faucet" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91a52f211164c9403c1ea11318b388d8d4bcfe3a886f7f70f695ade5409e359f" +dependencies = [ + "bincode", + "byteorder", + "clap 2.34.0", + "crossbeam-channel", + "log", + "serde", + "serde_derive", + "solana-clap-utils", + "solana-cli-config", + "solana-logger", + "solana-metrics", + "solana-sdk", + "solana-version", + "spl-memo", + "thiserror", + "tokio", +] + [[package]] name = "solana-frozen-abi" -version = "1.15.2" +version = "1.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f7051cccdf891ac2603cdd295eb651529fe2b678b6b3af60b82dec9a9b3b06" +checksum = "f651fd3d06d9aa6c66d2ceb7230278ddad59403dc1cc4abf82a69970dc6f631d" dependencies = [ "ahash", "blake3", @@ -1875,7 +3269,7 @@ dependencies = [ "memmap2", "once_cell", "rand_core 0.6.4", - "rustc_version 0.4.0", + "rustc_version", "serde", "serde_bytes", "serde_derive", @@ -1888,37 +3282,106 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.15.2" +version = "1.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06395428329810ade1d2518a7e75d8a6f02d01fe548aabb60ff1ba6a2eaebbe5" +checksum = "301bb4bd66f592d4b799db0fb0ed1ae9fc7a8453476961faef1223127091574b" dependencies = [ - "proc-macro2", - "quote", - "rustc_version 0.4.0", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "rustc_version", + "syn 1.0.107", ] [[package]] name = "solana-logger" -version = "1.15.2" +version = "1.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170714ca3612e4df75f57c2c14c8ab74654b3b66f668986aeed456cedcf24446" +checksum = "305cf85e48a7660df7a483762dcf7989d4b3f6e3de2153f2f9f98ba3785a0bd6" dependencies = [ "env_logger", "lazy_static", "log", ] +[[package]] +name = "solana-measure" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a19c00ebaf498911266b63bc55f78916bf3c6fe236316af8144e024df14c6d7" +dependencies = [ + "log", + "solana-sdk", +] + +[[package]] +name = "solana-metrics" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2dbc83864877ece6f686ba04e1230fc933916ca21bbf3aff9aac393918a3c63" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log", + "reqwest", + "solana-sdk", +] + +[[package]] +name = "solana-net-utils" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daaace80b5fe18adf86447cbe53f4a8424fa1be5d6f49ed816efd32769221c84" +dependencies = [ + "bincode", + "clap 3.2.23", + "crossbeam-channel", + "log", + "nix", + "rand 0.7.3", + "serde", + "serde_derive", + "socket2", + "solana-logger", + "solana-sdk", + "solana-version", + "tokio", + "url", +] + +[[package]] +name = "solana-perf" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3259b43ea1f93f825176bf1310ba7ace17541e0aae4c9167986a92d903ef92eb" +dependencies = [ + "ahash", + "bincode", + "bv", + "caps", + "curve25519-dalek", + "dlopen", + "dlopen_derive", + "fnv", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.7.3", + "rayon", + "serde", + "solana-metrics", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-vote-program", +] + [[package]] name = "solana-program" -version = "1.15.2" +version = "1.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ae9f0fa7db3a4e90fa0df2723ac8cbc042e579cf109cd0380bc5a8c88bed924" +checksum = "e5a52d34820e44c56a23ef540a9c996873885c4834e7e36bc5901990c675603c" dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff", - "array-bytes", "base64 0.13.1", "bincode", "bitflags", @@ -1939,14 +3402,13 @@ dependencies = [ "libc", "libsecp256k1", "log", - "memoffset 0.8.0", - "num-bigint", + "memoffset 0.6.5", "num-derive", "num-traits", "parking_lot", "rand 0.7.3", "rand_chacha 0.2.2", - "rustc_version 0.4.0", + "rustc_version", "rustversion", "serde", "serde_bytes", @@ -1963,11 +3425,67 @@ dependencies = [ "zeroize", ] +[[package]] +name = "solana-program-runtime" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bc5a5da86d34d458ce0fd67992f1a82b15b775b7c38e791e8a17ec3a08803ac" +dependencies = [ + "base64 0.13.1", + "bincode", + "eager", + "enum-iterator", + "itertools", + "libc", + "libloading", + "log", + "num-derive", + "num-traits", + "rand 0.7.3", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-rayon-threadlimit" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ca466115ea5d65863c8ce717efde714308dd60931244ea42ba394fac471a7c" +dependencies = [ + "lazy_static", + "num_cpus", +] + +[[package]] +name = "solana-remote-wallet" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0bdffc62c46598a541fab68355e313b5bae3429bcd4910761f4f6f63b849f5" +dependencies = [ + "console", + "dialoguer", + "log", + "num-derive", + "num-traits", + "parking_lot", + "qstring", + "semver", + "solana-sdk", + "thiserror", + "uriparse", +] + [[package]] name = "solana-sdk" -version = "1.15.2" +version = "1.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbefda9f9bda78fd9d91ae21c38d9693e94d5979838fb69b70c6addb8dab953f" +checksum = "f9ac3ab8b970c3e4c07d0c2b184a0be449075e933c81f0e27cd9fcab2b122020" dependencies = [ "assert_matches", "base64 0.13.1", @@ -1992,18 +3510,16 @@ dependencies = [ "memmap2", "num-derive", "num-traits", - "num_enum", "pbkdf2 0.11.0", "qstring", "rand 0.7.3", "rand_chacha 0.2.2", - "rustc_version 0.4.0", + "rustc_version", "rustversion", "serde", "serde_bytes", "serde_derive", "serde_json", - "serde_with", "sha2 0.10.6", "sha3 0.10.6", "solana-frozen-abi", @@ -2018,22 +3534,117 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.15.2" +version = "1.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f809319358d5da7c3a0ac08ebf4d87b21170d928dbb7260254e8f3061f7f9e0e" +checksum = "6a7f28d94a4ed37c6eb7c62221da0e2206f11af051e91c045f2cce60111d3020" dependencies = [ "bs58 0.4.0", - "proc-macro2", - "quote", + "proc-macro2 1.0.51", + "quote 1.0.23", "rustversion", - "syn", + "syn 1.0.107", +] + +[[package]] +name = "solana-streamer" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc73adca6270314a92480d944d991f3697b4bd66322ea39233ee5102a7a6760" +dependencies = [ + "crossbeam-channel", + "futures-util", + "histogram", + "indexmap", + "itertools", + "libc", + "log", + "nix", + "pem", + "percentage", + "pkcs8", + "quinn", + "rand 0.7.3", + "rcgen", + "rustls", + "solana-metrics", + "solana-perf", + "solana-sdk", + "thiserror", + "tokio", + "x509-parser", +] + +[[package]] +name = "solana-transaction-status" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c614df6e742e7be647b05775b3a0414fc0570f009e180d86554b3d6797f77e" +dependencies = [ + "Inflector", + "base64 0.13.1", + "bincode", + "borsh", + "bs58 0.4.0", + "lazy_static", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-address-lookup-table-program", + "solana-measure", + "solana-metrics", + "solana-sdk", + "solana-vote-program", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "solana-version" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "359aecee536123048ae876b938688b4a87fa879bd1e8e752406f871656b98153" +dependencies = [ + "log", + "rustc_version", + "semver", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", +] + +[[package]] +name = "solana-vote-program" +version = "1.14.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68586a5b4862cd840a4e3e17d8428714a0f01757e5221b1d6ac1dd3ba2237b9b" +dependencies = [ + "bincode", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-program-runtime", + "solana-sdk", + "thiserror", ] [[package]] name = "solana-zk-token-sdk" -version = "1.15.2" +version = "1.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a290aa32014e007b03f952d5b784433d95636c65a3fb08d19dc5658a450941c" +checksum = "1b25e1c3a45dfb9e4307cd5f655e0fb2efc64eb5011e517a8f6abc9c88c44566" dependencies = [ "aes-gcm-siv", "arrayref", @@ -2060,6 +3671,22 @@ dependencies = [ "zeroize", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "spl-associated-token-account" version = "1.1.2" @@ -2118,6 +3745,21 @@ dependencies = [ "thiserror", ] +[[package]] +name = "stateless-swap-client" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "anchor-spl", + "bytemuck", + "clockwork-client", + "solana-cli-config", + "solana-sdk", + "spl-associated-token-account", + "swap", + "whirlpool", +] + [[package]] name = "static-pubkey" version = "1.0.3" @@ -2125,11 +3767,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0547d5945c93f55e1b18bf2a67d1a3d0548561f2687645b22c1c1d4fbb9a8e90" dependencies = [ "bs58 0.4.0", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", ] +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + [[package]] name = "strsim" version = "0.10.0" @@ -2152,14 +3800,25 @@ dependencies = [ "whirlpool", ] +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + [[package]] name = "syn" version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.51", + "quote 1.0.23", "unicode-ident", ] @@ -2169,10 +3828,24 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", + "unicode-xid 0.2.4", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", ] [[package]] @@ -2184,6 +3857,21 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + [[package]] name = "thiserror" version = "1.0.38" @@ -2199,9 +3887,47 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af0097eaf301d576d0b2aead7a59facab6d53cc636340f0291fab8446a2e8613" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", ] [[package]] @@ -2238,6 +3964,89 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.42.0", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-stream" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki", + "webpki-roots", +] + +[[package]] +name = "tokio-util" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "toml" version = "0.5.11" @@ -2264,6 +4073,72 @@ dependencies = [ "toml_datetime", ] +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "tungstenite" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls", + "sha-1", + "thiserror", + "url", + "utf-8", + "webpki", + "webpki-roots", +] + [[package]] name = "typenum" version = "1.16.0" @@ -2271,10 +4146,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] -name = "ucd-trie" -version = "0.1.5" +name = "unicode-bidi" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" @@ -2297,6 +4172,18 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -2313,6 +4200,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "uriparse" version = "0.6.4" @@ -2323,6 +4216,29 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version" version = "3.0.0" @@ -2335,12 +4251,28 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2366,19 +4298,31 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ - "quote", + "quote 1.0.23", "wasm-bindgen-macro-support", ] @@ -2388,9 +4332,9 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2411,6 +4355,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "whirlpool" version = "0.1.0" @@ -2450,6 +4413,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -2516,12 +4494,57 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64 0.13.1", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time 0.3.18", +] + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "yansi" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yasna" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +dependencies = [ + "time 0.3.18", +] + [[package]] name = "zeroize" version = "1.3.0" @@ -2537,8 +4560,42 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", "synstructure", ] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.7+zstd.1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[patch.unused]] +name = "anchor-gen" +version = "0.3.1" diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 425bde6..b97b463 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -2,14 +2,21 @@ members = [ "programs/*", "crates/*", - # "client" + "client" ] [profile.release] overflow-checks = true lto = "fat" codegen-units = 1 + [profile.release.build-override] opt-level = 3 incremental = false codegen-units = 1 + +[patch.crates-io] +anchor-lang = { git = "https://github.com/Eliascm17/anchor", branch = "macros-with-capacity" } +anchor-spl = { git = "https://github.com/Eliascm17/anchor", branch = "macros-with-capacity" } +anchor-gen = { path = "/Users/eliasmoreno/work/Eliascm17/anchor-gen/crates/anchor-gen", features = ["compat-program-result"] } +clockwork-sdk = { path = "/Users/eliasmoreno/work/clockwork-xyz/clockwork/sdk" } diff --git a/swap/client/src/main.rs b/swap/client/src/main.rs index 910213e..f5d1dfd 100644 --- a/swap/client/src/main.rs +++ b/swap/client/src/main.rs @@ -111,8 +111,8 @@ fn dca_create( whirlpool::state::Whirlpool::try_deserialize(&mut whirlpool_data).unwrap(); let orca_whirlpool_swap_data = swap::instruction::OrcaWhirlpoolSwap { - amount: 10_000_000_000, - a_to_b: true, + amount: 100000, + a_to_b: false, }; let tick_array = get_tick_array_pubkeys( diff --git a/swap/crates/whirlpool/Cargo.toml b/swap/crates/whirlpool/Cargo.toml index 1702581..d8f518b 100644 --- a/swap/crates/whirlpool/Cargo.toml +++ b/swap/crates/whirlpool/Cargo.toml @@ -11,8 +11,5 @@ no-log-ix-name = [] cpi = ["no-entrypoint"] [dependencies] -# anchor-lang = { path = "/Users/eliasmoreno/work/Eliascm17/anchor/lang" } anchor-lang = "0.26.0" -# anchor-gen = { path = "/Users/eliasmoreno/work/Eliascm17/anchor-gen/crates/anchor-gen", features = ["compat-program-result"] } -# bytemuck = "1.13.0" anchor-gen = { git = "https://github.com/eliascm17/anchor-gen", version = "^0.3.1", features = ["compat-program-result"] } diff --git a/swap/programs/swap/Cargo.toml b/swap/programs/swap/Cargo.toml index 696c6f9..2a2bfd7 100644 --- a/swap/programs/swap/Cargo.toml +++ b/swap/programs/swap/Cargo.toml @@ -17,10 +17,6 @@ default = [] [dependencies] anchor-lang = "0.26.0" -# anchor-lang = { git = "https://github.com/eliascm17/anchor", version = "0.26.0" } -# anchor-lang = { path = "../../../../../Eliascm17/anchor/lang" } -# anchor-spl = { path = "../../../../../Eliascm17/anchor/spl" } anchor-spl = "0.26.0" -# clockwork-sdk = { path = "/Users/eliasmoreno/work/clockwork-xyz/clockwork/sdk" } clockwork-sdk = "1.4.2" whirlpool = { path = "../../crates/whirlpool" } diff --git a/swap/programs/swap/expanded.txt b/swap/programs/swap/expanded.txt deleted file mode 100644 index 706750f..0000000 --- a/swap/programs/swap/expanded.txt +++ /dev/null @@ -1,1681 +0,0 @@ -#![feature(prelude_import)] -#[prelude_import] -use std::prelude::rust_2021::*; -#[macro_use] -extern crate std; -pub mod id { - use anchor_lang::prelude::*; - /// The static program ID - pub static ID: anchor_lang::solana_program::pubkey::Pubkey = anchor_lang::solana_program::pubkey::Pubkey::new_from_array([ - 203u8, - 164u8, - 28u8, - 135u8, - 0u8, - 1u8, - 232u8, - 149u8, - 203u8, - 191u8, - 21u8, - 105u8, - 222u8, - 161u8, - 224u8, - 212u8, - 2u8, - 117u8, - 139u8, - 164u8, - 173u8, - 157u8, - 1u8, - 135u8, - 10u8, - 213u8, - 82u8, - 19u8, - 233u8, - 239u8, - 187u8, - 15u8, - ]); - /// Confirms that a given pubkey is equivalent to the program ID - pub fn check_id(id: &anchor_lang::solana_program::pubkey::Pubkey) -> bool { - id == &ID - } - /// Returns the program ID - pub fn id() -> anchor_lang::solana_program::pubkey::Pubkey { - ID - } -} -mod instructions { - pub mod orca_whirlpool_swap { - use { - anchor_lang::{prelude::*, solana_program::system_program, InstructionData}, - anchor_spl::token::{transfer, Mint, Token, TokenAccount, Transfer}, - clockwork_sdk::state::{Thread, ThreadAccount, ThreadResponse}, - whirlpool::utils::get_tick_array_pubkeys, - }; - #[instruction(amount:u64, a_to_b:bool)] - pub struct OrcaWhirlpoolSwap<'info> { - /// CHECK: - pub a_mint: Box>, - /// CHECK: - pub b_mint: Box>, - #[account( - mut, - associated_token::mint = a_mint, - associated_token::authority = swap_thread.authority - )] - pub authority_a_vault: Box>, - #[account( - mut, - associated_token::mint = b_mint, - associated_token::authority = swap_thread.authority - )] - pub authority_b_vault: Box>, - #[account( - mut, - associated_token::authority = swap_thread, - associated_token::mint = a_mint, - )] - pub swap_thread_a_vault: Box>, - #[account( - mut, - associated_token::authority = swap_thread, - associated_token::mint = b_mint, - )] - pub swap_thread_b_vault: Box>, - #[account( - signer, - address = swap_thread.pubkey(), - constraint = swap_thread.authority = = authority_a_vault.owner - )] - pub swap_thread: Box>, - /// CHECK: - pub oracle: AccountInfo<'info>, - /// CHECK: - pub orca_whirlpool_program: AccountInfo<'info>, - #[account(address = system_program::ID)] - pub system_program: Program<'info, System>, - #[account(address = anchor_spl::token::ID)] - pub token_program: Program<'info, Token>, - /// CHECK: - #[account(mut)] - pub whirlpool: AccountInfo<'info>, - /// CHECK: - #[account(mut)] - pub whirlpool_token_a_vault: AccountInfo<'info>, - /// CHECK: - #[account(mut)] - pub whirlpool_token_b_vault: AccountInfo<'info>, - } - #[automatically_derived] - impl<'info> anchor_lang::Accounts<'info> for OrcaWhirlpoolSwap<'info> - where - 'info: 'info, - { - #[inline(never)] - fn try_accounts( - program_id: &anchor_lang::solana_program::pubkey::Pubkey, - accounts: &mut &[anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >], - ix_data: &[u8], - __bumps: &mut std::collections::BTreeMap, - __reallocs: &mut std::collections::BTreeSet< - anchor_lang::solana_program::pubkey::Pubkey, - >, - ) -> anchor_lang::Result { - let mut ix_data = ix_data; - struct __Args { - amount: u64, - a_to_b: bool, - } - impl borsh::ser::BorshSerialize for __Args - where - u64: borsh::ser::BorshSerialize, - bool: borsh::ser::BorshSerialize, - { - fn serialize( - &self, - writer: &mut W, - ) -> ::core::result::Result<(), borsh::maybestd::io::Error> { - borsh::BorshSerialize::serialize(&self.amount, writer)?; - borsh::BorshSerialize::serialize(&self.a_to_b, writer)?; - Ok(()) - } - } - impl borsh::de::BorshDeserialize for __Args - where - u64: borsh::BorshDeserialize, - bool: borsh::BorshDeserialize, - { - fn deserialize( - buf: &mut &[u8], - ) -> ::core::result::Result { - Ok(Self { - amount: borsh::BorshDeserialize::deserialize(buf)?, - a_to_b: borsh::BorshDeserialize::deserialize(buf)?, - }) - } - } - let __Args { amount, a_to_b } = __Args::deserialize(&mut ix_data) - .map_err(|_| { - anchor_lang::error::ErrorCode::InstructionDidNotDeserialize - })?; - let a_mint: Box> = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("a_mint"))?; - let b_mint: Box> = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("b_mint"))?; - let authority_a_vault: Box< - anchor_lang::accounts::account::Account, - > = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("authority_a_vault"))?; - let authority_b_vault: Box< - anchor_lang::accounts::account::Account, - > = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("authority_b_vault"))?; - let swap_thread_a_vault: Box< - anchor_lang::accounts::account::Account, - > = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("swap_thread_a_vault"))?; - let swap_thread_b_vault: Box< - anchor_lang::accounts::account::Account, - > = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("swap_thread_b_vault"))?; - let swap_thread: Box> = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("swap_thread"))?; - let oracle: AccountInfo = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("oracle"))?; - let orca_whirlpool_program: AccountInfo = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("orca_whirlpool_program"))?; - let system_program: anchor_lang::accounts::program::Program = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("system_program"))?; - let token_program: anchor_lang::accounts::program::Program = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("token_program"))?; - let whirlpool: AccountInfo = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("whirlpool"))?; - let whirlpool_token_a_vault: AccountInfo = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("whirlpool_token_a_vault"))?; - let whirlpool_token_b_vault: AccountInfo = anchor_lang::Accounts::try_accounts( - program_id, - accounts, - ix_data, - __bumps, - __reallocs, - ) - .map_err(|e| e.with_account_name("whirlpool_token_b_vault"))?; - { - let my_owner = authority_a_vault.owner; - let wallet_address = swap_thread.authority.key(); - if my_owner != wallet_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintTokenOwner, - ) - .with_account_name("authority_a_vault") - .with_pubkeys((my_owner, wallet_address)), - ); - } - let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( - &wallet_address, - &a_mint.key(), - ); - let my_key = authority_a_vault.key(); - if my_key != __associated_token_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintAssociated, - ) - .with_account_name("authority_a_vault") - .with_pubkeys((my_key, __associated_token_address)), - ); - } - } - if !authority_a_vault.to_account_info().is_writable { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintMut, - ) - .with_account_name("authority_a_vault"), - ); - } - { - let my_owner = authority_b_vault.owner; - let wallet_address = swap_thread.authority.key(); - if my_owner != wallet_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintTokenOwner, - ) - .with_account_name("authority_b_vault") - .with_pubkeys((my_owner, wallet_address)), - ); - } - let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( - &wallet_address, - &b_mint.key(), - ); - let my_key = authority_b_vault.key(); - if my_key != __associated_token_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintAssociated, - ) - .with_account_name("authority_b_vault") - .with_pubkeys((my_key, __associated_token_address)), - ); - } - } - if !authority_b_vault.to_account_info().is_writable { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintMut, - ) - .with_account_name("authority_b_vault"), - ); - } - { - let my_owner = swap_thread_a_vault.owner; - let wallet_address = swap_thread.key(); - if my_owner != wallet_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintTokenOwner, - ) - .with_account_name("swap_thread_a_vault") - .with_pubkeys((my_owner, wallet_address)), - ); - } - let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( - &wallet_address, - &a_mint.key(), - ); - let my_key = swap_thread_a_vault.key(); - if my_key != __associated_token_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintAssociated, - ) - .with_account_name("swap_thread_a_vault") - .with_pubkeys((my_key, __associated_token_address)), - ); - } - } - if !swap_thread_a_vault.to_account_info().is_writable { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintMut, - ) - .with_account_name("swap_thread_a_vault"), - ); - } - { - let my_owner = swap_thread_b_vault.owner; - let wallet_address = swap_thread.key(); - if my_owner != wallet_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintTokenOwner, - ) - .with_account_name("swap_thread_b_vault") - .with_pubkeys((my_owner, wallet_address)), - ); - } - let __associated_token_address = anchor_spl::associated_token::get_associated_token_address( - &wallet_address, - &b_mint.key(), - ); - let my_key = swap_thread_b_vault.key(); - if my_key != __associated_token_address { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintAssociated, - ) - .with_account_name("swap_thread_b_vault") - .with_pubkeys((my_key, __associated_token_address)), - ); - } - } - if !swap_thread_b_vault.to_account_info().is_writable { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintMut, - ) - .with_account_name("swap_thread_b_vault"), - ); - } - if !swap_thread.to_account_info().is_signer { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintSigner, - ) - .with_account_name("swap_thread"), - ); - } - if !(swap_thread.authority == authority_a_vault.owner) { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintRaw, - ) - .with_account_name("swap_thread"), - ); - } - { - let actual = swap_thread.key(); - let expected = swap_thread.pubkey(); - if actual != expected { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintAddress, - ) - .with_account_name("swap_thread") - .with_pubkeys((actual, expected)), - ); - } - } - { - let actual = system_program.key(); - let expected = system_program::ID; - if actual != expected { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintAddress, - ) - .with_account_name("system_program") - .with_pubkeys((actual, expected)), - ); - } - } - { - let actual = token_program.key(); - let expected = anchor_spl::token::ID; - if actual != expected { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintAddress, - ) - .with_account_name("token_program") - .with_pubkeys((actual, expected)), - ); - } - } - if !whirlpool.to_account_info().is_writable { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintMut, - ) - .with_account_name("whirlpool"), - ); - } - if !whirlpool_token_a_vault.to_account_info().is_writable { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintMut, - ) - .with_account_name("whirlpool_token_a_vault"), - ); - } - if !whirlpool_token_b_vault.to_account_info().is_writable { - return Err( - anchor_lang::error::Error::from( - anchor_lang::error::ErrorCode::ConstraintMut, - ) - .with_account_name("whirlpool_token_b_vault"), - ); - } - Ok(OrcaWhirlpoolSwap { - a_mint, - b_mint, - authority_a_vault, - authority_b_vault, - swap_thread_a_vault, - swap_thread_b_vault, - swap_thread, - oracle, - orca_whirlpool_program, - system_program, - token_program, - whirlpool, - whirlpool_token_a_vault, - whirlpool_token_b_vault, - }) - } - } - #[automatically_derived] - impl<'info> anchor_lang::ToAccountInfos<'info> for OrcaWhirlpoolSwap<'info> - where - 'info: 'info, - { - fn to_account_infos( - &self, - ) -> Vec> { - let mut account_infos = ::alloc::vec::Vec::new(); - account_infos.extend(self.a_mint.to_account_infos()); - account_infos.extend(self.b_mint.to_account_infos()); - account_infos.extend(self.authority_a_vault.to_account_infos()); - account_infos.extend(self.authority_b_vault.to_account_infos()); - account_infos.extend(self.swap_thread_a_vault.to_account_infos()); - account_infos.extend(self.swap_thread_b_vault.to_account_infos()); - account_infos.extend(self.swap_thread.to_account_infos()); - account_infos.extend(self.oracle.to_account_infos()); - account_infos.extend(self.orca_whirlpool_program.to_account_infos()); - account_infos.extend(self.system_program.to_account_infos()); - account_infos.extend(self.token_program.to_account_infos()); - account_infos.extend(self.whirlpool.to_account_infos()); - account_infos.extend(self.whirlpool_token_a_vault.to_account_infos()); - account_infos.extend(self.whirlpool_token_b_vault.to_account_infos()); - account_infos - } - } - #[automatically_derived] - impl<'info> anchor_lang::ToAccountMetas for OrcaWhirlpoolSwap<'info> { - fn to_account_metas( - &self, - is_signer: Option, - ) -> Vec { - let mut account_metas = ::alloc::vec::Vec::new(); - account_metas.extend(self.a_mint.to_account_metas(None)); - account_metas.extend(self.b_mint.to_account_metas(None)); - account_metas.extend(self.authority_a_vault.to_account_metas(None)); - account_metas.extend(self.authority_b_vault.to_account_metas(None)); - account_metas.extend(self.swap_thread_a_vault.to_account_metas(None)); - account_metas.extend(self.swap_thread_b_vault.to_account_metas(None)); - account_metas.extend(self.swap_thread.to_account_metas(Some(true))); - account_metas.extend(self.oracle.to_account_metas(None)); - account_metas.extend(self.orca_whirlpool_program.to_account_metas(None)); - account_metas.extend(self.system_program.to_account_metas(None)); - account_metas.extend(self.token_program.to_account_metas(None)); - account_metas.extend(self.whirlpool.to_account_metas(None)); - account_metas - .extend(self.whirlpool_token_a_vault.to_account_metas(None)); - account_metas - .extend(self.whirlpool_token_b_vault.to_account_metas(None)); - account_metas - } - } - #[automatically_derived] - impl<'info> anchor_lang::AccountsExit<'info> for OrcaWhirlpoolSwap<'info> - where - 'info: 'info, - { - fn exit( - &self, - program_id: &anchor_lang::solana_program::pubkey::Pubkey, - ) -> anchor_lang::Result<()> { - anchor_lang::AccountsExit::exit(&self.authority_a_vault, program_id) - .map_err(|e| e.with_account_name("authority_a_vault"))?; - anchor_lang::AccountsExit::exit(&self.authority_b_vault, program_id) - .map_err(|e| e.with_account_name("authority_b_vault"))?; - anchor_lang::AccountsExit::exit(&self.swap_thread_a_vault, program_id) - .map_err(|e| e.with_account_name("swap_thread_a_vault"))?; - anchor_lang::AccountsExit::exit(&self.swap_thread_b_vault, program_id) - .map_err(|e| e.with_account_name("swap_thread_b_vault"))?; - anchor_lang::AccountsExit::exit(&self.whirlpool, program_id) - .map_err(|e| e.with_account_name("whirlpool"))?; - anchor_lang::AccountsExit::exit( - &self.whirlpool_token_a_vault, - program_id, - ) - .map_err(|e| e.with_account_name("whirlpool_token_a_vault"))?; - anchor_lang::AccountsExit::exit( - &self.whirlpool_token_b_vault, - program_id, - ) - .map_err(|e| e.with_account_name("whirlpool_token_b_vault"))?; - Ok(()) - } - } - /// An internal, Anchor generated module. This is used (as an - /// implementation detail), to generate a struct for a given - /// `#[derive(Accounts)]` implementation, where each field is a Pubkey, - /// instead of an `AccountInfo`. This is useful for clients that want - /// to generate a list of accounts, without explicitly knowing the - /// order all the fields should be in. - /// - /// To access the struct in this module, one should use the sibling - /// `accounts` module (also generated), which re-exports this. - pub(crate) mod __client_accounts_orca_whirlpool_swap { - use super::*; - use anchor_lang::prelude::borsh; - /// Generated client accounts for [`OrcaWhirlpoolSwap`]. - pub struct OrcaWhirlpoolSwap { - pub a_mint: anchor_lang::solana_program::pubkey::Pubkey, - pub b_mint: anchor_lang::solana_program::pubkey::Pubkey, - pub authority_a_vault: anchor_lang::solana_program::pubkey::Pubkey, - pub authority_b_vault: anchor_lang::solana_program::pubkey::Pubkey, - pub swap_thread_a_vault: anchor_lang::solana_program::pubkey::Pubkey, - pub swap_thread_b_vault: anchor_lang::solana_program::pubkey::Pubkey, - pub swap_thread: anchor_lang::solana_program::pubkey::Pubkey, - pub oracle: anchor_lang::solana_program::pubkey::Pubkey, - pub orca_whirlpool_program: anchor_lang::solana_program::pubkey::Pubkey, - pub system_program: anchor_lang::solana_program::pubkey::Pubkey, - pub token_program: anchor_lang::solana_program::pubkey::Pubkey, - pub whirlpool: anchor_lang::solana_program::pubkey::Pubkey, - pub whirlpool_token_a_vault: anchor_lang::solana_program::pubkey::Pubkey, - pub whirlpool_token_b_vault: anchor_lang::solana_program::pubkey::Pubkey, - } - impl borsh::ser::BorshSerialize for OrcaWhirlpoolSwap - where - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - anchor_lang::solana_program::pubkey::Pubkey: borsh::ser::BorshSerialize, - { - fn serialize( - &self, - writer: &mut W, - ) -> ::core::result::Result<(), borsh::maybestd::io::Error> { - borsh::BorshSerialize::serialize(&self.a_mint, writer)?; - borsh::BorshSerialize::serialize(&self.b_mint, writer)?; - borsh::BorshSerialize::serialize(&self.authority_a_vault, writer)?; - borsh::BorshSerialize::serialize(&self.authority_b_vault, writer)?; - borsh::BorshSerialize::serialize(&self.swap_thread_a_vault, writer)?; - borsh::BorshSerialize::serialize(&self.swap_thread_b_vault, writer)?; - borsh::BorshSerialize::serialize(&self.swap_thread, writer)?; - borsh::BorshSerialize::serialize(&self.oracle, writer)?; - borsh::BorshSerialize::serialize( - &self.orca_whirlpool_program, - writer, - )?; - borsh::BorshSerialize::serialize(&self.system_program, writer)?; - borsh::BorshSerialize::serialize(&self.token_program, writer)?; - borsh::BorshSerialize::serialize(&self.whirlpool, writer)?; - borsh::BorshSerialize::serialize( - &self.whirlpool_token_a_vault, - writer, - )?; - borsh::BorshSerialize::serialize( - &self.whirlpool_token_b_vault, - writer, - )?; - Ok(()) - } - } - #[automatically_derived] - impl anchor_lang::ToAccountMetas for OrcaWhirlpoolSwap { - fn to_account_metas( - &self, - is_signer: Option, - ) -> Vec { - let mut account_metas = ::alloc::vec::Vec::new(); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - self.a_mint, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - self.b_mint, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - self.authority_a_vault, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - self.authority_b_vault, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - self.swap_thread_a_vault, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - self.swap_thread_b_vault, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - self.swap_thread, - true, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - self.oracle, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - self.orca_whirlpool_program, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - self.system_program, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - self.token_program, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - self.whirlpool, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - self.whirlpool_token_a_vault, - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - self.whirlpool_token_b_vault, - false, - ), - ); - account_metas - } - } - } - /// An internal, Anchor generated module. This is used (as an - /// implementation detail), to generate a CPI struct for a given - /// `#[derive(Accounts)]` implementation, where each field is an - /// AccountInfo. - /// - /// To access the struct in this module, one should use the sibling - /// [`cpi::accounts`] module (also generated), which re-exports this. - pub(crate) mod __cpi_client_accounts_orca_whirlpool_swap { - use super::*; - /// Generated CPI struct of the accounts for [`OrcaWhirlpoolSwap`]. - pub struct OrcaWhirlpoolSwap<'info> { - pub a_mint: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub b_mint: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub authority_a_vault: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub authority_b_vault: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub swap_thread_a_vault: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub swap_thread_b_vault: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub swap_thread: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub oracle: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub orca_whirlpool_program: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub system_program: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub token_program: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub whirlpool: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub whirlpool_token_a_vault: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - pub whirlpool_token_b_vault: anchor_lang::solana_program::account_info::AccountInfo< - 'info, - >, - } - #[automatically_derived] - impl<'info> anchor_lang::ToAccountMetas for OrcaWhirlpoolSwap<'info> { - fn to_account_metas( - &self, - is_signer: Option, - ) -> Vec { - let mut account_metas = ::alloc::vec::Vec::new(); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - anchor_lang::Key::key(&self.a_mint), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - anchor_lang::Key::key(&self.b_mint), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - anchor_lang::Key::key(&self.authority_a_vault), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - anchor_lang::Key::key(&self.authority_b_vault), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - anchor_lang::Key::key(&self.swap_thread_a_vault), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - anchor_lang::Key::key(&self.swap_thread_b_vault), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - anchor_lang::Key::key(&self.swap_thread), - true, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - anchor_lang::Key::key(&self.oracle), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - anchor_lang::Key::key(&self.orca_whirlpool_program), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - anchor_lang::Key::key(&self.system_program), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new_readonly( - anchor_lang::Key::key(&self.token_program), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - anchor_lang::Key::key(&self.whirlpool), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - anchor_lang::Key::key(&self.whirlpool_token_a_vault), - false, - ), - ); - account_metas - .push( - anchor_lang::solana_program::instruction::AccountMeta::new( - anchor_lang::Key::key(&self.whirlpool_token_b_vault), - false, - ), - ); - account_metas - } - } - #[automatically_derived] - impl<'info> anchor_lang::ToAccountInfos<'info> for OrcaWhirlpoolSwap<'info> { - fn to_account_infos( - &self, - ) -> Vec> { - let mut account_infos = ::alloc::vec::Vec::new(); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos(&self.a_mint), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos(&self.b_mint), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.authority_a_vault, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.authority_b_vault, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.swap_thread_a_vault, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.swap_thread_b_vault, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.swap_thread, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos(&self.oracle), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.orca_whirlpool_program, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.system_program, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.token_program, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.whirlpool, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.whirlpool_token_a_vault, - ), - ); - account_infos - .extend( - anchor_lang::ToAccountInfos::to_account_infos( - &self.whirlpool_token_b_vault, - ), - ); - account_infos - } - } - } - pub fn handler<'info>( - ctx: Context<'_, '_, '_, 'info, OrcaWhirlpoolSwap<'info>>, - amount: u64, - a_to_b: bool, - ) -> Result { - let authority_a_vault = &mut ctx.accounts.authority_a_vault; - let authority_b_vault = &mut ctx.accounts.authority_b_vault; - let swap_thread_a_vault = &mut ctx.accounts.swap_thread_a_vault; - let swap_thread_b_vault = &mut ctx.accounts.swap_thread_b_vault; - let swap_thread = &ctx.accounts.swap_thread; - let oracle = &ctx.accounts.oracle; - let orca_whirlpool_program = &ctx.accounts.orca_whirlpool_program; - let token_program = &ctx.accounts.token_program; - let whirlpool = &mut ctx.accounts.whirlpool; - let whirlpool_token_a_vault = &mut ctx.accounts.whirlpool_token_a_vault; - let whirlpool_token_b_vault = &mut ctx.accounts.whirlpool_token_b_vault; - let tick_array0 = ctx.remaining_accounts.get(0).unwrap(); - let tick_array1 = ctx.remaining_accounts.get(1).unwrap(); - let tick_array2 = ctx.remaining_accounts.get(2).unwrap(); - let whirlpool_data = whirlpool.try_borrow_data().unwrap().to_owned(); - let whirlpool_state = whirlpool::state::Whirlpool::try_deserialize( - &mut whirlpool_data.as_slice(), - ) - .unwrap(); - let tick_array_pubkeys = get_tick_array_pubkeys( - whirlpool_state.tick_current_index, - whirlpool_state.tick_spacing, - a_to_b, - &whirlpool::ID, - &whirlpool.key(), - ); - transfer( - CpiContext::new( - token_program.to_account_info(), - Transfer { - from: if a_to_b { - authority_a_vault.to_account_info() - } else { - authority_b_vault.to_account_info() - }, - to: if a_to_b { - swap_thread_a_vault.to_account_info() - } else { - swap_thread_b_vault.to_account_info() - }, - authority: swap_thread.to_account_info(), - }, - ), - amount, - )?; - whirlpool::cpi::swap( - CpiContext::new( - orca_whirlpool_program.to_account_info(), - whirlpool::cpi::accounts::Swap { - token_program: token_program.to_account_info(), - token_authority: swap_thread.to_account_info(), - whirlpool: whirlpool.to_account_info(), - token_owner_account_a: swap_thread_a_vault.to_account_info(), - token_vault_a: whirlpool_token_a_vault.to_account_info(), - token_owner_account_b: swap_thread_b_vault.to_account_info(), - token_vault_b: whirlpool_token_b_vault.to_account_info(), - tick_array0: tick_array0.to_account_info(), - tick_array1: tick_array1.to_account_info(), - tick_array2: tick_array2.to_account_info(), - oracle: oracle.to_account_info(), - }, - ), - amount, - 0, - whirlpool_state.sqrt_price, - false, - a_to_b, - )?; - if a_to_b { - swap_thread_b_vault.reload()? - } else { - swap_thread_a_vault.reload()? - } - transfer( - CpiContext::new( - token_program.to_account_info(), - Transfer { - from: if a_to_b { - swap_thread_b_vault.to_account_info() - } else { - swap_thread_a_vault.to_account_info() - }, - to: if a_to_b { - authority_b_vault.to_account_info() - } else { - authority_a_vault.to_account_info() - }, - authority: swap_thread.to_account_info(), - }, - ), - swap_thread_b_vault.amount, - )?; - Ok(ThreadResponse { - kickoff_instruction: Some(clockwork_sdk::state::InstructionData { - program_id: crate::ID, - accounts: [ - crate::accounts::OrcaWhirlpoolSwap { - a_mint: ctx.accounts.a_mint.key(), - b_mint: ctx.accounts.b_mint.key(), - authority_a_vault: ctx.accounts.authority_a_vault.key(), - authority_b_vault: ctx.accounts.authority_b_vault.key(), - swap_thread: ctx.accounts.swap_thread.key(), - swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), - swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), - oracle: ctx.accounts.oracle.key(), - system_program: ctx.accounts.system_program.key(), - token_program: ctx.accounts.token_program.key(), - whirlpool: ctx.accounts.whirlpool.key(), - orca_whirlpool_program: whirlpool::ID, - whirlpool_token_a_vault: whirlpool_state.token_vault_a, - whirlpool_token_b_vault: whirlpool_state.token_vault_b, - } - .to_account_metas(Some(true)), - tick_array_pubkeys - .iter() - .map(|pk| AccountMeta::new(*pk, false)) - .collect::>(), - ] - .concat(), - data: crate::instruction::OrcaWhirlpoolSwap { - amount: 10_000_000_000, - a_to_b: true, - } - .data(), - }), - next_instruction: None, - }) - } - } - pub use orca_whirlpool_swap::*; -} -pub use id::ID; -use anchor_lang::prelude::*; -use instructions::*; -use self::swap::*; -/// The Anchor codegen exposes a programming model where a user defines -/// a set of methods inside of a `#[program]` module in a way similar -/// to writing RPC request handlers. The macro then generates a bunch of -/// code wrapping these user defined methods into something that can be -/// executed on Solana. -/// -/// These methods fall into one of three categories, each of which -/// can be considered a different "namespace" of the program. -/// -/// 1) Global methods - regular methods inside of the `#[program]`. -/// 2) State methods - associated methods inside a `#[state]` struct. -/// 3) Interface methods - methods inside a strait struct's -/// implementation of an `#[interface]` trait. -/// -/// Care must be taken by the codegen to prevent collisions between -/// methods in these different namespaces. For this reason, Anchor uses -/// a variant of sighash to perform method dispatch, rather than -/// something like a simple enum variant discriminator. -/// -/// The execution flow of the generated code can be roughly outlined: -/// -/// * Start program via the entrypoint. -/// * Strip method identifier off the first 8 bytes of the instruction -/// data and invoke the identified method. The method identifier -/// is a variant of sighash. See docs.rs for `anchor_lang` for details. -/// * If the method identifier is an IDL identifier, execute the IDL -/// instructions, which are a special set of hardcoded instructions -/// baked into every Anchor program. Then exit. -/// * Otherwise, the method identifier is for a user defined -/// instruction, i.e., one of the methods in the user defined -/// `#[program]` module. Perform method dispatch, i.e., execute the -/// big match statement mapping method identifier to method handler -/// wrapper. -/// * Run the method handler wrapper. This wraps the code the user -/// actually wrote, deserializing the accounts, constructing the -/// context, invoking the user's code, and finally running the exit -/// routine, which typically persists account changes. -/// -/// The `entry` function here, defines the standard entry to a Solana -/// program, where execution begins. -pub fn entry( - program_id: &Pubkey, - accounts: &[AccountInfo], - data: &[u8], -) -> anchor_lang::solana_program::entrypoint::ProgramResult { - try_entry(program_id, accounts, data) - .map_err(|e| { - e.log(); - e.into() - }) -} -fn try_entry( - program_id: &Pubkey, - accounts: &[AccountInfo], - data: &[u8], -) -> anchor_lang::Result<()> { - if *program_id != ID { - return Err(anchor_lang::error::ErrorCode::DeclaredProgramIdMismatch.into()); - } - if data.len() < 8 { - return Err(anchor_lang::error::ErrorCode::InstructionMissing.into()); - } - dispatch(program_id, accounts, data) -} -/// Module representing the program. -pub mod program { - use super::*; - /// Type representing the program. - pub struct Swap; - #[automatically_derived] - impl ::core::clone::Clone for Swap { - #[inline] - fn clone(&self) -> Swap { - Swap - } - } - impl anchor_lang::Id for Swap { - fn id() -> Pubkey { - ID - } - } -} -/// Performs method dispatch. -/// -/// Each method in an anchor program is uniquely defined by a namespace -/// and a rust identifier (i.e., the name given to the method). These -/// two pieces can be combined to creater a method identifier, -/// specifically, Anchor uses -/// -/// Sha256(":")[..8], -/// -/// where the namespace can be one of three types. 1) "global" for a -/// regular instruction, 2) "state" for a state struct instruction -/// handler and 3) a trait namespace (used in combination with the -/// `#[interface]` attribute), which is defined by the trait name, e.. -/// `MyTrait`. -/// -/// With this 8 byte identifier, Anchor performs method dispatch, -/// matching the given 8 byte identifier to the associated method -/// handler, which leads to user defined code being eventually invoked. -fn dispatch( - program_id: &Pubkey, - accounts: &[AccountInfo], - data: &[u8], -) -> anchor_lang::Result<()> { - let mut ix_data: &[u8] = data; - let sighash: [u8; 8] = { - let mut sighash: [u8; 8] = [0; 8]; - sighash.copy_from_slice(&ix_data[..8]); - ix_data = &ix_data[8..]; - sighash - }; - if true { - if sighash == anchor_lang::idl::IDL_IX_TAG.to_le_bytes() { - return __private::__idl::__idl_dispatch(program_id, accounts, &ix_data); - } - } - use anchor_lang::Discriminator; - match sighash { - instruction::OrcaWhirlpoolSwap::DISCRIMINATOR => { - __private::__global::orca_whirlpool_swap(program_id, accounts, ix_data) - } - _ => Err(anchor_lang::error::ErrorCode::InstructionFallbackNotFound.into()), - } -} -/// Create a private module to not clutter the program's namespace. -/// Defines an entrypoint for each individual instruction handler -/// wrapper. -mod __private { - use super::*; - /// __idl mod defines handlers for injected Anchor IDL instructions. - pub mod __idl { - use super::*; - #[inline(never)] - #[cfg(not(feature = "no-idl"))] - pub fn __idl_dispatch( - program_id: &Pubkey, - accounts: &[AccountInfo], - idl_ix_data: &[u8], - ) -> anchor_lang::Result<()> { - let mut accounts = accounts; - let mut data: &[u8] = idl_ix_data; - let ix = anchor_lang::idl::IdlInstruction::deserialize(&mut data) - .map_err(|_| { - anchor_lang::error::ErrorCode::InstructionDidNotDeserialize - })?; - match ix { - anchor_lang::idl::IdlInstruction::Create { data_len } => { - let mut bumps = std::collections::BTreeMap::new(); - let mut reallocs = std::collections::BTreeSet::new(); - let mut accounts = anchor_lang::idl::IdlCreateAccounts::try_accounts( - program_id, - &mut accounts, - &[], - &mut bumps, - &mut reallocs, - )?; - __idl_create_account(program_id, &mut accounts, data_len)?; - accounts.exit(program_id)?; - } - anchor_lang::idl::IdlInstruction::CreateBuffer => { - let mut bumps = std::collections::BTreeMap::new(); - let mut reallocs = std::collections::BTreeSet::new(); - let mut accounts = anchor_lang::idl::IdlCreateBuffer::try_accounts( - program_id, - &mut accounts, - &[], - &mut bumps, - &mut reallocs, - )?; - __idl_create_buffer(program_id, &mut accounts)?; - accounts.exit(program_id)?; - } - anchor_lang::idl::IdlInstruction::Write { data } => { - let mut bumps = std::collections::BTreeMap::new(); - let mut reallocs = std::collections::BTreeSet::new(); - let mut accounts = anchor_lang::idl::IdlAccounts::try_accounts( - program_id, - &mut accounts, - &[], - &mut bumps, - &mut reallocs, - )?; - __idl_write(program_id, &mut accounts, data)?; - accounts.exit(program_id)?; - } - anchor_lang::idl::IdlInstruction::SetAuthority { new_authority } => { - let mut bumps = std::collections::BTreeMap::new(); - let mut reallocs = std::collections::BTreeSet::new(); - let mut accounts = anchor_lang::idl::IdlAccounts::try_accounts( - program_id, - &mut accounts, - &[], - &mut bumps, - &mut reallocs, - )?; - __idl_set_authority(program_id, &mut accounts, new_authority)?; - accounts.exit(program_id)?; - } - anchor_lang::idl::IdlInstruction::SetBuffer => { - let mut bumps = std::collections::BTreeMap::new(); - let mut reallocs = std::collections::BTreeSet::new(); - let mut accounts = anchor_lang::idl::IdlSetBuffer::try_accounts( - program_id, - &mut accounts, - &[], - &mut bumps, - &mut reallocs, - )?; - __idl_set_buffer(program_id, &mut accounts)?; - accounts.exit(program_id)?; - } - } - Ok(()) - } - #[inline(never)] - pub fn __idl_create_account( - program_id: &Pubkey, - accounts: &mut anchor_lang::idl::IdlCreateAccounts, - data_len: u64, - ) -> anchor_lang::Result<()> { - ::solana_program::log::sol_log("Instruction: IdlCreateAccount"); - if program_id != accounts.program.key { - return Err( - anchor_lang::error::ErrorCode::IdlInstructionInvalidProgram.into(), - ); - } - let from = accounts.from.key; - let (base, nonce) = Pubkey::find_program_address(&[], program_id); - let seed = anchor_lang::idl::IdlAccount::seed(); - let owner = accounts.program.key; - let to = Pubkey::create_with_seed(&base, seed, owner).unwrap(); - let space = 8 + 32 + 4 + data_len as usize; - let rent = Rent::get()?; - let lamports = rent.minimum_balance(space); - let seeds = &[&[nonce][..]]; - let ix = anchor_lang::solana_program::system_instruction::create_account_with_seed( - from, - &to, - &base, - seed, - lamports, - space as u64, - owner, - ); - anchor_lang::solana_program::program::invoke_signed( - &ix, - &[ - accounts.from.clone(), - accounts.to.clone(), - accounts.base.clone(), - accounts.system_program.clone(), - ], - &[seeds], - )?; - let mut idl_account = { - let mut account_data = accounts.to.try_borrow_data()?; - let mut account_data_slice: &[u8] = &account_data; - anchor_lang::idl::IdlAccount::try_deserialize_unchecked( - &mut account_data_slice, - )? - }; - idl_account.authority = *accounts.from.key; - let mut data = accounts.to.try_borrow_mut_data()?; - let dst: &mut [u8] = &mut data; - let mut cursor = std::io::Cursor::new(dst); - idl_account.try_serialize(&mut cursor)?; - Ok(()) - } - #[inline(never)] - pub fn __idl_create_buffer( - program_id: &Pubkey, - accounts: &mut anchor_lang::idl::IdlCreateBuffer, - ) -> anchor_lang::Result<()> { - ::solana_program::log::sol_log("Instruction: IdlCreateBuffer"); - let mut buffer = &mut accounts.buffer; - buffer.authority = *accounts.authority.key; - Ok(()) - } - #[inline(never)] - pub fn __idl_write( - program_id: &Pubkey, - accounts: &mut anchor_lang::idl::IdlAccounts, - idl_data: Vec, - ) -> anchor_lang::Result<()> { - ::solana_program::log::sol_log("Instruction: IdlWrite"); - let mut idl = &mut accounts.idl; - idl.data.extend(idl_data); - Ok(()) - } - #[inline(never)] - pub fn __idl_set_authority( - program_id: &Pubkey, - accounts: &mut anchor_lang::idl::IdlAccounts, - new_authority: Pubkey, - ) -> anchor_lang::Result<()> { - ::solana_program::log::sol_log("Instruction: IdlSetAuthority"); - accounts.idl.authority = new_authority; - Ok(()) - } - #[inline(never)] - pub fn __idl_set_buffer( - program_id: &Pubkey, - accounts: &mut anchor_lang::idl::IdlSetBuffer, - ) -> anchor_lang::Result<()> { - ::solana_program::log::sol_log("Instruction: IdlSetBuffer"); - accounts.idl.data = accounts.buffer.data.clone(); - Ok(()) - } - } - /// __state mod defines wrapped handlers for state instructions. - pub mod __state { - use super::*; - } - /// __interface mod defines wrapped handlers for `#[interface]` trait - /// implementations. - pub mod __interface { - use super::*; - } - /// __global mod defines wrapped handlers for global instructions. - pub mod __global { - use super::*; - #[inline(never)] - pub fn orca_whirlpool_swap( - program_id: &Pubkey, - accounts: &[AccountInfo], - ix_data: &[u8], - ) -> anchor_lang::Result<()> { - ::solana_program::log::sol_log("Instruction: OrcaWhirlpoolSwap"); - let ix = instruction::OrcaWhirlpoolSwap::deserialize(&mut &ix_data[..]) - .map_err(|_| { - anchor_lang::error::ErrorCode::InstructionDidNotDeserialize - })?; - let instruction::OrcaWhirlpoolSwap { amount, a_to_b } = ix; - let mut __bumps = std::collections::BTreeMap::new(); - let mut __reallocs = std::collections::BTreeSet::new(); - let mut remaining_accounts: &[AccountInfo] = accounts; - let mut accounts = OrcaWhirlpoolSwap::try_accounts( - program_id, - &mut remaining_accounts, - ix_data, - &mut __bumps, - &mut __reallocs, - )?; - let result = swap::orca_whirlpool_swap( - anchor_lang::context::Context::new( - program_id, - &mut accounts, - remaining_accounts, - __bumps, - ), - amount, - a_to_b, - )?; - anchor_lang::solana_program::program::set_return_data( - &result.try_to_vec().unwrap(), - ); - accounts.exit(program_id) - } - } -} -pub mod swap { - use super::*; - pub fn orca_whirlpool_swap<'info>( - ctx: Context<'_, '_, '_, 'info, OrcaWhirlpoolSwap<'info>>, - amount: u64, - a_to_b: bool, - ) -> Result { - orca_whirlpool_swap::handler(ctx, amount, a_to_b) - } -} -/// An Anchor generated module containing the program's set of -/// instructions, where each method handler in the `#[program]` mod is -/// associated with a struct defining the input arguments to the -/// method. These should be used directly, when one wants to serialize -/// Anchor instruction data, for example, when speciying -/// instructions on a client. -pub mod instruction { - use super::*; - /// Instruction struct definitions for `#[state]` methods. - pub mod state { - use super::*; - } - /// Instruction. - pub struct OrcaWhirlpoolSwap { - pub amount: u64, - pub a_to_b: bool, - } - impl borsh::ser::BorshSerialize for OrcaWhirlpoolSwap - where - u64: borsh::ser::BorshSerialize, - bool: borsh::ser::BorshSerialize, - { - fn serialize( - &self, - writer: &mut W, - ) -> ::core::result::Result<(), borsh::maybestd::io::Error> { - borsh::BorshSerialize::serialize(&self.amount, writer)?; - borsh::BorshSerialize::serialize(&self.a_to_b, writer)?; - Ok(()) - } - } - impl borsh::de::BorshDeserialize for OrcaWhirlpoolSwap - where - u64: borsh::BorshDeserialize, - bool: borsh::BorshDeserialize, - { - fn deserialize( - buf: &mut &[u8], - ) -> ::core::result::Result { - Ok(Self { - amount: borsh::BorshDeserialize::deserialize(buf)?, - a_to_b: borsh::BorshDeserialize::deserialize(buf)?, - }) - } - } - impl anchor_lang::Discriminator for OrcaWhirlpoolSwap { - const DISCRIMINATOR: [u8; 8] = [79, 43, 112, 12, 131, 182, 81, 216]; - } - impl anchor_lang::InstructionData for OrcaWhirlpoolSwap {} - impl anchor_lang::Owner for OrcaWhirlpoolSwap { - fn owner() -> Pubkey { - ID - } - } -} -#[cfg(feature = "cpi")] -pub mod cpi { - use super::*; - use std::marker::PhantomData; - pub mod state { - use super::*; - } - pub struct Return { - phantom: std::marker::PhantomData, - } - impl Return { - pub fn get(&self) -> T { - let (_key, data) = anchor_lang::solana_program::program::get_return_data() - .unwrap(); - T::try_from_slice(&data).unwrap() - } - } - pub fn orca_whirlpool_swap<'a, 'b, 'c, 'info>( - ctx: anchor_lang::context::CpiContext< - 'a, - 'b, - 'c, - 'info, - crate::cpi::accounts::OrcaWhirlpoolSwap<'info>, - >, - amount: u64, - a_to_b: bool, - ) -> anchor_lang::Result> { - let ix = { - let ix = instruction::OrcaWhirlpoolSwap { - amount, - a_to_b, - }; - let mut ix_data = AnchorSerialize::try_to_vec(&ix) - .map_err(|_| anchor_lang::error::ErrorCode::InstructionDidNotSerialize)?; - let mut data = [79, 43, 112, 12, 131, 182, 81, 216].to_vec(); - data.append(&mut ix_data); - let accounts = ctx.to_account_metas(None); - anchor_lang::solana_program::instruction::Instruction { - program_id: crate::ID, - accounts, - data, - } - }; - let mut acc_infos = ctx.to_account_infos(); - anchor_lang::solana_program::program::invoke_signed( - &ix, - &acc_infos, - ctx.signer_seeds, - ) - .map_or_else( - |e| Err(Into::into(e)), - |_| { - Ok(crate::cpi::Return:: { - phantom: crate::cpi::PhantomData, - }) - }, - ) - } - /// An Anchor generated module, providing a set of structs - /// mirroring the structs deriving `Accounts`, where each field is - /// an `AccountInfo`. This is useful for CPI. - pub mod accounts { - pub use crate::__cpi_client_accounts_orca_whirlpool_swap::*; - } -} -/// An Anchor generated module, providing a set of structs -/// mirroring the structs deriving `Accounts`, where each field is -/// a `Pubkey`. This is useful for specifying accounts for a client. -pub mod accounts { - pub use crate::__client_accounts_orca_whirlpool_swap::*; -} diff --git a/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs b/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs index ab16edf..d4007cc 100644 --- a/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs +++ b/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs @@ -1,7 +1,9 @@ -use anchor_lang::solana_program::instruction::Instruction; - use { - anchor_lang::{prelude::*, solana_program::system_program, InstructionData}, + anchor_lang::{ + prelude::*, + solana_program::{instruction::Instruction, system_program}, + InstructionData, + }, anchor_spl::token::{transfer, Mint, Token, TokenAccount, Transfer}, clockwork_sdk::state::{Thread, ThreadAccount, ThreadResponse}, whirlpool::utils::get_tick_array_pubkeys, @@ -99,11 +101,12 @@ pub fn handler<'info>( let tick_array1 = ctx.remaining_accounts.get(1).unwrap(); let tick_array2 = ctx.remaining_accounts.get(2).unwrap(); + // deserialize whirlpool state let whirlpool_data = whirlpool.try_borrow_data().unwrap().to_owned(); let whirlpool_state = whirlpool::state::Whirlpool::try_deserialize(&mut whirlpool_data.as_slice()).unwrap(); - // get tick array pubkeys + // get tick array pubkeys for next swap let tick_array_pubkeys = get_tick_array_pubkeys( whirlpool_state.tick_current_index, whirlpool_state.tick_spacing, @@ -133,6 +136,7 @@ pub fn handler<'info>( amount, )?; + // perform orca whirlpool swap whirlpool::cpi::swap( CpiContext::new( orca_whirlpool_program.to_account_info(), @@ -185,6 +189,7 @@ pub fn handler<'info>( swap_thread_b_vault.amount, )?; + // return swap as the kickoff_instruction because this program is stateless Ok(ThreadResponse { kickoff_instruction: Some( Instruction { @@ -210,110 +215,14 @@ pub fn handler<'info>( // REMAINING ACCOUNTS tick_array_pubkeys .iter() - .map(|pk| AccountMeta::new_readonly(*pk, false)) + .map(|pk| AccountMeta::new(*pk, false)) .collect::>(), ] .concat(), - data: crate::instruction::OrcaWhirlpoolSwap { - amount: 10_000_000_000, - a_to_b: true, - } - .data(), + data: crate::instruction::OrcaWhirlpoolSwap { amount, a_to_b }.data(), } .into(), ), next_instruction: None, }) } - -// #[inline(always)] -// fn to_account_metas_datas( -// context: &Context, -// ) -> Vec { -// let mut account_metas = Vec::with_capacity(14); -// account_metas.push(AccountMetaData::new_readonly( -// context.accounts.a_mint.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new_readonly( -// context.accounts.b_mint.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new( -// context.accounts.authority_a_vault.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new( -// context.accounts.authority_b_vault.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new( -// context.accounts.swap_thread_a_vault.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new( -// context.accounts.swap_thread_b_vault.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new_readonly( -// context.accounts.swap_thread.key(), -// true, -// )); -// account_metas.push(AccountMetaData::new_readonly( -// context.accounts.oracle.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new_readonly( -// context.accounts.orca_whirlpool_program.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new_readonly( -// context.accounts.system_program.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new_readonly( -// context.accounts.token_program.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new(whirlpool::ID, false)); -// account_metas.push(AccountMetaData::new( -// context.accounts.whirlpool_token_a_vault.key(), -// false, -// )); -// account_metas.push(AccountMetaData::new( -// context.accounts.whirlpool_token_b_vault.key(), -// false, -// )); -// account_metas -// } - -// The sighash of a named instruction in an Anchor program. -// fn anchor_sighash(name: &str, mut data: Vec) -> Vec { -// let preimage = format!("{}:{}", "global", name); -// let mut sighash = [0u8; 8]; -// sighash.copy_from_slice( -// &anchor_lang::solana_program::hash::hash(preimage.as_bytes()).to_bytes()[..8], -// ); -// let mut d = sighash.to_vec(); -// d.append(&mut data); -// d -// } - -// crate::accounts::OrcaWhirlpoolSwap { -// a_mint: ctx.accounts.a_mint.key(), -// b_mint: ctx.accounts.b_mint.key(), -// authority_a_vault: ctx.accounts.authority_a_vault.key(), -// authority_b_vault: ctx.accounts.authority_b_vault.key(), -// swap_thread: ctx.accounts.swap_thread.key(), -// swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), -// swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), -// oracle: ctx.accounts.oracle.key(), -// system_program: ctx.accounts.system_program.key(), -// token_program: ctx.accounts.token_program.key(), -// whirlpool: ctx.accounts.whirlpool.key(), -// orca_whirlpool_program: whirlpool::ID, -// whirlpool_token_a_vault: whirlpool_state.token_vault_a, -// whirlpool_token_b_vault: whirlpool_state.token_vault_b, -// } -// .to_account_metas(Some(true)), -// REMAINING ACCOUNTS From 9331847bb31a4db322266d37c62d54deafbe780b Mon Sep 17 00:00:00 2001 From: Eliascm17 Date: Tue, 21 Feb 2023 22:32:17 -0700 Subject: [PATCH 3/6] add pre-swap ix to get tick arrays just before swap --- swap/programs/swap/src/instructions/mod.rs | 2 + .../instructions/orca_whirlpool_preswap.rs | 137 ++++++++++++++++++ .../src/instructions/orca_whirlpool_swap.rs | 76 ++++------ swap/programs/swap/src/lib.rs | 10 ++ 4 files changed, 180 insertions(+), 45 deletions(-) create mode 100644 swap/programs/swap/src/instructions/orca_whirlpool_preswap.rs diff --git a/swap/programs/swap/src/instructions/mod.rs b/swap/programs/swap/src/instructions/mod.rs index 08e8df4..a588ab7 100644 --- a/swap/programs/swap/src/instructions/mod.rs +++ b/swap/programs/swap/src/instructions/mod.rs @@ -1,3 +1,5 @@ +pub mod orca_whirlpool_preswap; pub mod orca_whirlpool_swap; +pub use orca_whirlpool_preswap::*; pub use orca_whirlpool_swap::*; diff --git a/swap/programs/swap/src/instructions/orca_whirlpool_preswap.rs b/swap/programs/swap/src/instructions/orca_whirlpool_preswap.rs new file mode 100644 index 0000000..d47efda --- /dev/null +++ b/swap/programs/swap/src/instructions/orca_whirlpool_preswap.rs @@ -0,0 +1,137 @@ +use { + anchor_lang::{ + prelude::*, + solana_program::{instruction::Instruction, system_program}, + InstructionData, + }, + anchor_spl::token::{Mint, Token, TokenAccount}, + clockwork_sdk::state::{Thread, ThreadAccount, ThreadResponse}, + whirlpool::{state::Whirlpool, utils::get_tick_array_pubkeys}, +}; + +#[derive(Accounts)] +#[instruction( + amount: u64, + a_to_b: bool, +)] +pub struct OrcaWhirlpoolPreSwap<'info> { + /// CHECK: + pub a_mint: Box>, + + /// CHECK: + pub b_mint: Box>, + + #[account( + mut, + associated_token::mint = a_mint, + associated_token::authority = swap_thread.authority + )] + pub authority_a_vault: Box>, + + #[account( + mut, + associated_token::mint = b_mint, + associated_token::authority = swap_thread.authority + )] + pub authority_b_vault: Box>, + + #[account( + mut, + associated_token::authority = swap_thread, + associated_token::mint = a_mint, + )] + pub swap_thread_a_vault: Box>, + + #[account( + mut, + associated_token::authority = swap_thread, + associated_token::mint = b_mint, + )] + pub swap_thread_b_vault: Box>, + + #[account( + signer, + address = swap_thread.pubkey(), + constraint = swap_thread.authority == authority_a_vault.owner + )] + pub swap_thread: Box>, + + /// CHECK: + pub oracle: AccountInfo<'info>, + + /// CHECK: + pub orca_whirlpool_program: AccountInfo<'info>, + + #[account(address = system_program::ID)] + pub system_program: Program<'info, System>, + + #[account(address = anchor_spl::token::ID)] + pub token_program: Program<'info, Token>, + + /// CHECK: + #[account(mut)] + pub whirlpool: Account<'info, Whirlpool>, + + /// CHECK: + #[account(mut)] + pub whirlpool_token_a_vault: AccountInfo<'info>, + + /// CHECK: + #[account(mut)] + pub whirlpool_token_b_vault: AccountInfo<'info>, +} + +pub fn handler<'info>( + ctx: Context>, + amount: u64, + a_to_b: bool, +) -> Result { + // get accounts + let whirlpool = &ctx.accounts.whirlpool; + + // get tick array pubkeys for next swap + let tick_array_pubkeys = get_tick_array_pubkeys( + whirlpool.tick_current_index, + whirlpool.tick_spacing, + a_to_b, + &whirlpool::ID, + &whirlpool.key(), + ); + + // return swap as the kickoff_instruction because this program is stateless + Ok(ThreadResponse { + kickoff_instruction: None, + next_instruction: Some( + Instruction { + program_id: crate::ID, + accounts: [ + crate::accounts::OrcaWhirlpoolSwap { + a_mint: ctx.accounts.a_mint.key(), + b_mint: ctx.accounts.b_mint.key(), + authority_a_vault: ctx.accounts.authority_a_vault.key(), + authority_b_vault: ctx.accounts.authority_b_vault.key(), + swap_thread: ctx.accounts.swap_thread.key(), + swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), + swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), + oracle: ctx.accounts.oracle.key(), + system_program: ctx.accounts.system_program.key(), + token_program: ctx.accounts.token_program.key(), + whirlpool: ctx.accounts.whirlpool.key(), + orca_whirlpool_program: whirlpool::ID, + whirlpool_token_a_vault: whirlpool.token_vault_a, + whirlpool_token_b_vault: whirlpool.token_vault_b, + } + .to_account_metas(Some(true)), + // REMAINING ACCOUNTS + tick_array_pubkeys + .iter() + .map(|pk| AccountMeta::new(*pk, false)) + .collect::>(), + ] + .concat(), + data: crate::instruction::OrcaWhirlpoolSwap { amount, a_to_b }.data(), + } + .into(), + ), + }) +} diff --git a/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs b/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs index d4007cc..29bb92b 100644 --- a/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs +++ b/swap/programs/swap/src/instructions/orca_whirlpool_swap.rs @@ -6,11 +6,14 @@ use { }, anchor_spl::token::{transfer, Mint, Token, TokenAccount, Transfer}, clockwork_sdk::state::{Thread, ThreadAccount, ThreadResponse}, - whirlpool::utils::get_tick_array_pubkeys, + whirlpool::{state::Whirlpool, utils::sqrt_price_from_tick_index}, }; #[derive(Accounts)] -#[instruction(amount: u64, a_to_b: bool)] +#[instruction( + amount: u64, + a_to_b: bool, +)] pub struct OrcaWhirlpoolSwap<'info> { /// CHECK: pub a_mint: Box>, @@ -67,7 +70,7 @@ pub struct OrcaWhirlpoolSwap<'info> { /// CHECK: #[account(mut)] - pub whirlpool: AccountInfo<'info>, + pub whirlpool: Account<'info, Whirlpool>, /// CHECK: #[account(mut)] @@ -101,19 +104,11 @@ pub fn handler<'info>( let tick_array1 = ctx.remaining_accounts.get(1).unwrap(); let tick_array2 = ctx.remaining_accounts.get(2).unwrap(); - // deserialize whirlpool state - let whirlpool_data = whirlpool.try_borrow_data().unwrap().to_owned(); - let whirlpool_state = - whirlpool::state::Whirlpool::try_deserialize(&mut whirlpool_data.as_slice()).unwrap(); - - // get tick array pubkeys for next swap - let tick_array_pubkeys = get_tick_array_pubkeys( - whirlpool_state.tick_current_index, - whirlpool_state.tick_spacing, - a_to_b, - &whirlpool::ID, - &whirlpool.key(), - ); + let sqrt_price_limit = if a_to_b { + sqrt_price_from_tick_index(whirlpool.tick_current_index - whirlpool.tick_spacing as i32) + } else { + sqrt_price_from_tick_index(whirlpool.tick_current_index + whirlpool.tick_spacing as i32) + }; // transfer swap amount from authority to swap_thread ata transfer( @@ -156,8 +151,8 @@ pub fn handler<'info>( ), amount, 0, - whirlpool_state.sqrt_price, - false, + sqrt_price_limit, + true, a_to_b, )?; @@ -189,37 +184,28 @@ pub fn handler<'info>( swap_thread_b_vault.amount, )?; - // return swap as the kickoff_instruction because this program is stateless Ok(ThreadResponse { kickoff_instruction: Some( Instruction { program_id: crate::ID, - accounts: [ - crate::accounts::OrcaWhirlpoolSwap { - a_mint: ctx.accounts.a_mint.key(), - b_mint: ctx.accounts.b_mint.key(), - authority_a_vault: ctx.accounts.authority_a_vault.key(), - authority_b_vault: ctx.accounts.authority_b_vault.key(), - swap_thread: ctx.accounts.swap_thread.key(), - swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), - swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), - oracle: ctx.accounts.oracle.key(), - system_program: ctx.accounts.system_program.key(), - token_program: ctx.accounts.token_program.key(), - whirlpool: ctx.accounts.whirlpool.key(), - orca_whirlpool_program: whirlpool::ID, - whirlpool_token_a_vault: whirlpool_state.token_vault_a, - whirlpool_token_b_vault: whirlpool_state.token_vault_b, - } - .to_account_metas(Some(true)), - // REMAINING ACCOUNTS - tick_array_pubkeys - .iter() - .map(|pk| AccountMeta::new(*pk, false)) - .collect::>(), - ] - .concat(), - data: crate::instruction::OrcaWhirlpoolSwap { amount, a_to_b }.data(), + accounts: crate::accounts::OrcaWhirlpoolPreSwap { + a_mint: ctx.accounts.a_mint.key(), + b_mint: ctx.accounts.b_mint.key(), + authority_a_vault: ctx.accounts.authority_a_vault.key(), + authority_b_vault: ctx.accounts.authority_b_vault.key(), + swap_thread: ctx.accounts.swap_thread.key(), + swap_thread_a_vault: ctx.accounts.swap_thread_a_vault.key(), + swap_thread_b_vault: ctx.accounts.swap_thread_b_vault.key(), + oracle: ctx.accounts.oracle.key(), + system_program: ctx.accounts.system_program.key(), + token_program: ctx.accounts.token_program.key(), + whirlpool: whirlpool.key(), + orca_whirlpool_program: whirlpool::ID, + whirlpool_token_a_vault: whirlpool.token_vault_a, + whirlpool_token_b_vault: whirlpool.token_vault_b, + } + .to_account_metas(Some(true)), + data: crate::instruction::OrcaWhirlpoolPreswap { amount, a_to_b }.data(), } .into(), ), diff --git a/swap/programs/swap/src/lib.rs b/swap/programs/swap/src/lib.rs index 98d6715..0730b37 100644 --- a/swap/programs/swap/src/lib.rs +++ b/swap/programs/swap/src/lib.rs @@ -11,6 +11,16 @@ use instructions::*; pub mod swap { use super::*; + // grab tick arrays for orca whirlpool swap + pub fn orca_whirlpool_preswap<'info>( + ctx: Context>, + amount: u64, + a_to_b: bool, + ) -> Result { + orca_whirlpool_preswap::handler(ctx, amount, a_to_b) + } + + // perform orca whirlpool swap pub fn orca_whirlpool_swap<'info>( ctx: Context<'_, '_, '_, 'info, OrcaWhirlpoolSwap<'info>>, amount: u64, From 7b6245a5a52b4e2af927ca4c46b9597545647e6d Mon Sep 17 00:00:00 2001 From: Eliascm17 Date: Tue, 21 Feb 2023 22:43:00 -0700 Subject: [PATCH 4/6] export sqrt_price method --- swap/crates/whirlpool/Cargo.toml | 2 ++ swap/crates/whirlpool/src/utils.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/swap/crates/whirlpool/Cargo.toml b/swap/crates/whirlpool/Cargo.toml index d8f518b..35ef01e 100644 --- a/swap/crates/whirlpool/Cargo.toml +++ b/swap/crates/whirlpool/Cargo.toml @@ -13,3 +13,5 @@ cpi = ["no-entrypoint"] [dependencies] anchor-lang = "0.26.0" anchor-gen = { git = "https://github.com/eliascm17/anchor-gen", version = "^0.3.1", features = ["compat-program-result"] } +whirlpool = { git = "https://github.com/orca-so/whirlpools", tag = "0.2.0", package = "whirlpool", features = ["cpi"] } +rust_decimal = { version = "1.23", features = ["maths"] } \ No newline at end of file diff --git a/swap/crates/whirlpool/src/utils.rs b/swap/crates/whirlpool/src/utils.rs index 5f6da34..1bfbc69 100644 --- a/swap/crates/whirlpool/src/utils.rs +++ b/swap/crates/whirlpool/src/utils.rs @@ -1,4 +1,5 @@ use anchor_lang::prelude::Pubkey; +pub use whirlpool::math::sqrt_price_from_tick_index; pub const MAX_TICK_INDEX: i32 = 443636; pub const MIN_TICK_INDEX: i32 = -443636; From 4123edb9130cce3ca00402c7e13f2b3419fc4c56 Mon Sep 17 00:00:00 2001 From: Eliascm17 Date: Tue, 21 Feb 2023 22:53:46 -0700 Subject: [PATCH 5/6] update client to use pre-swap ix at initialization --- swap/client/src/main.rs | 94 +++++++++++++++++++++------------------- swap/client/src/utils.rs | 6 +-- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/swap/client/src/main.rs b/swap/client/src/main.rs index f5d1dfd..68a1049 100644 --- a/swap/client/src/main.rs +++ b/swap/client/src/main.rs @@ -1,13 +1,8 @@ -use whirlpool::utils::get_tick_array_pubkeys; - mod utils; use { anchor_lang::{prelude::*, system_program, InstructionData}, - anchor_spl::{ - associated_token::get_associated_token_address, - token::{self}, - }, + anchor_spl::{associated_token::get_associated_token_address, token}, clockwork_client::{ thread::{ state::Thread, @@ -22,6 +17,7 @@ use { spl_associated_token_account::instruction::create_associated_token_account, std::str::FromStr, utils::*, + whirlpool::{utils::get_tick_array_pubkeys, TickArray}, }; fn main() -> ClientResult<()> { @@ -30,12 +26,20 @@ fn main() -> ClientResult<()> { let bonk_usdc_whirlpool = WhirlpoolParams { whirlpool: Pubkey::from_str("8QaXeHBrShJTdtN1rWCccBxpSVvKksQ2PCu5nufb2zbk").unwrap(), token_mint_a: Pubkey::from_str("DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263").unwrap(), // BONK + token_a_decimals: 5, token_mint_b: Pubkey::from_str("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v").unwrap(), // USDC + token_b_decimals: 6, oracle: Pubkey::from_str("4QqfXtmcMfHAQstgVuhDqY1UyHzyiBfwMrz7Jbgt8aQL").unwrap(), }; #[cfg(not(feature = "delete"))] - dca_create(&client, &bonk_usdc_whirlpool, "BONK_USDC_WP_DCA".into())?; + dca_create( + &client, + &bonk_usdc_whirlpool, + "BONK_USDC_WP_DCA".into(), + 1000000, + true, + )?; #[cfg(feature = "delete")] swap_delete(&client, "BONK_USDC_WP_DCA".into())?; @@ -47,7 +51,11 @@ fn dca_create( client: &Client, whirlpool_params: &WhirlpoolParams, swap_thread_id: String, + amount: u64, + a_to_b: bool, ) -> ClientResult<()> { + let whirlpool_id = Pubkey::from_str("whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc").unwrap(); + let swap_thread_pubkey = Thread::pubkey(client.payer_pubkey(), swap_thread_id.clone()); // BONK vaults @@ -110,52 +118,50 @@ fn dca_create( let whirlpool_state = whirlpool::state::Whirlpool::try_deserialize(&mut whirlpool_data).unwrap(); - let orca_whirlpool_swap_data = swap::instruction::OrcaWhirlpoolSwap { - amount: 100000, - a_to_b: false, - }; - - let tick_array = get_tick_array_pubkeys( + let tick_array_pubkeys = get_tick_array_pubkeys( whirlpool_state.tick_current_index, whirlpool_state.tick_spacing, - orca_whirlpool_swap_data.a_to_b, - &whirlpool::ID, + a_to_b, + &whirlpool_id, &whirlpool_params.whirlpool, ); + let mut tick_arrays: Vec = Vec::with_capacity(3); + + for i in 0..3 { + match client.get_account_data(&tick_array_pubkeys[i]) { + Ok(data) => { + tick_arrays + .push(whirlpool::TickArray::try_deserialize(&mut data.as_slice()).unwrap()); + } + Err(_) => {} + } + } + // create thread to transfer & swap let thread_create_swap_ix = thread_create( client.payer_pubkey(), swap_thread_id, Instruction { program_id: swap::ID, - accounts: [ - swap::accounts::OrcaWhirlpoolSwap { - a_mint: whirlpool_state.token_mint_a, - b_mint: whirlpool_state.token_mint_b, - authority_a_vault: authority_a_vault_pubkey, - authority_b_vault: authority_b_vault_pubkey, - swap_thread: swap_thread_pubkey, - swap_thread_a_vault: swap_thread_a_vault_pubkey, - swap_thread_b_vault: swap_thread_b_vault_pubkey, - oracle: whirlpool_params.oracle, - system_program: system_program::ID, - token_program: token::ID, - whirlpool: whirlpool_params.whirlpool, - orca_whirlpool_program: whirlpool::ID, - whirlpool_token_a_vault: whirlpool_state.token_vault_a, - whirlpool_token_b_vault: whirlpool_state.token_vault_b, - } - .to_account_metas(Some(true)), - // REMAINING ACCOUNTS - vec![ - AccountMeta::new(tick_array[0], false), - AccountMeta::new(tick_array[1], false), - AccountMeta::new(tick_array[2], false), - ], - ] - .concat(), - data: orca_whirlpool_swap_data.data(), + accounts: swap::accounts::OrcaWhirlpoolPreSwap { + a_mint: whirlpool_state.token_mint_a, + b_mint: whirlpool_state.token_mint_b, + authority_a_vault: authority_a_vault_pubkey, + authority_b_vault: authority_b_vault_pubkey, + swap_thread: swap_thread_pubkey, + swap_thread_a_vault: swap_thread_a_vault_pubkey, + swap_thread_b_vault: swap_thread_b_vault_pubkey, + oracle: whirlpool_params.oracle, + system_program: system_program::ID, + token_program: token::ID, + whirlpool: whirlpool_params.whirlpool, + orca_whirlpool_program: whirlpool_id, + whirlpool_token_a_vault: whirlpool_state.token_vault_a, + whirlpool_token_b_vault: whirlpool_state.token_vault_b, + } + .to_account_metas(Some(true)), + data: swap::instruction::OrcaWhirlpoolPreswap { amount, a_to_b }.data(), } .into(), client.payer_pubkey(), @@ -170,7 +176,7 @@ fn dca_create( let approve_token_delegation_ix = anchor_spl::token::spl_token::instruction::approve( &token::ID, - if orca_whirlpool_swap_data.a_to_b { + if a_to_b { &authority_a_vault_pubkey } else { &authority_b_vault_pubkey @@ -222,7 +228,7 @@ fn dca_create( ] .concat(), Some(vec![client.payer()]), - "stateless swap thread create, fund, approve, init ATAs".to_string(), + "stateless swap - thread create, fund thread, approve TA, init ATAs".to_string(), )?; Ok(()) diff --git a/swap/client/src/utils.rs b/swap/client/src/utils.rs index 012438c..7867d70 100644 --- a/swap/client/src/utils.rs +++ b/swap/client/src/utils.rs @@ -41,11 +41,7 @@ pub fn sign_send_and_confirm_tx( } pub fn default_client() -> Client { - #[cfg(not(feature = "localnet"))] let host = "https://api.mainnet-beta.solana.com"; - #[cfg(feature = "localnet")] - let host = "http://localhost:8899"; - let config_file = solana_cli_config::CONFIG_FILE.as_ref().unwrap().as_str(); let config = solana_cli_config::Config::load(config_file).unwrap(); let payer = read_keypair_file(&config.keypair_path).unwrap(); @@ -66,6 +62,8 @@ pub fn print_explorer_link(address: Pubkey, label: String) -> ClientResult<()> { pub struct WhirlpoolParams { pub whirlpool: Pubkey, pub token_mint_a: Pubkey, + pub token_a_decimals: i8, pub token_mint_b: Pubkey, + pub token_b_decimals: i8, pub oracle: Pubkey, } From 9724d86c3d2544519197d08e189052bc06f872c2 Mon Sep 17 00:00:00 2001 From: Eliascm17 Date: Tue, 21 Feb 2023 22:59:34 -0700 Subject: [PATCH 6/6] misc. --- swap/Cargo.lock | 546 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 507 insertions(+), 39 deletions(-) diff --git a/swap/Cargo.lock b/swap/Cargo.lock index ee05e44..65dd693 100644 --- a/swap/Cargo.lock +++ b/swap/Cargo.lock @@ -89,6 +89,19 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "anchor-attribute-access-control" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "anyhow", + "proc-macro2 1.0.51", + "quote 1.0.23", + "regex", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-access-control" version = "0.26.0" @@ -102,6 +115,20 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-attribute-account" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "anyhow", + "bs58 0.4.0", + "proc-macro2 1.0.51", + "quote 1.0.23", + "rustversion", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-account" version = "0.26.0" @@ -116,6 +143,16 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-attribute-constant" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "proc-macro2 1.0.51", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-constant" version = "0.26.0" @@ -126,6 +163,17 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-attribute-error" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-error" version = "0.26.0" @@ -137,6 +185,18 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-attribute-event" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "anyhow", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-event" version = "0.26.0" @@ -149,6 +209,19 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-attribute-interface" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "anyhow", + "heck 0.3.3", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-interface" version = "0.26.0" @@ -162,6 +235,18 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-attribute-program" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "anyhow", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-program" version = "0.26.0" @@ -174,6 +259,18 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-attribute-state" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "anyhow", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "anchor-attribute-state" version = "0.26.0" @@ -186,6 +283,18 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-derive-accounts" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-syn 0.20.1", + "anyhow", + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "anchor-derive-accounts" version = "0.26.0" @@ -240,40 +349,92 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "anchor-lang" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-attribute-access-control 0.20.1", + "anchor-attribute-account 0.20.1", + "anchor-attribute-constant 0.20.1", + "anchor-attribute-error 0.20.1", + "anchor-attribute-event 0.20.1", + "anchor-attribute-interface 0.20.1", + "anchor-attribute-program 0.20.1", + "anchor-attribute-state 0.20.1", + "anchor-derive-accounts 0.20.1", + "arrayref", + "base64 0.13.1", + "bincode", + "borsh 0.9.3", + "bytemuck", + "solana-program", + "thiserror", +] + [[package]] name = "anchor-lang" version = "0.26.0" source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-attribute-access-control", - "anchor-attribute-account", - "anchor-attribute-constant", - "anchor-attribute-error", - "anchor-attribute-event", - "anchor-attribute-interface", - "anchor-attribute-program", - "anchor-attribute-state", - "anchor-derive-accounts", + "anchor-attribute-access-control 0.26.0", + "anchor-attribute-account 0.26.0", + "anchor-attribute-constant 0.26.0", + "anchor-attribute-error 0.26.0", + "anchor-attribute-event 0.26.0", + "anchor-attribute-interface 0.26.0", + "anchor-attribute-program 0.26.0", + "anchor-attribute-state 0.26.0", + "anchor-derive-accounts 0.26.0", "arrayref", "base64 0.13.1", "bincode", - "borsh", + "borsh 0.9.3", "bytemuck", "solana-program", "thiserror", ] +[[package]] +name = "anchor-spl" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anchor-lang 0.20.1", + "solana-program", + "spl-associated-token-account", + "spl-token", +] + [[package]] name = "anchor-spl" version = "0.26.0" source = "git+https://github.com/Eliascm17/anchor?branch=macros-with-capacity#5a7769c9a4f5e7b712b06dadfd3011eb35d5970c" dependencies = [ - "anchor-lang", + "anchor-lang 0.26.0", "solana-program", "spl-associated-token-account", "spl-token", ] +[[package]] +name = "anchor-syn" +version = "0.20.1" +source = "git+https://github.com/project-serum/anchor?tag=v0.20.1#a81ff88d76956533a4ca5ae74d5dec37d7d76b51" +dependencies = [ + "anyhow", + "bs58 0.3.1", + "heck 0.3.3", + "proc-macro2 1.0.51", + "proc-macro2-diagnostics", + "quote 1.0.23", + "serde", + "serde_json", + "sha2 0.9.9", + "syn 1.0.107", + "thiserror", +] + [[package]] name = "anchor-syn" version = "0.26.0" @@ -536,18 +697,41 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" dependencies = [ - "borsh-derive", + "borsh-derive 0.9.3", "hashbrown 0.11.2", ] +[[package]] +name = "borsh" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40f9ca3698b2e4cb7c15571db0abc5551dca417a21ae8140460b50309bb2cc62" +dependencies = [ + "borsh-derive 0.10.2", + "hashbrown 0.12.3", +] + [[package]] name = "borsh-derive" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2 1.0.51", + "syn 1.0.107", +] + +[[package]] +name = "borsh-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598b3eacc6db9c3ee57b22707ad8f6a8d2f6d442bfe24ffeb8cbb70ca59e6a35" +dependencies = [ + "borsh-derive-internal 0.10.2", + "borsh-schema-derive-internal 0.10.2", "proc-macro-crate 0.1.5", "proc-macro2 1.0.51", "syn 1.0.107", @@ -564,6 +748,17 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "borsh-derive-internal" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186b734fa1c9f6743e90c95d7233c9faab6360d1a96d4ffa19d9cfd1e9350f8a" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "borsh-schema-derive-internal" version = "0.9.3" @@ -575,6 +770,17 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99b7ff1008316626f485991b960ade129253d4034014616b94f309a15366cc49" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "brotli" version = "3.3.4" @@ -624,6 +830,27 @@ dependencies = [ "serde", ] +[[package]] +name = "bytecheck" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d11cac2c12b5adc6570dad2ee1b87eff4955dac476fe12d81e5fdd352e52406f" +dependencies = [ + "bytecheck_derive", + "ptr_meta", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "bytemuck" version = "1.13.0" @@ -762,10 +989,10 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d8d7ae5aa361c17cb3d58b80f2143bb784031413f6a8f8978903696f5d486" dependencies = [ - "anchor-lang", - "anchor-spl", + "anchor-lang 0.26.0", + "anchor-spl 0.26.0", "bincode", - "borsh", + "borsh 0.9.3", "clockwork-network-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "clockwork-thread-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "clockwork-utils 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -800,8 +1027,8 @@ dependencies = [ name = "clockwork-network-program" version = "1.4.2" dependencies = [ - "anchor-lang", - "anchor-spl", + "anchor-lang 0.26.0", + "anchor-spl 0.26.0", "clockwork-utils 1.4.2", ] @@ -811,8 +1038,8 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "358aa1fb9a328d355cababfabb5ca69134a8bc703d355fe2979442441e30d6b7" dependencies = [ - "anchor-lang", - "anchor-spl", + "anchor-lang 0.26.0", + "anchor-spl 0.26.0", "clockwork-utils 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -820,7 +1047,7 @@ dependencies = [ name = "clockwork-sdk" version = "1.4.2" dependencies = [ - "anchor-lang", + "anchor-lang 0.26.0", "chrono", "clockwork-thread-program 1.4.2", "nom", @@ -831,7 +1058,7 @@ dependencies = [ name = "clockwork-thread-program" version = "1.4.2" dependencies = [ - "anchor-lang", + "anchor-lang 0.26.0", "chrono", "clockwork-cron 1.4.2", "clockwork-network-program 1.4.2", @@ -846,7 +1073,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00d8201d1680a1540e157a0a9f3cb84d9cc9a25ad66fcb9328c6f94b2fe14175" dependencies = [ - "anchor-lang", + "anchor-lang 0.26.0", "chrono", "clockwork-cron 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "clockwork-network-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -859,7 +1086,7 @@ dependencies = [ name = "clockwork-utils" version = "1.4.2" dependencies = [ - "anchor-lang", + "anchor-lang 0.26.0", "base64 0.13.1", "static-pubkey", ] @@ -870,7 +1097,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26a6168b2af3007a81363951be00237defe4152e77e407d96f365f5de1a6dd37" dependencies = [ - "anchor-lang", + "anchor-lang 0.26.0", "base64 0.13.1", "static-pubkey", ] @@ -881,7 +1108,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f198bfb4e8e6fb1d7320d65fd603d0a41045cf31d8e8261f0b4a3d5cedf39" dependencies = [ - "anchor-lang", + "anchor-lang 0.26.0", "clockwork-network-program 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1635,6 +1862,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "histogram" version = "0.6.9" @@ -2089,6 +2322,66 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "mpl-token-auth-rules" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69803fbfbc4bb0327de86f49d2639692c7c60276cb87d6cced84bb8189f2000" +dependencies = [ + "borsh 0.9.3", + "mpl-token-metadata-context-derive", + "num-derive", + "num-traits", + "rmp-serde", + "serde", + "shank", + "solana-program", + "solana-zk-token-sdk", + "thiserror", +] + +[[package]] +name = "mpl-token-metadata" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678bb3110abc45bb32e81f80ede7420ce9069d0feb872e7423779bf9a20d1f0" +dependencies = [ + "arrayref", + "borsh 0.9.3", + "mpl-token-auth-rules", + "mpl-token-metadata-context-derive", + "mpl-utils", + "num-derive", + "num-traits", + "shank", + "solana-program", + "spl-associated-token-account", + "spl-token", + "thiserror", +] + +[[package]] +name = "mpl-token-metadata-context-derive" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12989bc45715b0ee91944855130131479f9c772e198a910c3eb0ea327d5bffc3" +dependencies = [ + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "mpl-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc48e64c50dba956acb46eec86d6968ef0401ef37031426da479f1f2b592066" +dependencies = [ + "arrayref", + "borsh 0.9.3", + "solana-program", + "spl-token", +] + [[package]] name = "nix" version = "0.24.3" @@ -2312,6 +2605,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + [[package]] name = "pbkdf2" version = "0.4.0" @@ -2451,6 +2750,26 @@ dependencies = [ "yansi", ] +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "qstring" version = "0.7.2" @@ -2691,6 +3010,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "rend" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +dependencies = [ + "bytecheck", +] + [[package]] name = "reqwest" version = "0.11.14" @@ -2747,6 +3075,53 @@ dependencies = [ "winapi", ] +[[package]] +name = "rkyv" +version = "0.7.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c30f1d45d9aa61cbc8cd1eb87705470892289bb2d01943e7803b873a57404dc3" +dependencies = [ + "bytecheck", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "rmp" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b13be192e0220b8afb7222aa5813cb62cc269ebb5cac346ca6487681d2913e" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + [[package]] name = "rpassword" version = "6.0.1" @@ -2759,6 +3134,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "rust_decimal" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13cf35f7140155d02ba4ec3294373d513a3c7baa8364c162b030e33c61520a8" +dependencies = [ + "arrayvec", + "borsh 0.10.2", + "bytecheck", + "byteorder", + "bytes", + "num-traits", + "rand 0.8.5", + "rkyv", + "serde", + "serde_json", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -2868,6 +3261,12 @@ dependencies = [ "untrusted", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "security-framework" version = "2.8.2" @@ -3018,6 +3417,40 @@ dependencies = [ "keccak", ] +[[package]] +name = "shank" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63e565b5e95ad88ab38f312e89444c749360641c509ef2de0093b49f55974a5" +dependencies = [ + "shank_macro", +] + +[[package]] +name = "shank_macro" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" +dependencies = [ + "proc-macro2 1.0.51", + "quote 1.0.23", + "shank_macro_impl", + "syn 1.0.107", +] + +[[package]] +name = "shank_macro_impl" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" +dependencies = [ + "anyhow", + "proc-macro2 1.0.51", + "quote 1.0.23", + "serde", + "syn 1.0.107", +] + [[package]] name = "shell-words" version = "1.1.0" @@ -3386,8 +3819,8 @@ dependencies = [ "bincode", "bitflags", "blake3", - "borsh", - "borsh-derive", + "borsh 0.9.3", + "borsh-derive 0.9.3", "bs58 0.4.0", "bv", "bytemuck", @@ -3491,7 +3924,7 @@ dependencies = [ "base64 0.13.1", "bincode", "bitflags", - "borsh", + "borsh 0.9.3", "bs58 0.4.0", "bytemuck", "byteorder", @@ -3583,7 +4016,7 @@ dependencies = [ "Inflector", "base64 0.13.1", "bincode", - "borsh", + "borsh 0.9.3", "bs58 0.4.0", "lazy_static", "log", @@ -3694,7 +4127,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbc000f0fdf1f12f99d77d398137c1751345b18c88258ce0f99b7872cf6c9bd6" dependencies = [ "assert_matches", - "borsh", + "borsh 0.9.3", "num-derive", "num-traits", "solana-program", @@ -3749,15 +4182,15 @@ dependencies = [ name = "stateless-swap-client" version = "0.1.0" dependencies = [ - "anchor-lang", - "anchor-spl", + "anchor-lang 0.26.0", + "anchor-spl 0.26.0", "bytemuck", "clockwork-client", "solana-cli-config", "solana-sdk", "spl-associated-token-account", "swap", - "whirlpool", + "whirlpool 0.1.0", ] [[package]] @@ -3772,6 +4205,12 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.8.0" @@ -3794,10 +4233,10 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" name = "swap" version = "0.1.0" dependencies = [ - "anchor-lang", - "anchor-spl", + "anchor-lang 0.26.0", + "anchor-spl 0.26.0", "clockwork-sdk", - "whirlpool", + "whirlpool 0.1.0", ] [[package]] @@ -4145,6 +4584,18 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unicode-bidi" version = "0.3.10" @@ -4379,7 +4830,24 @@ name = "whirlpool" version = "0.1.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.26.0", + "rust_decimal", + "whirlpool 0.1.0 (git+https://github.com/orca-so/whirlpools?tag=0.2.0)", +] + +[[package]] +name = "whirlpool" +version = "0.1.0" +source = "git+https://github.com/orca-so/whirlpools?tag=0.2.0#34040c0645094dbf70ed31480a7d5c0804371620" +dependencies = [ + "anchor-lang 0.20.1", + "anchor-spl 0.20.1", + "borsh 0.9.3", + "mpl-token-metadata", + "solana-program", + "spl-token", + "thiserror", + "uint", ] [[package]]