diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f37dc58..0e5c146d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ckBTC commands and support. (#153) - SNS commands and support (replaces sns-quill). (#154) +- Support the new sns sale payment flow for the ticketing system. (#156) ## [0.3.2] - 2023-01-13 diff --git a/Cargo.lock b/Cargo.lock index b2e1a29a..442b1b7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -747,7 +747,7 @@ dependencies = [ [[package]] name = "cycles-minting-canister" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "base64 0.13.0", "build-info", @@ -907,7 +907,7 @@ dependencies = [ [[package]] name = "dfn_candid" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "dfn_core", @@ -919,7 +919,7 @@ dependencies = [ [[package]] name = "dfn_core" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ic-base-types", "on_wire", @@ -928,7 +928,7 @@ dependencies = [ [[package]] name = "dfn_http" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "dfn_candid", @@ -940,7 +940,7 @@ dependencies = [ [[package]] name = "dfn_http_metrics" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "dfn_candid", "dfn_core", @@ -952,7 +952,7 @@ dependencies = [ [[package]] name = "dfn_protobuf" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "dfn_core", "ic-base-types", @@ -1100,7 +1100,7 @@ dependencies = [ [[package]] name = "fe-derive" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "hex", "num-bigint-dig", @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "ic-base-types" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "base32", "byte-unit", @@ -1566,6 +1566,7 @@ dependencies = [ "crc32fast", "ic-crypto-sha", "ic-protobuf", + "ic-stable-structures", "phantom_newtype", "prost", "serde", @@ -1576,7 +1577,7 @@ dependencies = [ [[package]] name = "ic-btc-types" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "serde", @@ -1586,7 +1587,7 @@ dependencies = [ [[package]] name = "ic-btc-types-internal" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "ic-btc-types", @@ -1598,7 +1599,7 @@ dependencies = [ [[package]] name = "ic-canister-client-sender" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ed25519-consensus", "ic-base-types", @@ -1616,12 +1617,12 @@ dependencies = [ [[package]] name = "ic-canister-log" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" [[package]] name = "ic-canisters-http-types" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "serde", @@ -1667,7 +1668,7 @@ dependencies = [ [[package]] name = "ic-ckbtc-minter" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "bech32", @@ -1689,7 +1690,7 @@ dependencies = [ "ic-icrc1-client-cdk", "ic-ledger-core", "ic-metrics-encoder", - "ic-stable-structures 0.1.2", + "ic-stable-structures", "lazy_static", "num-traits", "ripemd", @@ -1701,12 +1702,12 @@ dependencies = [ [[package]] name = "ic-constants" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" [[package]] name = "ic-crypto-ecdsa-secp256k1" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "k256", "lazy_static", @@ -1719,7 +1720,7 @@ dependencies = [ [[package]] name = "ic-crypto-extended-bip32" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ic-crypto-internal-threshold-sig-ecdsa", ] @@ -1727,7 +1728,7 @@ dependencies = [ [[package]] name = "ic-crypto-getrandom-for-wasm" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "getrandom 0.2.6", ] @@ -1735,7 +1736,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-basic-sig-der-utils" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "hex", "ic-types 0.8.0", @@ -1746,7 +1747,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-basic-sig-ed25519" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "base64 0.11.0", "curve25519-dalek", @@ -1768,7 +1769,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-bls12-381-type" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "hex", "ic-crypto-getrandom-for-wasm", @@ -1786,7 +1787,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-hmac" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ic-crypto-internal-sha2", ] @@ -1794,7 +1795,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-multi-sig-bls12381" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "base64 0.11.0", "hex", @@ -1812,7 +1813,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-seed" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "hex", "ic-crypto-sha", @@ -1826,7 +1827,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-sha2" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "openssl", "sha2 0.9.9", @@ -1835,7 +1836,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-threshold-sig-bls12381" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "arrayvec 0.5.2", "base64 0.11.0", @@ -1862,7 +1863,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-threshold-sig-bls12381-der" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "simple_asn1", ] @@ -1870,7 +1871,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-threshold-sig-ecdsa" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "fe-derive", "hex", @@ -1896,7 +1897,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-types" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "arrayvec 0.5.2", "base64 0.11.0", @@ -1914,7 +1915,7 @@ dependencies = [ [[package]] name = "ic-crypto-node-key-validation" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "hex", "ic-base-types", @@ -1932,7 +1933,7 @@ dependencies = [ [[package]] name = "ic-crypto-secrets-containers" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "serde", "zeroize", @@ -1941,7 +1942,7 @@ dependencies = [ [[package]] name = "ic-crypto-sha" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ic-crypto-internal-sha2", ] @@ -1949,7 +1950,7 @@ dependencies = [ [[package]] name = "ic-crypto-tls-cert-validation" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "chrono", "dfn_core", @@ -1965,7 +1966,7 @@ dependencies = [ [[package]] name = "ic-crypto-tree-hash" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ic-crypto-internal-types", "ic-crypto-sha", @@ -1977,7 +1978,7 @@ dependencies = [ [[package]] name = "ic-crypto-utils-basic-sig" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "base64 0.11.0", "ed25519-consensus", @@ -1992,7 +1993,7 @@ dependencies = [ [[package]] name = "ic-error-types" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "serde", "strum 0.23.0", @@ -2002,7 +2003,7 @@ dependencies = [ [[package]] name = "ic-ic00-types" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "float-cmp", @@ -2022,7 +2023,7 @@ dependencies = [ [[package]] name = "ic-icrc1" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "ciborium 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2039,7 +2040,7 @@ dependencies = [ [[package]] name = "ic-icrc1-client" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "candid", @@ -2053,7 +2054,7 @@ dependencies = [ [[package]] name = "ic-icrc1-client-cdk" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "ic-cdk", @@ -2063,7 +2064,7 @@ dependencies = [ [[package]] name = "ic-icrc1-index" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "candid", @@ -2082,7 +2083,7 @@ dependencies = [ [[package]] name = "ic-icrc1-ledger" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "candid", @@ -2123,7 +2124,7 @@ dependencies = [ [[package]] name = "ic-ledger-canister-core" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "candid", @@ -2139,7 +2140,7 @@ dependencies = [ [[package]] name = "ic-ledger-core" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "candid", @@ -2162,7 +2163,7 @@ checksum = "8aef00d455eba8b8244a415f073a43042e57da6d09c294485a2b2ebc858c9da2" [[package]] name = "ic-nervous-system-common" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "anyhow", "async-trait", @@ -2182,8 +2183,6 @@ dependencies = [ "ic-ledger-core", "ic-metrics-encoder", "icp-ledger", - "rand", - "rand_chacha", "rust_decimal", "serde", ] @@ -2191,12 +2190,12 @@ dependencies = [ [[package]] name = "ic-nervous-system-common-build-metadata" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" [[package]] name = "ic-nervous-system-common-test-keys" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ic-base-types", "ic-canister-client-sender", @@ -2210,7 +2209,7 @@ dependencies = [ [[package]] name = "ic-nervous-system-root" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "dfn_candid", @@ -2227,7 +2226,7 @@ dependencies = [ [[package]] name = "ic-nns-common" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "comparable", @@ -2250,7 +2249,7 @@ dependencies = [ [[package]] name = "ic-nns-constants" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "ic-base-types", "lazy_static", @@ -2259,7 +2258,7 @@ dependencies = [ [[package]] name = "ic-nns-governance" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "build-info", @@ -2299,7 +2298,7 @@ dependencies = [ [[package]] name = "ic-protobuf" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "bincode", "candid", @@ -2314,7 +2313,7 @@ dependencies = [ [[package]] name = "ic-registry-keys" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "ic-base-types", @@ -2326,7 +2325,7 @@ dependencies = [ [[package]] name = "ic-registry-routing-table" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "ic-base-types", @@ -2337,7 +2336,7 @@ dependencies = [ [[package]] name = "ic-registry-subnet-features" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "ic-ic00-types", @@ -2348,7 +2347,7 @@ dependencies = [ [[package]] name = "ic-registry-subnet-type" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "ic-protobuf", @@ -2360,7 +2359,7 @@ dependencies = [ [[package]] name = "ic-registry-transport" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "bytes", "candid", @@ -2372,7 +2371,7 @@ dependencies = [ [[package]] name = "ic-sns-governance" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "base64 0.13.0", @@ -2421,7 +2420,7 @@ dependencies = [ [[package]] name = "ic-sns-init" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "anyhow", "base64 0.13.0", @@ -2453,7 +2452,7 @@ dependencies = [ [[package]] name = "ic-sns-root" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "build-info", @@ -2480,7 +2479,7 @@ dependencies = [ [[package]] name = "ic-sns-swap" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "build-info", @@ -2505,15 +2504,14 @@ dependencies = [ "ic-nervous-system-root", "ic-protobuf", "ic-sns-governance", - "ic-stable-structures 0.4.1", + "ic-stable-structures", "icp-ledger", "itertools", "lazy_static", + "maplit", "on_wire", "prost", "prost-build", - "rand", - "rand_chacha", "registry-canister", "rust_decimal", "serde", @@ -2524,7 +2522,7 @@ dependencies = [ [[package]] name = "ic-sns-wasm" version = "1.0.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "build-info", @@ -2553,20 +2551,14 @@ dependencies = [ [[package]] name = "ic-stable-structures" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8ded18fe296ff693ba8d8fd9890189ea28df4fc75d8b009523e15918452d8b" - -[[package]] -name = "ic-stable-structures" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77002de282a2042e50e345d17ff8a4b8a396bc6b4033aeb0dee1b7d519a80630" +checksum = "ead0e23ad5be0cad9f062a0a4e6777cd6f4d9bafa77a2cd06168f216943d67a1" [[package]] name = "ic-sys" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "hex", "ic-crypto-sha", @@ -2595,7 +2587,7 @@ dependencies = [ [[package]] name = "ic-types" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "base32", "base64 0.11.0", @@ -2635,7 +2627,7 @@ dependencies = [ [[package]] name = "ic-utils" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "bitflags", "cvt", @@ -2681,7 +2673,7 @@ dependencies = [ [[package]] name = "icp-ledger" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "comparable", @@ -2858,7 +2850,7 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "ledger-canister" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "async-trait", "candid", @@ -3266,7 +3258,7 @@ dependencies = [ [[package]] name = "on_wire" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" [[package]] name = "once_cell" @@ -3443,7 +3435,7 @@ dependencies = [ [[package]] name = "phantom_newtype" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "candid", "serde", @@ -3815,7 +3807,7 @@ checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "registry-canister" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77#0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" +source = "git+https://github.com/dfinity/ic?rev=1ce7e5b0bd68760382eb2b3b810a11bd600770be#1ce7e5b0bd68760382eb2b3b810a11bd600770be" dependencies = [ "build-info", "build-info-build", diff --git a/Cargo.toml b/Cargo.toml index 1ed21c6d..e8e357d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,20 +18,20 @@ flate2 = "1.0.22" hex = {version = "0.4.2", features = ["serde"] } ic-agent = "0.21.0" ic-identity-hsm = "0.21.0" -ic-base-types = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-icrc1 = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } +ic-base-types = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-icrc1 = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } ic-types = "0.4.1" -icp-ledger = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } -ledger-canister = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" } +icp-ledger = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } +ledger-canister = { git = "https://github.com/dfinity/ic", rev = "1ce7e5b0bd68760382eb2b3b810a11bd600770be" } num-bigint = "0.4.3" openssl = "0.10.45" pem = "1.0.1" diff --git a/candid/sns-swap.did b/candid/sns-swap.did index 01bf35c9..462bd201 100644 --- a/candid/sns-swap.did +++ b/candid/sns-swap.did @@ -31,6 +31,12 @@ type DerivedState = record { }; type DirectInvestment = record { buyer_principal : text }; type Err = record { description : opt text; error_type : opt int32 }; +type Err_1 = record { error_type : opt int32 }; +type Err_2 = record { + invalid_user_amount : opt InvalidUserAmount; + existing_ticket : opt Ticket; + error_type : int32; +}; type ErrorRefundIcpRequest = record { source_principal_id : opt principal }; type ErrorRefundIcpResponse = record { result : opt Result }; type FailedUpdate = record { @@ -38,13 +44,13 @@ type FailedUpdate = record { dapp_canister_id : opt principal; }; type FinalizeSwapResponse = record { + set_dapp_controllers_call_result : opt SetDappControllersCallResult; settle_community_fund_participation_result : opt SettleCommunityFundParticipationResult; error_message : opt text; - set_dapp_controllers_result : opt SetDappControllersCallResult; - sns_governance_normal_mode_enabled : opt SetModeCallResult; - sweep_icp : opt SweepResult; - sweep_sns : opt SweepResult; - create_neuron : opt SweepResult; + set_mode_call_result : opt SetModeCallResult; + sweep_icp_result : opt SweepResult; + claim_neuron_result : opt SweepResult; + sweep_sns_result : opt SweepResult; }; type GetBuyerStateRequest = record { principal_id : opt principal }; type GetBuyerStateResponse = record { buyer_state : opt BuyerState }; @@ -54,9 +60,15 @@ type GetDerivedStateResponse = record { buyer_total_icp_e8s : opt nat64; }; type GetInitResponse = record { init : opt Init }; -type GetLifecycleResponse = record { lifecycle : opt int32 }; +type GetLifecycleResponse = record { + decentralization_sale_open_timestamp_seconds : opt nat64; + lifecycle : opt int32; +}; +type GetOpenTicketResponse = record { result : opt Result_1 }; +type GetSaleParametersResponse = record { params : opt Params }; type GetStateResponse = record { swap : opt Swap; derived : opt DerivedState }; type GovernanceError = record { error_message : text; error_type : int32 }; +type Icrc1Account = record { owner : opt principal; subaccount : opt vec nat8 }; type Init = record { sns_root_canister_id : text; fallback_controller_principal_ids : vec text; @@ -67,16 +79,45 @@ type Init = record { sns_ledger_canister_id : text; sns_governance_canister_id : text; }; +type InvalidUserAmount = record { + min_amount_icp_e8s_included : nat64; + max_amount_icp_e8s_included : nat64; +}; type Investor = variant { CommunityFund : CfInvestment; Direct : DirectInvestment; }; +type ListCommunityFundParticipantsRequest = record { + offset : opt nat64; + limit : opt nat32; +}; +type ListCommunityFundParticipantsResponse = record { + cf_participants : vec CfParticipant; +}; +type ListDirectParticipantsRequest = record { + offset : opt nat32; + limit : opt nat32; +}; +type ListDirectParticipantsResponse = record { participants : vec Participant }; +type ListSnsNeuronRecipesRequest = record { + offset : opt nat64; + limit : opt nat32; +}; +type ListSnsNeuronRecipesResponse = record { + sns_neuron_recipes : vec SnsNeuronRecipe; +}; type NeuronAttributes = record { dissolve_delay_seconds : nat64; memo : nat64 }; type NeuronBasketConstructionParameters = record { dissolve_delay_interval_seconds : nat64; count : nat64; }; +type NewSaleTicketRequest = record { + subaccount : opt vec nat8; + amount_icp_e8s : nat64; +}; +type NewSaleTicketResponse = record { result : opt Result_2 }; type Ok = record { block_height : opt nat64 }; +type Ok_1 = record { ticket : opt Ticket }; type OpenRequest = record { cf_participants : vec CfParticipant; params : opt Params; @@ -89,15 +130,20 @@ type Params = record { swap_due_timestamp_seconds : nat64; min_participants : nat32; sns_token_e8s : nat64; + sale_delay_seconds : opt nat64; max_participant_icp_e8s : nat64; min_icp_e8s : nat64; }; -type Possibility = variant { Ok : Response; Err : CanisterCallError }; -type Possibility_1 = variant { +type Participant = record { + participation : opt BuyerState; + participant_id : opt principal; +}; +type Possibility = variant { Ok : SetDappControllersResponse; Err : CanisterCallError; }; -type Possibility_2 = variant { Err : CanisterCallError }; +type Possibility_1 = variant { Ok : Response; Err : CanisterCallError }; +type Possibility_2 = variant { Ok : record {}; Err : CanisterCallError }; type RefreshBuyerTokensRequest = record { buyer : text }; type RefreshBuyerTokensResponse = record { icp_accepted_participation_e8s : nat64; @@ -105,19 +151,23 @@ type RefreshBuyerTokensResponse = record { }; type Response = record { governance_error : opt GovernanceError }; type Result = variant { Ok : Ok; Err : Err }; -type SetDappControllersCallResult = record { possibility : opt Possibility_1 }; +type Result_1 = variant { Ok : Ok_1; Err : Err_1 }; +type Result_2 = variant { Ok : Ok_1; Err : Err_2 }; +type SetDappControllersCallResult = record { possibility : opt Possibility }; type SetDappControllersResponse = record { failed_updates : vec FailedUpdate }; type SetModeCallResult = record { possibility : opt Possibility_2 }; type SettleCommunityFundParticipationResult = record { - possibility : opt Possibility; + possibility : opt Possibility_1; }; type SnsNeuronRecipe = record { sns : opt TransferableAmount; + claimed_status : opt int32; neuron_attributes : opt NeuronAttributes; investor : opt Investor; }; type Swap = record { neuron_recipes : vec SnsNeuronRecipe; + decentralization_sale_open_timestamp_seconds : opt nat64; finalize_swap_in_progress : opt bool; cf_participants : vec CfParticipant; init : opt Init; @@ -126,7 +176,19 @@ type Swap = record { params : opt Params; open_sns_token_swap_proposal_id : opt nat64; }; -type SweepResult = record { failure : nat32; skipped : nat32; success : nat32 }; +type SweepResult = record { + failure : nat32; + skipped : nat32; + invalid : nat32; + success : nat32; + global_failures : nat32; +}; +type Ticket = record { + creation_time : nat64; + ticket_id : nat64; + account : opt Icrc1Account; + amount_icp_e8s : nat64; +}; type TransferableAmount = record { transfer_start_timestamp_seconds : nat64; amount_e8s : nat64; @@ -141,10 +203,22 @@ service : (Init) -> { get_derived_state : (record {}) -> (GetDerivedStateResponse) query; get_init : (record {}) -> (GetInitResponse) query; get_lifecycle : (record {}) -> (GetLifecycleResponse) query; + get_open_ticket : (record {}) -> (GetOpenTicketResponse) query; + get_sale_parameters : (record {}) -> (GetSaleParametersResponse) query; get_state : (record {}) -> (GetStateResponse) query; + list_community_fund_participants : (ListCommunityFundParticipantsRequest) -> ( + ListCommunityFundParticipantsResponse, + ) query; + list_direct_participants : (ListDirectParticipantsRequest) -> ( + ListDirectParticipantsResponse, + ) query; + list_sns_neuron_recipes : (ListSnsNeuronRecipesRequest) -> ( + ListSnsNeuronRecipesResponse, + ) query; + new_sale_ticket : (NewSaleTicketRequest) -> (NewSaleTicketResponse); open : (OpenRequest) -> (record {}); refresh_buyer_tokens : (RefreshBuyerTokensRequest) -> ( RefreshBuyerTokensResponse, ); restore_dapp_controllers : (record {}) -> (SetDappControllersCallResult); -} +} \ No newline at end of file diff --git a/docs/cli-reference/index.md b/docs/cli-reference/index.md index 54b2bdb2..6213ad8e 100644 --- a/docs/cli-reference/index.md +++ b/docs/cli-reference/index.md @@ -44,11 +44,12 @@ When you have quill installed, you can use the following commands to specify the - [quill sns make-proposal](./sns/quill-sns-make-proposal.md) - [quill sns make-upgrade-canister-proposal](./sns/quill-sns-make-upgrade-canister-proposal.md) - [quill sns neuron-permission](./sns/quill-sns-neuron-permission.md) + - [quill sns new-sale-ticket](./sns/quill-sns-new-sale-ticket.md) + - [quill sns pay](./sns/quill-sns-pay.md) - [quill sns register-vote](./sns/quill-sns-register-vote.md) - [quill sns stake-maturity](./sns/quill-sns-stake-maturity.md) - [quill sns stake-neuron](./sns/quill-sns-stake-neuron.md) - [quill sns status](./sns/quill-sns-status.md) - - [quill sns swap](./sns/quill-sns-swap.md) - [quill sns transfer](./sns/quill-sns-transfer.md) - [quill transfer](./quill-transfer.md) - [quill update-node-provider](./quill-update-node-provider.md) diff --git a/docs/cli-reference/sns/quill-sns-new-sale-ticket.md b/docs/cli-reference/sns/quill-sns-new-sale-ticket.md new file mode 100644 index 00000000..fd708747 --- /dev/null +++ b/docs/cli-reference/sns/quill-sns-new-sale-ticket.md @@ -0,0 +1,25 @@ +# quill sns new-sale-ticket + +Attempt to create a new sale ticket. If there is already an open ticket, it will return the details of the existing ticket. + + +## Basic usage + +The basic syntax for running `quill sns new-sale-ticket` commands is: + +```bash +quill sns new-sale-ticket --amount-icp-e8s [option] +``` + +## Flags + +| Flag | Description | +|-----------------|-----------------------------| +| `-h`, `--help` | Displays usage information. | + +## Options + +| Option | Description | +|-----------------------------|-----------------------------------------------------------| +| `--amount-icp-e8s ` | The amount of ICP tokens to participate in this sns sale. | +| `--subaccount ` | The subaccount you will use to pay for this ticket. | diff --git a/docs/cli-reference/sns/quill-sns-pay.md b/docs/cli-reference/sns/quill-sns-pay.md new file mode 100644 index 00000000..0df85642 --- /dev/null +++ b/docs/cli-reference/sns/quill-sns-pay.md @@ -0,0 +1,38 @@ +# quill sns pay + +Signs messages to pay for an open sale ticket that you can create using `quill sns new-sale-ticket`. + +This operation consists of two messages: + +First, transfer ICP to the sale canister on the NNS ledger, under the subaccount for your principal. + +Second, the sale canister is notified that the transfer has been made. + +## Basic usage + +The basic syntax for running `quill sns pay` commands is: + +```bash +quill sns pay --amount-icp-e8s --ticket-id [option] +``` + +## Flags + +| Flag | Description | +|-----------------|-----------------------------| +| `-h`, `--help` | Displays usage information. | +| `--notify-only` | No transfer will be made. | + +## Options + +| Option | Description | +|-------------------------------------------------|---------------------------------------| +| `--amount-icp-e8s ` | The amount of ICP to transfer. | +| `--subaccount ` | Pay from this subaccount. | +| `--ticket-id` | The ticket_id of the sale ticket. | + +## Remarks + +Once the pay has been finalized, if it was successful, you will receive your neurons automatically. Your neuron's share of the governance tokens at sale finalization will be proportional to your share of the contributed ICP. + +If `--notify-only` is specified, only the notification message will be generated. This is useful if there was an error previously submitting the notification which you have since rectified, or if you have made the transfer with another tool. diff --git a/docs/cli-reference/sns/quill-sns-swap.md b/docs/cli-reference/sns/quill-sns-swap.md deleted file mode 100644 index 3f4215b4..00000000 --- a/docs/cli-reference/sns/quill-sns-swap.md +++ /dev/null @@ -1,31 +0,0 @@ -# quill sns swap - -Signs messages needed to participate in the initial token swap. This operation consists of two messages: First, `amount` ICP is transferred to the swap canister on the NNS ledger, under the subaccount for your principal. Second, the swap canister is notified that the transfer has been made. - -## Basic usage - -The basic syntax for running `quill sns swap` commands is: - -```bash -quill sns swap [option] -``` - -## Flags - -| Flag | Description | -|-----------------|-----------------------------| -| `-h`, `--help` | Displays usage information. | -| `--notify-only` | No transfer will be made. | - -## Options - -| Option | Description | -|---------------------|-------------------------------------------------------------------------------| -| `--amount ` | The amount of ICP to transfer. | -| `--memo ` | An arbitrary number used to identify the NNS block this transfer was made in. | - -## Remarks - -Once the swap has been finalized, if it was successful, you will receive your neurons automatically. Your neuron's share of the governance tokens at sale finalization will be proportional to your share of the contributed ICP. - -If `--notify-only` is specified, only the notification message will be generated. This is useful if there was an error previously submitting the notification which you have since rectified, or if you have made the transfer with another tool. diff --git a/src/commands/sns.rs b/src/commands/sns.rs index 33e69553..9c16bfc2 100644 --- a/src/commands/sns.rs +++ b/src/commands/sns.rs @@ -22,11 +22,12 @@ mod list_deployed_snses; mod make_proposal; mod make_upgrade_canister_proposal; mod neuron_permission; +mod new_sale_ticket; +mod pay; mod register_vote; mod stake_maturity; mod stake_neuron; mod status; -mod swap; mod transfer; /// Commands for interacting with a Service Nervous System's Ledger & Governance canisters. @@ -58,11 +59,12 @@ pub enum SnsCommand { MakeProposal(make_proposal::MakeProposalOpts), MakeUpgradeCanisterProposal(make_upgrade_canister_proposal::MakeUpgradeCanisterProposalOpts), NeuronPermission(neuron_permission::NeuronPermissionOpts), + NewSaleTicket(new_sale_ticket::NewSaleTicketOpts), RegisterVote(register_vote::RegisterVoteOpts), StakeMaturity(stake_maturity::StakeMaturityOpts), StakeNeuron(stake_neuron::StakeNeuronOpts), Status(status::StatusOpts), - Swap(swap::SwapOpts), + Pay(pay::PayOpts), Transfer(transfer::TransferOpts), } @@ -95,6 +97,10 @@ pub fn dispatch(auth: &AuthInfo, opts: SnsOpts, qr: bool, fetch_root_key: bool) let out = neuron_permission::exec(auth, &canister_ids?, opts)?; print_vec(qr, &out)?; } + SnsCommand::NewSaleTicket(opts) => { + let out = new_sale_ticket::exec(auth, &canister_ids?, opts)?; + print_vec(qr, &out)?; + } SnsCommand::RegisterVote(opts) => { let out = register_vote::exec(auth, &canister_ids?, opts)?; print_vec(qr, &out)?; @@ -108,8 +114,8 @@ pub fn dispatch(auth: &AuthInfo, opts: SnsOpts, qr: bool, fetch_root_key: bool) print_vec(qr, &out)?; } SnsCommand::Status(opts) => status::exec(&canister_ids?, opts, fetch_root_key)?, - SnsCommand::Swap(opts) => { - let out = swap::exec(auth, &canister_ids?, opts)?; + SnsCommand::Pay(opts) => { + let out = pay::exec(auth, &canister_ids?, opts)?; print_vec(qr, &out)?; } SnsCommand::Transfer(opts) => { diff --git a/src/commands/sns/new_sale_ticket.rs b/src/commands/sns/new_sale_ticket.rs new file mode 100644 index 00000000..8f48a8c6 --- /dev/null +++ b/src/commands/sns/new_sale_ticket.rs @@ -0,0 +1,41 @@ +use candid::Encode; +use clap::Parser; +use ic_sns_swap::pb::v1::NewSaleTicketRequest; + +use crate::lib::{ + signing::{sign_ingress_with_request_status_query, IngressWithRequestId}, + AnyhowResult, AuthInfo, ParsedSubaccount, ROLE_SNS_SWAP, +}; + +use super::SnsCanisterIds; + +/// Attempt to reate a new sale ticket. If there is already an open ticket, it will return the details of the existing ticket. +#[derive(Parser)] +pub struct NewSaleTicketOpts { + /// The amount of ICP tokens to participate in this sns sale. You will need to make the transfer later. + #[clap(long)] + amount_icp_e8s: u64, + + /// The subaccount you will use to pay for this ticket. For example: e000d80101. + #[clap(long)] + subaccount: Option, +} + +pub fn exec( + auth: &AuthInfo, + sns_canister_ids: &SnsCanisterIds, + opts: NewSaleTicketOpts, +) -> AnyhowResult> { + let request = NewSaleTicketRequest { + amount_icp_e8s: opts.amount_icp_e8s, + subaccount: opts.subaccount.map(|x| x.0 .0.to_vec()), + }; + let message = sign_ingress_with_request_status_query( + auth, + sns_canister_ids.swap_canister_id, + ROLE_SNS_SWAP, + "new_sale_ticket", + Encode!(&request)?, + )?; + Ok(vec![message]) +} diff --git a/src/commands/sns/swap.rs b/src/commands/sns/pay.rs similarity index 61% rename from src/commands/sns/swap.rs rename to src/commands/sns/pay.rs index 2274a104..70f83176 100644 --- a/src/commands/sns/swap.rs +++ b/src/commands/sns/pay.rs @@ -4,7 +4,7 @@ use ic_base_types::PrincipalId; use ic_sns_swap::pb::v1::RefreshBuyerTokensRequest; use icp_ledger::{AccountIdentifier, Memo, SendArgs, Subaccount, Tokens}; -use crate::commands::transfer::parse_tokens; +use crate::lib::ParsedSubaccount; use crate::lib::{ ledger_canister_id, signing::{sign_ingress_with_request_status_query, IngressWithRequestId}, @@ -13,19 +13,24 @@ use crate::lib::{ use super::SnsCanisterIds; -/// Signs messages needed to participate in the initial token swap. This operation consists of two messages: -/// First, `amount` ICP is transferred to the swap canister on the NNS ledger, under the subaccount for your principal. -/// Second, the swap canister is notified that the transfer has been made. -/// Once the swap has been finalized, if it was successful, you will receive your neurons automatically. +/// Signs messages to pay for an open sale ticket that you can create using `quill sns new-sale-ticket`. +/// This operation consists of two messages: +/// First, transfer ICP to the sale canister on the NNS ledger, under the subaccount for your principal. +/// Second, the sale canister is notified that the transfer has been made. #[derive(Parser)] -pub struct SwapOpts { - /// The amount of ICP to transfer. Your neuron's share of the governance tokens at sale finalization will be proportional to your share of the contributed ICP. - #[clap(long, requires("memo"), required_unless_present("notify-only"), value_parser = parse_tokens)] - amount: Option, +pub struct PayOpts { + /// The amount of ICP to transfer. This should be the same as the "amount_icp_e8s" of the sale ticket. + /// Please note that a 10000 e8s transaction fee will be charged on top of this amount. + #[clap(long, required_unless_present("notify-only"))] + amount_icp_e8s: Option, - /// An arbitrary number used to identify the NNS block this transfer was made in. + /// Pay from this subaccount. For example: e000d80101. This should be aligned with the "account" of the sale ticket. #[clap(long)] - memo: Option, + subaccount: Option, + + /// The tocket_id of the sale ticket. This should be the same as the "ticket_id" of the sale ticket. + #[clap(long, required_unless_present("notify-only"))] + ticket_id: Option, /// If this flag is specified, then no transfer will be made, and only the notification message will be generated. /// This is useful if there was an error previously submitting the notification which you have since rectified, or if you have made the transfer with another tool. @@ -36,7 +41,7 @@ pub struct SwapOpts { pub fn exec( auth: &AuthInfo, sns_canister_ids: &SnsCanisterIds, - opts: SwapOpts, + opts: PayOpts, ) -> AnyhowResult> { let (controller, _) = crate::commands::public::get_ids(auth)?; let mut messages = vec![]; @@ -45,11 +50,11 @@ pub fn exec( let account_id = AccountIdentifier::new(sns_canister_ids.swap_canister_id.into(), Some(subaccount)); let request = SendArgs { - amount: opts.amount.unwrap(), + amount: Tokens::from_e8s(opts.amount_icp_e8s.unwrap()), created_at_time: None, - from_subaccount: None, + from_subaccount: opts.subaccount.map(|x| x.0), fee: Tokens::from_e8s(10_000), - memo: Memo(opts.memo.unwrap()), + memo: Memo(opts.ticket_id.unwrap()), to: account_id, }; messages.push(sign_ingress_with_request_status_query( diff --git a/tests/commands/sns-new-sale-ticket.sh b/tests/commands/sns-new-sale-ticket.sh new file mode 100644 index 00000000..d27082af --- /dev/null +++ b/tests/commands/sns-new-sale-ticket.sh @@ -0,0 +1 @@ +"$QUILL" sns new-sale-ticket --amount-icp-e8s 100000 --subaccount e000d80101 --canister-ids-file ./sns_canister_ids.json --pem-file - | "$QUILL" send --dry-run - diff --git a/tests/commands/sns-pay.sh b/tests/commands/sns-pay.sh new file mode 100755 index 00000000..aefff2fb --- /dev/null +++ b/tests/commands/sns-pay.sh @@ -0,0 +1 @@ +"$QUILL" sns pay --amount-icp-e8s 100000 --subaccount e000d80101 --ticket-id 100 --canister-ids-file ./sns_canister_ids.json --pem-file - | "$QUILL" send --dry-run - diff --git a/tests/commands/sns-swap.sh b/tests/commands/sns-swap.sh deleted file mode 100755 index 0da87e13..00000000 --- a/tests/commands/sns-swap.sh +++ /dev/null @@ -1 +0,0 @@ -"$QUILL" sns swap --amount 500 --memo 4 --canister-ids-file ./sns_canister_ids.json --pem-file - | "$QUILL" send --dry-run - diff --git a/tests/outputs/sns-new-sale-ticket.txt b/tests/outputs/sns-new-sale-ticket.txt new file mode 100644 index 00000000..ed5e0c5e --- /dev/null +++ b/tests/outputs/sns-new-sale-ticket.txt @@ -0,0 +1,12 @@ +Sending message with + + Call type: update + Sender: fdsgv-62ihb-nbiqv-xgic5-iefsv-3cscz-tmbzv-63qd5-vh43v-dqfrt-pae + Canister id: rkp4c-7iaaa-aaaaa-aaaca-cai + Method name: new_sale_ticket + Arguments: ( + record { + subaccount = opt blob "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e0\00\d8\01\01"; + amount_icp_e8s = 100_000 : nat64; + }, +) diff --git a/tests/outputs/sns-swap.txt b/tests/outputs/sns-pay.txt similarity index 77% rename from tests/outputs/sns-swap.txt rename to tests/outputs/sns-pay.txt index 69cb862a..20f9250c 100644 --- a/tests/outputs/sns-swap.txt +++ b/tests/outputs/sns-pay.txt @@ -8,10 +8,10 @@ Sending message with record { to = "bff3218e708b09187a586a1f397edf081964e560a5a0f6435fac044c7f4a25e9"; fee = record { e8s = 10_000 : nat64 }; - memo = 4 : nat64; - from_subaccount = null; + memo = 100 : nat64; + from_subaccount = opt blob "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e0\00\d8\01\01"; created_at_time = null; - amount = record { e8s = 50_000_000_000 : nat64 }; + amount = record { e8s = 100_000 : nat64 }; }, ) Sending message with diff --git a/tests/outputs/sns-status.txt b/tests/outputs/sns-status.txt index b784c38e..822fdd5e 100644 --- a/tests/outputs/sns-status.txt +++ b/tests/outputs/sns-status.txt @@ -4,4 +4,4 @@ Sending message with Sender: 2vxsx-fae Canister id: r7inp-6aaaa-aaaaa-aaabq-cai Method name: get_sns_canisters_summary - Arguments: (record { update_canister_list = null }) \ No newline at end of file + Arguments: (record { update_canister_list = null })