diff --git a/Anchor.example.toml b/Anchor.example.toml index f0b74a0..c853c74 100644 --- a/Anchor.example.toml +++ b/Anchor.example.toml @@ -9,12 +9,12 @@ cluster = "localnet" wallet = [scripts] -test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" +test = "yarn run ts-mocha -p --parallel ./tsconfig.json -t 1000000 tests/**/*.ts" [test.validator] url = "mainnet" [[test.validator.clone]] -address = "GxJJd3q28eUd7kpPCbNXGeixqHmBYJ2owqUYqse3ZrGS" +address = "8nzxsNf74ZHDguHi51SjQWxDxegL2DBgxeGHA2pQVtTJ" [[test.validator.clone]] -address = "DQFt5uWLeXQKfQkwuiojaGPgdF5bFa4hgDiS4HSFFadV" +address = "K2z1qkxZdsw6WpFd63hqhqx9MYUc5c85NdbXULNeGhW" diff --git a/Cargo.lock b/Cargo.lock index 604856b..f7e74b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e53fd8d0aa034bb2e647c39eec4e399095438dbc83526949ac6a072e3c4ce7" +checksum = "a9b75d05b6b4ac9d95bb6e3b786b27d3a708c4c5a87c92ffaa25bbe9ae4c5d91" dependencies = [ "anchor-syn", "anyhow", @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "362b1b119372b38cdd45949bd8f09a8f5c56a701d49a747fc43d7a59393b647f" +checksum = "485351a6d8157750d10d88c8e256f1bf8339262b2220ae9125aed3471309b5de" dependencies = [ "anchor-syn", "anyhow", @@ -46,11 +46,22 @@ dependencies = [ "syn", ] +[[package]] +name = "anchor-attribute-constant" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc632c540913dd051a78b00587cc47f57013d303163ddfaf4fa18717f7ccc1e0" +dependencies = [ + "anchor-syn", + "proc-macro2", + "syn", +] + [[package]] name = "anchor-attribute-error" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c8be43ca34309afcafb24274bba6733b6b5d59be47f1cc11ef3afe9584e5cd" +checksum = "3b5bd1dcfa7f3bc22dacef233d70a9e0bee269c4ac484510662f257cba2353a1" dependencies = [ "anchor-syn", "proc-macro2", @@ -60,9 +71,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899640f277f8296da82d6505312b03a4cd4901c3c6d6fe8eb3ca2db33f26ebb9" +checksum = "6c6f9e6ce551ac9a177a45c99a65699a860c9e95fac68675138af1246e2591b0" dependencies = [ "anchor-syn", "anyhow", @@ -73,9 +84,9 @@ dependencies = [ [[package]] name = "anchor-attribute-interface" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f514a6502a0ad56f321df492f1c699ee8ad3912c6354acd087f3d28431a0fac4" +checksum = "d104aa17418cb329ed7418b227e083d5f326a27f26ce98f5d92e33da62a5f459" dependencies = [ "anchor-syn", "anyhow", @@ -87,9 +98,9 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadc2f9bcaeb3be4a8efb76c455bc772b5d257c01796b415eb3aa4bd93ed43fe" +checksum = "b6831b920b173c004ddf7ae1167d1d25e9f002ffcb1773bbc5c7ce532a4441e1" dependencies = [ "anchor-syn", "anyhow", @@ -100,9 +111,9 @@ dependencies = [ [[package]] name = "anchor-attribute-state" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adbff8f1a2b53a42ef547f3188e25f7e3d6933113ab0f94b11afb825eee80f47" +checksum = "cde147b10c71d95dc679785db0b5f3abac0091f789167aa62ac0135e2f54e8b9" dependencies = [ "anchor-syn", "anyhow", @@ -113,9 +124,9 @@ dependencies = [ [[package]] name = "anchor-derive-accounts" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458185d8bd23559f6ed35c4a7a7d0f83ac4d7837b2e790d90e50cafc9371503e" +checksum = "9cde98a0e1a56046b040ff591dfda391f88917af2b6487d02b45093c05be3514" dependencies = [ "anchor-syn", "anyhow", @@ -126,30 +137,45 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46dd615c2eb55d88de8800c46fa7ed51ef045d76ed669222a798976d0a447f59" +checksum = "a85dd2c5e29e20c7f4701a43724d6cd5406d0ee5694705522e43da0f26542a84" 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.0", + "bincode", "borsh", "bytemuck", "solana-program", "thiserror", ] +[[package]] +name = "anchor-spl" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0188c33b4a3c124c4e593f2b440415aaea70a7650fac6ba0772395385d71c003" +dependencies = [ + "anchor-lang", + "solana-program", + "spl-associated-token-account", + "spl-token", +] + [[package]] name = "anchor-syn" -version = "0.18.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77faec86e3bf8e15568d026bd586e381910610544aa0b2642b942b37698029e5" +checksum = "03549dc2eae0b20beba6333b14520e511822a6321cdb1760f841064a69347316" dependencies = [ "anyhow", "bs58 0.3.1", @@ -195,9 +221,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" @@ -228,17 +254,16 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake3" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "526c210b4520e416420759af363083471656e819a75e831b8d2c9d5a584f2413" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "crypto-mac 0.11.1", - "digest", + "digest 0.10.3", ] [[package]] @@ -251,6 +276,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + [[package]] name = "block-padding" version = "0.2.1" @@ -275,7 +309,7 @@ checksum = "684155372435f578c0fa1acd13ebbb182cc19d6b38b64ae7901da4393217d264" dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "syn", ] @@ -316,9 +350,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bumpalo" -version = "3.8.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "bv" @@ -408,7 +442,9 @@ name = "cross-pile" version = "0.1.0" dependencies = [ "anchor-lang", + "anchor-spl", "solrand", + "spl-token", ] [[package]] @@ -418,20 +454,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "crypto-mac" -version = "0.8.0" +name = "crypto-common" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ "generic-array", - "subtle", + "typenum", ] [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array", "subtle", @@ -439,12 +475,12 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" dependencies = [ "byteorder", - "digest", + "digest 0.9.0", "rand_core", "subtle", "zeroize", @@ -459,6 +495,17 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", +] + [[package]] name = "either" version = "1.6.1" @@ -541,8 +588,8 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac 0.8.0", - "digest", + "crypto-mac", + "digest 0.9.0", ] [[package]] @@ -551,7 +598,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ - "digest", + "digest 0.9.0", "generic-array", "hmac", ] @@ -588,9 +635,9 @@ checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] @@ -621,7 +668,7 @@ checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" dependencies = [ "arrayref", "base64 0.12.3", - "digest", + "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", "libsecp256k1-gen-ecmult", @@ -639,7 +686,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" dependencies = [ "crunchy", - "digest", + "digest 0.9.0", "subtle", ] @@ -663,10 +710,11 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ + "autocfg", "scopeguard", ] @@ -687,9 +735,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" -version = "0.5.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" dependencies = [ "libc", ] @@ -714,6 +762,27 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "opaque-debug" version = "0.3.0" @@ -760,6 +829,16 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro2" version = "1.0.36" @@ -834,9 +913,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] @@ -887,9 +966,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" -version = "1.0.4" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" [[package]] name = "serde" @@ -937,10 +1016,10 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] @@ -950,23 +1029,23 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.9.0", + "digest 0.9.0", "keccak", "opaque-debug", ] [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "solana-frozen-abi" -version = "1.9.2" +version = "1.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fd67f1408118e24d056251c5ae2cc11512ebcf1337500c0df886b6e95176404" +checksum = "f0a9783aac947e789852cbd6f4650521f8f6f744cba5fc0524a8bc104fa11e01" dependencies = [ "bs58 0.4.0", "bv", @@ -984,9 +1063,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.9.2" +version = "1.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e91b2f34d96a4cb05e780bfc59ed0f411c2de035ce4f00bef04b1bd314a423" +checksum = "f32ebf882f69105e64e283966d9ce0dd22696aec8b8de9bb6b61ea26c7fc896a" dependencies = [ "proc-macro2", "quote", @@ -996,9 +1075,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.9.2" +version = "1.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f2dbc47d8a5104f5e0d0b78398603c979da1c8f668f72184257a3afc912516" +checksum = "aa8b0587f360598ef3a9444e05dce63e701a5c008c54101f54707b5f5852ec09" dependencies = [ "env_logger", "lazy_static", @@ -1007,9 +1086,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.9.2" +version = "1.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "892c969af68555ebf498beb550da817b08e836d5ba58ce09df18f146317bd142" +checksum = "252118d7b708b0bec7e1ec5aeb3397843c8d9dbe8946f04fcebed06c5d3a32c7" dependencies = [ "base64 0.13.0", "bincode", @@ -1050,9 +1129,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.9.2" +version = "1.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf60865744bbde0602df80f21c10c4c177a4b735e7c1d366914b9b7a585ed844" +checksum = "6340ca326c8a919575e594a3ca71a380c233ae2615f62acd15c7af4f2aafb21d" dependencies = [ "bs58 0.4.0", "proc-macro2", @@ -1063,13 +1142,37 @@ dependencies = [ [[package]] name = "solrand" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc47926f175c6c0bae667d236e17725cb2f7ea20d2a3f6d98a4af939711ab5d" +checksum = "7d1250c3391adac6e32903aa1bad880f633a623bde51a13a81125e53a4b05e4a" dependencies = [ "anchor-lang", ] +[[package]] +name = "spl-associated-token-account" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428" +dependencies = [ + "solana-program", + "spl-token", +] + +[[package]] +name = "spl-token" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc67166ef99d10c18cb5e9c208901e6d8255c6513bb1f877977eba48e6cc4fb" +dependencies = [ + "arrayref", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "thiserror", +] + [[package]] name = "subtle" version = "2.4.1" @@ -1157,9 +1260,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1167,9 +1270,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -1182,9 +1285,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1192,9 +1295,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -1205,15 +1308,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", @@ -1258,6 +1361,6 @@ checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" [[package]] name = "zeroize" -version = "1.4.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" diff --git a/app/challenge.ts b/app/challenge.ts new file mode 100644 index 0000000..51f1516 --- /dev/null +++ b/app/challenge.ts @@ -0,0 +1,103 @@ +import { web3, workspace } from '@project-serum/anchor'; +import { TypeDef } from '@project-serum/anchor/dist/cjs/program/namespace/types'; +import { PublicKey } from '@solana/web3.js'; +import { expect } from 'chai'; + +// full ts class meant to mimic the challenge PDA +// pub initiator: Pubkey, +// pub initiator_tokens_mint: Pubkey, +// pub initiator_tokens_vault: Pubkey, +// pub initiator_wager_token_amount: u64, +// pub acceptor: Pubkey, +// pub acceptor_tokens_mint: Pubkey, +// pub acceptor_tokens_vault: Pubkey, +// pub acceptor_wager_token_amount: u64, +// pub acceptor_wager_approved: bool, +// pub requester: Pubkey, +// pub bump: u8, + +export class Challenge { + // part of initialization + seed: string = "challenge"; + programId: PublicKey; + initiator: PublicKey; + requester: PublicKey; + + // assignAddressAndBump + address: PublicKey; + bump: number; + + // set after new_challenge + initiatorTokensMint: PublicKey; + initiatorTokensVault: PublicKey; + initiatorWagerTokenAmount: number; + + // set after accept_challenge + // removed after decline_acceptor_wager + acceptor: PublicKey; + acceptorTokensVault: PublicKey; + acceptorTokensMint: PublicKey; + acceptorWagerTokenAmount: number; + + // set after approve_acceptor_wager, but initialized to false + acceptorWagerApproved: boolean = false; + + constructor(programId: PublicKey, userPublicKey?: PublicKey, requester?: PublicKey, challengeData?: TypeDef, challengeAddress?: PublicKey) + { + this.programId = programId; + if (userPublicKey !== null) { + this.initiator = userPublicKey; + this.requester = requester; + + this.initiatorTokensMint = PublicKey.default; + this.initiatorTokensVault = PublicKey.default; + this.initiatorWagerTokenAmount = 0; + this.acceptor = PublicKey.default; + this.acceptorTokensVault = PublicKey.default; + this.acceptorTokensMint = PublicKey.default; + this.acceptorWagerTokenAmount = 0; + } + + if (challengeData !== null && challengeData !== undefined) { + this.initiator = challengeData.initiator; + this.bump = challengeData.bump; + this.initiatorTokensMint = challengeData.initiatorTokensMint; + this.initiatorTokensVault = challengeData.initiatorTokensVault; + this.initiatorWagerTokenAmount = Number(challengeData.initiatorWagerTokenAmount); + this.acceptor = challengeData.acceptor; + this.acceptorTokensVault = challengeData.acceptorTokensVault; + this.acceptorTokensMint = challengeData.acceptorTokensMint; + this.acceptorWagerTokenAmount = Number(challengeData.acceptorWagerTokenAmount); + this.acceptorWagerApproved = challengeData.acceptorWagerApproved; + this.requester = challengeData.requester; + } + } + + async assignAddressAndBump(): Promise { + let [address, bump] = await web3.PublicKey.findProgramAddress( + [ + Buffer.from(this.seed), + this.initiator.toBuffer(), + this.requester.toBuffer() + ], + this.programId, + ); + this.address = address; + this.bump = bump; + return address; + } + + isEquivalentTo(otherChallenge: Challenge) { + expect(otherChallenge.initiator.toString(), "initiator").equals(this.initiator.toString()); + expect(otherChallenge.bump, "Bump").equals(this.bump); + expect(otherChallenge.initiatorTokensMint.toString(), "initiatorTokensMint").equals(this.initiatorTokensMint.toString()); + expect(otherChallenge.initiatorTokensVault.toString(), "initiatorTokensVault").equals(this.initiatorTokensVault.toString()); + expect(otherChallenge.initiatorWagerTokenAmount, "initiatorWagerTokenAmount").equals(this.initiatorWagerTokenAmount); + expect(otherChallenge.acceptor.toString(), "acceptor").equals(this.acceptor.toString()); + expect(otherChallenge.acceptorTokensVault.toString(), "acceptorTokensVault").equals(this.acceptorTokensVault.toString()); + expect(otherChallenge.acceptorTokensMint.toString(), "acceptorTokensMint").equals(this.acceptorTokensMint.toString()); + expect(otherChallenge.acceptorWagerTokenAmount, "acceptorWagerTokenAmount").equals(this.acceptorWagerTokenAmount); + expect(otherChallenge.acceptorWagerApproved, "acceptorWagerApproved").equals(this.acceptorWagerApproved); + expect(otherChallenge.requester.toString(), "requester").equals(this.requester.toString()); + } +} \ No newline at end of file diff --git a/app/sessions.ts b/app/sessions.ts new file mode 100644 index 0000000..df85916 --- /dev/null +++ b/app/sessions.ts @@ -0,0 +1,330 @@ +import { web3, Wallet, Provider, Program, setProvider, Idl, BN, AnchorProvider } from '@project-serum/anchor'; +import { Keypair, PublicKey, Connection } from '@solana/web3.js'; +import { CrossPile } from '../target/types/cross_pile'; +import * as spl from '@solana/spl-token'; +import { TimeLogger, CommitmentLevel } from './utils'; +import { Challenge } from './challenge'; +import { PROGRAM_ID } from '@demox-labs/solrand'; + +const solrandId = new web3.PublicKey(PROGRAM_ID); + +export class Session { + userKeypair: Keypair; + idl: Idl; + programId: PublicKey; + seed: string; + solConnection: Connection; + walletWrapper: Wallet; + provider: Provider; + program: Program; + timeLogger: TimeLogger; + tokensSource: spl.Account; + + constructor(program: Program, env: string, timeLogger: TimeLogger) { + this.timeLogger = timeLogger; + this.userKeypair = web3.Keypair.generate();; + this.idl = program.idl; + this.programId = program.programId; + this.seed = "challenge"; + + this.solConnection = new web3.Connection(env); + this.walletWrapper = new Wallet(this.userKeypair); + this.provider = new AnchorProvider(this.solConnection, this.walletWrapper, { + preflightCommitment: 'recent', + commitment: CommitmentLevel.CONFIRMED + }); + this.program = new Program(program.idl, program.programId, this.provider); + timeLogger.log("created Session"); + } + + async getBalance() { + this.timeLogger.log("getting balance for " + this.userKeypair.publicKey); + setProvider(this.provider); + return await this.provider.connection.getBalance(this.userKeypair.publicKey, 'processed'); + } + + async requestAirdrop(amount=10_000_000_000) { + setProvider(this.provider); + + this.timeLogger.log("requesting airdrop of " + amount + " for " + this.userKeypair.publicKey.toString()); + await this.provider.connection.confirmTransaction( + await this.provider.connection.requestAirdrop(this.userKeypair.publicKey, amount), + CommitmentLevel.FINALIZED // need finalized here before we can use this balance + ); + this.timeLogger.log("airdrop complete for " + this.userKeypair.publicKey.toString()); + } + + async getOrCreateAssociatedTokenAccount(tokensMintPublicKey: PublicKey, mintAuthority: Keypair): Promise { + setProvider(this.provider); + return await spl.getOrCreateAssociatedTokenAccount( + this.provider.connection, + mintAuthority, + tokensMintPublicKey, + this.userKeypair.publicKey + ); + } + + async fundTokens(tokenFundAmount: number, mintOfTokens: PublicKey, mintAuthority: Keypair) { + this.timeLogger.log("funding tokens"); + setProvider(this.provider); + + this.tokensSource = await spl.getOrCreateAssociatedTokenAccount( + this.provider.connection, + this.userKeypair, + mintOfTokens, + this.userKeypair.publicKey, + ); + + this.timeLogger.log("tokens source account created"); + + const mintTx = await spl.mintTo( + this.provider.connection, + this.userKeypair, + mintOfTokens, + this.tokensSource.address, + mintAuthority, + tokenFundAmount + ); + + await this.provider.connection.confirmTransaction(mintTx, CommitmentLevel.FINALIZED); + + this.tokensSource = await spl.getOrCreateAssociatedTokenAccount( + this.provider.connection, + this.userKeypair, + mintOfTokens, + this.userKeypair.publicKey, + ); + this.timeLogger.log("tokens funded: " + Number(this.tokensSource.amount).toString()); + this.timeLogger.log("tokens source account funded"); + } +} + +export class User { + session: Session; + tokensVaultAddress: PublicKey; + tokensVaultBump: any; // u8 + acceptorTokensVaultSeed: string = "acceptor_tokens_vault"; + initiatorTokensVaultSeed: string = "initiator_tokens_vault"; + ownTokensTakerAccount: spl.Account; + otherTokensTakerAccount: spl.Account; + opponentOwnTokensTakerAccount: spl.Account; + opponentOtherTokensTakerAccount: spl.Account; + + constructor(session: Session) { + this.session = session; + } + + async newChallenge( + challenge: Challenge, + amountOfTokens: BN, + solrandId: PublicKey, + solrandRequester: PublicKey + ): Promise { + setProvider(this.session.provider); + + [this.tokensVaultAddress, this.tokensVaultBump] = await web3.PublicKey.findProgramAddress( + [Buffer.from(this.initiatorTokensVaultSeed), this.session.userKeypair.publicKey.toBuffer()], + this.session.programId, + ); + + this.session.timeLogger.log("creating new challenge: " + challenge.address.toString()); + this.session.timeLogger.log("wager amount: " + Number(amountOfTokens).toString()); + this.session.timeLogger.log("token source amount: " + this.session.tokensSource.amount); + return await this.session.program.methods.newChallenge( + challenge.bump, + this.tokensVaultBump, + amountOfTokens + ) + .accounts({ + challenge: challenge.address, + initiatorTokensVault: this.tokensVaultAddress, + initiatorTokensMint: this.session.tokensSource.mint, + initiator: this.session.userKeypair.publicKey, + initiatorTokensSource: this.session.tokensSource.address, + requester: solrandRequester, + solrandProgram: solrandId, + systemProgram: web3.SystemProgram.programId, + rent: web3.SYSVAR_RENT_PUBKEY, + tokenProgram: spl.TOKEN_PROGRAM_ID, + }) + .rpc(); + } + + async acceptChallenge( + challengeAddress: PublicKey, + wagerTokenAmount: BN + ): Promise { + setProvider(this.session.provider); + + [this.tokensVaultAddress, this.tokensVaultBump] = await web3.PublicKey.findProgramAddress( + [Buffer.from(this.acceptorTokensVaultSeed), this.session.userKeypair.publicKey.toBuffer()], + this.session.programId, + ); + + return await this.session.program.methods.acceptChallenge( + this.tokensVaultBump, + wagerTokenAmount + ) + .accounts({ + acceptor: this.session.userKeypair.publicKey, + challenge: challengeAddress, + acceptorTokensVault: this.tokensVaultAddress, + acceptorTokensMint: this.session.tokensSource.mint, + acceptorTokensSource: this.session.tokensSource.address, + systemProgram: web3.SystemProgram.programId, + tokenProgram: spl.TOKEN_PROGRAM_ID, + rent: web3.SYSVAR_RENT_PUBKEY, + }) + .rpc(); + } + + async approveAcceptorWager( + challengeAddress: PublicKey, + solrandRequester: PublicKey, + oracle: PublicKey + ): Promise { + setProvider(this.session.provider); + + return await this.session.program.methods.approveAcceptorWager() + .accounts({ + initiator: this.session.userKeypair.publicKey, + challenge: challengeAddress, + requester: solrandRequester, + oracle: oracle, + solrandProgram: solrandId, + systemProgram: web3.SystemProgram.programId, + tokenProgram: spl.TOKEN_PROGRAM_ID, + }) + .rpc(); + } + + async declineAcceptorWager( + challengeAddress: PublicKey, + acceptor: PublicKey, + acceptorTokensVault: PublicKey, + acceptorOwnTokensTaker: PublicKey + ): Promise { + setProvider(this.session.provider); + + return await this.session.program.methods.declineAcceptorWager() + .accounts({ + caller: this.session.userKeypair.publicKey, + challenge: challengeAddress, + acceptor: acceptor, + acceptorTokensVault: acceptorTokensVault, + acceptorOwnTokensTaker: acceptorOwnTokensTaker, + tokenProgram: spl.TOKEN_PROGRAM_ID, + }) + .rpc(); + } + + async revealWinner( + challengeAddress: PublicKey, + initiatorTokensVault: PublicKey, + otherTokensMintPublicKey: PublicKey, + initiatorPubKey: PublicKey, + acceptorTokensVault: PublicKey, + acceptorPubKey: PublicKey, + solrandId: PublicKey, + solrandRequester: PublicKey, + ): Promise + { + setProvider(this.session.provider); + let selfIsAcceptor = this.session.userKeypair.publicKey.toString() === acceptorPubKey.toString(); + let otherPubkey = selfIsAcceptor ? initiatorPubKey : acceptorPubKey; + + this.ownTokensTakerAccount = await spl.getOrCreateAssociatedTokenAccount( + this.session.provider.connection, + this.session.userKeypair, + this.session.tokensSource.mint, + this.session.userKeypair.publicKey, + ); + + this.otherTokensTakerAccount = await spl.getOrCreateAssociatedTokenAccount( + this.session.provider.connection, + this.session.userKeypair, + otherTokensMintPublicKey, + this.session.userKeypair.publicKey, + ); + + this.opponentOwnTokensTakerAccount = await spl.getOrCreateAssociatedTokenAccount( + this.session.provider.connection, + this.session.userKeypair, + otherTokensMintPublicKey, + otherPubkey + ); + + this.opponentOtherTokensTakerAccount = await spl.getOrCreateAssociatedTokenAccount( + this.session.provider.connection, + this.session.userKeypair, + this.session.tokensSource.mint, + otherPubkey + ); + + let acceptorOwnTokensTaker = this.ownTokensTakerAccount.address; + let acceptorOtherTokensTaker = this.otherTokensTakerAccount.address; + let initiatorOwnTokensTaker = this.opponentOwnTokensTakerAccount.address; + let initiatorOtherTokensTaker = this.opponentOtherTokensTakerAccount.address; + + if (!selfIsAcceptor) { + acceptorOwnTokensTaker = this.opponentOwnTokensTakerAccount.address; + acceptorOtherTokensTaker = this.opponentOtherTokensTakerAccount.address; + initiatorOwnTokensTaker = this.ownTokensTakerAccount.address; + initiatorOtherTokensTaker = this.otherTokensTakerAccount.address; + } + + return await this.session.program.methods.revealWinner() + .accounts({ + challenge: challengeAddress, + initiator: initiatorPubKey, + acceptor: acceptorPubKey, + initiatorTokensVault: initiatorTokensVault, + acceptorTokensVault: acceptorTokensVault, + acceptorOwnTokensTaker: acceptorOwnTokensTaker, + acceptorOtherTokensTaker: acceptorOtherTokensTaker, + initiatorOwnTokensTaker: initiatorOwnTokensTaker, + initiatorOtherTokensTaker: initiatorOtherTokensTaker, + requester: solrandRequester, + solrandProgram: solrandId, + systemProgram: web3.SystemProgram.programId, + tokenProgram: spl.TOKEN_PROGRAM_ID, + }) + .rpc(); + } + + async cancelBeforeAcceptor( + challengeAddress: PublicKey, + ) : Promise + { + return await this.session.program.methods.cancelBeforeAcceptor() + .accounts({ + initiator: this.session.userKeypair.publicKey, + challenge: challengeAddress, + initiatorTokensVault: this.tokensVaultAddress, + initiatorOwnTokensTaker: this.session.tokensSource.address, + tokenProgram: spl.TOKEN_PROGRAM_ID + }) + .rpc(); + } + + async cancelAfterAcceptor( + challengeAddress: PublicKey, + acceptor: PublicKey, + acceptorTokensVault: PublicKey, + acceptorTokensSource: PublicKey + ) : Promise + { + return await this.session.program.methods.cancelAfterAcceptor() + .accounts({ + initiator: this.session.userKeypair.publicKey, + challenge: challengeAddress, + initiatorTokensVault: this.tokensVaultAddress, + initiatorOwnTokensTaker: this.session.tokensSource.address, + acceptor: acceptor, + acceptorTokensVault: acceptorTokensVault, + acceptorOwnTokensTaker: acceptorTokensSource, + tokenProgram: spl.TOKEN_PROGRAM_ID + }) + .rpc(); + } +} \ No newline at end of file diff --git a/app/solrandSession.ts b/app/solrandSession.ts new file mode 100644 index 0000000..fa9555a --- /dev/null +++ b/app/solrandSession.ts @@ -0,0 +1,33 @@ +import * as anchor from '@project-serum/anchor'; +import { UserSession } from '@demox-labs/solrand'; +import { Keypair, PublicKey } from '@solana/web3.js'; + +export class SolrandSession { + userSession: UserSession; + + constructor(keypair: Keypair, solrandIDL: any, solrandId: PublicKey, oraclePublicKey: PublicKey, env: string, uuid: number) + { + this.userSession = new UserSession(keypair, solrandIDL, solrandId, oraclePublicKey, env, uuid); + } + + async setAccounts() { + return await this.userSession.setAccounts(); + } + + async initializeAccount(): Promise> { + anchor.setProvider(this.userSession.provider); + + let initTx = await this.userSession.program.methods.initialize(this.userSession.reqBump, this.userSession.uuid) + .accounts({ + requester: this.userSession.reqAccount, + authority: this.userSession.keypair.publicKey, + oracle: this.userSession.oraclePubkey, + rent: anchor.web3.SYSVAR_RENT_PUBKEY, + systemProgram: anchor.web3.SystemProgram.programId + }) + .signers([this.userSession.keypair]) + .rpc(); + + return await this.userSession.provider.connection.confirmTransaction(initTx);//, CommitmentLevel.FINALIZED); + } +} \ No newline at end of file diff --git a/app/utils.ts b/app/utils.ts new file mode 100644 index 0000000..56a3379 --- /dev/null +++ b/app/utils.ts @@ -0,0 +1,133 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from "@project-serum/anchor"; +import { PROGRAM_ID } from '@demox-labs/solrand'; +import { PublicKey } from "@solana/web3.js"; +import { CrossPile } from "../target/types/cross_pile"; +import { Session, User } from "./sessions"; +import { SolrandSession } from "./solrandSession"; +import { Challenge } from "./challenge"; +import * as spl from '@solana/spl-token'; + +const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + +export class TimeLogger { + startTime: number; + lastTimeLogged: number; + logs: any[]; + enabled: boolean = true; + + constructor() { + this.startTime = new Date().getTime(); + this.lastTimeLogged = this.startTime; + this.logs = []; + } + + log(event: string) { + if (this.enabled) { + let time = new Date().getTime(); + let timeElapsedSinceStart = time - this.startTime; + let timeElapsedSinceLastTime = time - this.lastTimeLogged; + let logObject = { + timeElapsedSinceStart: timeElapsedSinceStart, + timeElapsedSinceLastLog: timeElapsedSinceLastTime, + eventName: event + }; + this.logs.push(logObject); + this.lastTimeLogged = time; + console.table(logObject) + } + } + + outputAllLogs() { + if (this.enabled) { + console.table(this.logs); + } + } + + disable() { + this.enabled = false; + } +} + +export function instantiateSessions( + numSessionsToCreate: number, + program: Program, + env: string, + timeLogger: TimeLogger + ): Session[] + { + let sessions = []; + for (var i = 0; i < numSessionsToCreate; i++) { + sessions.push(new Session(program, env, timeLogger)); + } + return sessions; + } + +export async function createChallengesWithAddressAndBump( + programId: PublicKey, + initiators: User[], + solrandSessions: SolrandSession[], + ): Promise + { + let challenges: Challenge[] = []; + for (let i = 0; i < initiators.length; i++) { + let challenge = new Challenge( + programId, + initiators[i].session.userKeypair.publicKey, + solrandSessions[i].userSession.reqAccount); + await challenge.assignAddressAndBump(); + challenges.push(challenge); + } + + return challenges; + } + +export function newChallenges( + initiators: User[], + solrandSessions: SolrandSession[], + initiatorWagerTokenAmount: Number, + expectedChallenges: Challenge[] + ): Promise[] + { + const initiatorWagerTokenAmountBigNumber = new anchor.BN(initiatorWagerTokenAmount); + let newChallengeTransactions: Promise[] = []; + + for (let i = 0; i < initiators.length; i++) { + let initiator = initiators[i]; + let solrandSession = solrandSessions[i]; + let expectedChallenge = expectedChallenges[i]; + + let newChallengeTx = initiator.newChallenge(expectedChallenge, initiatorWagerTokenAmountBigNumber, solrandId, solrandSession.userSession.reqAccount); + + newChallengeTransactions.push(newChallengeTx); + } + + return newChallengeTransactions; + } + +export function createMintsInParallel( + numMints: number, + mintSessionCreator: Session, + ): Promise[] + { + let mintCreationPromises: Promise[] = []; + for (let i = 0; i < numMints; i++) { + let mintPromise = spl.createMint( + mintSessionCreator.provider.connection, + mintSessionCreator.userKeypair, + mintSessionCreator.userKeypair.publicKey, + null, // don't need a freeze authority for the example mint + 9, // decimal places 9, could change this to 1 if we wanted this mint to be explicitly for an NFT + anchor.web3.Keypair.generate(), + ); + mintCreationPromises.push(mintPromise); + } + + return mintCreationPromises; + } + +export enum CommitmentLevel { + PROCESSED = "processed", + CONFIRMED = "confirmed", + FINALIZED = "finalized" +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ff58aef..5a2947d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,39 +5,24 @@ "packages": { "": { "dependencies": { - "@demox_labs/solrand": "^0.0.3", - "@demox-labs/solrand": "^0.0.3", - "@project-serum/anchor": "^0.18.2", - "@project-serum/anchor-cli": "0.18.2" + "@demox-labs/solrand": "^0.0.5", + "@project-serum/anchor": "^0.24.2", + "@project-serum/anchor-cli": "0.24.2", + "@solana/spl-token": "^0.2.0" }, "devDependencies": { "@types/mocha": "^9.0.0", "chai": "^4.3.4", "mocha": "^9.0.3", - "ts-mocha": "^8.0.0", - "typescript": "^4.3.5" - } - }, - "../../demox/solrand": { - "name": "@demox_labs/solrand", - "version": "0.0.3", - "extraneous": true, - "license": "AGPL-3.0-or-later", - "dependencies": { - "@project-serum/anchor": "^0.18.2" - }, - "devDependencies": { - "@types/mocha": "^9.0.0", - "chai": "^4.3.4", - "mocha": "^9.0.3", - "ts-mocha": "^8.0.0", + "ts-mocha": "^9.0.2", "typescript": "^4.3.5" } }, "node_modules/@babel/runtime": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", - "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", + "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.13.4" }, @@ -45,26 +30,19 @@ "node": ">=6.9.0" } }, - "node_modules/@demox_labs/solrand": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@demox_labs/solrand/-/solrand-0.0.3.tgz", - "integrity": "sha512-aI/V5BybTtjoXwDULIPcyu6A3eQCU79w/dmRr12X2rCuReSG4iOyPQC3fdp45AtUpltxrMp413KiGsT0h+5gbg==", - "dependencies": { - "@project-serum/anchor": "^0.18.2" - } - }, "node_modules/@demox-labs/solrand": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@demox-labs/solrand/-/solrand-0.0.3.tgz", - "integrity": "sha512-f3sw1Zw8RcTPuCCgXj4DXfVC7T9FPuqLCCfCNUV/Re1ns5IqabTw+33yM6RnszVTGo3BQxtLBMxXnuoktOpsNw==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@demox-labs/solrand/-/solrand-0.0.5.tgz", + "integrity": "sha512-QOyAuojzMpf5Etw2aNV71PnMQDHovEJCeGhc49MU5PI2PDL5C48d6XzHtHJVMaKW958QbvCfQmUNv8gLtv+IeQ==", + "license": "AGPL-3.0-or-later", "dependencies": { - "@project-serum/anchor": "^0.18.2" + "@project-serum/anchor": "^0.24.2" } }, "node_modules/@ethersproject/bytes": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", - "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", "funding": [ { "type": "individual", @@ -75,14 +53,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", - "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "funding": [ { "type": "individual", @@ -92,12 +71,13 @@ "type": "individual", "url": "https://www.buymeacoffee.com/ricmoo" } - ] + ], + "license": "MIT" }, "node_modules/@ethersproject/sha2": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.5.0.tgz", - "integrity": "sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", "funding": [ { "type": "individual", @@ -108,27 +88,44 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "hash.js": "1.1.7" } }, + "node_modules/@hapi/hoek": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", + "integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==", + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, "node_modules/@project-serum/anchor": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.18.2.tgz", - "integrity": "sha512-uyjiN/3Ipp+4hrZRm/hG18HzGLZyvP790LXrCsGO3IWxSl28YRhiGEpKnZycfMW94R7nxdUoE3wY67V+ZHSQBQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.24.2.tgz", + "integrity": "sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA==", + "license": "(MIT OR Apache-2.0)", "dependencies": { - "@project-serum/borsh": "^0.2.2", - "@solana/web3.js": "^1.17.0", + "@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.0", + "buffer-layout": "^1.2.2", "camelcase": "^5.3.1", + "cross-fetch": "^3.1.5", "crypto-hash": "^1.3.0", "eventemitter3": "^4.0.7", - "find": "^0.3.0", "js-sha256": "^0.9.0", "pako": "^2.0.3", "snake-case": "^3.0.4", @@ -139,17 +136,19 @@ } }, "node_modules/@project-serum/anchor-cli": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/@project-serum/anchor-cli/-/anchor-cli-0.18.2.tgz", - "integrity": "sha512-zZvLSa0DvsjsKSK8cU7ENqPB1tQ8WCT6dTY2IaJjWdG0UvXUTri8phnYyF5+Zti+frTdKyggOtI+i1QApOWhRQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@project-serum/anchor-cli/-/anchor-cli-0.24.2.tgz", + "integrity": "sha512-3D+fB3n/PAmY5AF2P+zxNvV2ZKx6YLoDlqHXqFa7wGqxVZfTo4WM2O7ChJjU2WIxS/WoTt6qXnehbuGUJ1JXig==", + "license": "(MIT OR Apache-2.0)", "bin": { "anchor": "anchor.js" } }, - "node_modules/@project-serum/borsh": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.3.tgz", - "integrity": "sha512-lH9zEYADZE3cxrgiFym8+jbUE3NM/LH+WOKYcUjs65CT10Q64Hv45bcAAa/phwYk4Tpz0uQ1x+ergFaAoGt67Q==", + "node_modules/@project-serum/anchor/node_modules/@project-serum/borsh": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.5.tgz", + "integrity": "sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==", + "license": "Apache-2.0", "dependencies": { "bn.js": "^5.1.2", "buffer-layout": "^1.2.0" @@ -161,10 +160,57 @@ "@solana/web3.js": "^1.2.0" } }, - "node_modules/@solana/buffer-layout": { + "node_modules/@project-serum/anchor/node_modules/@solana/web3.js": { + "version": "1.37.2", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.2.tgz", + "integrity": "sha512-rgPidynwPTu8iLmS++aQbDGiPPtwjRmu+uQxF9jTNT7v3ifKIlS4HccMdjj4WDcYx8h2mUtQX5xkdk6liSbdvg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5", + "@ethersproject/sha2": "^5.5.0", + "@solana/buffer-layout": "^4.0.0", + "bn.js": "^5.0.0", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.1", + "cross-fetch": "^3.1.4", + "jayson": "^3.4.4", + "js-sha3": "^0.8.0", + "rpc-websockets": "^7.4.2", + "secp256k1": "^4.0.2", + "superstruct": "^0.14.2", + "tweetnacl": "^1.0.0" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/formula": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz", - "integrity": "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", + "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==", + "license": "BSD-3-Clause" + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@solana/buffer-layout": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz", + "integrity": "sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ==", + "license": "MIT", "dependencies": { "buffer": "~6.0.3" }, @@ -172,6 +218,21 @@ "node": ">=5.10" } }, + "node_modules/@solana/buffer-layout-utils": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz", + "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==", + "license": "Apache-2.0", + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/web3.js": "^1.32.0", + "bigint-buffer": "^1.1.5", + "bignumber.js": "^9.0.1" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/@solana/buffer-layout/node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -190,21 +251,38 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, + "node_modules/@solana/spl-token": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.2.0.tgz", + "integrity": "sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ==", + "license": "Apache-2.0", + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/buffer-layout-utils": "^0.2.0", + "@solana/web3.js": "^1.32.0", + "start-server-and-test": "^1.14.0" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/@solana/web3.js": { - "version": "1.31.0", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.31.0.tgz", - "integrity": "sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz", + "integrity": "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", "@ethersproject/sha2": "^5.5.0", - "@solana/buffer-layout": "^3.0.0", + "@solana/buffer-layout": "^4.0.0", "bn.js": "^5.0.0", - "borsh": "^0.4.0", + "borsh": "^0.7.0", "bs58": "^4.0.1", "buffer": "6.0.1", "cross-fetch": "^3.1.4", @@ -219,26 +297,20 @@ "node": ">=12.20.0" } }, - "node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.27", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz", - "integrity": "sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA==", + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -250,38 +322,45 @@ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true, + "license": "MIT", "optional": true }, "node_modules/@types/lodash": { - "version": "4.14.178", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", - "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==" + "version": "4.14.181", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", + "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==", + "license": "MIT" }, "node_modules/@types/mocha": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "17.0.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.6.tgz", - "integrity": "sha512-+XBAjfZmmivILUzO0HwBJoYkAyyySSLg5KCGBDFLomJo0sV6szvVLAf4ANZZ0pfWzgEds5KmGLG9D5hfEqOhaA==" + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz", + "integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==", + "license": "MIT" }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "license": "MIT" }, "node_modules/@types/ws": { "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -290,13 +369,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -306,6 +387,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -315,6 +397,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -330,6 +413,7 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, + "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -342,13 +426,15 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -358,20 +444,32 @@ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/base-x": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "license": "MIT", "dependencies": { "safe-buffer": "^5.0.1" } @@ -393,29 +491,69 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" + }, + "node_modules/bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "bindings": "^1.3.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/bignumber.js": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", + "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==", + "license": "MIT", + "engines": { + "node": "*" + } }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "license": "MIT" + }, "node_modules/bn.js": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "license": "MIT" }, "node_modules/borsh": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.4.0.tgz", - "integrity": "sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", + "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", + "license": "Apache-2.0", "dependencies": { - "@types/bn.js": "^4.11.5", - "bn.js": "^5.0.0", + "bn.js": "^5.2.0", "bs58": "^4.0.0", "text-encoding-utf-8": "^1.0.2" } @@ -425,6 +563,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -435,6 +574,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.0.1" }, @@ -445,18 +585,21 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "license": "MIT" }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "license": "MIT", "dependencies": { "base-x": "^3.0.2" } @@ -479,6 +622,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -488,21 +632,24 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/buffer-layout": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", + "license": "MIT", "engines": { "node": ">=4.5" } }, "node_modules/bufferutil": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz", - "integrity": "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", "hasInstallScript": true, + "license": "MIT", "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -515,6 +662,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", "engines": { "node": ">=6" } @@ -524,6 +672,7 @@ "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", "dev": true, + "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", @@ -541,6 +690,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -557,6 +707,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -569,15 +720,26 @@ "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, + "node_modules/check-more-types": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA=", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/chokidar": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "dev": true, + "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -598,13 +760,14 @@ "version": "0.5.9", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==", - "deprecated": "CircularJSON is in maintenance only, flatted is its successor." + "license": "MIT" }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -616,6 +779,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -627,31 +791,50 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "license": "MIT", + "dependencies": { + "node-fetch": "2.6.7" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "license": "MIT", "dependencies": { - "node-fetch": "2.6.1" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, "node_modules/crypto-hash": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -663,7 +846,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -680,13 +863,14 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "license": "MIT" }, "node_modules/decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -699,6 +883,7 @@ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "dev": true, + "license": "MIT", "dependencies": { "type-detect": "^4.0.0" }, @@ -710,6 +895,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -722,6 +908,7 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -730,15 +917,23 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "license": "MIT", "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3" } }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "license": "MIT" + }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "license": "MIT", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -752,23 +947,27 @@ "node_modules/elliptic/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "license": "MIT" }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "license": "MIT" }, "node_modules/es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "license": "MIT", "dependencies": { "es6-promise": "^4.0.3" } @@ -778,6 +977,7 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -787,6 +987,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -794,10 +995,49 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/event-stream": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", + "pause-stream": "0.0.11", + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } }, "node_modules/eyes": { "version": "0.1.8", @@ -807,11 +1047,18 @@ "node": "> 0.1.90" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -819,19 +1066,12 @@ "node": ">=8" } }, - "node_modules/find": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", - "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", - "dependencies": { - "traverse-chain": "~0.1.0" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -848,22 +1088,50 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, + "license": "BSD-3-Clause", "bin": { "flat": "cli.js" } }, + "node_modules/follow-redirects": { + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "license": "MIT" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -877,6 +1145,7 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -886,15 +1155,29 @@ "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -915,6 +1198,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -927,6 +1211,7 @@ "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.x" } @@ -936,6 +1221,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -944,6 +1230,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -954,6 +1241,7 @@ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, + "license": "MIT", "bin": { "he": "bin/he" } @@ -962,12 +1250,22 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "license": "MIT", "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -985,13 +1283,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1000,13 +1300,15 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, + "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -1019,6 +1321,7 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1028,6 +1331,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1037,6 +1341,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1049,6 +1354,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1058,8 +1364,21 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-unicode-supported": { @@ -1067,6 +1386,7 @@ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1078,12 +1398,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "license": "ISC" }, "node_modules/isomorphic-ws": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "license": "MIT", "peerDependencies": { "ws": "*" } @@ -1092,6 +1413,7 @@ "version": "3.6.6", "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", + "license": "MIT", "dependencies": { "@types/connect": "^3.4.33", "@types/express-serve-static-core": "^4.17.9", @@ -1117,25 +1439,42 @@ } }, "node_modules/jayson/node_modules/@types/node": { - "version": "12.20.40", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.40.tgz", - "integrity": "sha512-RX6hFa0hxkFuktu5629zJEkWK5e0HreW4vpNSLn4nWkOui7CTGCjtKiKpvtZ4QwCZ2Am5uhrb5ULHKNyunYYqg==" + "version": "12.20.48", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.48.tgz", + "integrity": "sha512-4kxzqkrpwYtn6okJUcb2lfUu9ilnb3yhUOH6qX3nug8D2DupZ2drIkff2yJzYcNJVl3begnlcaBJ7tqiTTzjnQ==", + "license": "MIT" + }, + "node_modules/joi": { + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz", + "integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.0", + "@sideway/pinpoint": "^2.0.0" + } }, "node_modules/js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "license": "MIT" }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -1146,13 +1485,15 @@ "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "license": "ISC" }, "node_modules/json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "minimist": "^1.2.0" @@ -1167,12 +1508,14 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "engines": [ "node >= 0.2.0" - ] + ], + "license": "MIT" }, "node_modules/JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "license": "(MIT OR Apache-2.0)", "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -1184,11 +1527,21 @@ "node": "*" } }, + "node_modules/lazy-ass": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha1-eZllXoZGwX8In90YfRUNMyTVRRM=", + "license": "MIT", + "engines": { + "node": "> 0.8" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -1202,13 +1555,15 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -1224,6 +1579,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "license": "MIT", "dependencies": { "tslib": "^2.0.3" } @@ -1232,23 +1588,47 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "dev": true, + "license": "ISC" + }, + "node_modules/map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "license": "ISC" }, "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "license": "MIT" }, "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1260,13 +1640,14 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "license": "MIT" }, "node_modules/mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.5" }, @@ -1279,6 +1660,7 @@ "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, + "license": "MIT", "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", @@ -1321,13 +1703,15 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nanoid": { "version": "3.1.25", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", "dev": true, + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1339,6 +1723,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "license": "MIT", "dependencies": { "lower-case": "^2.0.2", "tslib": "^2.0.3" @@ -1347,20 +1732,34 @@ "node_modules/node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "license": "MIT" }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", + "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -1372,24 +1771,54 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -1405,6 +1834,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -1418,13 +1848,15 @@ "node_modules/pako": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz", - "integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==" + "integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==", + "license": "(MIT AND Zlib)" }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1434,24 +1866,48 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, + "node_modules/pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" + } + }, "node_modules/picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -1459,11 +1915,27 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/ps-tree": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", + "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "license": "MIT", + "dependencies": { + "event-stream": "=3.3.4" + }, + "bin": { + "ps-tree": "bin/ps-tree.js" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } @@ -1473,6 +1945,7 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -1483,21 +1956,24 @@ "node_modules/regenerator-runtime": { "version": "0.13.9", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "license": "MIT" }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/rpc-websockets": { - "version": "7.4.16", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.16.tgz", - "integrity": "sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ==", + "version": "7.4.17", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.17.tgz", + "integrity": "sha512-eolVi/qlXS13viIUH9aqrde902wzSLAai0IjmOZSRefp5I3CSG/vCnD0c0fDSYCWuEyUoRL1BHQA8K1baEUyow==", + "license": "LGPL-3.0-only", "dependencies": { "@babel/runtime": "^7.11.2", "circular-json": "^0.5.9", @@ -1514,6 +1990,15 @@ "utf-8-validate": "^5.0.2" } }, + "node_modules/rxjs": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz", + "integrity": "sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1531,15 +2016,17 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/secp256k1": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", "hasInstallScript": true, + "license": "MIT", "dependencies": { - "elliptic": "^6.5.2", + "elliptic": "^6.5.4", "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0" }, @@ -1552,14 +2039,43 @@ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, "node_modules/snake-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "license": "MIT", "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" @@ -1570,6 +2086,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -1579,16 +2096,62 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, + "node_modules/split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "license": "MIT", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/start-server-and-test": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.14.0.tgz", + "integrity": "sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw==", + "license": "MIT", + "dependencies": { + "bluebird": "3.7.2", + "check-more-types": "2.24.0", + "debug": "4.3.2", + "execa": "5.1.1", + "lazy-ass": "1.6.0", + "ps-tree": "1.2.0", + "wait-on": "6.0.0" + }, + "bin": { + "server-test": "src/bin/start.js", + "start-server-and-test": "src/bin/start.js", + "start-test": "src/bin/start.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -1603,6 +2166,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1615,16 +2179,27 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=4" } }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -1635,13 +2210,15 @@ "node_modules/superstruct": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", - "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==" + "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==", + "license": "MIT" }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1660,13 +2237,15 @@ "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "license": "MIT" }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -1677,18 +2256,21 @@ "node_modules/toml": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", - "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "license": "MIT" }, - "node_modules/traverse-chain": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", - "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=" + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "license": "MIT" }, "node_modules/ts-mocha": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/ts-mocha/-/ts-mocha-8.0.0.tgz", - "integrity": "sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/ts-mocha/-/ts-mocha-9.0.2.tgz", + "integrity": "sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw==", "dev": true, + "license": "MIT", "dependencies": { "ts-node": "7.0.1" }, @@ -1702,7 +2284,7 @@ "tsconfig-paths": "^3.5.0" }, "peerDependencies": { - "mocha": "^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X" + "mocha": "^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X" } }, "node_modules/ts-node": { @@ -1710,6 +2292,7 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", "dev": true, + "license": "MIT", "dependencies": { "arrify": "^1.0.0", "buffer-from": "^1.1.0", @@ -1732,6 +2315,7 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -1741,6 +2325,7 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/json5": "^0.0.29", @@ -1752,18 +2337,21 @@ "node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "license": "0BSD" }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "license": "Unlicense" }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -1773,6 +2361,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1782,10 +2371,11 @@ } }, "node_modules/utf-8-validate": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz", - "integrity": "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", "hasInstallScript": true, + "license": "MIT", "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -1798,15 +2388,51 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, + "node_modules/wait-on": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz", + "integrity": "sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==", + "license": "MIT", + "dependencies": { + "axios": "^0.21.1", + "joi": "^17.4.0", + "lodash": "^4.17.21", + "minimist": "^1.2.5", + "rxjs": "^7.1.0" + }, + "bin": { + "wait-on": "bin/wait-on" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -1821,13 +2447,15 @@ "version": "6.1.5", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -1844,12 +2472,14 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", + "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "license": "MIT", "engines": { "node": ">=8.3.0" }, @@ -1871,6 +2501,7 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -1880,6 +2511,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -1898,6 +2530,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -1907,6 +2540,7 @@ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, + "license": "MIT", "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", @@ -1922,6 +2556,7 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1934,6 +2569,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -1943,6 +2579,7 @@ "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -1952,6 +2589,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1962,91 +2600,137 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", - "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", + "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", "requires": { "regenerator-runtime": "^0.13.4" } }, - "@demox_labs/solrand": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@demox_labs/solrand/-/solrand-0.0.3.tgz", - "integrity": "sha512-aI/V5BybTtjoXwDULIPcyu6A3eQCU79w/dmRr12X2rCuReSG4iOyPQC3fdp45AtUpltxrMp413KiGsT0h+5gbg==", - "requires": { - "@project-serum/anchor": "^0.18.2" - } - }, "@demox-labs/solrand": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@demox-labs/solrand/-/solrand-0.0.3.tgz", - "integrity": "sha512-f3sw1Zw8RcTPuCCgXj4DXfVC7T9FPuqLCCfCNUV/Re1ns5IqabTw+33yM6RnszVTGo3BQxtLBMxXnuoktOpsNw==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@demox-labs/solrand/-/solrand-0.0.5.tgz", + "integrity": "sha512-QOyAuojzMpf5Etw2aNV71PnMQDHovEJCeGhc49MU5PI2PDL5C48d6XzHtHJVMaKW958QbvCfQmUNv8gLtv+IeQ==", "requires": { - "@project-serum/anchor": "^0.18.2" + "@project-serum/anchor": "^0.24.2" } }, "@ethersproject/bytes": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", - "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", "requires": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/logger": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", - "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==" }, "@ethersproject/sha2": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.5.0.tgz", - "integrity": "sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "hash.js": "1.1.7" } }, + "@hapi/hoek": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", + "integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==" + }, + "@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, "@project-serum/anchor": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.18.2.tgz", - "integrity": "sha512-uyjiN/3Ipp+4hrZRm/hG18HzGLZyvP790LXrCsGO3IWxSl28YRhiGEpKnZycfMW94R7nxdUoE3wY67V+ZHSQBQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.24.2.tgz", + "integrity": "sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA==", "requires": { - "@project-serum/borsh": "^0.2.2", - "@solana/web3.js": "^1.17.0", + "@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.0", + "buffer-layout": "^1.2.2", "camelcase": "^5.3.1", + "cross-fetch": "^3.1.5", "crypto-hash": "^1.3.0", "eventemitter3": "^4.0.7", - "find": "^0.3.0", "js-sha256": "^0.9.0", "pako": "^2.0.3", "snake-case": "^3.0.4", "toml": "^3.0.0" + }, + "dependencies": { + "@project-serum/borsh": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.5.tgz", + "integrity": "sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==", + "requires": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + } + }, + "@solana/web3.js": { + "version": "1.37.2", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.2.tgz", + "integrity": "sha512-rgPidynwPTu8iLmS++aQbDGiPPtwjRmu+uQxF9jTNT7v3ifKIlS4HccMdjj4WDcYx8h2mUtQX5xkdk6liSbdvg==", + "requires": { + "@babel/runtime": "^7.12.5", + "@ethersproject/sha2": "^5.5.0", + "@solana/buffer-layout": "^4.0.0", + "bn.js": "^5.0.0", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.1", + "cross-fetch": "^3.1.4", + "jayson": "^3.4.4", + "js-sha3": "^0.8.0", + "rpc-websockets": "^7.4.2", + "secp256k1": "^4.0.2", + "superstruct": "^0.14.2", + "tweetnacl": "^1.0.0" + } + } } }, "@project-serum/anchor-cli": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/@project-serum/anchor-cli/-/anchor-cli-0.18.2.tgz", - "integrity": "sha512-zZvLSa0DvsjsKSK8cU7ENqPB1tQ8WCT6dTY2IaJjWdG0UvXUTri8phnYyF5+Zti+frTdKyggOtI+i1QApOWhRQ==" - }, - "@project-serum/borsh": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.3.tgz", - "integrity": "sha512-lH9zEYADZE3cxrgiFym8+jbUE3NM/LH+WOKYcUjs65CT10Q64Hv45bcAAa/phwYk4Tpz0uQ1x+ergFaAoGt67Q==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@project-serum/anchor-cli/-/anchor-cli-0.24.2.tgz", + "integrity": "sha512-3D+fB3n/PAmY5AF2P+zxNvV2ZKx6YLoDlqHXqFa7wGqxVZfTo4WM2O7ChJjU2WIxS/WoTt6qXnehbuGUJ1JXig==" + }, + "@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", "requires": { - "bn.js": "^5.1.2", - "buffer-layout": "^1.2.0" + "@hapi/hoek": "^9.0.0" } }, - "@solana/buffer-layout": { + "@sideway/formula": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz", - "integrity": "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", + "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==" + }, + "@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" + }, + "@solana/buffer-layout": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz", + "integrity": "sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ==", "requires": { "buffer": "~6.0.3" }, @@ -2062,16 +2746,38 @@ } } }, + "@solana/buffer-layout-utils": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz", + "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==", + "requires": { + "@solana/buffer-layout": "^4.0.0", + "@solana/web3.js": "^1.32.0", + "bigint-buffer": "^1.1.5", + "bignumber.js": "^9.0.1" + } + }, + "@solana/spl-token": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.2.0.tgz", + "integrity": "sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ==", + "requires": { + "@solana/buffer-layout": "^4.0.0", + "@solana/buffer-layout-utils": "^0.2.0", + "@solana/web3.js": "^1.32.0", + "start-server-and-test": "^1.14.0" + } + }, "@solana/web3.js": { - "version": "1.31.0", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.31.0.tgz", - "integrity": "sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz", + "integrity": "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==", "requires": { "@babel/runtime": "^7.12.5", "@ethersproject/sha2": "^5.5.0", - "@solana/buffer-layout": "^3.0.0", + "@solana/buffer-layout": "^4.0.0", "bn.js": "^5.0.0", - "borsh": "^0.4.0", + "borsh": "^0.7.0", "bs58": "^4.0.1", "buffer": "6.0.1", "cross-fetch": "^3.1.4", @@ -2083,14 +2789,6 @@ "tweetnacl": "^1.0.0" } }, - "@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "requires": { - "@types/node": "*" - } - }, "@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -2100,9 +2798,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.27", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz", - "integrity": "sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA==", + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -2117,9 +2815,9 @@ "optional": true }, "@types/lodash": { - "version": "4.14.178", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", - "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==" + "version": "4.14.181", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz", + "integrity": "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" }, "@types/mocha": { "version": "9.0.0", @@ -2128,9 +2826,9 @@ "dev": true }, "@types/node": { - "version": "17.0.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.6.tgz", - "integrity": "sha512-+XBAjfZmmivILUzO0HwBJoYkAyyySSLg5KCGBDFLomJo0sV6szvVLAf4ANZZ0pfWzgEds5KmGLG9D5hfEqOhaA==" + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz", + "integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==" }, "@types/qs": { "version": "6.9.7", @@ -2205,6 +2903,14 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2224,24 +2930,49 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, + "bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "requires": { + "bindings": "^1.3.0" + } + }, + "bignumber.js": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", + "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==" + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, "bn.js": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, "borsh": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.4.0.tgz", - "integrity": "sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", + "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", "requires": { - "@types/bn.js": "^4.11.5", - "bn.js": "^5.0.0", + "bn.js": "^5.2.0", "bs58": "^4.0.0", "text-encoding-utf-8": "^1.0.2" } @@ -2305,9 +3036,9 @@ "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==" }, "bufferutil": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz", - "integrity": "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", "optional": true, "requires": { "node-gyp-build": "^4.3.0" @@ -2359,6 +3090,11 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "check-more-types": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA=" + }, "chokidar": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", @@ -2418,11 +3154,21 @@ "dev": true }, "cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", "requires": { - "node-fetch": "2.6.1" + "node-fetch": "2.6.7" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "crypto-hash": { @@ -2434,7 +3180,6 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, "requires": { "ms": "2.1.2" }, @@ -2442,8 +3187,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -2482,6 +3226,11 @@ "tslib": "^2.0.3" } }, + "duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" + }, "elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -2534,16 +3283,51 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "event-stream": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "requires": { + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", + "pause-stream": "0.0.11", + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" + } + }, "eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2553,14 +3337,6 @@ "to-regex-range": "^5.0.1" } }, - "find": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", - "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", - "requires": { - "traverse-chain": "~0.1.0" - } - }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2577,6 +3353,16 @@ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, + "follow-redirects": { + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" + }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2602,6 +3388,11 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + }, "glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -2662,6 +3453,11 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -2724,6 +3520,11 @@ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -2733,8 +3534,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isomorphic-ws": { "version": "4.0.1", @@ -2765,12 +3565,24 @@ }, "dependencies": { "@types/node": { - "version": "12.20.40", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.40.tgz", - "integrity": "sha512-RX6hFa0hxkFuktu5629zJEkWK5e0HreW4vpNSLn4nWkOui7CTGCjtKiKpvtZ4QwCZ2Am5uhrb5ULHKNyunYYqg==" + "version": "12.20.48", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.48.tgz", + "integrity": "sha512-4kxzqkrpwYtn6okJUcb2lfUu9ilnb3yhUOH6qX3nug8D2DupZ2drIkff2yJzYcNJVl3begnlcaBJ7tqiTTzjnQ==" } } }, + "joi": { + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz", + "integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==", + "requires": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.0", + "@sideway/pinpoint": "^2.0.0" + } + }, "js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", @@ -2819,6 +3631,11 @@ "through": ">=2.2.7 <3" } }, + "lazy-ass": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha1-eZllXoZGwX8In90YfRUNMyTVRRM=" + }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -2857,6 +3674,21 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -2879,8 +3711,7 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "mkdirp": { "version": "0.5.5", @@ -2950,14 +3781,17 @@ "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } }, "node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" }, "normalize-path": { "version": "3.0.0", @@ -2965,6 +3799,14 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "requires": { + "path-key": "^3.0.0" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2974,6 +3816,14 @@ "wrappy": "1" } }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3009,18 +3859,39 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "requires": { + "through": "~2.3" + } + }, "picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, + "ps-tree": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", + "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "requires": { + "event-stream": "=3.3.4" + } + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3051,9 +3922,9 @@ "dev": true }, "rpc-websockets": { - "version": "7.4.16", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.16.tgz", - "integrity": "sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ==", + "version": "7.4.17", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.17.tgz", + "integrity": "sha512-eolVi/qlXS13viIUH9aqrde902wzSLAai0IjmOZSRefp5I3CSG/vCnD0c0fDSYCWuEyUoRL1BHQA8K1baEUyow==", "requires": { "@babel/runtime": "^7.11.2", "bufferutil": "^4.0.1", @@ -3064,17 +3935,25 @@ "ws": "^7.4.5" } }, + "rxjs": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz", + "integrity": "sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==", + "requires": { + "tslib": "^2.1.0" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "secp256k1": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", "requires": { - "elliptic": "^6.5.2", + "elliptic": "^6.5.4", "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0" } @@ -3088,6 +3967,24 @@ "randombytes": "^2.1.0" } }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, "snake-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", @@ -3113,6 +4010,36 @@ "source-map": "^0.6.0" } }, + "split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "requires": { + "through": "2" + } + }, + "start-server-and-test": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.14.0.tgz", + "integrity": "sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw==", + "requires": { + "bluebird": "3.7.2", + "check-more-types": "2.24.0", + "debug": "4.3.2", + "execa": "5.1.1", + "lazy-ass": "1.6.0", + "ps-tree": "1.2.0", + "wait-on": "6.0.0" + } + }, + "stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "requires": { + "duplexer": "~0.1.1" + } + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3140,6 +4067,11 @@ "dev": true, "optional": true }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -3184,15 +4116,15 @@ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" }, - "traverse-chain": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", - "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=" + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, "ts-mocha": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/ts-mocha/-/ts-mocha-8.0.0.tgz", - "integrity": "sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/ts-mocha/-/ts-mocha-9.0.2.tgz", + "integrity": "sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw==", "dev": true, "requires": { "ts-node": "7.0.1", @@ -3259,9 +4191,9 @@ "dev": true }, "utf-8-validate": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz", - "integrity": "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", "optional": true, "requires": { "node-gyp-build": "^4.3.0" @@ -3272,11 +4204,36 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, + "wait-on": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz", + "integrity": "sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==", + "requires": { + "axios": "^0.21.1", + "joi": "^17.4.0", + "lodash": "^4.17.21", + "minimist": "^1.2.5", + "rxjs": "^7.1.0" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -3305,9 +4262,9 @@ "dev": true }, "ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", + "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", "requires": {} }, "y18n": { diff --git a/package.json b/package.json index 235867c..6123337 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,15 @@ { "dependencies": { - "@demox-labs/solrand": "^0.0.3", - "@project-serum/anchor": "^0.18.2", - "@project-serum/anchor-cli": "0.18.2" + "@demox-labs/solrand": "^0.0.5", + "@project-serum/anchor": "^0.24.2", + "@project-serum/anchor-cli": "0.24.2", + "@solana/spl-token": "^0.2.0" }, "devDependencies": { "@types/mocha": "^9.0.0", "chai": "^4.3.4", "mocha": "^9.0.3", - "ts-mocha": "^8.0.0", + "ts-mocha": "^9.0.2", "typescript": "^4.3.5" } } diff --git a/programs/cross-pile/Cargo.toml b/programs/cross-pile/Cargo.toml index 806e368..f5014a2 100644 --- a/programs/cross-pile/Cargo.toml +++ b/programs/cross-pile/Cargo.toml @@ -15,5 +15,7 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = "0.18.2" -solrand = { version = "0.1.3", features = ["cpi"] } +anchor-lang = "0.24.2" +anchor-spl = "0.24.2" +spl-token = { version="3.3.0", features = [ "no-entrypoint" ] } +solrand = { version = "0.1.5", features = ["cpi"] } \ No newline at end of file diff --git a/programs/cross-pile/src/lib.rs b/programs/cross-pile/src/lib.rs index cd1f3d8..6828531 100644 --- a/programs/cross-pile/src/lib.rs +++ b/programs/cross-pile/src/lib.rs @@ -1,319 +1,778 @@ use anchor_lang::prelude::*; use std::mem::size_of; +use anchor_spl::token::{Mint, Token, TokenAccount}; -declare_id!("6urrPCjcrQ1xaxbAJGMTtvZfA9wbMqQbEArKnVUHhYTs"); - -/** - * The Cross And Pile Program (P2P Heads or Tails) - * - * Accounts: - * requester: PDA owned by the Solrand Program used to store data - * oracle: The Oracle's account. Refer to Published Addreses. - * oracle_vault: PDA owned by the Solrand Program for paying Oracle - * solrand_program: The Program Address for the Solrand Program - * coin: PDA owned by Cross & Pile used for storing data - * vault: PDA owned by Cross & Pile used for escrowing sol and paying winner - * initiator: The account creating the coin - * acceptor: The account accepting the offer to flip - * rent: The Rent Program - * system_program: The System Program - * - * Considerations: - * 1. The CPI call to RequestRandom should happen only after or all funds are locked into the contract. - * 2. Once a CPI call to RequestRandom is made, no funds should be allowed to be withdrawn. - * - */ - +declare_id!("BCEjUoZJcUJXPhmaLpKPUpXEX8roYXUSwrMD9UrVACow"); #[program] pub mod cross_pile { use super::*; - pub fn create_coin( - ctx: Context, - coin_bump: u8, - _req_bump: u8, - vault_bump: u8, - amount: u64, - ) -> ProgramResult { - let authority_key = ctx.accounts.initiator.key(); - // Set data for PDAs - { - let coin = &mut ctx.accounts.coin.load_init()?; - let clock: Clock = Clock::get().unwrap(); - - coin.initiator = authority_key; - coin.acceptor = ctx.accounts.acceptor.key(); - coin.is_flipping = false; - coin.created_at = clock.unix_timestamp; - coin.bump = coin_bump; - - let vault = &mut ctx.accounts.vault; - vault.amount = amount; - vault.bump = vault_bump; + pub fn new_challenge( + ctx: Context, + challenge_bump: u8, + _initiator_tokens_vault_bump: u8, + initiator_wager_token_amount: u64, + ) -> Result<()> { + let challenge = &mut ctx.accounts.challenge; + challenge.initiator = ctx.accounts.initiator.to_account_info().key.clone(); + challenge.initiator_tokens_mint = ctx.accounts.initiator_tokens_mint.to_account_info().key.clone(); + challenge.initiator_tokens_vault = ctx.accounts.initiator_tokens_vault.to_account_info().key.clone(); + challenge.initiator_wager_token_amount = initiator_wager_token_amount; + challenge.bump = challenge_bump; + challenge.acceptor_wager_approved = false; + challenge.requester = ctx.accounts.requester.to_account_info().key.clone(); + + // move the tokens in the wager from the initiator's token source to the token vault + anchor_spl::token::transfer( + CpiContext::new( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx + .accounts + .initiator_tokens_source + .to_account_info(), + to: ctx + .accounts + .initiator_tokens_vault + .to_account_info(), + authority: ctx.accounts.initiator.to_account_info(), + }, + ), + initiator_wager_token_amount, + )?; + + // solrand piece + { + // Transfer authority for the oracle requester to the challenge PDA + let cpi_accounts = solrand::cpi::accounts::TransferAuthority { + requester: ctx.accounts.requester.to_account_info(), + authority: ctx.accounts.initiator.to_account_info(), + new_authority: ctx.accounts.challenge.to_account_info(), + system_program: ctx.accounts.system_program.to_account_info() + }; + + let cpi_context = CpiContext::new( + ctx.accounts.solrand_program.clone(), + cpi_accounts + ); + + solrand::cpi::transfer_authority(cpi_context)?; } - // Transfer authority for the oracle requester to the Coin PDA - let cpi_accounts = solrand::cpi::accounts::TransferAuthority { - requester: ctx.accounts.requester.to_account_info(), - authority: ctx.accounts.initiator.to_account_info(), - new_authority: ctx.accounts.coin.to_account_info(), - system_program: ctx.accounts.system_program.to_account_info() - }; - - let cpi_context = CpiContext::new( - ctx.accounts.solrand_program.clone(), - cpi_accounts - ); - - solrand::cpi::transfer_authority(cpi_context)?; - - // Transfer sol from Initiator to Vault PDA - let ix = anchor_lang::solana_program::system_instruction::transfer( - &ctx.accounts.initiator.key(), - &ctx.accounts.vault.key(), - amount, - ); - - anchor_lang::solana_program::program::invoke( - &ix, - &[ - ctx.accounts.initiator.to_account_info(), - ctx.accounts.vault.to_account_info(), - ctx.accounts.system_program.to_account_info(), - ], + Ok(()) + } + + pub fn accept_challenge( + ctx: Context, + _acceptor_tokens_vault_bump: u8, + acceptor_wager_token_amount: u64, + ) -> Result<()> { + let challenge = &mut ctx.accounts.challenge; + challenge.acceptor = *ctx.accounts.acceptor.to_account_info().key; + challenge.acceptor_tokens_mint = ctx.accounts.acceptor_tokens_mint.to_account_info().key.clone(); + challenge.acceptor_tokens_vault = ctx.accounts.acceptor_tokens_vault.to_account_info().key.clone(); + challenge.acceptor_wager_token_amount = acceptor_wager_token_amount; + + // move the tokens in the wager from the acceptor's token source to the token vault + anchor_spl::token::transfer( + CpiContext::new( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx + .accounts + .acceptor_tokens_source + .to_account_info(), + to: ctx + .accounts + .acceptor_tokens_vault + .to_account_info(), + authority: ctx.accounts.acceptor.to_account_info(), + }, + ), + acceptor_wager_token_amount, )?; Ok(()) } - - pub fn approve_flip<'key, 'accounts, 'remaining, 'info>( - ctx: Context<'key, 'accounts, 'remaining, 'info, ApproveFlip<'info>> - ) -> ProgramResult { - // Transfer sol from Acceptor to Vault PDA + pub fn approve_acceptor_wager( + ctx: Context, + ) -> Result<()> { + let challenge = &mut ctx.accounts.challenge; + challenge.acceptor_wager_approved = true; + // solrand section { - let ix = anchor_lang::solana_program::system_instruction::transfer( - &ctx.accounts.authority.key(), - &ctx.accounts.vault.key(), - ctx.accounts.vault.amount, + // Use challenge PDA to Request Random From Oracle + let cpi_accounts = solrand::cpi::accounts::RequestRandom { + requester: ctx.accounts.requester.to_account_info(), + authority: challenge.to_account_info(), + oracle: ctx.accounts.oracle.to_account_info(), + system_program: ctx.accounts.system_program.to_account_info() + }; + + let challenge_bump = challenge.bump; + let challenge_seeds = &[ + b"challenge".as_ref(), + ctx.accounts.challenge.initiator.as_ref(), + ctx.accounts.challenge.requester.as_ref(), + &[challenge_bump] + ]; + + let signer = &[ + &challenge_seeds[..] + ]; + + let cpi_context = CpiContext::new_with_signer( + ctx.accounts.solrand_program.clone(), + cpi_accounts, + signer ); - anchor_lang::solana_program::program::invoke( - &ix, - &[ - ctx.accounts.authority.to_account_info(), - ctx.accounts.vault.to_account_info(), - ctx.accounts.system_program.to_account_info(), - ], + solrand::cpi::request_random(cpi_context)?; + } + Ok(()) + } + + pub fn decline_acceptor_wager( + ctx: Context, + ) -> Result<()> { + { + let challenge = &ctx.accounts.challenge; + + let challenge_seeds = &[ + b"challenge".as_ref(), + ctx.accounts.challenge.initiator.as_ref(), + ctx.accounts.challenge.requester.as_ref(), + &[challenge.bump] + ]; + + // refund the acceptor's wagered tokens back into their account + anchor_spl::token::transfer( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx.accounts.acceptor_tokens_vault.to_account_info(), + to: ctx.accounts.acceptor_own_tokens_taker.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ), + ctx.accounts.challenge.acceptor_wager_token_amount, )?; + + // close escrow account + anchor_spl::token::close_account( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::CloseAccount { + account: ctx + .accounts + .acceptor_tokens_vault + .to_account_info(), + destination: ctx.accounts.acceptor.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ))?; } - // Use Coin PDA to Request Random From Oracle - let coin_acc = &ctx.remaining_accounts[0]; + { + let challenge = &mut ctx.accounts.challenge; + // reset all acceptor fields on challenge PDA + challenge.acceptor_wager_approved = false; + challenge.acceptor = Pubkey::default(); + challenge.acceptor_tokens_mint = Pubkey::default(); + challenge.acceptor_tokens_vault = Pubkey::default(); + challenge.acceptor_wager_token_amount = 0; + } - let cpi_accounts = solrand::cpi::accounts::RequestRandom { - requester: ctx.accounts.requester.to_account_info(), - vault: ctx.accounts.oracle_vault.clone(), - authority: coin_acc.to_account_info(), - oracle: ctx.accounts.oracle.to_account_info(), - system_program: ctx.accounts.system_program.to_account_info() - }; + Ok(()) + } - let (_coin_authority, coin_bump) = - Pubkey::find_program_address(&[b"coin-seed".as_ref(), ctx.accounts.initiator.key.as_ref()], &ctx.program_id); + pub fn reveal_winner( + ctx: Context, + ) -> Result<()> { + // Determine winner from random number + let requester = &mut ctx.accounts.requester; + let mut initiator_tokens_taker = ctx.accounts.acceptor_other_tokens_taker.to_account_info(); + let mut acceptor_tokens_taker = ctx.accounts.acceptor_own_tokens_taker.to_account_info(); + + // Take first byte (u8) and check if even + // If the random number is even, then the initiator wins & the acceptor loses. + if requester.random[0] % 2 == 0 { + initiator_tokens_taker = ctx.accounts.initiator_own_tokens_taker.to_account_info(); + acceptor_tokens_taker = ctx.accounts.initiator_other_tokens_taker.to_account_info(); + } - let coin_seeds = &[ - b"coin-seed".as_ref(), - ctx.accounts.initiator.key.as_ref(), - &[coin_bump] + // transfer loser's tokens vault to winner's other tokens taker account + // ie the winner is receiving the loser's bet + let challenge_seeds = &[ + b"challenge", + ctx.accounts.challenge.initiator.as_ref(), + ctx.accounts.challenge.requester.as_ref(), + &[ctx.accounts.challenge.bump] ]; + anchor_spl::token::transfer( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx.accounts.initiator_tokens_vault.to_account_info(), + to: initiator_tokens_taker, + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ), + ctx.accounts.challenge.initiator_wager_token_amount, + )?; - let signer = &[ - &coin_seeds[..] + // transfer winner's tokens vault to winner's own tokens taker account + // ie the winner is recouping their own bet + anchor_spl::token::transfer( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx.accounts.acceptor_tokens_vault.to_account_info(), + to: acceptor_tokens_taker, + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ), + ctx.accounts.challenge.acceptor_wager_token_amount, + )?; + + // Close the escrow accounts + anchor_spl::token::close_account( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::CloseAccount { + account: ctx + .accounts + .initiator_tokens_vault + .to_account_info(), + destination: ctx.accounts.initiator.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ))?; + + anchor_spl::token::close_account( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::CloseAccount { + account: ctx + .accounts + .acceptor_tokens_vault + .to_account_info(), + destination: ctx.accounts.acceptor.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ))?; + + Ok(()) + } + + pub fn cancel_before_acceptor<'info>( + ctx: Context + ) -> Result<()> { + // If the challenge has been accepted, then the accounts of the acceptor must be passed in, + // so cancel_after_acceptor must be used. + require!(ctx.accounts.challenge.acceptor == Pubkey::default(), ErrorCode::IncorrectRemainingAccounts); + let challenge_seeds = &[ + b"challenge", + ctx.accounts.challenge.initiator.as_ref(), + ctx.accounts.challenge.requester.as_ref(), + &[ctx.accounts.challenge.bump] ]; - let cpi_context = CpiContext::new_with_signer( - ctx.accounts.solrand_program.clone(), - cpi_accounts, - signer - ); + // return escrowed initiator tokens back to source + anchor_spl::token::transfer( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx.accounts.initiator_tokens_vault.to_account_info(), + to: ctx.accounts.initiator_own_tokens_taker.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ), + ctx.accounts.challenge.initiator_wager_token_amount, + )?; - solrand::cpi::request_random(cpi_context)?; + // Close the escrow account + anchor_spl::token::close_account( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::CloseAccount { + account: ctx + .accounts + .initiator_tokens_vault + .to_account_info(), + destination: ctx.accounts.initiator.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ))?; Ok(()) } - pub fn reveal_coin<'key, 'accounts, 'remaining, 'info>( - ctx: Context<'key, 'accounts, 'remaining, 'info, RevealCoin<'info>> - ) -> ProgramResult { - { - let authority_key = ctx.accounts.authority.key(); + pub fn cancel_after_acceptor<'info>( + ctx: Context + ) -> Result<()> { + let challenge_seeds = &[ + b"challenge", + ctx.accounts.challenge.initiator.as_ref(), + ctx.accounts.challenge.requester.as_ref(), + &[ctx.accounts.challenge.bump] + ]; - if authority_key != ctx.accounts.initiator.key() && authority_key != ctx.accounts.acceptor.key() { - return Err(ErrorCode::Unauthorized.into()); - } - } - // Determine winner from random number & transfer prize - { - let requester_loader: AccountLoader = AccountLoader::try_from_unchecked(ctx.program_id, &ctx.accounts.requester).unwrap(); - let requester = requester_loader.load()?; - let mut winner = ctx.accounts.initiator.clone(); - - if requester.active_request { - return Err(ErrorCode::OracleNotCompleted.into()); - } - - // Take first byte (u8) and check if even - // Even random => acceptor wins & initiator loses - if requester.random[0] % 2 == 0 { - winner = ctx.accounts.acceptor.clone(); - } - - **winner.try_borrow_mut_lamports()? += ctx.accounts.vault.to_account_info().lamports(); - **ctx.accounts.vault.to_account_info().try_borrow_mut_lamports()? = 0; - } + // return escrowed initiator tokens back to source + anchor_spl::token::transfer( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx.accounts.initiator_tokens_vault.to_account_info(), + to: ctx.accounts.initiator_own_tokens_taker.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ), + ctx.accounts.challenge.initiator_wager_token_amount, + )?; - // Transfer back ownership of requester - let coin_acc = &ctx.remaining_accounts[0]; + // Close the escrow account + anchor_spl::token::close_account( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::CloseAccount { + account: ctx + .accounts + .initiator_tokens_vault + .to_account_info(), + destination: ctx.accounts.initiator.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ))?; + + // return escrowed acceptor tokens back to source + anchor_spl::token::transfer( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::Transfer { + from: ctx.accounts.acceptor_tokens_vault.to_account_info(), + to: ctx.accounts.acceptor_own_tokens_taker.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ), + ctx.accounts.challenge.acceptor_wager_token_amount, + )?; - let cpi_accounts = solrand::cpi::accounts::TransferAuthority { - requester: ctx.accounts.requester.to_account_info(), - authority: coin_acc.to_account_info(), - new_authority: ctx.accounts.initiator.to_account_info(), - system_program: ctx.accounts.system_program.to_account_info() - }; + // Close the escrow account + anchor_spl::token::close_account( + CpiContext::new_with_signer( + ctx.accounts.token_program.to_account_info(), + anchor_spl::token::CloseAccount { + account: ctx + .accounts + .acceptor_tokens_vault + .to_account_info(), + destination: ctx.accounts.acceptor.to_account_info(), + authority: ctx + .accounts + .challenge + .to_account_info(), + }, + &[&challenge_seeds[..]], + ))?; - let (_coin_authority, coin_bump) = - Pubkey::find_program_address(&[b"coin-seed".as_ref(), ctx.accounts.initiator.key.as_ref()], &ctx.program_id); + Ok(()) + } +} - let coin_seeds = &[ - b"coin-seed".as_ref(), - ctx.accounts.initiator.key.as_ref(), - &[coin_bump] - ]; +#[derive(Accounts)] +pub struct CancelBeforeAcceptor<'info> { + #[account( + mut, + constraint = initiator.key() == challenge.initiator @ ErrorCode::Unauthorized + )] + pub initiator: Signer<'info>, + #[account(mut, close = initiator)] + pub challenge: Account<'info, Challenge>, + #[account( + mut, + constraint = initiator_tokens_vault.key() == challenge.initiator_tokens_vault, + )] + initiator_tokens_vault: Box>, + // account to receive initiator's own bet back into + #[account( + mut, + constraint = initiator_own_tokens_taker.owner == challenge.initiator, + )] + initiator_own_tokens_taker: Box>, - let signer = &[ - &coin_seeds[..] - ]; + // application level accounts + pub token_program: Program<'info, Token>, +} - let cpi_context = CpiContext::new_with_signer( - ctx.accounts.solrand_program.clone(), - cpi_accounts, - signer - ); +#[derive(Accounts)] +pub struct CancelAfterAcceptor<'info> { + #[account( + mut, + constraint = initiator.key() == challenge.initiator @ ErrorCode::Unauthorized + )] + pub initiator: Signer<'info>, + #[account(mut, close = initiator)] + pub challenge: Account<'info, Challenge>, + #[account( + mut, + constraint = initiator_tokens_vault.key() == challenge.initiator_tokens_vault, + )] + initiator_tokens_vault: Box>, + // account to receive initiator's own bet back into + #[account( + mut, + constraint = initiator_own_tokens_taker.owner == challenge.initiator, + )] + initiator_own_tokens_taker: Box>, - solrand::cpi::transfer_authority(cpi_context)?; + #[account( + mut, + constraint = challenge.acceptor == acceptor.key() + )] + /// CHECK: constraint makes sure that the acceptor of the challenge is the account passed in here + acceptor: AccountInfo<'info>, + #[account( + mut, + constraint = acceptor_tokens_vault.key() == challenge.acceptor_tokens_vault, + )] + acceptor_tokens_vault: Box>, + // account to receive initiator's own bet back into + #[account( + mut, + constraint = acceptor_own_tokens_taker.owner == challenge.acceptor, + )] + acceptor_own_tokens_taker: Box>, - return Ok(()); - } + // application level accounts + pub token_program: Program<'info, Token>, } +// PDA that holds the state of the challenge +#[account] +pub struct Challenge { + pub initiator: Pubkey, + pub initiator_tokens_mint: Pubkey, + pub initiator_tokens_vault: Pubkey, + pub initiator_wager_token_amount: u64, + pub acceptor: Pubkey, + pub acceptor_tokens_mint: Pubkey, + pub acceptor_tokens_vault: Pubkey, + pub acceptor_wager_token_amount: u64, + pub acceptor_wager_approved: bool, + pub requester: Pubkey, + pub bump: u8, +} + +// arguments list for new_challenge #[derive(Accounts)] -pub struct CreateCoin<'info> { +#[instruction(initiator_wager_token_amount: u64)] +pub struct NewChallenge<'info> { + #[account(mut)] + pub initiator: Signer<'info>, + + // PDAs #[account( - init, - seeds = [b"coin-seed".as_ref(), initiator.key().as_ref()], - bump, + init, payer = initiator, - space = 8 + size_of::() + space = 8 + size_of::(), + seeds = [ + b"challenge", + initiator.to_account_info().key.as_ref(), + requester.key().as_ref(), + ], + bump )] - pub coin: AccountLoader<'info, Coin>, + pub challenge: Account<'info, Challenge>, + + // account to transfer initiator's wager tokens to #[account( - init, - seeds = [b"vault-seed".as_ref(), initiator.key().as_ref()], - bump, + init, payer = initiator, - space = 8 + size_of::() + seeds = [ + b"initiator_tokens_vault".as_ref(), + initiator.to_account_info().key.as_ref(), + ], + bump, + token::mint=initiator_tokens_mint, + token::authority=challenge, + )] + initiator_tokens_vault: Account<'info, TokenAccount>, + + // Mint of the wager that the person creating the challenge is putting up + pub initiator_tokens_mint: Account<'info, Mint>, + + // Where to withdraw the intiator's wager tokens from + #[account( + mut, + constraint = initiator_tokens_source.mint == initiator_tokens_mint.key(), + constraint = initiator_tokens_source.amount > 0, + constraint = initiator_tokens_source.owner == initiator.key() )] - pub vault: Account<'info, Vault>, - /// CHECK: The Requester is the account provided to Solrand + pub initiator_tokens_source: Account<'info, TokenAccount>, + + /// CHECK: The Requester is the account provided to Solrand, which should have been initialized by Solrand already #[account(mut)] pub requester: AccountInfo<'info>, - /// CHECK: Making check pass - #[account(mut, signer)] - pub initiator: AccountInfo<'info>, - /// CHECK: The initiator decides the acceptor to use - pub acceptor: AccountInfo<'info>, - /// CHECK: Oracle decided by the coin - pub oracle: AccountInfo<'info>, - /// CHECK: Oracle decided by the coin - pub oracle_vault: AccountInfo<'info>, - /// CHECK: Checks done in program + + /// CHECK: Checks done in solrand program pub solrand_program: AccountInfo<'info>, + + // Application level accounts + pub system_program: Program<'info, System>, + pub token_program: Program<'info, Token>, pub rent: Sysvar<'info, Rent>, +} + +#[derive(Accounts)] +#[instruction(acceptor_wager_token_amount: u64)] +pub struct AcceptChallenge<'info> { + #[account( + mut, + )] + pub acceptor: Signer<'info>, + #[account( + mut, + // ensure the challenge has not already been accepted + constraint = challenge.acceptor == Pubkey::default() + )] + pub challenge: Account<'info, Challenge>, + + // account to transfer acceptor's wager tokens to + #[account( + init, + payer = acceptor, + seeds = [b"acceptor_tokens_vault".as_ref(), acceptor.to_account_info().key.as_ref()], + bump, + token::mint=acceptor_tokens_mint, + token::authority=challenge, + )] + acceptor_tokens_vault: Account<'info, TokenAccount>, + + // Mint of the wager that the person accepting the challenge is putting up + pub acceptor_tokens_mint: Account<'info, Mint>, + + // Where to withdraw the acceptor's wager tokens from + #[account( + mut, + constraint = acceptor_tokens_source.mint == acceptor_tokens_mint.key(), + // tried making this constraint > acceptor_token_wager_amount, but anchor complained about that + constraint = acceptor_tokens_source.amount > 0, + constraint = acceptor_tokens_source.owner == acceptor.key() + )] + pub acceptor_tokens_source: Account<'info, TokenAccount>, + + // Application level accounts pub system_program: Program<'info, System>, + pub token_program: Program<'info, Token>, + pub rent: Sysvar<'info, Rent>, } #[derive(Accounts)] -pub struct ApproveFlip<'info> { - #[account(mut)] - pub authority: Signer<'info>, - #[account(mut)] - pub vault: Account<'info, Vault>, - /// CHECK: Checks done in program - pub initiator: AccountInfo<'info>, - /// CHECK: Checks done in program - #[account(mut)] +pub struct DeclineAcceptorWager<'info> { + #[account( + mut, + constraint = + caller.key() == challenge.initiator || + caller.key() == challenge.acceptor + @ ErrorCode::Unauthorized + )] + pub caller: Signer<'info>, + #[account( + mut, + // ensure the challenge has been accepted + constraint = challenge.acceptor != Pubkey::default(), + constraint = !challenge.acceptor_wager_approved @ ErrorCode::AcceptorWagerAlreadyApproved + )] + pub challenge: Account<'info, Challenge>, + #[account( + mut, + constraint = acceptor.key() == challenge.acceptor.key() + )] + /// CHECK: checked with the constraint to make sure this acceptor account is the one attached to the challenge + pub acceptor: AccountInfo<'info>, + + #[account( + mut, + constraint = acceptor_tokens_vault.mint == challenge.acceptor_tokens_mint, + )] + acceptor_tokens_vault: Box>, + // account to receive acceptor's own bet back into + #[account( + mut, + constraint = acceptor_own_tokens_taker.mint == challenge.acceptor_tokens_mint, + constraint = acceptor_own_tokens_taker.owner == challenge.acceptor.key() + )] + acceptor_own_tokens_taker: Box>, + + // application level accounts + pub token_program: Program<'info, Token>, +} + +#[derive(Accounts)] +pub struct ApproveAcceptorWager<'info> { + #[account( + mut, + // only the original initiator of the challenge may approve the wager + constraint = challenge.initiator == initiator.key() @ ErrorCode::Unauthorized, + constraint = !challenge.acceptor_wager_approved @ ErrorCode::AcceptorWagerAlreadyApproved + )] + pub initiator: Signer<'info>, + #[account( + mut, + // ensure the challenge has been accepted + constraint = challenge.acceptor != Pubkey::default() + )] + pub challenge: Account<'info, Challenge>, + + #[account( + mut, + constraint = requester.key() == challenge.requester.key() + )] + /// CHECK: The constraint checks that this requester is the same one that the challenge was initialized with pub requester: AccountInfo<'info>, - /// CHECK: Checks done in program - #[account(mut)] - pub oracle: AccountInfo<'info>, - /// CHECK: Checks done in program - #[account(mut)] - pub oracle_vault: AccountInfo<'info>, - /// CHECK: Checks done in program - pub solrand_program: AccountInfo<'info>, + #[account(mut)] + /// CHECK: Checks done in Solrand program + pub oracle: AccountInfo<'info>, + /// CHECK: Checks done in program + pub solrand_program: AccountInfo<'info>, + + // Application level accounts pub system_program: Program<'info, System>, + pub token_program: Program<'info, Token>, + pub rent: Sysvar<'info, Rent>, } #[derive(Accounts)] -pub struct RevealCoin<'info> { - /// CHECK: Checks done in program - #[account(mut)] +pub struct RevealWinner<'info> { + #[account( + mut, + close = initiator, + constraint = challenge.acceptor_wager_approved @ ErrorCode::NotApproved, + )] + pub challenge: Account<'info, Challenge>, + + /// CHECK: Constraint ensures that the initiator is the same one who kicked off the challenge + #[account( + mut, + constraint = initiator.key() == challenge.initiator.key() + )] pub initiator: AccountInfo<'info>, - /// CHECK: Checks done in program - #[account(mut)] + /// CHECK: Constraint ensures that the acceptor is the same one who accepted the challenge + #[account( + mut, + constraint = acceptor.key() == challenge.acceptor.key() + )] pub acceptor: AccountInfo<'info>, + + #[account( + mut, + constraint = initiator_tokens_vault.key() == challenge.initiator_tokens_vault, + )] + initiator_tokens_vault: Box>, + #[account( + mut, + constraint = acceptor_tokens_vault.key() == challenge.acceptor_tokens_vault, + )] + acceptor_tokens_vault: Box>, + + // accounts to receive the bet back into + // account to receive acceptor's own bet back into + #[account( + mut, + constraint = acceptor_own_tokens_taker.owner == acceptor.key(), + )] + acceptor_own_tokens_taker: Box>, + // account to receive initiator's bet into + #[account( + mut, + constraint = acceptor_other_tokens_taker.mint == challenge.initiator_tokens_mint, + constraint = acceptor_other_tokens_taker.owner == acceptor.key(), + )] + acceptor_other_tokens_taker: Box>, + // account to receive initiator's own bet back into + #[account( + mut, + constraint = initiator_own_tokens_taker.mint == challenge.initiator_tokens_mint, + constraint = initiator_own_tokens_taker.owner == initiator.key(), + )] + initiator_own_tokens_taker: Box>, + // account to receive acceptor's bet into + #[account( + mut, + constraint = initiator_other_tokens_taker.mint == challenge.acceptor_tokens_mint, + constraint = initiator_other_tokens_taker.owner == initiator.key(), + )] + initiator_other_tokens_taker: Box>, + /// CHECK: Checks done in program - #[account(mut)] - pub vault: Account<'info, Vault>, - /// CHECK: Checks done in program - #[account(mut)] - pub requester: AccountInfo<'info>, - #[account(mut)] - pub authority: Signer<'info>, + #[account( + mut, + constraint = challenge.requester.key() == requester.key() + )] + pub requester: Account<'info, solrand::Requester>, /// CHECK: Checks done in program pub solrand_program: AccountInfo<'info>, - pub system_program: Program<'info, System>, -} -// Used for signing CPI to oracle -#[account(zero_copy)] -pub struct Coin { - pub initiator: Pubkey, - pub acceptor: Pubkey, - pub is_flipping: bool, - pub is_cross: bool, - pub created_at: i64, - pub bump: u8, -} - -// Used for holding the sol balance and transfering to winner -#[account] -pub struct Vault { - pub amount: u64, - pub bump: u8, + // Application level accounts + pub system_program: Program<'info, System>, + pub token_program: Program<'info, Token>, } -#[error] +#[error_code] pub enum ErrorCode { #[msg("You are not authorized to complete this transaction")] Unauthorized, - #[msg("The coin is has already been flipped")] - AlreadyCompleted, - #[msg("A coin is already flipping. Only one flip may be made at a time")] - InflightRequest, - #[msg("The Oracle has not provided a response yet")] - OracleNotCompleted, + #[msg("The challenge initiator has not approved the acceptor's wager.")] + NotApproved, + #[msg("The acceptor's wager has already been approved.")] + AcceptorWagerAlreadyApproved, + #[msg("Incorrect remaining accounts passed in.")] + IncorrectRemainingAccounts } \ No newline at end of file diff --git a/tests/accept-challenge.ts b/tests/accept-challenge.ts new file mode 100644 index 0000000..026a698 --- /dev/null +++ b/tests/accept-challenge.ts @@ -0,0 +1,140 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from '@project-serum/anchor'; +import { MockOracleSession, SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; +import { SolrandSession } from '../app/solrandSession'; +import { CrossPile } from '../target/types/cross_pile'; +import { Session, User } from "../app/sessions"; +import * as spl from '@solana/spl-token'; +import { PublicKey } from '@solana/web3.js'; +import { expect } from 'chai'; +import { TimeLogger, CommitmentLevel, instantiateSessions, createMintsInParallel, createChallengesWithAddressAndBump, newChallenges } from '../app/utils'; +import { Challenge } from '../app/challenge'; + +const timeLogger = new TimeLogger(); +timeLogger.disable(); +const program = anchor.workspace.CrossPile as Program; +const ENV = 'http://localhost:8899'; +const uuid = Math.floor(Math.random() * 2**50); + +describe('accept-challenge', () => { + timeLogger.log("beginning accept-challenge tests"); + + after(() => { + timeLogger.log("all accept-challenge tests finished"); + timeLogger.outputAllLogs(); + }); + + const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + const oracleKeypair = anchor.web3.Keypair.generate(); + const oracleSession = new MockOracleSession(oracleKeypair, SOLRAND_IDL, solrandId, ENV); + + let initiatorSessions = instantiateSessions(1, program, ENV, timeLogger); + let acceptorSessions = instantiateSessions(1, program, ENV, timeLogger); + let solrandSessions = initiatorSessions.map((session) => new SolrandSession(session.userKeypair, SOLRAND_IDL, solrandId, oracleKeypair.publicKey, ENV, uuid)); + + let allUserSessions = initiatorSessions.concat(acceptorSessions); + + const thirdPartySession = new Session(program, ENV, timeLogger); + + const mintAuthority = thirdPartySession.userKeypair; + let mint1: PublicKey; + let mint2: PublicKey; + + let expectedChallenges: Challenge[]; + let initiators: User[]; + let acceptors: User[]; + + const initialTokenFundAmount = 2000; + const initiatorWagerTokenAmount = 1000; + it('Set up tests', async() => { + await Promise.all([ + thirdPartySession.requestAirdrop(), + allUserSessions.map((session) => session.requestAirdrop()), + oracleSession.provider.connection.confirmTransaction( + await oracleSession.provider.connection.requestAirdrop(oracleKeypair.publicKey, 10000000000), + ), + solrandSessions.map((session) => session.setAccounts()) + ]); + + timeLogger.log("creating mints and initializing solrand accounts"); + + let mintPromises = createMintsInParallel(2, thirdPartySession); + await Promise.all([ + ...mintPromises, + solrandSessions.map((session) => session.initializeAccount()) + ]).then((values) => { + mint1 = values[0] as PublicKey; + mint2 = values[1] as PublicKey; + }); + timeLogger.log("mints created, solrand initialized"); + + await Promise.all( + initiatorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint1, mintAuthority)).concat( + acceptorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint2, mintAuthority))) + ); + + initiators = initiatorSessions.map((initiatorSession) => new User(initiatorSession)); + acceptors = acceptorSessions.map((acceptorSession) => new User(acceptorSession)); + + expectedChallenges = await createChallengesWithAddressAndBump(program.programId, initiators, solrandSessions); + + await Promise.all( + newChallenges(initiators, solrandSessions, initiatorWagerTokenAmount, expectedChallenges) + ); + }); + + describe('accept_challenge', () => { + it('accepts a challenge', async () => { + let testIndex = 0; + let initiator = initiators[testIndex]; + let acceptor = acceptors[testIndex]; + let expectedChallenge = expectedChallenges[testIndex]; + + const acceptorWagerTokenAmountBigNumber = new anchor.BN(37); + const acceptorWagerTokenAmount = acceptorWagerTokenAmountBigNumber.toNumber(); + + timeLogger.log("new challenge created for accepts a challenge test"); + + // accept the challenge + let acceptTx = await acceptor.acceptChallenge( + expectedChallenge.address, + acceptorWagerTokenAmountBigNumber + ); + + await acceptor.session.provider.connection.confirmTransaction( + acceptTx, + CommitmentLevel.FINALIZED + ); + + let challengeData; + let acceptorTokenSourceAccount; + let acceptorTokensVault; + await Promise.all([ + program.account.challenge.fetch(expectedChallenge.address), + acceptor.session.getOrCreateAssociatedTokenAccount(acceptor.session.tokensSource.mint, mintAuthority), + spl.getAccount( + acceptor.session.provider.connection, + acceptor.tokensVaultAddress + ) + ]).then((values) => { + challengeData = values[0]; + acceptorTokenSourceAccount = values[1]; + acceptorTokensVault = values[2]; + }); + let actualChallenge = new Challenge(program.programId, null, null, challengeData); + expectedChallenge.initiatorTokensMint = mint1; + expectedChallenge.initiatorTokensVault = initiator.tokensVaultAddress; + expectedChallenge.initiatorWagerTokenAmount = initiatorWagerTokenAmount; + expectedChallenge.acceptor = acceptor.session.userKeypair.publicKey; + expectedChallenge.acceptorTokensVault = acceptor.tokensVaultAddress; + expectedChallenge.acceptorTokensMint = mint2; + expectedChallenge.acceptorWagerTokenAmount = acceptorWagerTokenAmount; + + expectedChallenge.isEquivalentTo(actualChallenge); + expect(Number(acceptorTokenSourceAccount.amount), "Token source should be initial amount minus the amount bet in the wager.") + .equals(initialTokenFundAmount - acceptorWagerTokenAmount); + expect(Number(acceptorTokensVault.amount), "Acceptor tokens vault should have the wager amount deposited in it.") + .equals(Number(acceptorWagerTokenAmount)); + }); + }); +}); \ No newline at end of file diff --git a/tests/approve-acceptor-wager.ts b/tests/approve-acceptor-wager.ts new file mode 100644 index 0000000..23abbe5 --- /dev/null +++ b/tests/approve-acceptor-wager.ts @@ -0,0 +1,163 @@ +import * as anchor from '@project-serum/anchor'; +import { AnchorError, Program } from '@project-serum/anchor'; +import { MockOracleSession, SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; +import { SolrandSession } from '../app/solrandSession'; +import { CrossPile } from '../target/types/cross_pile'; +import { Session, User } from "../app/sessions"; +import { PublicKey } from '@solana/web3.js'; +import { expect } from 'chai'; +import { TimeLogger, CommitmentLevel, instantiateSessions, newChallenges, createChallengesWithAddressAndBump, createMintsInParallel } from '../app/utils'; +import { Challenge } from '../app/challenge'; + +const timeLogger = new TimeLogger(); +timeLogger.disable(); +const program = anchor.workspace.CrossPile as Program; +const ENV = 'http://localhost:8899'; +const uuid = Math.floor(Math.random() * 2**50); + +describe('approve-acceptor-wager', () => { + timeLogger.log("beginning approve-acceptor-wager tests"); + + after(() => { + timeLogger.log("all approve-acceptor-wager tests finished"); + timeLogger.outputAllLogs(); + }); + + const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + const oracleKeypair = anchor.web3.Keypair.generate(); + const oracleSession = new MockOracleSession(oracleKeypair, SOLRAND_IDL, solrandId, ENV); + + let initiatorSessions = instantiateSessions(2, program, ENV, timeLogger); + let acceptorSessions = instantiateSessions(2, program, ENV, timeLogger); + let solrandSessions = initiatorSessions.map((session) => new SolrandSession(session.userKeypair, SOLRAND_IDL, solrandId, oracleKeypair.publicKey, ENV, uuid)); + + let allUserSessions = initiatorSessions.concat(acceptorSessions); + + const thirdPartySession = new Session(program, ENV, timeLogger); + + const mintAuthority = thirdPartySession.userKeypair; + let mint1: PublicKey; + let mint2: PublicKey; + + let expectedChallenges: Challenge[]; + let initiators: User[]; + let acceptors: User[]; + + const initialTokenFundAmount = 2000; + const initiatorWagerTokenAmount = 1000; + + it('Set up tests', async() => { + timeLogger.log("running initial airdrops and solrand set accounts in parallel"); + await Promise.all([ + thirdPartySession.requestAirdrop(), + allUserSessions.map((session) => session.requestAirdrop()), + oracleSession.provider.connection.confirmTransaction( + await oracleSession.provider.connection.requestAirdrop(oracleKeypair.publicKey, 10000000000), + ), + solrandSessions.map((session) => session.setAccounts()) + ]); + + let mintPromises = createMintsInParallel(2, thirdPartySession); + await Promise.all([ + ...mintPromises, + solrandSessions.map((session) => session.initializeAccount()) + ]).then((values) => { + mint1 = values[0] as PublicKey; + mint2 = values[1] as PublicKey; + }); + timeLogger.log("mints created, solrand initialized"); + + await Promise.all( + initiatorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint1, mintAuthority)).concat( + acceptorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint2, mintAuthority))) + ); + + initiators = initiatorSessions.map((initiatorSession) => new User(initiatorSession)); + acceptors = acceptorSessions.map((acceptorSession) => new User(acceptorSession)); + + expectedChallenges = await createChallengesWithAddressAndBump(program.programId, initiators, solrandSessions); + + await Promise.all( + newChallenges(initiators, solrandSessions, initiatorWagerTokenAmount, expectedChallenges) + ); + }); + + describe('approve_acceptor_wager', () => { + it('throws unauthorized error when account other than initiator calls it', async () => { + let testIndex = 0; + let acceptor = acceptors[testIndex]; + let solrandSession = solrandSessions[testIndex]; + let expectedChallenge = expectedChallenges[testIndex]; + + const acceptorWagerTokenAmount = 37; + const acceptorWagerTokenAmountBigNumber = new anchor.BN(acceptorWagerTokenAmount); + + timeLogger.log("accepting challenge"); + await acceptor.acceptChallenge( + expectedChallenge.address, + acceptorWagerTokenAmountBigNumber + ); + + timeLogger.log("challenge accepted"); + + // challenge accepted, now accept the wager as the acceptor + timeLogger.log("approving acceptor's wager"); + try { + await acceptor.approveAcceptorWager( + expectedChallenge.address, + solrandSession.userSession.reqAccount, + oracleKeypair.publicKey + ); + } catch (err) { + const errMsg = "You are not authorized to complete this transaction"; + let anchorError = err as AnchorError; + expect(anchorError.message).include(errMsg); + } + }); + + it('approves acceptor wager', async () => { + let testIndex = 1; + let initiator = initiators[testIndex]; + let acceptor = acceptors[testIndex]; + let solrandSession = solrandSessions[testIndex]; + let expectedChallenge = expectedChallenges[testIndex]; + + const acceptorWagerTokenAmountBigNumber = new anchor.BN(37); + const acceptorWagerTokenAmount = acceptorWagerTokenAmountBigNumber.toNumber(); + + await acceptor.acceptChallenge( + expectedChallenge.address, + acceptorWagerTokenAmountBigNumber + ); + + timeLogger.log("challenge accepted"); + + // challenge accepted, now accept the wager + timeLogger.log("approving acceptor's wager"); + let approvalTx = await initiator.approveAcceptorWager( + expectedChallenge.address, + solrandSession.userSession.reqAccount, + oracleKeypair.publicKey + ); + await initiator.session.provider.connection.confirmTransaction( + approvalTx, + CommitmentLevel.FINALIZED + ); + timeLogger.log("acceptor wager approved"); + timeLogger.log("expected challenge: " + expectedChallenge.address.toString()); + let challengeData = await program.account.challenge.fetch(expectedChallenge.address); + timeLogger.log("challengeData: " + challengeData); + let actualChallenge = new Challenge(program.programId, null, null, challengeData); + expectedChallenge.initiatorTokensMint = mint1; + expectedChallenge.initiatorTokensVault = initiator.tokensVaultAddress; + expectedChallenge.initiatorWagerTokenAmount = initiatorWagerTokenAmount; + expectedChallenge.acceptor = acceptor.session.userKeypair.publicKey; + expectedChallenge.acceptorTokensVault = acceptor.tokensVaultAddress; + expectedChallenge.acceptorTokensMint = mint2; + expectedChallenge.acceptorWagerTokenAmount = acceptorWagerTokenAmount; + expectedChallenge.acceptorWagerApproved = true; + + expectedChallenge.isEquivalentTo(actualChallenge); + }); + }); +}); \ No newline at end of file diff --git a/tests/cancel-after-acceptor.ts b/tests/cancel-after-acceptor.ts new file mode 100644 index 0000000..1867a9a --- /dev/null +++ b/tests/cancel-after-acceptor.ts @@ -0,0 +1,137 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from '@project-serum/anchor'; +import { MockOracleSession, SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; +import { SolrandSession } from '../app/solrandSession'; +import { CrossPile } from '../target/types/cross_pile'; +import { Session, User } from "../app/sessions"; +import { Keypair, PublicKey, Connection } from '@solana/web3.js'; +import { expect } from 'chai'; +import { TimeLogger, CommitmentLevel, instantiateSessions, createMintsInParallel, createChallengesWithAddressAndBump, newChallenges } from '../app/utils'; +import { Challenge } from '../app/challenge'; + +const timeLogger = new TimeLogger(); +timeLogger.disable(); +const program = anchor.workspace.CrossPile as Program; +const ENV = 'http://localhost:8899'; +const uuid = Math.floor(Math.random() * 2**50); + +describe('cancel_after_acceptor', () => { + timeLogger.log("beginning cancel after acceptor tests"); + + after(() => { + timeLogger.log("all cancel after acceptor tests finished"); + timeLogger.outputAllLogs(); + }); + + const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + const oracleKeypair = anchor.web3.Keypair.generate(); + const oracleSession = new MockOracleSession(oracleKeypair, SOLRAND_IDL, solrandId, ENV); + + let initiatorSessions = instantiateSessions(1, program, ENV, timeLogger); + let acceptorSessions = instantiateSessions(1, program, ENV, timeLogger); + let solrandSessions = initiatorSessions.map((session) => new SolrandSession(session.userKeypair, SOLRAND_IDL, solrandId, oracleKeypair.publicKey, ENV, uuid)); + + let allUserSessions = initiatorSessions.concat(acceptorSessions); + + const thirdPartySession = new Session(program, ENV, timeLogger); + + const mintAuthority = thirdPartySession.userKeypair; + let mint1: PublicKey; + let mint2: PublicKey; + + let expectedChallenges: Challenge[]; + let initiators: User[]; + let acceptors: User[]; + + const initialTokenFundAmount = 2000; + it('Set up tests', async() => { + await Promise.all([ + thirdPartySession.requestAirdrop(), + allUserSessions.map((session) => session.requestAirdrop()), + oracleSession.provider.connection.confirmTransaction( + await oracleSession.provider.connection.requestAirdrop(oracleKeypair.publicKey, 10000000000), + ), + solrandSessions.map((session) => session.setAccounts()) + ]); + + timeLogger.log("creating mints and initializing solrand accounts"); + + let mintPromises = createMintsInParallel(2, thirdPartySession); + await Promise.all([ + ...mintPromises, + solrandSessions.map((session) => session.initializeAccount()) + ]).then((values) => { + mint1 = values[0] as PublicKey; + mint2 = values[1] as PublicKey; + }); + timeLogger.log("mints created, solrand initialized"); + + await Promise.all( + initiatorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint1, mintAuthority)).concat( + acceptorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint2, mintAuthority))) + ); + + initiators = initiatorSessions.map((initiatorSession) => new User(initiatorSession)); + acceptors = acceptorSessions.map((acceptorSession) => new User(acceptorSession)); + + expectedChallenges = await createChallengesWithAddressAndBump(program.programId, initiators, solrandSessions); + const initiatorWagerTokenAmount = 1000; + + await Promise.all( + newChallenges(initiators, solrandSessions, initiatorWagerTokenAmount, expectedChallenges) + ); + }); + + describe('cancel-after-acceptor', () => { + it('cancels the challenge after an acceptor', async () => { + let testIndex = 0; + let initiator = initiators[testIndex]; + let acceptor = acceptors[testIndex]; + let expectedChallenge = expectedChallenges[testIndex]; + + const acceptorWagerTokenAmount = 37; + const acceptorWagerTokenAmountBigNumber = new anchor.BN(acceptorWagerTokenAmount); + + timeLogger.log("accepting challenge"); + await acceptor.acceptChallenge( + expectedChallenge.address, + acceptorWagerTokenAmountBigNumber + ); + + timeLogger.log("challenge accepted"); + timeLogger.log("the owner of the tokens source is: " + acceptor.session.tokensSource.owner.toString()); + timeLogger.log("the acceptor is: " + acceptor.session.userKeypair.publicKey.toString()); + + let cancelTx = await initiator.cancelAfterAcceptor( + expectedChallenge.address, + acceptor.session.userKeypair.publicKey, + acceptor.tokensVaultAddress, + acceptor.session.tokensSource.address + ); + await initiator.session.provider.connection.confirmTransaction( + cancelTx, + CommitmentLevel.FINALIZED + ); + + let initiatorTokensSource; + let acceptorTokensSource; + let programAccounts; + await Promise.all([ + initiator.session.getOrCreateAssociatedTokenAccount(mint1, mintAuthority), + acceptor.session.getOrCreateAssociatedTokenAccount(mint2, mintAuthority), + initiator.session.solConnection.getProgramAccounts(program.programId) + ]).then((values) => { + initiatorTokensSource = values[0]; + acceptorTokensSource = values[1]; + programAccounts = values[2]; + }); + let accountPubkeyStrings = programAccounts.map((account) => account.pubkey.toString()); + + expect(Number(acceptorTokensSource.amount), "Acceptor token source should be full amount.") + .equals(initialTokenFundAmount); + expect(Number(initiatorTokensSource.amount), "Initiator token source should be full amount.") + .equals(initialTokenFundAmount); + expect(accountPubkeyStrings, "Challenge should be deleted.").not.include(expectedChallenge.address); + }); + }); +}); \ No newline at end of file diff --git a/tests/cancel-before-acceptor.ts b/tests/cancel-before-acceptor.ts new file mode 100644 index 0000000..461cf40 --- /dev/null +++ b/tests/cancel-before-acceptor.ts @@ -0,0 +1,108 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from '@project-serum/anchor'; +import { MockOracleSession, SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; +import { SolrandSession } from '../app/solrandSession'; +import { CrossPile } from '../target/types/cross_pile'; +import { Session, User } from "../app/sessions"; +import { PublicKey } from '@solana/web3.js'; +import { expect } from 'chai'; +import { TimeLogger, CommitmentLevel, instantiateSessions, createMintsInParallel, createChallengesWithAddressAndBump, newChallenges } from '../app/utils'; +import { Challenge } from '../app/challenge'; + +const timeLogger = new TimeLogger(); +timeLogger.disable(); +const program = anchor.workspace.CrossPile as Program; +const ENV = 'http://localhost:8899'; +const uuid = Math.floor(Math.random() * 2**50); + +describe('cancel_before_acceptor', () => { + timeLogger.log("beginning cancel before acceptor tests"); + + after(() => { + timeLogger.log("all cancel before acceptor tests finished"); + timeLogger.outputAllLogs(); + }); + + const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + const oracleKeypair = anchor.web3.Keypair.generate(); + const oracleSession = new MockOracleSession(oracleKeypair, SOLRAND_IDL, solrandId, ENV); + + let initiatorSessions = instantiateSessions(1, program, ENV, timeLogger); + let acceptorSessions = instantiateSessions(1, program, ENV, timeLogger); + let solrandSessions = initiatorSessions.map((session) => new SolrandSession(session.userKeypair, SOLRAND_IDL, solrandId, oracleKeypair.publicKey, ENV, uuid)); + + let allUserSessions = initiatorSessions.concat(acceptorSessions); + + const thirdPartySession = new Session(program, ENV, timeLogger); + + const mintAuthority = thirdPartySession.userKeypair; + let mint1: PublicKey; + let mint2: PublicKey; + + let expectedChallenges: Challenge[]; + let initiators: User[]; + let acceptors: User[]; + + const initialTokenFundAmount = 2000; + it('Set up tests', async() => { + await Promise.all([ + thirdPartySession.requestAirdrop(), + allUserSessions.map((session) => session.requestAirdrop()), + oracleSession.provider.connection.confirmTransaction( + await oracleSession.provider.connection.requestAirdrop(oracleKeypair.publicKey, 10000000000), + ), + solrandSessions.map((session) => session.setAccounts()) + ]); + + timeLogger.log("creating mints and initializing solrand accounts"); + + let mintPromises = createMintsInParallel(2, thirdPartySession); + await Promise.all([ + ...mintPromises, + solrandSessions.map((session) => session.initializeAccount()) + ]).then((values) => { + mint1 = values[0] as PublicKey; + mint2 = values[1] as PublicKey; + }); + timeLogger.log("mints created, solrand initialized"); + + await Promise.all( + initiatorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint1, mintAuthority)).concat( + acceptorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint2, mintAuthority))) + ); + + initiators = initiatorSessions.map((initiatorSession) => new User(initiatorSession)); + acceptors = acceptorSessions.map((acceptorSession) => new User(acceptorSession)); + + expectedChallenges = await createChallengesWithAddressAndBump(program.programId, initiators, solrandSessions); + const initiatorWagerTokenAmount = 1000; + + await Promise.all( + newChallenges(initiators, solrandSessions, initiatorWagerTokenAmount, expectedChallenges) + ); + }); + + describe('cancel-before-acceptor', () => { + it('cancels the challenge before an acceptor', async () => { + let testIndex = 0; + let initiator = initiators[testIndex]; + let expectedChallenge = expectedChallenges[testIndex]; + + let cancelTx = await initiator.cancelBeforeAcceptor(expectedChallenge.address); + await initiator.session.provider.connection.confirmTransaction( + cancelTx, + CommitmentLevel.FINALIZED + ); + + let initiatorTokensSource = await initiator.session.getOrCreateAssociatedTokenAccount( + mint1, mintAuthority + ); + let programAccounts = await initiator.session.solConnection.getProgramAccounts(program.programId); + let accountPubkeyStrings = programAccounts.map((account) => account.pubkey.toString()); + + expect(Number(initiatorTokensSource.amount), "Initiator token source should be full amount.") + .equals(initialTokenFundAmount); + expect(accountPubkeyStrings).not.include(expectedChallenge.address); + }); + }); +}); \ No newline at end of file diff --git a/tests/cross-pile.ts b/tests/cross-pile.ts deleted file mode 100644 index c8f540f..0000000 --- a/tests/cross-pile.ts +++ /dev/null @@ -1,215 +0,0 @@ -import * as anchor from '@project-serum/anchor'; -import { Program } from '@project-serum/anchor'; -import { MockOracleSession, SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; -import { CrossPile } from '../target/types/cross_pile'; -import { randomBytes } from 'crypto'; -import { assert } from "chai"; - -describe('cross-pile', () => { - const ENV = 'http://localhost:8899'; - const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); - - function createProvider(keyPair) { - let solConnection = new anchor.web3.Connection(ENV); - let walletWrapper = new anchor.Wallet(keyPair); - return new anchor.Provider(solConnection, walletWrapper, { - preflightCommitment: 'recent', - }); - } - - async function getBalance(prov, key) { - anchor.setProvider(prov); - return await prov.connection.getBalance(key, "confirmed"); - } - - const userKeyPair = anchor.web3.Keypair.generate(); - const user2KeyPair = anchor.web3.Keypair.generate(); - const oracle = anchor.web3.Keypair.generate(); - const oracleSession = new MockOracleSession(oracle, SOLRAND_IDL, solrandId, ENV); - - let provider = createProvider(userKeyPair); - let provider2 = createProvider(user2KeyPair); - - const program = anchor.workspace.CrossPile as Program; - const userProgram = new anchor.Program(program.idl, program.programId, provider); - const user2Program = new anchor.Program(program.idl, program.programId, provider2); - - const oraclePubkey = oracle.publicKey; - const solrandProgram = new anchor.Program(SOLRAND_IDL, solrandId, provider); - const amount = new anchor.BN(100000000); - const airdropAmount = 10000000000; // Should be more than betting amount - let reqAccount, reqBump; - let reqVaultAccount, reqVaultBump; - let coinAccount, coinBump; - let vaultAccount, vaultBump; - - anchor.setProvider(provider); - - it('Set up tests', async () => { - console.log('User Pubkey: ', userKeyPair.publicKey.toString()); - await provider.connection.confirmTransaction( - await provider.connection.requestAirdrop(userKeyPair.publicKey, airdropAmount), - "confirmed" - ); - - console.log('User 2 Pubkey: ', user2KeyPair.publicKey.toString()); - await provider.connection.confirmTransaction( - await provider.connection.requestAirdrop(user2KeyPair.publicKey, airdropAmount), - "confirmed" - ); - - console.log('Oracle Pubkey', oracle.publicKey.toString()); - await provider.connection.confirmTransaction( - await provider.connection.requestAirdrop(oracle.publicKey, airdropAmount), - "confirmed" - ); - - [reqAccount, reqBump] = await anchor.web3.PublicKey.findProgramAddress( - [Buffer.from("r-seed"), userKeyPair.publicKey.toBuffer()], - solrandId - ); - - [reqVaultAccount, reqVaultBump] = await anchor.web3.PublicKey.findProgramAddress( - [Buffer.from("v-seed"), userKeyPair.publicKey.toBuffer()], - solrandId, - ); - - await solrandProgram.rpc.initialize( - reqBump, - reqVaultBump, - { - accounts: { - requester: reqAccount, - vault: reqVaultAccount, - authority: userKeyPair.publicKey, - oracle: oraclePubkey, - rent: anchor.web3.SYSVAR_RENT_PUBKEY, - systemProgram: anchor.web3.SystemProgram.programId, - }, - signers: [userKeyPair], - } - ); - }); - - it('Create a coin!', async () => { - [coinAccount, coinBump] = await anchor.web3.PublicKey.findProgramAddress( - [Buffer.from("coin-seed"), userKeyPair.publicKey.toBuffer()], - program.programId - ); - - [vaultAccount, vaultBump] = await anchor.web3.PublicKey.findProgramAddress( - [Buffer.from("vault-seed"), userKeyPair.publicKey.toBuffer()], - program.programId - ); - - console.log('Coin account: ', coinAccount.toString()); - console.log('Req account: ', reqAccount.toString()); - console.log('Vault account: ', vaultAccount.toString()); - - await program.rpc.createCoin( - coinBump, - reqBump, - vaultBump, - amount, - { - accounts: { - coin: coinAccount, - vault: vaultAccount, - requester: reqAccount, - initiator: userKeyPair.publicKey, - acceptor: user2KeyPair.publicKey, - oracle: oraclePubkey, - oracleVault: reqVaultAccount, - solrandProgram: solrandId, - rent: anchor.web3.SYSVAR_RENT_PUBKEY, - systemProgram: anchor.web3.SystemProgram.programId, - }, - signers: [userKeyPair], - } - ); - - let userBalance = await getBalance(provider, userKeyPair.publicKey); - assert(userBalance < airdropAmount); - - console.log('User Balance: ', userBalance); - - await provider.connection.confirmTransaction( - await provider.connection.requestAirdrop(reqVaultAccount, 1000000000), - "confirmed" - ); - }); - - it('Approve a flip', async () => { - anchor.setProvider(provider2); - await user2Program.rpc.approveFlip( - { - accounts: { - authority: user2KeyPair.publicKey, - vault: vaultAccount, - initiator: userKeyPair.publicKey, - requester: reqAccount, - oracle: oraclePubkey, - oracleVault: reqVaultAccount, - solrandProgram: solrandId, - systemProgram: anchor.web3.SystemProgram.programId, - }, - remainingAccounts: [ - { - pubkey: coinAccount, - isWritable: true, - isSigner: false, - }, - ], - signers: [user2KeyPair], - }, - ); - - let user2Balance = await getBalance(provider2, user2KeyPair.publicKey); - assert(user2Balance < airdropAmount + amount.toNumber()); - - console.log('User 2 Balance: ', user2Balance); - }); - - it('Oracle responds to request', async () => { - let randomNumber = randomBytes(64); - randomNumber[0] = 0; // Force winner to be acceptor - - let requester = { publicKey: reqAccount }; - - await oracleSession.publishRandom(requester, randomNumber); - }); - - it('Reveal the result', async () => { - anchor.setProvider(provider2); - await user2Program.rpc.revealCoin( - { - accounts: { - initiator: userKeyPair.publicKey, - acceptor: user2KeyPair.publicKey, - vault: vaultAccount, - requester: reqAccount, - authority: user2KeyPair.publicKey, - solrandProgram: solrandId, - systemProgram: anchor.web3.SystemProgram.programId, - }, - remainingAccounts: [ - { - pubkey: coinAccount, - isWritable: true, - isSigner: false, - }, - ], - signers: [user2KeyPair], - }, - ); - - let userBalance = await getBalance(provider, userKeyPair.publicKey); - let user2Balance = await getBalance(provider2, user2KeyPair.publicKey); - - console.log('User Balance: ', userBalance); - console.log('User 2 Balance: ', user2Balance); - - assert(userBalance < airdropAmount + amount.toNumber()); - assert(user2Balance >= airdropAmount + amount.toNumber() - 3 * 5000); // account for transaction cost - }); -}); diff --git a/tests/decline-acceptor-wager.ts b/tests/decline-acceptor-wager.ts new file mode 100644 index 0000000..244f7c4 --- /dev/null +++ b/tests/decline-acceptor-wager.ts @@ -0,0 +1,127 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from '@project-serum/anchor'; +import { MockOracleSession, SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; +import { SolrandSession } from '../app/solrandSession'; +import { CrossPile } from '../target/types/cross_pile'; +import { Session, User } from "../app/sessions"; +import * as spl from '@solana/spl-token'; +import { Keypair, PublicKey, Connection } from '@solana/web3.js'; +import { expect } from 'chai'; +import { TimeLogger, CommitmentLevel, instantiateSessions, createMintsInParallel, createChallengesWithAddressAndBump, newChallenges } from '../app/utils'; +import { randomBytes } from 'crypto'; +import { Challenge } from '../app/challenge'; + +const timeLogger = new TimeLogger(); +timeLogger.disable(); +const program = anchor.workspace.CrossPile as Program; +const ENV = 'http://localhost:8899'; +const uuid = Math.floor(Math.random() * 2**50); + +describe('decline-acceptor-wager', () => { + timeLogger.log("beginning decline-acceptor-wager tests"); + + after(() => { + timeLogger.log("all decline-acceptor-wager tests finished"); + timeLogger.outputAllLogs(); + }); + + const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + const oracleKeypair = anchor.web3.Keypair.generate(); + const oracleSession = new MockOracleSession(oracleKeypair, SOLRAND_IDL, solrandId, ENV); + timeLogger.log("solrandId: " + solrandId.toString()); + + let initiatorSessions = instantiateSessions(1, program, ENV, timeLogger); + let acceptorSessions = instantiateSessions(1, program, ENV, timeLogger); + let solrandSessions = initiatorSessions.map((session) => new SolrandSession(session.userKeypair, SOLRAND_IDL, solrandId, oracleKeypair.publicKey, ENV, uuid)); + let allUserSessions = initiatorSessions.concat(acceptorSessions); + + const thirdPartySession = new Session(program, ENV, timeLogger); + + const mintAuthority = thirdPartySession.userKeypair; + let mint1: PublicKey; + let mint2: PublicKey; + + let expectedChallenges: Challenge[]; + let initiators: User[]; + let acceptors: User[]; + + const initialTokenFundAmount = 2000; + + const initiatorWagerTokenAmount = 1000; + + it('Set up tests', async() => { + await Promise.all([ + thirdPartySession.requestAirdrop(), + allUserSessions.map((session) => session.requestAirdrop()), + oracleSession.provider.connection.confirmTransaction( + await oracleSession.provider.connection.requestAirdrop(oracleKeypair.publicKey, 10000000000), + ), + solrandSessions.map((session) => session.setAccounts()) + ]); + + let mintPromises = createMintsInParallel(2, thirdPartySession); + await Promise.all([ + ...mintPromises, + solrandSessions.map((session) => session.initializeAccount()) + ]).then((values) => { + mint1 = values[0] as PublicKey; + mint2 = values[1] as PublicKey; + }); + timeLogger.log("mints created, solrand initialized"); + + await Promise.all( + initiatorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint1, mintAuthority)).concat( + acceptorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint2, mintAuthority))) + ); + + initiators = initiatorSessions.map((initiatorSession) => new User(initiatorSession)); + acceptors = acceptorSessions.map((acceptorSession) => new User(acceptorSession)); + + expectedChallenges = await createChallengesWithAddressAndBump(program.programId, initiators, solrandSessions); + + await Promise.all( + newChallenges(initiators, solrandSessions, initiatorWagerTokenAmount, expectedChallenges) + ); + }); + + describe('decline_acceptor_wager', () => { + it('declines acceptor wager', async () => { + let testIndex = 0; + let initiator = initiators[testIndex]; + let acceptor = acceptors[testIndex]; + let expectedChallenge = expectedChallenges[testIndex]; + const acceptorWagerTokenAmountBigNumber = new anchor.BN(37); + + // challenge created, now accept the challenge + await acceptor.acceptChallenge( + expectedChallenge.address, + acceptorWagerTokenAmountBigNumber + ); + + timeLogger.log("challenge accepted"); + + // challenge accepted, now decline the wager + timeLogger.log("declining acceptor's wager"); + let declineTx = await initiator.declineAcceptorWager( + expectedChallenge.address, + acceptor.session.userKeypair.publicKey, + acceptor.tokensVaultAddress, + acceptor.session.tokensSource.address + ); + await initiator.session.provider.connection.confirmTransaction( + declineTx, + CommitmentLevel.FINALIZED + ); + timeLogger.log("acceptor wager declined"); + let challengeData = await program.account.challenge.fetch(expectedChallenge.address); + let actualChallenge = new Challenge(program.programId, null, null, challengeData); + expectedChallenge.initiatorTokensMint = mint1; + expectedChallenge.initiatorTokensVault = initiator.tokensVaultAddress; + expectedChallenge.initiatorWagerTokenAmount = initiatorWagerTokenAmount; + expectedChallenge.isEquivalentTo(actualChallenge); + + let acceptorTokensSource = await acceptor.session.getOrCreateAssociatedTokenAccount(mint2, mintAuthority); + expect(Number(acceptorTokensSource.amount)).equals(initialTokenFundAmount); + }); + }); +}); diff --git a/tests/new-challenge.ts b/tests/new-challenge.ts new file mode 100644 index 0000000..ee2c230 --- /dev/null +++ b/tests/new-challenge.ts @@ -0,0 +1,119 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from '@project-serum/anchor'; +import { SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; +import { SolrandSession } from '../app/solrandSession'; +import { CrossPile } from '../target/types/cross_pile'; +import { Session, User } from "../app/sessions"; +import * as spl from '@solana/spl-token'; +import { PublicKey } from '@solana/web3.js'; +import { expect } from 'chai'; +import { TimeLogger, CommitmentLevel, instantiateSessions } from '../app/utils'; +import { Challenge } from '../app/challenge'; + +const timeLogger = new TimeLogger(); +// timeLogger.disable(); +const program = anchor.workspace.CrossPile as Program; +const ENV = 'http://localhost:8899'; +const uuid = Math.floor(Math.random() * 2**50); + +describe('new-challenge', () => { + timeLogger.log("beginning new-challenge tests"); + + after(() => { + timeLogger.log("all new-challenge tests finished"); + timeLogger.outputAllLogs(); + }); + + let initiator: User; + let initiatorSession = instantiateSessions(1, program, ENV, timeLogger)[0]; + const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + const oracleKeypair = anchor.web3.Keypair.generate(); + + let solrandSession = new SolrandSession(initiatorSession.userKeypair, SOLRAND_IDL, solrandId, oracleKeypair.publicKey, ENV, uuid) + + const thirdPartySession = new Session(program, ENV, timeLogger); + + const mintAuthority = thirdPartySession.userKeypair; + let mint: PublicKey; + + const initialTokenFundAmount = 2000; + it('Set up tests', async() => { + await Promise.all([ + thirdPartySession.requestAirdrop(), + initiatorSession.requestAirdrop(), + solrandSession.setAccounts() + ]); + + timeLogger.log("creating mints and initializing solrand accounts"); + + let mintPromise = spl.createMint( + thirdPartySession.provider.connection, + mintAuthority, + thirdPartySession.userKeypair.publicKey, + null, // don't need a freeze authority for the example mint + 9, // decimal places 9 + anchor.web3.Keypair.generate(), + { + commitment: CommitmentLevel.FINALIZED + } + ); + timeLogger.log("mint created"); + + await Promise.all([ + mintPromise, + solrandSession.initializeAccount() + ]).then((values) => { + mint = values[0]; + }); + + await initiatorSession.fundTokens(initialTokenFundAmount, mint, mintAuthority); + }); + + describe('new_challenge', () => { + before(async () => { + initiator = new User(initiatorSession); + }); + timeLogger.log("beginning new challenge"); + + it('creates a new challenge', async () => { + const wagerTokensAmount = 1000; + const wagerTokensAmountBigNumber = new anchor.BN(wagerTokensAmount); + + let tokenSourceAccount = await initiator.session.getOrCreateAssociatedTokenAccount(initiator.session.tokensSource.mint, mintAuthority); + timeLogger.log("initiator token source account amount right before challenge: " + tokenSourceAccount.amount); + + let expectedChallenge = new Challenge(program.programId, initiator.session.userKeypair.publicKey, solrandSession.userSession.reqAccount); + await expectedChallenge.assignAddressAndBump(); + timeLogger.log("assigned address for expected challenge: " + expectedChallenge.address.toString()); + + let newChallengeTx = await initiator.newChallenge(expectedChallenge, wagerTokensAmountBigNumber, solrandId, solrandSession.userSession.reqAccount); + timeLogger.log("challenge created"); + await initiator.session.provider.connection.confirmTransaction( + newChallengeTx, CommitmentLevel.FINALIZED + ); + timeLogger.log("challenge confirmed"); + + let challengeData = await program.account.challenge.fetch(expectedChallenge.address); + tokenSourceAccount = await initiator.session.getOrCreateAssociatedTokenAccount(initiator.session.tokensSource.mint, mintAuthority); + + const initiatorTokensVaultAccount = await spl.getAccount( + initiator.session.provider.connection, + initiator.tokensVaultAddress + ); + + expectedChallenge.initiatorTokensMint = mint; + expectedChallenge.initiatorTokensVault = initiator.tokensVaultAddress; + expectedChallenge.initiatorWagerTokenAmount = wagerTokensAmount; + + let actualChallenge = new Challenge(program.programId, null, null, challengeData); + timeLogger.log("actualChallenge requester: " + actualChallenge.requester.toString()); + timeLogger.log("expectedChallenge requester: " + expectedChallenge.requester.toString()); + + expectedChallenge.isEquivalentTo(actualChallenge); + expect(Number(tokenSourceAccount.amount)) + .equals(initialTokenFundAmount - wagerTokensAmount); + expect(Number(initiatorTokensVaultAccount.amount)) + .equals(Number(wagerTokensAmount)); + }); + }); +}); \ No newline at end of file diff --git a/tests/reveal-winner.ts b/tests/reveal-winner.ts new file mode 100644 index 0000000..61b94bb --- /dev/null +++ b/tests/reveal-winner.ts @@ -0,0 +1,152 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from '@project-serum/anchor'; +import { MockOracleSession, SOLRAND_IDL, PROGRAM_ID } from '@demox-labs/solrand'; +import { SolrandSession } from '../app/solrandSession'; +import { CrossPile } from '../target/types/cross_pile'; +import { Session, User } from "../app/sessions"; +import { PublicKey } from '@solana/web3.js'; +import { expect } from 'chai'; +import { TimeLogger, CommitmentLevel, instantiateSessions, createMintsInParallel, createChallengesWithAddressAndBump, newChallenges } from '../app/utils'; +import { randomBytes } from 'crypto'; +import { Challenge } from '../app/challenge'; + +const timeLogger = new TimeLogger(); +timeLogger.disable(); +const program = anchor.workspace.CrossPile as Program; +const ENV = 'http://localhost:8899'; +const uuid = Math.floor(Math.random() * 2**50); + +describe('reveal-winner', () => { + timeLogger.log("beginning reveal-winner tests"); + + after(() => { + timeLogger.log("all reveal-winner tests finished"); + timeLogger.outputAllLogs(); + }); + + const solrandId = new anchor.web3.PublicKey(PROGRAM_ID); + const oracleKeypair = anchor.web3.Keypair.generate(); + const oracleSession = new MockOracleSession(oracleKeypair, SOLRAND_IDL, solrandId, ENV); + + let initiatorSessions = instantiateSessions(1, program, ENV, timeLogger); + let acceptorSessions = instantiateSessions(1, program, ENV, timeLogger); + let solrandSessions = initiatorSessions.map((session) => new SolrandSession(session.userKeypair, SOLRAND_IDL, solrandId, oracleKeypair.publicKey, ENV, uuid)); + + let allUserSessions = initiatorSessions.concat(acceptorSessions); + + const thirdPartySession = new Session(program, ENV, timeLogger); + + const mintAuthority = thirdPartySession.userKeypair; + let mint1: PublicKey; + let mint2: PublicKey; + + let expectedChallenges: Challenge[]; + let initiators: User[]; + let acceptors: User[]; + + const initialTokenFundAmount = 2000; + const initiatorWagerTokenAmount = 1000; + + it('Set up tests', async() => { + await Promise.all([ + thirdPartySession.requestAirdrop(), + allUserSessions.map((session) => session.requestAirdrop()), + oracleSession.provider.connection.confirmTransaction( + await oracleSession.provider.connection.requestAirdrop(oracleKeypair.publicKey, 10000000000), + ), + solrandSessions.map((session) => session.setAccounts()) + ]); + + let mintPromises = createMintsInParallel(2, thirdPartySession); + await Promise.all([ + ...mintPromises, + solrandSessions.map((session) => session.initializeAccount()) + ]).then((values) => { + mint1 = values[0] as PublicKey; + mint2 = values[1] as PublicKey; + }); + timeLogger.log("mints created, solrand initialized"); + + await Promise.all( + initiatorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint1, mintAuthority)).concat( + acceptorSessions.map((session) => session.fundTokens(initialTokenFundAmount, mint2, mintAuthority))) + ); + + initiators = initiatorSessions.map((initiatorSession) => new User(initiatorSession)); + acceptors = acceptorSessions.map((acceptorSession) => new User(acceptorSession)); + + expectedChallenges = await createChallengesWithAddressAndBump(program.programId, initiators, solrandSessions); + + await Promise.all( + newChallenges(initiators, solrandSessions, initiatorWagerTokenAmount, expectedChallenges) + ); + }); + + describe('reveal_winner', () => { + it('reveals a winner', async () => { + let testIndex = 0; + let initiator = initiators[testIndex]; + let acceptor = acceptors[testIndex]; + let solrandSession = solrandSessions[testIndex]; + let expectedChallenge = expectedChallenges[testIndex]; + + const acceptorWagerTokenAmountBigNumber = new anchor.BN(37); + + await acceptor.acceptChallenge( + expectedChallenge.address, + acceptorWagerTokenAmountBigNumber + ); + + timeLogger.log("challenge accepted"); + + // challenge accepted, now approve the acceptor's wager + await initiator.approveAcceptorWager( + expectedChallenge.address, + solrandSession.userSession.reqAccount, + oracleKeypair.publicKey + ); + + timeLogger.log("publishing non random number"); + let randomNumber = randomBytes(64); + randomNumber[0] = 1; // Force winner to be acceptor + + let requester = { publicKey: solrandSession.userSession.reqAccount }; + + await oracleSession.publishRandom(requester, randomNumber); + timeLogger.log("non random number published"); + + // acceptor's wager approved, now reveal the winner + timeLogger.log("revealing winner"); + let revealTx = await acceptor.revealWinner( + expectedChallenge.address, + initiator.tokensVaultAddress, + initiator.session.tokensSource.mint, + initiator.session.userKeypair.publicKey, + acceptor.tokensVaultAddress, + acceptor.session.userKeypair.publicKey, + solrandId, + solrandSession.userSession.reqAccount, + ); + await acceptor.session.provider.connection.confirmTransaction( + revealTx, + CommitmentLevel.FINALIZED + ); + timeLogger.log("winner revealed"); + + let acceptorOwnTokensTaker = await acceptor.session.getOrCreateAssociatedTokenAccount( + acceptor.session.tokensSource.mint, + mintAuthority + ); + timeLogger.log("retrieved own tokens taker account"); + let acceptorOtherTokensTaker = await acceptor.session.getOrCreateAssociatedTokenAccount( + mint1, + mintAuthority + ); + timeLogger.log("retrieved other tokens taker account"); + expect(Number(acceptorOwnTokensTaker.amount), "Token own taker should be full amount.") + .equals(initialTokenFundAmount); + expect(Number(acceptorOtherTokensTaker.amount), "Token other taker should be initiator bet amount.") + .equals(initiatorWagerTokenAmount); + }); + }); +}); \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d7cabc2..3d6ee21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,97 +3,139 @@ "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": - "integrity" "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==" - "resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz" - "version" "7.16.7" + "integrity" "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==" + "resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz" + "version" "7.17.9" dependencies: "regenerator-runtime" "^0.13.4" -"@demox_labs/solrand@^0.0.3": - "integrity" "sha512-aI/V5BybTtjoXwDULIPcyu6A3eQCU79w/dmRr12X2rCuReSG4iOyPQC3fdp45AtUpltxrMp413KiGsT0h+5gbg==" - "resolved" "https://registry.npmjs.org/@demox_labs/solrand/-/solrand-0.0.3.tgz" - "version" "0.0.3" - dependencies: - "@project-serum/anchor" "^0.18.2" - -"@demox-labs/solrand@^0.0.3": - "integrity" "sha512-f3sw1Zw8RcTPuCCgXj4DXfVC7T9FPuqLCCfCNUV/Re1ns5IqabTw+33yM6RnszVTGo3BQxtLBMxXnuoktOpsNw==" - "resolved" "https://registry.npmjs.org/@demox-labs/solrand/-/solrand-0.0.3.tgz" - "version" "0.0.3" +"@demox-labs/solrand@^0.0.5": + "integrity" "sha512-QOyAuojzMpf5Etw2aNV71PnMQDHovEJCeGhc49MU5PI2PDL5C48d6XzHtHJVMaKW958QbvCfQmUNv8gLtv+IeQ==" + "resolved" "https://registry.npmjs.org/@demox-labs/solrand/-/solrand-0.0.5.tgz" + "version" "0.0.5" dependencies: - "@project-serum/anchor" "^0.18.2" + "@project-serum/anchor" "^0.24.2" -"@ethersproject/bytes@^5.5.0": - "integrity" "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==" - "resolved" "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz" - "version" "5.5.0" +"@ethersproject/bytes@^5.6.0": + "integrity" "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==" + "resolved" "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz" + "version" "5.6.1" dependencies: - "@ethersproject/logger" "^5.5.0" + "@ethersproject/logger" "^5.6.0" -"@ethersproject/logger@^5.5.0": - "integrity" "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" - "resolved" "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz" - "version" "5.5.0" +"@ethersproject/logger@^5.6.0": + "integrity" "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==" + "resolved" "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz" + "version" "5.6.0" "@ethersproject/sha2@^5.5.0": - "integrity" "sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA==" - "resolved" "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.5.0.tgz" - "version" "5.5.0" + "integrity" "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==" + "resolved" "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz" + "version" "5.6.0" dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" "hash.js" "1.1.7" -"@project-serum/anchor-cli@0.18.2": - "integrity" "sha512-zZvLSa0DvsjsKSK8cU7ENqPB1tQ8WCT6dTY2IaJjWdG0UvXUTri8phnYyF5+Zti+frTdKyggOtI+i1QApOWhRQ==" - "resolved" "https://registry.npmjs.org/@project-serum/anchor-cli/-/anchor-cli-0.18.2.tgz" - "version" "0.18.2" +"@hapi/hoek@^9.0.0": + "integrity" "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==" + "resolved" "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz" + "version" "9.2.1" -"@project-serum/anchor@^0.18.2": - "integrity" "sha512-uyjiN/3Ipp+4hrZRm/hG18HzGLZyvP790LXrCsGO3IWxSl28YRhiGEpKnZycfMW94R7nxdUoE3wY67V+ZHSQBQ==" - "resolved" "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.18.2.tgz" - "version" "0.18.2" +"@hapi/topo@^5.0.0": + "integrity" "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==" + "resolved" "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz" + "version" "5.1.0" dependencies: - "@project-serum/borsh" "^0.2.2" - "@solana/web3.js" "^1.17.0" + "@hapi/hoek" "^9.0.0" + +"@project-serum/anchor-cli@0.24.2": + "integrity" "sha512-3D+fB3n/PAmY5AF2P+zxNvV2ZKx6YLoDlqHXqFa7wGqxVZfTo4WM2O7ChJjU2WIxS/WoTt6qXnehbuGUJ1JXig==" + "resolved" "https://registry.npmjs.org/@project-serum/anchor-cli/-/anchor-cli-0.24.2.tgz" + "version" "0.24.2" + +"@project-serum/anchor@^0.24.2": + "integrity" "sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA==" + "resolved" "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.24.2.tgz" + "version" "0.24.2" + 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.0" + "buffer-layout" "^1.2.2" "camelcase" "^5.3.1" + "cross-fetch" "^3.1.5" "crypto-hash" "^1.3.0" "eventemitter3" "^4.0.7" - "find" "^0.3.0" "js-sha256" "^0.9.0" "pako" "^2.0.3" "snake-case" "^3.0.4" "toml" "^3.0.0" -"@project-serum/borsh@^0.2.2": - "integrity" "sha512-lH9zEYADZE3cxrgiFym8+jbUE3NM/LH+WOKYcUjs65CT10Q64Hv45bcAAa/phwYk4Tpz0uQ1x+ergFaAoGt67Q==" - "resolved" "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.3.tgz" - "version" "0.2.3" +"@project-serum/borsh@^0.2.5": + "integrity" "sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==" + "resolved" "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.5.tgz" + "version" "0.2.5" dependencies: "bn.js" "^5.1.2" "buffer-layout" "^1.2.0" -"@solana/buffer-layout@^3.0.0": - "integrity" "sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w==" - "resolved" "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz" +"@sideway/address@^4.1.3": + "integrity" "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==" + "resolved" "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz" + "version" "4.1.4" + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.0": + "integrity" "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==" + "resolved" "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz" "version" "3.0.0" + +"@sideway/pinpoint@^2.0.0": + "integrity" "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" + "resolved" "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz" + "version" "2.0.0" + +"@solana/buffer-layout-utils@^0.2.0": + "integrity" "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==" + "resolved" "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz" + "version" "0.2.0" + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/web3.js" "^1.32.0" + "bigint-buffer" "^1.1.5" + "bignumber.js" "^9.0.1" + +"@solana/buffer-layout@^4.0.0": + "integrity" "sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ==" + "resolved" "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz" + "version" "4.0.0" dependencies: "buffer" "~6.0.3" -"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.2.0": - "integrity" "sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw==" - "resolved" "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.31.0.tgz" - "version" "1.31.0" +"@solana/spl-token@^0.2.0": + "integrity" "sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ==" + "resolved" "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.2.0.tgz" + "version" "0.2.0" + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/buffer-layout-utils" "^0.2.0" + "@solana/web3.js" "^1.32.0" + "start-server-and-test" "^1.14.0" + +"@solana/web3.js@^1.2.0", "@solana/web3.js@^1.36.0": + "integrity" "sha512-rgPidynwPTu8iLmS++aQbDGiPPtwjRmu+uQxF9jTNT7v3ifKIlS4HccMdjj4WDcYx8h2mUtQX5xkdk6liSbdvg==" + "resolved" "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.2.tgz" + "version" "1.37.2" dependencies: "@babel/runtime" "^7.12.5" "@ethersproject/sha2" "^5.5.0" - "@solana/buffer-layout" "^3.0.0" + "@solana/buffer-layout" "^4.0.0" "bn.js" "^5.0.0" - "borsh" "^0.4.0" + "borsh" "^0.7.0" "bs58" "^4.0.1" "buffer" "6.0.1" "cross-fetch" "^3.1.4" @@ -104,12 +146,25 @@ "superstruct" "^0.14.2" "tweetnacl" "^1.0.0" -"@types/bn.js@^4.11.5": - "integrity" "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==" - "resolved" "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz" - "version" "4.11.6" +"@solana/web3.js@^1.32.0": + "integrity" "sha512-1zm1blRU6ANb8bOfONibKkNKoMyzE1e0Z88MagyRLF1AmfHc+18lFvqxSQKUdazLMHcioZ28h+GfyAaeCT63iA==" + "resolved" "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.37.1.tgz" + "version" "1.37.1" dependencies: - "@types/node" "*" + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^4.0.0" + "bn.js" "^5.0.0" + "borsh" "^0.7.0" + "bs58" "^4.0.1" + "buffer" "6.0.1" + "cross-fetch" "^3.1.4" + "jayson" "^3.4.4" + "js-sha3" "^0.8.0" + "rpc-websockets" "^7.4.2" + "secp256k1" "^4.0.2" + "superstruct" "^0.14.2" + "tweetnacl" "^1.0.0" "@types/connect@^3.4.33": "integrity" "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==" @@ -119,9 +174,9 @@ "@types/node" "*" "@types/express-serve-static-core@^4.17.9": - "integrity" "sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA==" - "resolved" "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz" - "version" "4.17.27" + "integrity" "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==" + "resolved" "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz" + "version" "4.17.28" dependencies: "@types/node" "*" "@types/qs" "*" @@ -133,9 +188,9 @@ "version" "0.0.29" "@types/lodash@^4.14.159": - "integrity" "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==" - "resolved" "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz" - "version" "4.14.178" + "integrity" "sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==" + "resolved" "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.181.tgz" + "version" "4.14.181" "@types/mocha@^9.0.0": "integrity" "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==" @@ -143,14 +198,14 @@ "version" "9.0.0" "@types/node@*": - "integrity" "sha512-+XBAjfZmmivILUzO0HwBJoYkAyyySSLg5KCGBDFLomJo0sV6szvVLAf4ANZZ0pfWzgEds5KmGLG9D5hfEqOhaA==" - "resolved" "https://registry.npmjs.org/@types/node/-/node-17.0.6.tgz" - "version" "17.0.6" + "integrity" "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==" + "resolved" "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz" + "version" "17.0.24" "@types/node@^12.12.54": - "integrity" "sha512-RX6hFa0hxkFuktu5629zJEkWK5e0HreW4vpNSLn4nWkOui7CTGCjtKiKpvtZ4QwCZ2Am5uhrb5ULHKNyunYYqg==" - "resolved" "https://registry.npmjs.org/@types/node/-/node-12.20.40.tgz" - "version" "12.20.40" + "integrity" "sha512-4kxzqkrpwYtn6okJUcb2lfUu9ilnb3yhUOH6qX3nug8D2DupZ2drIkff2yJzYcNJVl3begnlcaBJ7tqiTTzjnQ==" + "resolved" "https://registry.npmjs.org/@types/node/-/node-12.20.48.tgz" + "version" "12.20.48" "@types/qs@*": "integrity" "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" @@ -214,6 +269,13 @@ "resolved" "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" "version" "1.1.0" +"axios@^0.21.1": + "integrity" "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==" + "resolved" "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz" + "version" "0.21.4" + dependencies: + "follow-redirects" "^1.14.0" + "balanced-match@^1.0.0": "integrity" "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" "resolved" "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" @@ -231,28 +293,51 @@ "resolved" "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" "version" "1.5.1" +"bigint-buffer@^1.1.5": + "integrity" "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==" + "resolved" "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz" + "version" "1.1.5" + dependencies: + "bindings" "^1.3.0" + +"bignumber.js@^9.0.1": + "integrity" "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==" + "resolved" "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz" + "version" "9.0.2" + "binary-extensions@^2.0.0": "integrity" "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" "resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" "version" "2.2.0" +"bindings@^1.3.0": + "integrity" "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==" + "resolved" "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" + "version" "1.5.0" + dependencies: + "file-uri-to-path" "1.0.0" + +"bluebird@3.7.2": + "integrity" "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + "resolved" "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" + "version" "3.7.2" + "bn.js@^4.11.9": "integrity" "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" "resolved" "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" "version" "4.12.0" -"bn.js@^5.0.0", "bn.js@^5.1.2": +"bn.js@^5.0.0", "bn.js@^5.1.2", "bn.js@^5.2.0": "integrity" "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" "resolved" "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz" "version" "5.2.0" -"borsh@^0.4.0": - "integrity" "sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g==" - "resolved" "https://registry.npmjs.org/borsh/-/borsh-0.4.0.tgz" - "version" "0.4.0" +"borsh@^0.7.0": + "integrity" "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==" + "resolved" "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz" + "version" "0.7.0" dependencies: - "@types/bn.js" "^4.11.5" - "bn.js" "^5.0.0" + "bn.js" "^5.2.0" "bs58" "^4.0.0" "text-encoding-utf-8" "^1.0.2" @@ -293,7 +378,7 @@ "resolved" "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" "version" "1.1.2" -"buffer-layout@^1.2.0": +"buffer-layout@^1.2.0", "buffer-layout@^1.2.2": "integrity" "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==" "resolved" "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz" "version" "1.2.2" @@ -315,9 +400,9 @@ "ieee754" "^1.2.1" "bufferutil@^4.0.1": - "integrity" "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==" - "resolved" "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz" - "version" "4.0.5" + "integrity" "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==" + "resolved" "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz" + "version" "4.0.6" dependencies: "node-gyp-build" "^4.3.0" @@ -356,6 +441,11 @@ "resolved" "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" "version" "1.0.2" +"check-more-types@2.24.0": + "integrity" "sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA=" + "resolved" "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz" + "version" "2.24.0" + "chokidar@3.5.2": "integrity" "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==" "resolved" "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz" @@ -407,12 +497,21 @@ "resolved" "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" "version" "0.0.1" -"cross-fetch@^3.1.4": - "integrity" "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==" - "resolved" "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz" - "version" "3.1.4" +"cross-fetch@^3.1.4", "cross-fetch@^3.1.5": + "integrity" "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==" + "resolved" "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz" + "version" "3.1.5" + dependencies: + "node-fetch" "2.6.7" + +"cross-spawn@^7.0.3": + "integrity" "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==" + "resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" + "version" "7.0.3" dependencies: - "node-fetch" "2.6.1" + "path-key" "^3.1.0" + "shebang-command" "^2.0.0" + "which" "^2.0.1" "crypto-hash@^1.3.0": "integrity" "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==" @@ -461,7 +560,12 @@ "no-case" "^3.0.4" "tslib" "^2.0.3" -"elliptic@^6.5.2": +"duplexer@~0.1.1": + "integrity" "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" + "resolved" "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz" + "version" "0.1.2" + +"elliptic@^6.5.4": "integrity" "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==" "resolved" "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" "version" "6.5.4" @@ -501,16 +605,49 @@ "resolved" "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" "version" "4.0.0" +"event-stream@=3.3.4": + "integrity" "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=" + "resolved" "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz" + "version" "3.3.4" + dependencies: + "duplexer" "~0.1.1" + "from" "~0" + "map-stream" "~0.1.0" + "pause-stream" "0.0.11" + "split" "0.3" + "stream-combiner" "~0.0.4" + "through" "~2.3.1" + "eventemitter3@^4.0.7": "integrity" "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" "resolved" "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" "version" "4.0.7" +"execa@5.1.1": + "integrity" "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==" + "resolved" "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" + "version" "5.1.1" + dependencies: + "cross-spawn" "^7.0.3" + "get-stream" "^6.0.0" + "human-signals" "^2.1.0" + "is-stream" "^2.0.0" + "merge-stream" "^2.0.0" + "npm-run-path" "^4.0.1" + "onetime" "^5.1.2" + "signal-exit" "^3.0.3" + "strip-final-newline" "^2.0.0" + "eyes@^0.1.8": "integrity" "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" "resolved" "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz" "version" "0.1.8" +"file-uri-to-path@1.0.0": + "integrity" "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "resolved" "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz" + "version" "1.0.0" + "fill-range@^7.0.1": "integrity" "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==" "resolved" "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" @@ -526,18 +663,21 @@ "locate-path" "^6.0.0" "path-exists" "^4.0.0" -"find@^0.3.0": - "integrity" "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==" - "resolved" "https://registry.npmjs.org/find/-/find-0.3.0.tgz" - "version" "0.3.0" - dependencies: - "traverse-chain" "~0.1.0" - "flat@^5.0.2": "integrity" "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" "resolved" "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" "version" "5.0.2" +"follow-redirects@^1.14.0": + "integrity" "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" + "resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz" + "version" "1.14.9" + +"from@~0": + "integrity" "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" + "resolved" "https://registry.npmjs.org/from/-/from-0.1.7.tgz" + "version" "0.1.7" + "fs.realpath@^1.0.0": "integrity" "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" @@ -558,6 +698,11 @@ "resolved" "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" "version" "2.0.0" +"get-stream@^6.0.0": + "integrity" "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + "resolved" "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" + "version" "6.0.1" + "glob-parent@~5.1.2": "integrity" "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==" "resolved" "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" @@ -609,6 +754,11 @@ "minimalistic-assert" "^1.0.0" "minimalistic-crypto-utils" "^1.0.1" +"human-signals@^2.1.0": + "integrity" "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + "resolved" "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" + "version" "2.1.0" + "ieee754@^1.2.1": "integrity" "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" "resolved" "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" @@ -661,6 +811,11 @@ "resolved" "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" "version" "2.1.0" +"is-stream@^2.0.0": + "integrity" "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + "resolved" "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" + "version" "2.0.1" + "is-unicode-supported@^0.1.0": "integrity" "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" "resolved" "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" @@ -697,6 +852,17 @@ "uuid" "^8.3.2" "ws" "^7.4.5" +"joi@^17.4.0": + "integrity" "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==" + "resolved" "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz" + "version" "17.6.0" + dependencies: + "@hapi/hoek" "^9.0.0" + "@hapi/topo" "^5.0.0" + "@sideway/address" "^4.1.3" + "@sideway/formula" "^3.0.0" + "@sideway/pinpoint" "^2.0.0" + "js-sha256@^0.9.0": "integrity" "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" "resolved" "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz" @@ -739,6 +905,11 @@ "jsonparse" "^1.2.0" "through" ">=2.2.7 <3" +"lazy-ass@1.6.0": + "integrity" "sha1-eZllXoZGwX8In90YfRUNMyTVRRM=" + "resolved" "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz" + "version" "1.6.0" + "locate-path@^6.0.0": "integrity" "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==" "resolved" "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" @@ -746,7 +917,7 @@ dependencies: "p-locate" "^5.0.0" -"lodash@^4.17.20": +"lodash@^4.17.20", "lodash@^4.17.21": "integrity" "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" "resolved" "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" "version" "4.17.21" @@ -771,6 +942,21 @@ "resolved" "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" "version" "1.3.6" +"map-stream@~0.1.0": + "integrity" "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" + "resolved" "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz" + "version" "0.1.0" + +"merge-stream@^2.0.0": + "integrity" "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "resolved" "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" + "version" "2.0.0" + +"mimic-fn@^2.1.0": + "integrity" "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + "resolved" "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" + "version" "2.1.0" + "minimalistic-assert@^1.0.0", "minimalistic-assert@^1.0.1": "integrity" "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" "resolved" "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" @@ -800,7 +986,7 @@ dependencies: "minimist" "^1.2.5" -"mocha@^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X", "mocha@^9.0.3": +"mocha@^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X", "mocha@^9.0.3": "integrity" "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==" "resolved" "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz" "version" "9.1.3" @@ -858,21 +1044,30 @@ "resolved" "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz" "version" "2.0.2" -"node-fetch@2.6.1": - "integrity" "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" - "resolved" "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz" - "version" "2.6.1" +"node-fetch@2.6.7": + "integrity" "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==" + "resolved" "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" + "version" "2.6.7" + dependencies: + "whatwg-url" "^5.0.0" "node-gyp-build@^4.2.0", "node-gyp-build@^4.3.0": - "integrity" "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" - "resolved" "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz" - "version" "4.3.0" + "integrity" "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" + "resolved" "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz" + "version" "4.4.0" "normalize-path@^3.0.0", "normalize-path@~3.0.0": "integrity" "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" "resolved" "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" "version" "3.0.0" +"npm-run-path@^4.0.1": + "integrity" "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==" + "resolved" "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" + "version" "4.0.1" + dependencies: + "path-key" "^3.0.0" + "once@^1.3.0": "integrity" "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=" "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" @@ -880,6 +1075,13 @@ dependencies: "wrappy" "1" +"onetime@^5.1.2": + "integrity" "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==" + "resolved" "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" + "version" "5.1.2" + dependencies: + "mimic-fn" "^2.1.0" + "p-limit@^3.0.2": "integrity" "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==" "resolved" "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" @@ -909,16 +1111,35 @@ "resolved" "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" "version" "1.0.1" +"path-key@^3.0.0", "path-key@^3.1.0": + "integrity" "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "resolved" "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" + "version" "3.1.1" + "pathval@^1.1.1": "integrity" "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" "resolved" "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" "version" "1.1.1" +"pause-stream@0.0.11": + "integrity" "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=" + "resolved" "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz" + "version" "0.0.11" + dependencies: + "through" "~2.3" + "picomatch@^2.0.4", "picomatch@^2.2.1": "integrity" "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" "resolved" "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" "version" "2.3.0" +"ps-tree@1.2.0": + "integrity" "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==" + "resolved" "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "event-stream" "=3.3.4" + "randombytes@^2.1.0": "integrity" "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==" "resolved" "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" @@ -944,9 +1165,9 @@ "version" "2.1.1" "rpc-websockets@^7.4.2": - "integrity" "sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ==" - "resolved" "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.16.tgz" - "version" "7.4.16" + "integrity" "sha512-eolVi/qlXS13viIUH9aqrde902wzSLAai0IjmOZSRefp5I3CSG/vCnD0c0fDSYCWuEyUoRL1BHQA8K1baEUyow==" + "resolved" "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.4.17.tgz" + "version" "7.4.17" dependencies: "@babel/runtime" "^7.11.2" "circular-json" "^0.5.9" @@ -957,17 +1178,24 @@ "bufferutil" "^4.0.1" "utf-8-validate" "^5.0.2" +"rxjs@^7.1.0": + "integrity" "sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==" + "resolved" "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz" + "version" "7.5.5" + dependencies: + "tslib" "^2.1.0" + "safe-buffer@^5.0.1", "safe-buffer@^5.1.0": "integrity" "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" "version" "5.2.1" "secp256k1@^4.0.2": - "integrity" "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==" - "resolved" "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz" - "version" "4.0.2" + "integrity" "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==" + "resolved" "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz" + "version" "4.0.3" dependencies: - "elliptic" "^6.5.2" + "elliptic" "^6.5.4" "node-addon-api" "^2.0.0" "node-gyp-build" "^4.2.0" @@ -978,6 +1206,23 @@ dependencies: "randombytes" "^2.1.0" +"shebang-command@^2.0.0": + "integrity" "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==" + "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "shebang-regex" "^3.0.0" + +"shebang-regex@^3.0.0": + "integrity" "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + "resolved" "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" + "version" "3.0.0" + +"signal-exit@^3.0.3": + "integrity" "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "resolved" "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" + "version" "3.0.7" + "snake-case@^3.0.4": "integrity" "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==" "resolved" "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz" @@ -999,6 +1244,33 @@ "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" "version" "0.6.1" +"split@0.3": + "integrity" "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=" + "resolved" "https://registry.npmjs.org/split/-/split-0.3.3.tgz" + "version" "0.3.3" + dependencies: + "through" "2" + +"start-server-and-test@^1.14.0": + "integrity" "sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw==" + "resolved" "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.14.0.tgz" + "version" "1.14.0" + dependencies: + "bluebird" "3.7.2" + "check-more-types" "2.24.0" + "debug" "4.3.2" + "execa" "5.1.1" + "lazy-ass" "1.6.0" + "ps-tree" "1.2.0" + "wait-on" "6.0.0" + +"stream-combiner@~0.0.4": + "integrity" "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=" + "resolved" "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz" + "version" "0.0.4" + dependencies: + "duplexer" "~0.1.1" + "string-width@^4.1.0", "string-width@^4.2.0": "integrity" "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==" "resolved" "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" @@ -1020,6 +1292,11 @@ "resolved" "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" "version" "3.0.0" +"strip-final-newline@^2.0.0": + "integrity" "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + "resolved" "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" + "version" "2.0.0" + "strip-json-comments@3.1.1": "integrity" "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" "resolved" "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" @@ -1049,7 +1326,7 @@ "resolved" "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz" "version" "1.0.2" -"through@>=2.2.7 <3": +"through@>=2.2.7 <3", "through@~2.3", "through@~2.3.1", "through@2": "integrity" "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" "resolved" "https://registry.npmjs.org/through/-/through-2.3.8.tgz" "version" "2.3.8" @@ -1066,15 +1343,15 @@ "resolved" "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz" "version" "3.0.0" -"traverse-chain@~0.1.0": - "integrity" "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=" - "resolved" "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz" - "version" "0.1.0" +"tr46@~0.0.3": + "integrity" "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "resolved" "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" + "version" "0.0.3" -"ts-mocha@^8.0.0": - "integrity" "sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA==" - "resolved" "https://registry.npmjs.org/ts-mocha/-/ts-mocha-8.0.0.tgz" - "version" "8.0.0" +"ts-mocha@^9.0.2": + "integrity" "sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw==" + "resolved" "https://registry.npmjs.org/ts-mocha/-/ts-mocha-9.0.2.tgz" + "version" "9.0.2" dependencies: "ts-node" "7.0.1" optionalDependencies: @@ -1104,7 +1381,7 @@ "minimist" "^1.2.0" "strip-bom" "^3.0.0" -"tslib@^2.0.3": +"tslib@^2.0.3", "tslib@^2.1.0": "integrity" "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" "resolved" "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" "version" "2.3.1" @@ -1125,9 +1402,9 @@ "version" "4.5.4" "utf-8-validate@^5.0.2": - "integrity" "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==" - "resolved" "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz" - "version" "5.0.7" + "integrity" "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==" + "resolved" "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz" + "version" "5.0.9" dependencies: "node-gyp-build" "^4.3.0" @@ -1136,7 +1413,31 @@ "resolved" "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" "version" "8.3.2" -"which@2.0.2": +"wait-on@6.0.0": + "integrity" "sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==" + "resolved" "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz" + "version" "6.0.0" + dependencies: + "axios" "^0.21.1" + "joi" "^17.4.0" + "lodash" "^4.17.21" + "minimist" "^1.2.5" + "rxjs" "^7.1.0" + +"webidl-conversions@^3.0.0": + "integrity" "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "resolved" "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" + "version" "3.0.1" + +"whatwg-url@^5.0.0": + "integrity" "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=" + "resolved" "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" + "version" "5.0.0" + dependencies: + "tr46" "~0.0.3" + "webidl-conversions" "^3.0.0" + +"which@^2.0.1", "which@2.0.2": "integrity" "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==" "resolved" "https://registry.npmjs.org/which/-/which-2.0.2.tgz" "version" "2.0.2" @@ -1163,9 +1464,9 @@ "version" "1.0.2" "ws@*", "ws@^7.4.5": - "integrity" "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==" - "resolved" "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz" - "version" "7.5.6" + "integrity" "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==" + "resolved" "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz" + "version" "7.5.7" "y18n@^5.0.5": "integrity" "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="